Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Flip
- HP_LIMIT_1 = 10 # lowest limit to change the graphic of the battler
- HP_LIMIT_2 = 25 # low limit to change the graphic of the battler
- HP_LIMIT_3 = 50 # middle limit to change the graphic of the battler
- HP_LIMIT_4 = 75 # highest limit to change the battler graphic
- HP_LIMIT_PERCENT = true # if true, the HP_LIMITer will be set as percentage
- HP_LIMIT_ENDING_1 = "_critical" # ending phrase of the battler graphic by LIMIT_1
- HP_LIMIT_ENDING_2 = "_low" # ending phrase of the battler graphic by LIMIT_2
- HP_LIMIT_ENDING_3 = "_middle" # ending phrase of the battler graphic by LIMIT_3
- HP_LIMIT_ENDING_4 = "_ok" # ending phrase of the battler graphic by LIMIT_4
- #battler graphics should be saved by the name of the battler like:
- # Aluxes
- # Aluxes_ok
- # Aluxes_middle
- # Aluxes_low
- # Aluxes_critical
- # else you will run into errors.
- end
- class Scene_Battle
- #--------------------------------------------------------------------------
- # ● フレーム更新
- #--------------------------------------------------------------------------
- def change_battler_graphic
- for i in $game_party.actors
- old_graphics = []
- old_graphics[0] = i.character_name
- old_graphics[1] = i.character_hue
- old_graphics[2] = i.battler_name
- old_graphics[3] = i.battler_hue
- if Flip::HP_LIMIT_PERCENT
- actor_hp = i.hp
- actor_hp *= 100
- actor_hp /= i.maxhp
- if actor_hp <= Flip::HP_LIMIT_1
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_1,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_2
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_2,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_3
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_3,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_4
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_4,old_graphics[3])
- else
- i.set_graphic(old_graphics[0],old_graphics[1],i.name,old_graphics[3])
- end
- else
- if actor_hp <= Flip::HP_LIMIT_1
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_1,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_2
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_2,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_3
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_3,old_graphics[3])
- elsif actor_hp <= Flip::HP_LIMIT_4
- i.set_graphic(old_graphics[0],old_graphics[1],i.name + Flip::HP_LIMIT_ENDING_4,old_graphics[3])
- else
- i.set_graphic(old_graphics[0],old_graphics[1],i.name,old_graphics[3])
- end
- end
- end
- end
- #--------------------------------------------------------------------------
- # * Frame Update (main phase step 6 : refresh)
- #--------------------------------------------------------------------------
- alias flip_update_phase4_step6 update_phase4_step6
- def update_phase4_step6
- change_battler_graphic
- flip_update_phase4_step6
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement