More moves, allow for typeless moves
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user