Help - Search - Members - Calendar
Full Version: Regenration State
RPG RPG Revolution Forums > Scripting > Event Emporium
Applepie181
I am completely new to the RPG Revolution forums and I didn't plan on ask for help with things until my first project is done but I really want one of my characters in my game to have a regeneration spell. I looking for a state that slowly recovers a small amount of health each turn but I have no idea how to work it since you can only setup slip damage or parameter changes.

Does anybody know how to work a regeneration state or there's absolutely no way without coding? Thanks guys biggrin.gif
brewmeister
I'm certain there is a way, albeit rather cumbersome, to do this with events. However, since it's already built in for Armor, it's pretty easy to just have it check for the Regen state as well....

CODE
class Game_Actor
  alias regen_auto_hp_recover auto_hp_recover
  def auto_hp_recover
    if state?(17)  # Regenerate.  Change 17 to your Regen state ID
      if self.hp == maxhp
        remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
      end
      return true
    end
    regen_auto_hp_recover
  end
end


This adds 1 HP per step on the map, and 5% of MAXHP per turn during battle. (Same as the Auto HP Recover for Armor)
This script will also remove the Regen state once the character is fully healed.
LaDestitute
Might be a good idea if you make regen and poison cancel each other out.

Edit: Try this if you want, it's up to you.

CODE
class Game_Actor
  alias regen_auto_hp_recover auto_hp_recover
  def auto_hp_recover
    if state?(17)  # Regenerate.  Change 17 to your Regen state ID
      if self.hp == maxhp
        remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
      end
    if state?(3) # Venom. Change 3 to your venom/poison state ID (Poison will cancel out Regen, and vice versa)
      remove_state(17)  # Regenerate.  Change 17 to your Regen state ID
    end
    if state?(17) # Regenerate. Change 17 to your Regen state ID
      remove_state(3)  # Venom.  Change 17 to your Venom/Poison state ID
    end
      return true
    end
    regen_auto_hp_recover
  end
end
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.