Further work on the script interface rework
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "double_power_if_target_damaged_in_turn_data")]
|
||||
public class DoublePowerIfTargetDamagedInTurnData : Script, IScriptOnEndTurn
|
||||
public class DoublePowerIfTargetDamagedInTurnData : Script, IScriptOnEndTurn, IScriptOnDamage
|
||||
{
|
||||
public readonly HashSet<IPokemon> HitPokemon = [];
|
||||
|
||||
@@ -14,7 +14,7 @@ public class DoublePowerIfTargetDamagedInTurnData : Script, IScriptOnEndTurn
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnDamage(IPokemon pokemon, DamageSource source, uint oldHealth, uint newHealth)
|
||||
public void OnDamage(IPokemon pokemon, DamageSource source, uint oldHealth, uint newHealth)
|
||||
{
|
||||
HitPokemon.Add(pokemon);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "healing_wish")]
|
||||
public class HealingWishEffect : Script
|
||||
public class HealingWishEffect : Script, IScriptOnSwitchIn
|
||||
{
|
||||
private readonly byte _position;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class HealingWishEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
{
|
||||
if (position == _position)
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "lunar_dance")]
|
||||
public class LunarDanceEffect(byte position) : Script
|
||||
public class LunarDanceEffect(byte position) : Script, IScriptOnSwitchIn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position1)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position1)
|
||||
{
|
||||
if (position != position1)
|
||||
return;
|
||||
|
||||
@@ -2,10 +2,10 @@ using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
public class MatBlockEffect : Script, IScriptOnEndTurn
|
||||
public class MatBlockEffect : Script, IScriptOnEndTurn, IScriptBlockIncomingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
public void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
if (executingMove.UseMove.Category != MoveCategory.Status)
|
||||
block = true;
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "spikes")]
|
||||
public class SpikesEffect : Script
|
||||
public class SpikesEffect : Script, IScriptOnSwitchIn, IScriptStack
|
||||
{
|
||||
private int _layers = 1;
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Stack()
|
||||
public void Stack()
|
||||
{
|
||||
if (_layers < 3)
|
||||
_layers++;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
{
|
||||
if (pokemon.IsFloating)
|
||||
return;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "stealth_rock")]
|
||||
public class StealthRockEffect : Script
|
||||
public class StealthRockEffect : Script, IScriptOnSwitchIn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
{
|
||||
var typeLibrary = pokemon.Library.StaticLibrary.Types;
|
||||
var effectiveness = 1.0f;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "sticky_web")]
|
||||
public class StickyWebEffect : Script
|
||||
public class StickyWebEffect : Script, IScriptOnSwitchIn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
{
|
||||
if (pokemon.IsFloating)
|
||||
return;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "toxic_spikes")]
|
||||
public class ToxicSpikesEffect : Script
|
||||
public class ToxicSpikesEffect : Script, IScriptOnSwitchIn
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
public void OnSwitchIn(IPokemon pokemon, byte position)
|
||||
{
|
||||
if (pokemon.IsFloating)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user