Deukhoofd a17cb92c5a
Some checks failed
continuous-integration/drone/push Build is failing
Implements a bunch more moves
2025-05-17 17:44:15 +02:00

23 lines
947 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "techno_blast")]
public class TechnoBlast : Script
{
/// <inheritdoc />
public override void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? moveType)
{
var heldItem = move.User.HeldItem;
if (heldItem == null)
return;
var typeLibrary = target.Library.StaticLibrary.Types;
moveType = heldItem.Name.ToString().ToLowerInvariant() switch
{
"burn_drive" when typeLibrary.TryGetTypeIdentifier("fire", out var fire) => fire,
"chill_drive" when typeLibrary.TryGetTypeIdentifier("ice", out var ice) => ice,
"douse_drive" when typeLibrary.TryGetTypeIdentifier("water", out var water) => water,
"shock_drive" when typeLibrary.TryGetTypeIdentifier("electric", out var electric) => electric,
_ => moveType,
};
}
}