More moves, allow for typeless moves

This commit is contained in:
2025-05-02 15:46:37 +02:00
parent 807acf1947
commit 068ff8d5b7
33 changed files with 525 additions and 56 deletions

View File

@@ -1,7 +1,40 @@
using PkmnLib.Static.Moves;
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
[Script(ScriptCategory.Side, "reflect")]
public class ReflectEffect : Script
public class ReflectEffect(int turns) : Script
{
// TODO: Implement ReflectEffect
private int _turns = turns;
/// <inheritdoc />
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
{
var hitData = move.GetHitData(target, hit);
if (move.UseMove.Category != MoveCategory.Physical)
return;
if (hitData.IsCritical)
return;
switch (move.Battle.PositionsPerSide)
{
case 1:
damage /= 2;
break;
default:
damage *= 2 / 3;
break;
}
}
/// <inheritdoc />
public override void OnEndTurn(IBattle battle)
{
if (_turns > 0)
{
_turns--;
return;
}
RemoveSelf();
}
}