Further work on the script interface rework
This commit is contained in:
@@ -3,10 +3,10 @@ using PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "doom_desire")]
|
||||
public class DoomDesire : Script
|
||||
public class DoomDesire : Script, IScriptBlockOutgoingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
public void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
var battleData = target.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "dream_eater")]
|
||||
public class DreamEater : Script, IScriptOnSecondaryEffect
|
||||
public class DreamEater : Script, IScriptOnSecondaryEffect, IScriptBlockOutgoingHit
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
public void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
|
||||
{
|
||||
if (!target.HasStatus("asleep"))
|
||||
block = true;
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
public class KingsShield : ProtectionScript
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
base.OnSecondaryEffect(move, target, hit);
|
||||
// Default form is shield form
|
||||
|
||||
@@ -8,7 +8,7 @@ public class ProtectionScript : Script, IScriptOnSecondaryEffect
|
||||
protected virtual Script GetEffectScript() => new ProtectionEffectScript();
|
||||
|
||||
/// <inheritdoc />
|
||||
public void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
public virtual void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
var battleData = target.BattleData;
|
||||
if (battleData == null)
|
||||
|
||||
Reference in New Issue
Block a user