More moves

This commit is contained in:
2025-04-17 10:22:24 +02:00
parent 7c2845502d
commit 1b54c78b07
9 changed files with 172 additions and 16 deletions

View File

@@ -0,0 +1,22 @@
using System.Linq;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "parabolic_charge")]
public class ParabolicCharge : Script
{
/// <inheritdoc />
public override void OnAfterMove(IExecutingMove move)
{
if (move.User.IsFainted)
return;
var totalDamage = move.Hits.Sum(x => x.Damage);
var halfDamage = totalDamage / 2;
if (halfDamage == 0)
return;
if (halfDamage > uint.MaxValue)
halfDamage = uint.MaxValue;
move.User.Heal((uint)halfDamage);
}
}