Advertisement
FlipelyFlip

FFS - Actor Voice in Battle

Aug 7th, 2024
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.72 KB | None | 0 0
  1. module FFS
  2.   module RNG
  3.     MAX = 10  # Es wird eine Zahl zwischen 0 und MAX generiert
  4.     BELOW = 2 # Es wird geprüft, ob die generierte Zahl kleiner
  5.               # oder gleich als BELOW ist.
  6.   end
  7. end
  8.  
  9. #==============================================================================
  10. # ** Game_Actor
  11. #------------------------------------------------------------------------------
  12. #  This class handles actors. It is used within the Game_Actors class
  13. # ($game_actors) and is also referenced from the Game_Party class ($game_party).
  14. #==============================================================================
  15. class Game_Actor < Game_Battler
  16.   #--------------------------------------------------------------------------
  17.   # * Aliased Method: [HP Recovery] Effect
  18.   #--------------------------------------------------------------------------
  19.   alias :ffs_item_effect_recover_hp :item_effect_recover_hp
  20.   def item_effect_recover_hp( *args )
  21.     num = rand(FFS::RNG::MAX)
  22.     if args[0] != self && !(num <= FFS::RNG::BELOW)
  23.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  24.     end
  25.    
  26.     # Call Original Method
  27.     ffs_item_effect_recover_hp( *args )
  28.   end
  29.  
  30.   #--------------------------------------------------------------------------
  31.   # * Aliased Method: [MP Recovery] Effect
  32.   #--------------------------------------------------------------------------
  33.   alias :ffs_item_effec_recover_mp :item_effect_recover_mp
  34.   def item_effect_recover_mp( *args )
  35.     num = rand(FFS::RNG::MAX)
  36.     if args[0] != self && !(num <= FFS::RNG::BELOW)
  37.       DiamondandPlatinum3::BattleVoices::play_healed_voice(@actor_id)
  38.     end
  39.    
  40.     # Call Original Method
  41.     ffs_item_effect_recover_mp( *args )
  42.   end
  43. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement