Deukhoofd eea5697109
All checks were successful
Build / Build (push) Successful in 49s
Fixes all warnings
2025-05-19 11:50:51 +02:00

20 lines
553 B
C#

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);
}
}