- 16
- Posts
- 4
- Years
- He/They/It
- Area Zero Underdepths
- Seen Oct 17, 2024
this was my first attempt at coding on my own
Battle::AbilityEffects::OnHPDroppedBelowHalf.add(:SLOWSTART,
proc { |ability, battler, move_user, battle|
battle.pbShowAbilitySplash(battler, true)
battle.pbHideAbilitySplash(battler)
battle.pbDisplay(_INTL("{1} realized the gravity of the situation and got it together!"))
battle.allBattlers.each do |b|
# Slow Start - end all turn counts
b.effects[PBEffects::SlowStart] = 0
end
}
)
Battle::AbilityEffects::SpeedCalc.add(:SLOWSTART,
proc { |ability, battler, mult|
next mult * 1.2 if battler.effects[PBEffects::SlowStart] < 0 && user.hp <= user.totalhp / 2
}
)
Battle::AbilityEffects::DamageCalcFromUser.add(:SLOWSTART,
proc { |ability, user, target, move, mults, power, type|
mults[:attack_multiplier] *= 1.2 if user.effects[PBEffects::SlowStart] < 0 && user.hp <= user.totalhp / 2
}
)
Battle::AbilityEffects::PriorityChange.add(:SLOWSTART,
proc { |ability, battler, move, pri|
next pri + 3 if user.hp <= user.totalhp / 2 &&
move.type == :NORMAL
}
)
Does this work at all? What can I change?
Spoiler: Regigigas ability change
Battle::AbilityEffects::OnHPDroppedBelowHalf.add(:SLOWSTART,
proc { |ability, battler, move_user, battle|
battle.pbShowAbilitySplash(battler, true)
battle.pbHideAbilitySplash(battler)
battle.pbDisplay(_INTL("{1} realized the gravity of the situation and got it together!"))
battle.allBattlers.each do |b|
# Slow Start - end all turn counts
b.effects[PBEffects::SlowStart] = 0
end
}
)
Battle::AbilityEffects::SpeedCalc.add(:SLOWSTART,
proc { |ability, battler, mult|
next mult * 1.2 if battler.effects[PBEffects::SlowStart] < 0 && user.hp <= user.totalhp / 2
}
)
Battle::AbilityEffects::DamageCalcFromUser.add(:SLOWSTART,
proc { |ability, user, target, move, mults, power, type|
mults[:attack_multiplier] *= 1.2 if user.effects[PBEffects::SlowStart] < 0 && user.hp <= user.totalhp / 2
}
)
Battle::AbilityEffects::PriorityChange.add(:SLOWSTART,
proc { |ability, battler, move, pri|
next pri + 3 if user.hp <= user.totalhp / 2 &&
move.type == :NORMAL
}
)
Does this work at all? What can I change?
Last edited: