Hello, I have a question, you'll see, I have been working in a certain formula
class Game_Battler < Game_BattlerBase
def hp_regen(a, b)
x0 = ([30000, b.mhp].min) / 16.0
dmg = x0 + b.luk
variance = Random.new
low = 0.87
high = 0.99
dmg *= variance.rand(low..high)
return dmg.round.to_i
end
end
You'll see, just before the variane part I want to add those multipliers
-If b's level is bigger than 10 but lower or equal than 20, then dmg is multiplied by 1.2
-If b's level is bigger than 20 but lower or equal than 30, then dmg is multiplied by 1.4
-If b's level is bigger than 30 but lower or equal than 40, then dmg is multplied by 1.6
-If b's level is bigger than 40, then dmg is multiplied by 1.8
Can someone help me to make this? Thank you 🙂
class Game_Battler < Game_BattlerBase
def hp_regen(a, b)
x0 = ([30000, b.mhp].min) / 16.0
dmg = x0 + b.luk
variance = Random.new
low = 0.87
high = 0.99
dmg *= variance.rand(low..high)
return dmg.round.to_i
end
end
You'll see, just before the variane part I want to add those multipliers
-If b's level is bigger than 10 but lower or equal than 20, then dmg is multiplied by 1.2
-If b's level is bigger than 20 but lower or equal than 30, then dmg is multiplied by 1.4
-If b's level is bigger than 30 but lower or equal than 40, then dmg is multplied by 1.6
-If b's level is bigger than 40, then dmg is multiplied by 1.8
Can someone help me to make this? Thank you 🙂