Even more abilities

This commit is contained in:
2025-06-09 14:23:51 +02:00
parent 97868ab4c6
commit 074f92bfc0
31 changed files with 319 additions and 51 deletions

View File

@@ -0,0 +1,29 @@
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Galvanize is an ability that turns Normal-type moves into Electric-type moves and boosts their power.
/// This ability is exclusive to Alolan Golem.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Galvanize_(Ability)">Bulbapedia - Galvanize</see>
/// </summary>
[Script(ScriptCategory.Ability, "galvanize")]
public class Galvanize : Script
{
/// <inheritdoc />
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit,
ref TypeIdentifier? typeIdentifier)
{
if (typeIdentifier?.Name == "normal" &&
move.Battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("electric", out var electricType))
{
typeIdentifier = electricType;
}
}
/// <inheritdoc />
public override void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
{
if (move.GetHitData(target, hit).Type?.Name == "electric")
modifier *= 1.2f;
}
}