This commit is contained in:
parent
5961bb746e
commit
1b9d137bb0
@ -60,15 +60,15 @@ public static class TurnRunner
|
|||||||
{
|
{
|
||||||
scripts.Clear();
|
scripts.Clear();
|
||||||
pokemon.GetOwnScripts(scripts);
|
pokemon.GetOwnScripts(scripts);
|
||||||
scripts.RunScriptHook(x => x.OnEndTurn(battle));
|
scripts.RunScriptHook(x => x.OnEndTurn(pokemon, battle));
|
||||||
}
|
}
|
||||||
scripts.Clear();
|
scripts.Clear();
|
||||||
side.GetOwnScripts(scripts);
|
side.GetOwnScripts(scripts);
|
||||||
scripts.RunScriptHook(x => x.OnEndTurn(battle));
|
scripts.RunScriptHook(x => x.OnEndTurn(side, battle));
|
||||||
}
|
}
|
||||||
scripts.Clear();
|
scripts.Clear();
|
||||||
battle.GetOwnScripts(scripts);
|
battle.GetOwnScripts(scripts);
|
||||||
scripts.RunScriptHook(x => x.OnEndTurn(battle));
|
scripts.RunScriptHook(x => x.OnEndTurn(battle, battle));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -552,8 +552,9 @@ public abstract class Script : IDeepCloneable
|
|||||||
/// running. Note that choices are not active anymore here, so their scripts do not call this
|
/// running. Note that choices are not active anymore here, so their scripts do not call this
|
||||||
/// function.
|
/// function.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="owner"></param>
|
||||||
/// <param name="battle"></param>
|
/// <param name="battle"></param>
|
||||||
public virtual void OnEndTurn(IBattle battle)
|
public virtual void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,15 +567,33 @@
|
|||||||
"slow_start": {
|
"slow_start": {
|
||||||
"effect": "slow_start"
|
"effect": "slow_start"
|
||||||
},
|
},
|
||||||
"slush_rush": {},
|
"slush_rush": {
|
||||||
"sniper": {},
|
"effect": "slush_rush"
|
||||||
"snow_cloak": {},
|
},
|
||||||
"snow_warning": {},
|
"sniper": {
|
||||||
"solar_power": {},
|
"effect": "sniper"
|
||||||
"solid_rock": {},
|
},
|
||||||
"soul_heart": {},
|
"snow_cloak": {
|
||||||
"soundproof": {},
|
"effect": "snow_cloak"
|
||||||
"speed_boost": {},
|
},
|
||||||
|
"snow_warning": {
|
||||||
|
"effect": "snow_warning"
|
||||||
|
},
|
||||||
|
"solar_power": {
|
||||||
|
"effect": "solar_power"
|
||||||
|
},
|
||||||
|
"solid_rock": {
|
||||||
|
"effect": "solid_rock"
|
||||||
|
},
|
||||||
|
"soul_heart": {
|
||||||
|
"effect": "soul_heart"
|
||||||
|
},
|
||||||
|
"soundproof": {
|
||||||
|
"effect": "soundproof"
|
||||||
|
},
|
||||||
|
"speed_boost": {
|
||||||
|
"effect": "speed_boost"
|
||||||
|
},
|
||||||
"stakeout": {},
|
"stakeout": {},
|
||||||
"stall": {},
|
"stall": {},
|
||||||
"stamina": {},
|
"stamina": {},
|
||||||
|
@ -20,7 +20,7 @@ public class BadDreams : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_owner is null)
|
if (_owner is null)
|
||||||
return;
|
return;
|
||||||
|
@ -39,7 +39,7 @@ public class DrySkin : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_owningPokemon == null)
|
if (_owningPokemon == null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class Harvest : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon?.BattleData is null)
|
if (_pokemon?.BattleData is null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class Healer : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon?.BattleData is null)
|
if (_pokemon?.BattleData is null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class Hydration : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon is null)
|
if (_pokemon is null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class IceBody : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon is null)
|
if (_pokemon is null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class Moody : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon == null)
|
if (_pokemon == null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class PowerConstruct : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon?.BattleData?.Battle == null)
|
if (_pokemon?.BattleData?.Battle == null)
|
||||||
return;
|
return;
|
||||||
|
@ -19,7 +19,7 @@ public class RainDish : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_owner is null)
|
if (_owner is null)
|
||||||
return;
|
return;
|
||||||
|
@ -22,7 +22,7 @@ public class Schooling : Script
|
|||||||
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
public override void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
||||||
|
|
||||||
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ public class ShedSkin : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_owningPokemon is null || _owningPokemon.StatusScript.IsEmpty)
|
if (_owningPokemon is null || _owningPokemon.StatusScript.IsEmpty)
|
||||||
return;
|
return;
|
||||||
|
@ -22,7 +22,7 @@ public class ShieldsDown : Script
|
|||||||
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
public override void OnSwitchIn(IPokemon pokemon, byte position) => ChangeFormIfNeeded(pokemon);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
public override void OnEndTurn(IScriptSource owner, IBattle battle) => ChangeFormIfNeeded(_owningPokemon);
|
||||||
|
|
||||||
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
private static void ChangeFormIfNeeded(IPokemon? pokemon)
|
||||||
{
|
{
|
||||||
|
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SlushRush.cs
Normal file
19
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SlushRush.cs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Slush Rush is an ability that doubles the Pokémon's Speed during hail.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Slush_Rush_(Ability)">Bulbapedia - Slush Rush</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "slush_rush")]
|
||||||
|
public class SlushRush : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeSpeed(ITurnChoice choice, ref uint speed)
|
||||||
|
{
|
||||||
|
if (choice.User.BattleData?.Battle.WeatherName == ScriptUtils.ResolveName<Weather.Hail>())
|
||||||
|
{
|
||||||
|
speed *= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Sniper.cs
Normal file
16
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Sniper.cs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Sniper is an ability that increases the power of critical hits.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sniper_(Ability)">Bulbapedia - Sniper</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "sniper")]
|
||||||
|
public class Sniper : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeCriticalModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier)
|
||||||
|
{
|
||||||
|
modifier *= 1.5f;
|
||||||
|
}
|
||||||
|
}
|
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SnowCloak.cs
Normal file
27
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SnowCloak.cs
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Snow Cloak is an ability that raises the Pokémon's evasion during hail.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Snow_Cloak_(Ability)">Bulbapedia - Snow Cloak</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "snow_cloak")]
|
||||||
|
public class SnowCloak : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||||
|
ref int modifiedAccuracy)
|
||||||
|
{
|
||||||
|
// If the weather is hail, increase evasion by 20%
|
||||||
|
if (executingMove.Battle.WeatherName == ScriptUtils.ResolveName<Weather.Hail>())
|
||||||
|
{
|
||||||
|
modifiedAccuracy = (int)(modifiedAccuracy * 0.8f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||||
|
{
|
||||||
|
if (eventName == CustomTriggers.IgnoreHail && args is CustomTriggers.IgnoreHailArgs hailArgs)
|
||||||
|
hailArgs.Ignore = true;
|
||||||
|
}
|
||||||
|
}
|
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SnowWarning.cs
Normal file
25
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SnowWarning.cs
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Snow Warning is an ability that creates hail when the Pokémon enters battle.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Snow_Warning_(Ability)">Bulbapedia - Snow Warning</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "snow_warning")]
|
||||||
|
public class SnowWarning : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnSwitchIn(IPokemon pokemon, byte position)
|
||||||
|
{
|
||||||
|
var battleData = pokemon.BattleData;
|
||||||
|
if (battleData == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (battleData.Battle.WeatherName == ScriptUtils.ResolveName<Weather.Hail>())
|
||||||
|
return;
|
||||||
|
|
||||||
|
EventBatchId batchId = new();
|
||||||
|
battleData.Battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon));
|
||||||
|
battleData.Battle.SetWeather(ScriptUtils.ResolveName<Weather.Hail>(), 5, batchId);
|
||||||
|
}
|
||||||
|
}
|
34
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SolarPower.cs
Normal file
34
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SolarPower.cs
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Solar Power is an ability that boosts Special Attack in harsh sunlight but causes the Pokémon to lose HP each turn.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Solar_Power_(Ability)">Bulbapedia - Solar Power</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "solar_power")]
|
||||||
|
public class SolarPower : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||||
|
ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
|
||||||
|
{
|
||||||
|
if ((stat == Statistic.SpecialAttack &&
|
||||||
|
move.Battle.WeatherName == ScriptUtils.ResolveName<Weather.HarshSunlight>()) ||
|
||||||
|
move.Battle.WeatherName == ScriptUtils.ResolveName<Weather.DesolateLands>())
|
||||||
|
{
|
||||||
|
value = value.MultiplyOrMax(1.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
|
{
|
||||||
|
if (owner is not IPokemon pokemon)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!pokemon.IsUsable)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pokemon.Damage(pokemon.MaxHealth / 8, DamageSource.Weather);
|
||||||
|
}
|
||||||
|
}
|
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SolidRock.cs
Normal file
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SolidRock.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Solid Rock is an ability that reduces damage from super-effective moves.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Solid_Rock_(Ability)">Bulbapedia - Solid Rock</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "solid_rock")]
|
||||||
|
public class SolidRock : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
|
||||||
|
{
|
||||||
|
if (move.GetHitData(target, hit).Effectiveness >= 2f)
|
||||||
|
damage = (uint)(damage * 0.75f);
|
||||||
|
}
|
||||||
|
}
|
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SoulHeart.cs
Normal file
22
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SoulHeart.cs
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Soul-Heart is an ability that raises Special Attack when another Pokémon faints.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Soul-Heart_(Ability)">Bulbapedia - Soul-Heart</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "soul_heart")]
|
||||||
|
public class SoulHeart : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnAllyFaint(IPokemon ally, IPokemon faintedPokemon)
|
||||||
|
{
|
||||||
|
ally.ChangeStatBoost(Statistic.SpecialAttack, 1, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnOpponentFaints(IExecutingMove move, IPokemon target, byte hit)
|
||||||
|
{
|
||||||
|
move.User.ChangeStatBoost(Statistic.SpecialAttack, 1, true, false);
|
||||||
|
}
|
||||||
|
}
|
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Soundproof.cs
Normal file
17
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/Soundproof.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Soundproof is an ability that grants immunity to sound-based moves.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Soundproof_(Ability)">Bulbapedia - Soundproof</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "soundproof")]
|
||||||
|
public class Soundproof : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable)
|
||||||
|
{
|
||||||
|
if (move.UseMove.HasFlag("sound"))
|
||||||
|
invulnerable = true;
|
||||||
|
}
|
||||||
|
}
|
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SpeedBoost.cs
Normal file
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Abilities/SpeedBoost.cs
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Speed Boost is an ability that raises the Pokémon's Speed at the end of each turn.
|
||||||
|
///
|
||||||
|
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Speed_Boost_(Ability)">Bulbapedia - Speed Boost</see>
|
||||||
|
/// </summary>
|
||||||
|
[Script(ScriptCategory.Ability, "speed_boost")]
|
||||||
|
public class SpeedBoost : Script
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
|
{
|
||||||
|
if (owner is not IPokemon pokemon)
|
||||||
|
return;
|
||||||
|
|
||||||
|
EventBatchId batchId = new();
|
||||||
|
battle.EventHook.Invoke(new AbilityTriggerEvent(pokemon)
|
||||||
|
{
|
||||||
|
BatchId = batchId,
|
||||||
|
});
|
||||||
|
pokemon.ChangeStatBoost(Statistic.Speed, 1, true, false, batchId);
|
||||||
|
}
|
||||||
|
}
|
@ -18,7 +18,7 @@ public class FairyLockEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
|
@ -12,7 +12,7 @@ public class FutureSightEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turnsLeft -= 1;
|
_turnsLeft -= 1;
|
||||||
if (_turnsLeft <= 0)
|
if (_turnsLeft <= 0)
|
||||||
|
@ -34,7 +34,7 @@ public class Gravity : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns > 0)
|
if (_turns > 0)
|
||||||
|
@ -19,7 +19,7 @@ public class MagicRoomEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turnsLeft > 0)
|
if (_turnsLeft > 0)
|
||||||
_turnsLeft--;
|
_turnsLeft--;
|
||||||
|
@ -17,7 +17,7 @@ public class MudSportEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turnsLeft--;
|
_turnsLeft--;
|
||||||
if (_turnsLeft <= 0)
|
if (_turnsLeft <= 0)
|
||||||
|
@ -53,7 +53,7 @@ public class SnatchEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class TrickRoomEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turnsLeft--;
|
_turnsLeft--;
|
||||||
if (_turnsLeft <= 0)
|
if (_turnsLeft <= 0)
|
||||||
|
@ -39,7 +39,7 @@ public class UproarEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (!_hasUsedUproar)
|
if (!_hasUsedUproar)
|
||||||
{
|
{
|
||||||
|
@ -19,7 +19,7 @@ public class WonderRoomEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
TurnsLeft--;
|
TurnsLeft--;
|
||||||
if (TurnsLeft <= 0)
|
if (TurnsLeft <= 0)
|
||||||
|
@ -43,7 +43,7 @@ public class MetalBurst : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ public class MirrorCoat : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class BindEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_owner == null)
|
if (_owner == null)
|
||||||
return;
|
return;
|
||||||
|
@ -18,7 +18,7 @@ public class ChargeEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turnOfUse)
|
if (_turnOfUse)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@ public class DisableEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turnsLeft--;
|
_turnsLeft--;
|
||||||
if (_turnsLeft <= 0)
|
if (_turnsLeft <= 0)
|
||||||
|
@ -18,7 +18,7 @@ public class EmbargoEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns == 0)
|
if (_turns == 0)
|
||||||
|
@ -30,7 +30,7 @@ public class EncoreEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
|
@ -11,5 +11,5 @@ public class EndureEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle) => RemoveSelf();
|
public override void OnEndTurn(IScriptSource owner, IBattle battle) => RemoveSelf();
|
||||||
}
|
}
|
@ -11,7 +11,7 @@ public class FireSpinEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_owner.Damage(_owner.BoostedStats.Hp / 8, DamageSource.Misc);
|
_owner.Damage(_owner.BoostedStats.Hp / 8, DamageSource.Misc);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class GhostCurseEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_pokemon.Damage(_pokemon.CurrentHealth / 4, DamageSource.Misc);
|
_pokemon.Damage(_pokemon.CurrentHealth / 4, DamageSource.Misc);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class HealBlockEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_duration--;
|
_duration--;
|
||||||
if (_duration <= 0)
|
if (_duration <= 0)
|
||||||
|
@ -16,9 +16,10 @@ public class HealEachEndOfTurnEffect : Script
|
|||||||
_pokemon = pokemon;
|
_pokemon = pokemon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <param name="owner"></param>
|
||||||
/// <param name="battle"></param>
|
/// <param name="battle"></param>
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon is null)
|
if (_pokemon is null)
|
||||||
return;
|
return;
|
||||||
|
@ -9,5 +9,5 @@ public class HelpingHandEffect : Script
|
|||||||
basePower = basePower.MultiplyOrMax(1.5f);
|
basePower = basePower.MultiplyOrMax(1.5f);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle) => RemoveSelf();
|
public override void OnEndTurn(IScriptSource owner, IBattle battle) => RemoveSelf();
|
||||||
}
|
}
|
@ -31,7 +31,7 @@ public class IceBallEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (TurnCount < 5)
|
if (TurnCount < 5)
|
||||||
TurnCount++;
|
TurnCount++;
|
||||||
|
@ -19,7 +19,7 @@ public class InfestationEffect : Script
|
|||||||
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true;
|
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
var damage = _owner.BoostedStats.Hp / 8;
|
var damage = _owner.BoostedStats.Hp / 8;
|
||||||
_owner.Damage(damage, DamageSource.Misc);
|
_owner.Damage(damage, DamageSource.Misc);
|
||||||
|
@ -19,7 +19,7 @@ public class IngrainEffect : Script
|
|||||||
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true;
|
public override void PreventSelfRunAway(IFleeChoice choice, ref bool prevent) => prevent = true;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
var heal = _owner.BoostedStats.Hp / 16;
|
var heal = _owner.BoostedStats.Hp / 16;
|
||||||
_owner.Heal(heal);
|
_owner.Heal(heal);
|
||||||
|
@ -13,7 +13,7 @@ public class LeechSeedEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
var damage = _owner.BoostedStats.Hp / 8;
|
var damage = _owner.BoostedStats.Hp / 8;
|
||||||
if (_owner.CurrentHealth <= damage)
|
if (_owner.CurrentHealth <= damage)
|
||||||
|
@ -20,7 +20,7 @@ public class LockOnEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class LuckyChantEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turnsLeft--;
|
_turnsLeft--;
|
||||||
if (_turnsLeft > 0)
|
if (_turnsLeft > 0)
|
||||||
|
@ -11,7 +11,7 @@ public class MagmaStormEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_owner.Damage(_owner.BoostedStats.Hp / 16, DamageSource.Misc);
|
_owner.Damage(_owner.BoostedStats.Hp / 16, DamageSource.Misc);
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class MagnetRiseEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turnsRemaining > 0)
|
if (_turnsRemaining > 0)
|
||||||
_turnsRemaining--;
|
_turnsRemaining--;
|
||||||
|
@ -13,7 +13,7 @@ public class NightmareEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (!_owner.HasStatus(ScriptUtils.ResolveName<Sleep>()))
|
if (!_owner.HasStatus(ScriptUtils.ResolveName<Sleep>()))
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ public class PerishSongEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
|
@ -17,7 +17,7 @@ public class ProtectionFailureScript : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (!UsedProtect)
|
if (!UsedProtect)
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@ public class RageEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -13,5 +13,5 @@ public class RoostEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle) => RemoveSelf();
|
public override void OnEndTurn(IScriptSource owner, IBattle battle) => RemoveSelf();
|
||||||
}
|
}
|
@ -20,7 +20,7 @@ public class SlowStartEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turnsRemaining <= 0)
|
if (_turnsRemaining <= 0)
|
||||||
return;
|
return;
|
||||||
|
@ -25,7 +25,7 @@ public class TauntEffect(int turns) : Script
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
|
@ -20,7 +20,7 @@ public class ThroatChopEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns--;
|
_turns--;
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
|
@ -56,7 +56,7 @@ public class WhirlpoolEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_user == null)
|
if (_user == null)
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@ public class WishEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon == null)
|
if (_pokemon == null)
|
||||||
return;
|
return;
|
||||||
|
@ -20,7 +20,7 @@ public class YawnEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon == null)
|
if (_pokemon == null)
|
||||||
{
|
{
|
||||||
|
@ -34,9 +34,10 @@ public class AuroraVeilEffect : Script
|
|||||||
NumberOfTurns = numberOfTurns;
|
NumberOfTurns = numberOfTurns;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <param name="owner"></param>
|
||||||
/// <param name="battle"></param>
|
/// <param name="battle"></param>
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (NumberOfTurns > 0)
|
if (NumberOfTurns > 0)
|
||||||
NumberOfTurns--;
|
NumberOfTurns--;
|
||||||
|
@ -36,7 +36,7 @@ public class DoomDesireEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_side == null)
|
if (_side == null)
|
||||||
return;
|
return;
|
||||||
|
@ -5,9 +5,10 @@ public class DoublePowerIfTargetDamagedInTurnData : Script
|
|||||||
{
|
{
|
||||||
public readonly HashSet<IPokemon> HitPokemon = [];
|
public readonly HashSet<IPokemon> HitPokemon = [];
|
||||||
|
|
||||||
|
/// <param name="owner"></param>
|
||||||
/// <param name="battle"></param>
|
/// <param name="battle"></param>
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Side;
|
|||||||
public class EchoedVoiceData : Script
|
public class EchoedVoiceData : Script
|
||||||
{
|
{
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ public class LightScreenEffect(int turns) : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_turns -= 1;
|
_turns -= 1;
|
||||||
if (_turns <= 0)
|
if (_turns <= 0)
|
||||||
|
@ -12,7 +12,7 @@ public class MatBlockEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ public class QuickGuardEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ public class RagePowderEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ public class ReflectEffect(int turns) : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_turns > 0)
|
if (_turns > 0)
|
||||||
{
|
{
|
||||||
|
@ -25,7 +25,7 @@ public class SpotlightEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ public class TailwindEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_duration--;
|
_duration--;
|
||||||
if (_duration <= 0)
|
if (_duration <= 0)
|
||||||
|
@ -31,7 +31,7 @@ public class WideGuardEffect : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
RemoveSelf();
|
RemoveSelf();
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ public class BadlyPoisoned : Poisoned
|
|||||||
public override float GetPoisonMultiplier() => 1f / (16f * _turns);
|
public override float GetPoisonMultiplier() => 1f / (16f * _turns);
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
base.OnEndTurn(battle);
|
base.OnEndTurn(owner, battle);
|
||||||
_turns = Math.Min(_turns + 1, 15);
|
_turns = Math.Min(_turns + 1, 15);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -25,7 +25,7 @@ public class Burned : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_target == null)
|
if (_target == null)
|
||||||
return;
|
return;
|
||||||
|
@ -28,7 +28,7 @@ public class Frozen : Script
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon == null)
|
if (_pokemon == null)
|
||||||
return;
|
return;
|
||||||
|
@ -16,7 +16,7 @@ public class Poisoned : Script
|
|||||||
public virtual float GetPoisonMultiplier() => 1f / 8f;
|
public virtual float GetPoisonMultiplier() => 1f / 8f;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (_pokemon == null)
|
if (_pokemon == null)
|
||||||
return;
|
return;
|
||||||
|
@ -35,7 +35,7 @@ public class DesolateLands : HarshSunlight
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class Hail : Script, ILimitedTurnsScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
if (!battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("ice", out var iceType))
|
if (!battle.Library.StaticLibrary.Types.TryGetTypeIdentifier("ice", out var iceType))
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@ public class HarshSunlight : Script, ILimitedTurnsScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_duration--;
|
_duration--;
|
||||||
if (_duration <= 0)
|
if (_duration <= 0)
|
||||||
|
@ -34,7 +34,7 @@ public class PrimordialSea : Rain
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
// We don't want to call base.OnEndTurn here, as we want to prevent the weather from ending
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public class Rain : Script, ILimitedTurnsScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override void OnEndTurn(IBattle battle)
|
public override void OnEndTurn(IScriptSource owner, IBattle battle)
|
||||||
{
|
{
|
||||||
_duration--;
|
_duration--;
|
||||||
if (_duration <= 0)
|
if (_duration <= 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user