Jump to content
Sign in to follow this  
Big Fat Mantis

Drain HP Status?

Recommended Posts

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

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

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

something like


when /DRAIN[ ](\d+)([%%])/i

drain = (user.hp * $1.to_i * 0.01).to_i

state_origin.hp += drain

user.hp -= drain

not tested

Share this post


Link to post
Share on other sites

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
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted