Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Healing script

Mean1

Member

Hey all its me again.
In my game each person in the world has an ability. Each person is different. Some are stronger, some are weaker. But EVERY ONE has one.
That's the background of my request. Here is the request. One of my main characters, Demetrius, has the ability to heal quickly for example, for every step you take, Demetrius heals 1 HP. In battle after he attacks, Demetrius heals 1% of his health. Kind of like Poison does but only in reverse. I do not understand scripting at all haha
so any help is appreciated. Also in battle healing, I have an SBS ATB system so after his bar fills up and attacks, he heals.

I know this is probably going to be a hard script to make...I don't really expect much responses from it. Hopefully some one can full fill this. I am sure others could also benefit from this script.



~Mean1
 
I have no idea which battle system you are using, but this works with the default battle system, and on the map.

As long as your battle system is calling "do_auto_recovery", it should work in battle too.

Paste Above Main

Look for the comments in the script to set the actor ID (2 places). I used Actor 2 for testing.

Code:
 

class Game_Actor

  #--------------------------------------------------------------------------

  # * Perform Automatic Recovery (called at end of turn)

  # Add an option for a certain actor to heal additionally

  #--------------------------------------------------------------------------

  def do_auto_recovery

    if auto_hp_recover and not dead?

      self.hp += maxhp / 20              # HP auto recovery from armor

    end

    #-----------------------

    # Set your actor ID here

    #-----------------------

    if @actor_id == 2 and not dead?

      self.hp += maxhp / 100            # HP auto recovery for 1 actor

    end

  end

end

 

class Game_Party

  #--------------------------------------------------------------------------

  # * Processing Performed When Player Takes 1 Step

  #--------------------------------------------------------------------------

  def on_player_walk

    for actor in members

      if actor.slip_damage?

        actor.hp -= 1 if actor.hp > 1   # Poison damage

        $game_map.screen.start_flash(Color.new(255,0,0,64), 4)

      end

      if actor.auto_hp_recover and actor.hp > 0

        actor.hp += 1                   # HP auto recovery from armor

      end

      #-----------------------

      # Set your actor ID here

      #-----------------------

      if actor.id == 2

        actor.hp += 1                   # HP auto recovery for 1 actor

      end

    end

  end

end

 

Ref: Project2
 

Mean1

Member

My bad. I am using the Takentai system (I believe. While the ATB script says it can only work with the SBS Takentai script, the SBS script does not say it is Takentai. I do believe it is because I got it from Mr.Bubble which I think is Takentai)

But I tried it none the less and tested just walking around at it works...
but getting it to work in battle is a bit different story...hmmm
Thanks man. Who is to credit? Unless it is yours?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top