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.

Final Fantasy 7 Regen script

Can anyone make a script that adds in the regen status, but not to where it just gains a small amount of HP each turn, but to where it constantly makes your HP go up until it's full like in Final Fantasy 7. If this has already been done, then just tell me where I can find the script. Any help would appreciated greatly.
 

Shiro

Member

Yay for archiving posts that you like :) I hope Ccoa doesn't mind me reposting this.

I did this as a request on another forum this morning. Although I've seen this asked here before, I haven't seen the script. Apologies if someone else has already done the same thing.

Add to Game_Battler 2, right under the method slip_damage?, the following new method:

Code:
#--------------------------------------------------------------------------
# * Ccoa - Determine [Regen] States
#--------------------------------------------------------------------------
def regen?
for i in @states
if $data_states[i].guard_element_set.include?($REGEN_ELEMENT)
return true
end
end
return false
end

And to Game_Battler 3, right under the method slip_damage_effect:

Code:
#--------------------------------------------------------------------------
# * Ccoa - application of Regen Effect
#--------------------------------------------------------------------------
def regen_effect
# Set "damage"
self.damage = -(self.maxhp / 10)
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Add damage to HP
self.hp -= self.damage
return true
end

And to Scene Battle 4, look for the comment # Slip Damage, and replace the if statement right under it with this:
Code:
# Slip damage and regen - ccoa
if @active_battler.hp > 0
if @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
if @active_battler.regen?
@active_battler.regen_effect
@active_battler.damage_pop = true
end
end

Finally, insert a new file above Game_Temp, and name it CONSTANTS. Put the following line in it:

Code:
$REGEN_ELEMENT = 17

Now go to the database, and create a new element called Regen. If it is not element 17, go back to CONSTANTS, and change the 17 to the number of the element you just created. Now go to the states tab, and create a new status effect. Check the checkbox next to Regen for the element defense attribute. All done, you have a regen status!

To change how much HP the hero gains each turn, fiddle with this line:

Code:
self.damage = -(self.maxhp / 10)

Currently, she gains 1/10 of her max hp each turn. To make it less, make the 10 higher, to make it more, make it smaller.
 
Would there be a way to have two separate regen effects stack with each other?

I have a working regen, as detailed above, which affects all party members. But I have one character who plays a defensive role in battles, and she's half lizard person, so I want her to have a regrow ability of her own, which only affects herself. So far I have:

Game Battler 2

Code:
   #--------------------------------------------------------------------------
# * Ccoa - Determine [Regen] States
#--------------------------------------------------------------------------
def regen?
for i in @states
if $data_states[i].guard_element_set.include?($REGEN_ELEMENT)
return true
end
end
return false
end
#--------------------------------------------------------------------------
# * Ccoa - Determine [Regrowth] States
#--------------------------------------------------------------------------
def regrowth?
for i in @states
if $data_states[i].guard_element_set.include?($REGROWTH_ELEMENT)
return true
end
end
return false
end

Game Battler 3

Code:
   #--------------------------------------------------------------------------
# * Ccoa - application of Regen Effect
#--------------------------------------------------------------------------
def regen_effect
# Set "damage"
self.damage = -(self.maxhp / 10)
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Add damage to HP
self.hp -= self.damage
return true
end
#--------------------------------------------------------------------------
# * Ccoa - application of Regrowth Effect
#--------------------------------------------------------------------------
def regrowth_effect
# Set "damage"
self.damage = -(self.maxhp / 10)
# Dispersion
if self.damage.abs > 0
amp = [self.damage.abs * 15 / 100, 1].max
self.damage += rand(amp+1) + rand(amp+1) - amp
end
# Add damage to HP
self.hp -= self.damage
return true
end

Scene Battle 4 (I successfully combined the two separate strings on this one)

Code:
    # Slip damage
    # Slip damage and regen - ccoa
if @active_battler.hp > 0
if @active_battler.slip_damage?
@active_battler.slip_damage_effect
@active_battler.damage_pop = true
end
if @active_battler.regen?
@active_battler.regen_effect
@active_battler.damage_pop = true
end
if @active_battler.regrowth?
@active_battler.regrowth_effect
@active_battler.damage_pop = true
end
end

CONSTANTS

Code:
$REGEN_ELEMENT = 18
$REGROWTH_ELEMENT = 23

Both Regen and Regrow work independantly of each other. But when both are active on the lizardgirl, she only receives the effects of one of them. Can somebody please help her?
 

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