This commit is contained in:
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/FlashFire.cs
Normal file
29
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/FlashFire.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
|
||||
/// <summary>
|
||||
/// Flash Fire is an ability that makes the Pokémon immune to Fire-type moves.
|
||||
/// When hit by a Fire-type move, the ability activates and increases the power of the Pokémon's Fire-type moves by 50%.
|
||||
/// This ability is commonly associated with Ninetales and Arcanine.
|
||||
///
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Flash_Fire_(Ability)">Bulbapedia - Flash Fire</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "flash_fire")]
|
||||
public class FlashFire : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingEffectiveness(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref float effectiveness)
|
||||
{
|
||||
if (executingMove.GetHitData(target, hitIndex).Type?.Name == "fire")
|
||||
{
|
||||
effectiveness = 0f;
|
||||
|
||||
if (target.Volatile.Contains<FlashFireEffect>())
|
||||
return;
|
||||
target.Volatile.Add(new FlashFireEffect());
|
||||
executingMove.Battle.EventHook.Invoke(new AbilityTriggerEvent(target));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user