Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #---------------------------------------------------------------------------#
- # #
- # ==== ===== ====== #
- # ======= == === === #
- # == === == === === #
- # == === == === == #
- # == === == === === #
- # == === == === === #
- # == === ======== === #
- # ====== == === == #
- # == == === == #
- # == == == === #
- # == == === === #
- # == == === === #
- # == ====== == #
- # #
- #---------------------------------------------------------------------------#
- #---------------------------------------------------------------------------#
- # #
- # * Spriteset: Battle * #
- # #
- # Remakes the sprites for the battlebackground and enemies #
- #---------------------------------------------------------------------------#
- class Spriteset_Battle
- #--------------------------------------------------------------------------
- # * Object Initialization
- #--------------------------------------------------------------------------
- def initialize
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- create_actorback
- create_actorfloor
- end
- create_viewports
- create_battlefloor
- create_enemyfloor
- create_enemies
- create_actors
- create_pictures
- create_timer
- update
- end
- #--------------------------------------------------------------------------
- # * Dispose
- #--------------------------------------------------------------------------
- def dispose
- dispose_actorback
- dispose_actorfloor
- dispose_enemyfloor
- dispose_battlefloor
- dispose_enemies
- dispose_actors
- dispose_pictures
- dispose_timer
- dispose_viewports
- end
- #--------------------------------------------------------------------------
- # * Frame Update
- #--------------------------------------------------------------------------
- def update
- update_battleback
- update_battlefloor
- update_enemies
- update_actors
- update_pictures
- update_timer
- update_viewports
- update_actorback
- end
- #--------------------------------------------------------------------------
- # * Update Battleback
- #--------------------------------------------------------------------------
- def update_battleback
- @battlefloor_sprite.update
- end
- #--------------------------------------------------------------------------
- # EnemyFloor Sprite
- #--------------------------------------------------------------------------
- def create_enemyfloor
- @enemyfloor_sprite = Sprite.new(@viewport1)
- @enemyfloor_sprite.bitmap = PBS::Cache.system(PBS::Cache::ENEMYBACKGROUND)
- @enemyfloor_sprite.x = -PBS::Cache.system(PBS::Cache::ENEMYBACKGROUND).width
- @enemyfloor_sprite.y = 110
- @enemyfloor_sprite.z = 1
- @enemyfloor_sprite.opacity = 255
- end
- def update_enemyfloor
- @enemyfloor_sprite.update
- end
- def dispose_enemyfloor
- @enemyfloor_sprite.bitmap.dispose unless @enemyfloor_sprite.bitmap.disposed?()
- @enemyfloor_sprite.dispose unless @enemyfloor_sprite.disposed?()
- end
- #--------------------------------------------------------------------------
- # Battleback Sprite
- #--------------------------------------------------------------------------
- def create_battlefloor
- @battlefloor_sprite = Sprite.new(@viewport1)
- @battlefloor_sprite.bitmap = PBS::Cache.system(PBS::Cache::BATTLEBACKGROUND)
- @battlefloor_sprite.x = 0
- @battlefloor_sprite.y = 0
- @battlefloor_sprite.z = 0
- @battlefloor_sprite.opacity = 255
- end
- def dispose_battleback
- @battlefloor_sprite.bitmap.dispose unless @battlefloor_sprite.bitmap.disposed?()
- @battlefloor_sprite.dispose unless @battlefloor_sprite.disposed?()
- end
- #--------------------------------------------------------------------------
- # * Create Enemy Sprite
- #--------------------------------------------------------------------------
- def create_enemies
- @enemy_sprites = []
- for enemy in $game_troop.members.reverse
- @enemy_sprites.push(Sprite_Battler.new(@viewport1, enemy))
- end
- end
- #--------------------------------------------------------------------------
- # ActorFloor Sprite
- #--------------------------------------------------------------------------
- def create_actorfloor
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorfloor_sprite = Sprite.new(@viewport1)
- @actorfloor_sprite.bitmap = PBS::Cache.system(PBS::Cache::ACTORBACKGROUND)
- @actorfloor_sprite.x = PBS::Cache.system(PBS::Cache::ACTORBACKGROUND).width
- @actorfloor_sprite.y = 190
- @actorfloor_sprite.z = 1
- @actorfloor_sprite.opacity = 255
- end
- end
- def update_actorfloor
- @actorfloor_sprite.update unless @actorfloor_sprite.nil?()
- end
- def dispose_actorfloor
- @actorfloor_sprite.dispose unless @actorfloor_sprite.nil?()
- end
- def actorfloor_actor_hit_s
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorfloor_sprite.x -=8
- $scene.wait(2)
- end
- end
- def actorfloor_actor_hit_e
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- $scene.wait(2)
- @actorfloor_sprite.x +=8
- end
- end
- #--------------------------------------------------------------------------
- # * Actor Back Sprite
- #--------------------------------------------------------------------------
- def create_actorback
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite = Sprite.new(@viewport1)
- @actorback_sprite.bitmap = PBS::Cache.actorbacks($game_party.members[1].id.to_s)
- @actorback_sprite.x = 20
- @actorback_sprite.y = 140
- @actorback_sprite.z = 2
- @actorback_sprite.visible = false
- end
- end
- def update_actorback
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite.update
- end
- end
- def dispose_actorback
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite.dispose
- end
- end
- def actor_back_attack_s
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite.x += 3
- $scene.wait(2)
- end
- end
- def actor_back_attack_e
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- $scene.wait(2)
- @actorback_sprite.x -= 3
- end
- end
- def actor_back_damage_s
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite.x -= 8
- $scene.wait(2)
- end
- end
- def actor_back_damage_e
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- $scene.wait(2)
- @actorback_sprite.x += 8
- end
- end
- #--------------------------------------------------------------------------
- # * Slide In
- #--------------------------------------------------------------------------
- def slide_in
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorback_sprite.visible = true
- end
- $game_troop.members.each { |enemy| enemy.screen_x -= 295 }
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- $game_party.members.each { |actor| @actorback_sprite.x += 295 }
- end
- 30.times { |i|
- $game_troop.members.each { |enemy| enemy.screen_x += 10}
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- $game_party.members.each { |actor| @actorback_sprite.x -= 10}
- update_actorback
- end
- update_enemies
- if i <= 30
- @enemyfloor_sprite.x += 14 # 10
- if $game_switches[BATTLE_CONFIG::ACTOR_BACK_SWITCH_ID]
- @actorfloor_sprite.x -= 9 # 10
- update_actorfloor
- end
- update_enemyfloor
- end
- $scene.update_basic
- }
- end
- end
- class Sprite_Battler
- def setup_new_effect
- if @battler.animation_id != 0
- animation = $data_animations[@battler.animation_id]
- mirror = @battler.animation_mirror
- start_animation(animation, mirror)
- @battler.animation_id = 0
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Start Animation
- #--------------------------------------------------------------------------
- #---------------------------------------------------------------------------#
- # END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ #
- # END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ END /:/ #
- #---------------------------------------------------------------------------#
Advertisement
Add Comment
Please, Sign In to add comment