Big Fat Mantis 40 Posted January 2, 2013 I've been trying for the past couple days to perfect a state that simply drains a set % of HP from the individual with the state back to the actor that inflicted the state. But no matter what I do I just can't seem to get it to work. I've tried using Lunatic states and tried doing some coding in there, but nothing's working. All I want is for the state to Drain x% HP from the target at the end of each turn. It seems really simple, but I just can't get it. Has anyone else tried this? Share this post Link to post Share on other sites
Xypher 176 Posted January 2, 2013 you can edit the drain hp effect from lunatic states punishment and set it to close effect. Share this post Link to post Share on other sites
Big Fat Mantis 40 Posted January 2, 2013 Unfortunately, my scripting knowledge isn't the greatest thing around, so I must be doing something wrong. With this: when /DRAIN HP[ ](\d+)([%ï¼…])/i return unless @result.hp_damage > 0 dmg = (@result.hp_damage * $1.to_i * 0.01).to_i if $imported["YEA-BattleEngine"] && dmg > 0 Sound.play_recovery text = sprintf(YEA::BATTLE::POPUP_SETTINGS[:hp_heal], dmg.group) user.create_popup(text, "HP_HEAL") end state_origin.hp += dmg What do I need to tweak to get it to work right? Share this post Link to post Share on other sites
Xypher 176 Posted January 2, 2013 something like when /DRAIN[ ](\d+)([%%])/i drain = (user.hp * $1.to_i * 0.01).to_i state_origin.hp += drain user.hp -= drainnot tested Share this post Link to post Share on other sites
Big Fat Mantis 40 Posted January 2, 2013 Yeah I did that, and I did <close effect: drain hp 5%> on the status, and it doesn't work. Nothing crashes, just it doesn't do the drain effect. Share this post Link to post Share on other sites
Xypher 176 Posted January 2, 2013 it should be <close effect: drain 5%> Share this post Link to post Share on other sites
Big Fat Mantis 40 Posted January 2, 2013 Oh wow, I feel silly. Works perfectly now, thanks! Share this post Link to post Share on other sites