Move all battle state from IPokemon to an ephemeral IBattlePokemon wrapper
This commit is contained in:
@@ -10,9 +10,9 @@ public class Present : Script, IScriptOnSecondaryEffect, IScriptChangeBasePower,
|
||||
private byte _basePower;
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex)
|
||||
public void OnBeforeHit(IExecutingMove move, IBattlePokemon target, byte hitIndex)
|
||||
{
|
||||
var battleRandom = move.User.BattleData?.Battle.Random;
|
||||
var battleRandom = move.User.Battle.Random;
|
||||
if (battleRandom == null)
|
||||
return;
|
||||
var percentRoll = battleRandom.GetFloat() * 100.0;
|
||||
@@ -34,20 +34,20 @@ public class Present : Script, IScriptOnSecondaryEffect, IScriptChangeBasePower,
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ChangeCategory(IExecutingMove move, IPokemon target, byte hitIndex, ref MoveCategory category)
|
||||
public void ChangeCategory(IExecutingMove move, IBattlePokemon target, byte hitIndex, ref MoveCategory category)
|
||||
{
|
||||
if (_isHealing)
|
||||
category = MoveCategory.Status;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
public void ChangeBasePower(IExecutingMove move, IBattlePokemon target, byte hit, ref ushort basePower)
|
||||
{
|
||||
basePower = _basePower;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public void OnSecondaryEffect(IExecutingMove move, IBattlePokemon target, byte hit)
|
||||
{
|
||||
if (!_isHealing)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user