More moves implemented

This commit is contained in:
2025-05-05 11:36:59 +02:00
parent 11ba3c73bb
commit 292c303fc0
39 changed files with 818 additions and 68 deletions

View File

@@ -0,0 +1,35 @@
using System;
using System.Collections.Generic;
using PkmnLib.Static.Utils;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "static_damage")]
public class StaticDamage : Script
{
private uint Damage { get; set; }
/// <inheritdoc />
public override void OnInitialize(IReadOnlyDictionary<StringKey, object?>? parameters)
{
if (parameters == null)
throw new Exception("Parameters cannot be null for StaticDamage script.");
if (parameters.TryGetValue("damage", out var damage))
{
if (damage is int d)
Damage = (uint)d;
else
throw new Exception($"Invalid damage value: {damage}");
}
else
{
throw new Exception("Missing required parameter: damage");
}
}
/// <inheritdoc />
public override void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
{
damage = Damage;
}
}