20 lines
780 B
GDScript
20 lines
780 B
GDScript
class_name FlashFireAbility
|
|
extends BattleEffect
|
|
|
|
#Torche : immunise contre le type Feu, puis renforce ses propres capacites Feu de 50 %
|
|
|
|
func _init() -> void:
|
|
id = &"flash_fire"
|
|
|
|
func on_before_hit(battle : Battle, attacker : BattleSlot, defender : BattleSlot, move : MoveData) -> bool:
|
|
if attacker == defender or move.type.to_lower() != "fire": return false
|
|
await battle.announce_ability(defender)
|
|
defender.mon.flags["flash_fire"] = true
|
|
await battle.message("La puissance Feu de %s augmente !" % defender.mon.display_name())
|
|
return true
|
|
|
|
func modify_outgoing_damage(attacker : BattleMon, _defender : BattleMon, move : MoveData, damage : float) -> float:
|
|
if attacker.flags.get("flash_fire", false) and move.type.to_lower() == "fire":
|
|
return damage * 1.5
|
|
return damage
|