Tales-of-PKMN/game/battle/effects/paralysis_effect.gd

17 lines
551 B
GDScript

class_name ParalysisEffect
extends BattleEffect
const FULL_PARALYSIS_CHANCE : float = 0.25
func _init() -> void:
id = &"paralysis"
func modify_stat(_mon : BattleMon, stat : PokemonNature.Stat, value : float) -> float:
return value * 0.5 if stat == PokemonNature.Stat.SPEED else value
func before_action(battle : Battle, slot : BattleSlot, _action : BattleAction) -> bool:
if battle.rng.randf() < FULL_PARALYSIS_CHANCE:
await battle.message("%s est paralysé ! Il ne peut pas attaquer !" % slot.mon.display_name())
return false
return true