Cleanup, move OnBeforeAnyHookInvoked function to an interface
This commit is contained in:
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Klutz_(Ability)">Bulbapedia - Klutz</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "klutz")]
|
||||
public class Klutz : Script
|
||||
public class Klutz : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= new List<ScriptCategory>();
|
||||
suppressedCategories.Add(ScriptCategory.ItemBattleTrigger);
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Mold_Breaker_(Ability)">Bulbapedia - Mold Breaker</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "mold_breaker")]
|
||||
public class MoldBreaker : Script
|
||||
public class MoldBreaker : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= [];
|
||||
suppressedCategories.Add(ScriptCategory.Ability);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Shadow_Shield_(Ability)">Bulbapedia - Shadow Shield</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "shadow_shield")]
|
||||
public class ShadowShield : Script
|
||||
public class ShadowShield : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||
@@ -18,7 +18,7 @@ public class ShadowShield : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
// Shadow Shield can not be suppressed by any other script, so we remove it from the list of suppressed categories
|
||||
// if it was added.
|
||||
|
||||
@@ -9,10 +9,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Air_Lock_(Ability)">Bulbapedia - Air Lock</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "suppress_weather")]
|
||||
public class SuppressWeatherAbility : Script
|
||||
public class SuppressWeatherAbility : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= [];
|
||||
suppressedCategories.Add(ScriptCategory.Weather);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Battle;
|
||||
|
||||
[Script(ScriptCategory.Battle, "magic_room")]
|
||||
public class MagicRoomEffect : Script
|
||||
public class MagicRoomEffect : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
private int _turnsLeft = 5;
|
||||
|
||||
@@ -12,7 +12,7 @@ public class MagicRoomEffect : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= [];
|
||||
suppressedCategories.Add(ScriptCategory.ItemBattleTrigger);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "moongeist_beam")]
|
||||
public class MoongeistBeam : Script
|
||||
public class MoongeistBeam : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= [];
|
||||
suppressedCategories.Add(ScriptCategory.Ability);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
||||
|
||||
[Script(ScriptCategory.Side, "teravolt")]
|
||||
public class TeravoltEffect : Script
|
||||
public class TeravoltEffect : Script, IScriptOnBeforeAnyHookInvoked
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
public void OnBeforeAnyHookInvoked(ref List<ScriptCategory>? suppressedCategories)
|
||||
{
|
||||
suppressedCategories ??= [];
|
||||
suppressedCategories.Add(ScriptCategory.Ability);
|
||||
|
||||
Reference in New Issue
Block a user