Getting started with implementing an explicit AI, based on the Essentials one.
All checks were successful
Build / Build (push) Successful in 1m2s
All checks were successful
Build / Build (push) Successful in 1m2s
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
[Script(ScriptCategory.Pokemon, "whirlpool")]
|
||||
public class WhirlpoolEffect : Script, IScriptOnEndTurn, IScriptPreventOpponentRunAway, IScriptPreventOpponentSwitch
|
||||
public class WhirlpoolEffect : Script, IScriptOnEndTurn, IScriptPreventOpponentRunAway, IScriptPreventOpponentSwitch,
|
||||
IAIInfoScriptExpectedEndOfTurnDamage
|
||||
{
|
||||
public record PokemonTurn
|
||||
{
|
||||
@@ -80,4 +81,14 @@ public class WhirlpoolEffect : Script, IScriptOnEndTurn, IScriptPreventOpponentR
|
||||
_targetedPokemon.Remove(turn);
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void ExpectedEndOfTurnDamage(IPokemon pokemon, ref int damage)
|
||||
{
|
||||
var turn = _targetedPokemon.FirstOrDefault(x => x.Pokemon == pokemon);
|
||||
if (turn != null)
|
||||
{
|
||||
damage += (int)(pokemon.MaxHealth * turn.DamagePercent);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user