This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
|
||||
[Script(ScriptCategory.Terrain, "electric_terrain")]
|
||||
public class ElectricTerrain : Script, IScriptChangeBasePower
|
||||
public class ElectricTerrain : Script, IScriptChangeBasePower, IScriptPreventStatusChange, IScriptPreventVolatileAdd
|
||||
{
|
||||
private static bool IsAffectedByTerrain(IPokemon pokemon) =>
|
||||
!pokemon.IsFloating;
|
||||
@@ -17,8 +17,7 @@ public class ElectricTerrain : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
public void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus)
|
||||
{
|
||||
if (!IsAffectedByTerrain(pokemon))
|
||||
return;
|
||||
@@ -27,7 +26,7 @@ public class ElectricTerrain : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
public void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
{
|
||||
if (parent is IPokemon pokemon && !IsAffectedByTerrain(pokemon))
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Terrain;
|
||||
|
||||
[Script(ScriptCategory.Terrain, "misty_terrain")]
|
||||
public class MistyTerrain : Script, IScriptChangeBasePower
|
||||
public class MistyTerrain : Script, IScriptChangeBasePower, IScriptPreventStatusChange
|
||||
{
|
||||
private static bool IsAffectedByTerrain(IPokemon pokemon) =>
|
||||
!pokemon.IsFloating;
|
||||
@@ -18,8 +18,7 @@ public class MistyTerrain : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted,
|
||||
ref bool preventStatus)
|
||||
public void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus)
|
||||
{
|
||||
if (!IsAffectedByTerrain(pokemon))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user