Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: callmedan on August 04, 2017, 11:14:43 pm

Title: [RESOLVED] [XP] Healing Weapon script
Post by: callmedan on August 04, 2017, 11:14:43 pm
Introduction
Hello! I'm looking for a healing weapon script. Because several people misunderstood it so I'd like to say no, it's not absorb/vampiric weapon.
My English is not really good so I would try my best to explain what I need.
Thanks a ton!  :)

What I would like it to do.
The healing weapon works just like normal weapons. It damages the enemy but it also heals player who equipped it x HP each attack turn (In my game, player equipped healing weapon gains 10 HP each attack turn).

How I would like it to work


Scripts I'm using now
Title: Re: [XP] Healing Weapon script
Post by: KK20 on August 05, 2017, 02:55:28 am
There's a script in Tons of Add-ons (http://forum.chaos-project.com/index.php/topic,105.0.html) that consumes actor's HP/SP with a normal weapon attack (HP/SP Crush, in Part 2). As the script's description states (in bold):
Quote
#   This add-on allows you to make weapons consume HP/SP for each attack. The
#   attack will not be executed if there are not enough HP or SP. The actor can
#   use up all SP and/or all HP (except 1) for an attack to succeed. If you use
#   negative values in the configuration, the stats will be restored instead of
#   consumed.


Title: Re: [XP] Healing Weapon script
Post by: callmedan on August 05, 2017, 04:08:54 am
Quote from: KK20 on August 05, 2017, 02:55:28 am
There's a script in Tons of Add-ons (http://forum.chaos-project.com/index.php/topic,105.0.html) that consumes actor's HP/SP with a normal weapon attack (HP/SP Crush, in Part 2). As the script's description states (in bold):
Quote
#   This add-on allows you to make weapons consume HP/SP for each attack. The
#   attack will not be executed if there are not enough HP or SP. The actor can
#   use up all SP and/or all HP (except 1) for an attack to succeed. If you use
#   negative values in the configuration, the stats will be restored instead of
#   consumed.



Thank you! Btw, Is it possible to make the consumed/restored HP number show up in battle scene?
Title: Re: [XP] Healing Weapon script
Post by: KK20 on August 05, 2017, 04:27:02 am
Just need to add one line to the method in the script:

      current_battler.hp -= reqs[0]
      current_battler.sp -= reqs[1]

      current_battler.damage = (reqs[0] != 0 ? reqs[0] : (reqs[1] != 0 ? reqs[1] : current_battler.damage)) #<===== This line

      @status_window.refresh

Will probably not display the correct amount if you have a poison state or some other script that heals/damages the attacking battler since they will most likely overwrite the damage value.
Title: Re: [RESOLVED] [XP] Healing Weapon script
Post by: callmedan on August 05, 2017, 09:44:18 am
Thanks a lot!  :)