Advertisement
diamondandplatinum3

Battler Death Hue Transition

Jun 7th, 2014
554
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.60 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Battler Death Hue Transition
  3. #             Version: 1.0
  4. #             Author: DiamondandPlatinum3
  5. #             Date: June 7, 2014
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #
  9. #    This script grants enemy battlers with a Target Hue to reach upon death.
  10. #     What this means is that the more you attack and hurt the Battler, the
  11. #     closer their hue colour effect gets to the target.
  12. #
  13. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  14. #------------------------------------------------------------------------------
  15. #  Instructions:
  16. #
  17. #  ~  Modify The Default Target Hue in the Editable Region to suit your liking.
  18. #
  19. #
  20. #  ~  If you wish to set up individual hue targets for an enemy.
  21. #       Inside the Enemy Database, enter the following as a notetag:
  22. #               <~TargetHue: ???>
  23. #
  24. #       Replacing the ??? to a valid Hue Colour. Doing so will give the
  25. #       enemy an individual hue target compared to other enemy types in
  26. #       the enemy troop.
  27. #
  28. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  29. module DiamondandPlatinum3
  30.   module BattlerHue
  31.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  32.     #                                                        -=
  33.     #                 Editable Region        ////            ==
  34.     #                                                        =-
  35.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36.    
  37.     # What HUE should the Enemy have when close to death?
  38.     # As the enemy HP goes down, they will slowly head towards this hue.
  39.     #
  40.     # This value is used if the Enemy does NOT have a notetag to specify
  41.     # the Tarhet Hue.
  42.     # By default, the value is 160; which is a Red Hue.
  43.     TargetHue = 160
  44.    
  45.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  46.     #                                           \/
  47.     #               End of Editable Region      /\
  48.     #                                           \/
  49.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  50.   end
  51. end
  52.  
  53.  
  54.  
  55. #==============================================================================
  56. # ** Game_Enemy
  57. #------------------------------------------------------------------------------
  58. #  This class handles enemies. It used within the Game_Troop class
  59. # ($game_troop).
  60. #==============================================================================
  61.  
  62. class Game_Enemy < Game_Battler
  63.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  64.   # *= Alias Listings
  65.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  66.   alias_method(:dp3_bht_gameenemy_pdamgeff_093tv,     :perform_damage_effect)
  67.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  68.   # * Aliased Method: Execute Damage Effect
  69.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  70.   def perform_damage_effect(*args)
  71.     dp3_bht_gameenemy_pdamgeff_093tv(*args) # Call Original Method
  72.     @battler_hue = (((mhp() - @hp).to_f / mhp())* dp3_target_battler_hue()) if @hp > 0
  73.   end
  74.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  75.   # * New Method: Get Target Hue
  76.   #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  77.   def dp3_target_battler_hue
  78.     if enemy.note =~ /<~Target\s?Hue:?\s?(\d+)>/i
  79.       return $1.to_i
  80.     else
  81.       return DiamondandPlatinum3::BattlerHue::TargetHue
  82.     end
  83.   end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement