Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- =begin
- RGSS3 Enemy Scale/Invert 2012/1/19 mo-to
- TKOOL COOL
- http://mototkool.blog.fc2.com/
- ★Usage★
- This script uses overwrite function, and thus if you decide to use the script, put it above all your custom scripts for the best compatibility cases (or edit it yourself so that you could put it anywhere in your script slot)
- ●In the enemy Note box, put this note tag <scale>.
- ●If you use <invert> inside the enemy Note box,
- the enemy graphic is flipped horizontal. Can be used together with scaling.
- Example) <scale 1.5> in the Note box for slime of enemy ID1
- The slime graphic is multiplied by 1.5 during battle.
- ★Overview★
- Scale / Invert effect can be used without directly editing the enemy graphics.
- ★Note★
- Please pay attention to performance of large enemy graphics.
- If you use multiple enemies, they will overlap unless you adjust their position.
- Due to how redefinition is used, there may be script conflicts.
- ★RGSS Reference★
- Suppon blog
- http://supponweblog.blog88.fc2.com/
- Reference of zoom from Game_Battler for Maker XP.
- =end
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ● Public instance variables
- #--------------------------------------------------------------------------
- attr_reader :zoom # Scale enemy characters
- attr_reader :mirror # Invert enemy characters
- #--------------------------------------------------------------------------
- # ● Object initialization * Redefined
- # index : Enemy group index
- # enemy_id : Enemy ID
- #--------------------------------------------------------------------------
- def initialize(index, enemy_id)
- super()
- @index = index
- @enemy_id = enemy_id
- enemy = $data_enemies[@enemy_id]
- @original_name = enemy.name
- @letter = ''
- @plural = false
- @screen_x = 0
- @screen_y = 0
- @battler_name = enemy.battler_name
- @battler_hue = enemy.battler_hue
- @hp = mhp
- @mp = mmp
- @mirror = false
- @zoom = 1
- enemy.note.each_line { |line|
- case line
- when /<scale\s*([0-9]+(\.[0-9]*)?|(\.[0-9]+)?)>/
- @zoom = $1.to_f
- when /<invert>/
- @mirror = true
- end
- }
- end
- end
- class Sprite_Battler < Sprite_Base
- #--------------------------------------------------------------------------
- # ● Object initialization ※ Redefine
- # viewport
- # battler : Game_Battler
- #--------------------------------------------------------------------------
- def initialize(viewport, battler = nil)
- super(viewport)
- @battler = battler
- @battler_visible = false
- @effect_type = nil # Effect type
- @effect_duration = 0 # Duration/ time
- if battler.class == Game_Enemy
- self.zoom_x = battler.zoom
- self.zoom_y = battler.zoom
- self.mirror = battler.mirror
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement