Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # RGSS2_バトルミスト (Battle Mist)
- # Original Script by tomoaky (http://hikimoki.sakura.ne.jp)
- # Translation by Zak (http://www.rpgmaker-reload.de)
- #
- # 2010/03/29 Small changes to the display size of the mist, etc.
- # 2010/01/04 Released
- #
- # Adds a Battle Mist to the Battle Scene.
- #
- # This script needs a file named "mist",
- # insert it into the Graphics/System-folder
- # In line 32 it's possible to change the name of the file.
- #==============================================================================
- #==============================================================================
- # □ Manual
- #==============================================================================
- module BMIST
- SW_NOUSE = 8 #Switch-ID to turn the script on/off
- end
- #==============================================================================
- # ■ Sprite_Mist
- #==============================================================================
- class Sprite_Mist < Sprite
- #--------------------------------------------------------------------------
- # ● オブジェクト初期化
- #--------------------------------------------------------------------------
- def initialize(viewport)
- super(viewport)
- self.bitmap = Cache.system("mist")
- self.blend_type = 1
- self.ox = 128
- self.oy = 90
- self.y = Graphics.height - 128 - self.oy + rand(32)
- setup
- self.x = rand(Graphics.width)
- @real_x = self.x << 10
- end
- #--------------------------------------------------------------------------
- # ● セットアップ
- #--------------------------------------------------------------------------
- def setup
- @vx = rand(512) + 256
- self.zoom_x = (rand(600) + 700) / 1200.0
- if self.zoom_x < 1.0 # バトラーの奥に配置
- self.z = 2
- else # バトラーの手前に配置
- self.z = 1000
- end
- self.zoom_y = self.zoom_x
- self.x = Graphics.width + (128 * self.zoom_x).to_i
- @real_x = self.x << 10
- end
- #--------------------------------------------------------------------------
- # ● 解放
- #--------------------------------------------------------------------------
- def dispose
- self.bitmap.dispose
- super
- end
- #--------------------------------------------------------------------------
- # ● 更新
- #--------------------------------------------------------------------------
- def update
- super
- @real_x -= @vx
- self.x = @real_x >> 10
- setup if self.x < (0 - (128 * self.zoom_x).to_i)
- end
- end
- #==============================================================================
- # ■ Spriteset_Battle
- #==============================================================================
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # ● バトルバックスプライトの作成
- #--------------------------------------------------------------------------
- alias bmist_spriteset_battle_create_battleback create_battleback2
- def create_battleback2
- bmist_spriteset_battle_create_battleback
- @mist_sprites = []
- unless $game_switches[BMIST::SW_NOUSE]
- for i in 0...8 do @mist_sprites.push(Sprite_Mist.new(@viewport1)) end
- end
- end
- #--------------------------------------------------------------------------
- # ● バトルバックスプライトの解放
- #--------------------------------------------------------------------------
- alias bmist_spriteset_battle_dispose_battleback dispose_battleback2
- def dispose_battleback2
- bmist_spriteset_battle_dispose_battleback
- for sprite in @mist_sprites do sprite.dispose end
- end
- #--------------------------------------------------------------------------
- # ● バトルバックの更新
- #--------------------------------------------------------------------------
- alias bmist_spriteset_battle_update_battleback update_battleback2
- def update_battleback2
- bmist_spriteset_battle_update_battleback
- for sprite in @mist_sprites do sprite.update end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement