So I've been working on this script (I'll reveal at the bottom). And it's running smoothly now, what it does is work with another script that makes a "Mood" gauge, and depending on the mood level this script will change your hp and mhp. However, when in battle and the hp/mhp has been changed an enemies attack adds hp to the actor for at least 2 turns and then does nothing whatsoever.
Edit: The HP changes after any action.
I've been told I should find another way to accomplish this, if you know of a way, I'm more than open to suggestions! Thanks!
class Game_Actor < Game_Battler attr_reader :mood alias euphoria_moodeffects_gameactor_initialize_5 initialize def initialize(actor_id) @mood = 50 euphoria_moodeffects_gameactor_initialize_5(actor_id) end alias euphoria_moodeffects_gameactor_mhp_5 mhp def mhp if @mood == 100 (euphoria_moodeffects_gameactor_mhp_5 * 1.25).to_i elsif @mood >= 75 (euphoria_moodeffects_gameactor_mhp_5 * 1.10).to_i elsif @mood >= 55 (euphoria_moodeffects_gameactor_mhp_5 * 1.05).to_i elsif @mood == 50 (euphoria_moodeffects_gameactor_mhp_5 * 1.00).to_i elsif @mood == 0 (euphoria_moodeffects_gameactor_mhp_5 * 0.75).to_i elsif @mood <= 25 (euphoria_moodeffects_gameactor_mhp_5 * 0.90).to_i elsif @mood <= 45 (euphoria_moodeffects_gameactor_mhp_5 * 0.95).to_i else (euphoria_moodeffects_gameactor_mhp_5 * 1.00).to_i end end alias euphoria_moodeffects_gameactor_hp_5 hp def hp if @mood == 100 (euphoria_moodeffects_gameactor_hp_5 * 1.25).to_i elsif @mood >= 75 (euphoria_moodeffects_gameactor_hp_5 * 1.10).to_i elsif @mood >= 55 (euphoria_moodeffects_gameactor_hp_5 * 1.05).to_i elsif @mood == 50 (euphoria_moodeffects_gameactor_hp_5 * 1.00).to_i elsif @mood == 0 (euphoria_moodeffects_gameactor_hp_5 * 0.75).to_i elsif @mood <= 25 (euphoria_moodeffects_gameactor_hp_5 * 0.90).to_i elsif @mood <= 45 (euphoria_moodeffects_gameactor_hp_5 * 0.95).to_i else (euphoria_moodeffects_gameactor_hp_5 * 1.00).to_i end end def hp_rate hp.to_f / mhp end endI did overwrite hp_rate, could that be what's causing this?
[ACE] Enemy Attacks ADD Hp???
● ARCHIVED · READ-ONLY
-
-
I dont know why you are changing the current hp. I think it would be better if you keep the current hp as it is.
Here is some example with using case and not change the current hp:
class Game_Actor < Game_Battler attr_accessor :mood alias :euphoria_moodeffects_gameactor_initialize_5 :initialize def initialize(actor_id) @mood = 50 euphoria_moodeffects_gameactor_initialize_5(actor_id) end alias :euphoria_moodeffects_gameactor_mhp_5 :mhp def mhp max_hp = euphoria_moodeffects_gameactor_mhp_5 case @mood when 100 then (max_hp * 1.25).to_i when 75..100 then (max_hp * 1.10).to_i when 55..75 then (max_hp * 1.05).to_i when 50 then (max_hp * 1.00).to_i when 26..45 then (max_hp * 0.95).to_i when 1..25 then (max_hp * 0.90).to_i when 0 then (max_hp * 0.75).to_i else max_hp end end alias :ga_12_hp_rate_e222 :hp_rate def hp_rate # call refresh before the rate gets calculated because the @hp # needs to be set to mhp if its higher than mhp refresh ga_12_hp_rate_e222 end def hp refresh return @hp end endMaybe it would be better if you work with passive states. Then the user of your script can define which state will be activated on which mood and can set the effects himself. -
I'm not smart enough to do that yet xD That's a good idea for something to start practicing on though. Thanks again for helping me out!