This commit is contained in:
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Aura_Break_(Ability)">Bulbapedia - Aura Break</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "aura_break")]
|
||||
public class AuraBreak : Script
|
||||
public class AuraBreak : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifyAuraEffect || args is not CustomTriggers.ModifyAuraEffectArgs auraArgs)
|
||||
return;
|
||||
|
||||
@@ -8,11 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Comatose_(Ability)">Bulbapedia - Comatose</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "comatose")]
|
||||
public class Comatose : Script
|
||||
public class Comatose : Script, IScriptPreventStatusChange, IScriptCustomTrigger
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Sleep>())
|
||||
{
|
||||
@@ -21,7 +20,7 @@ public class Comatose : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSleep && args is CustomTriggers.BypassSleepArgs bypassArgs)
|
||||
{
|
||||
|
||||
@@ -7,10 +7,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Compound_Eyes_(Ability)">Bulbapedia - Compound Eyes</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "compound_eyes")]
|
||||
public class CompoundEyes : Script
|
||||
public class CompoundEyes : Script, IScriptChangeAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeAccuracy(IExecutingMove move, IPokemon target, byte hit, ref int modifiedAccuracy)
|
||||
public void ChangeAccuracy(IExecutingMove move, IPokemon target, byte hit, ref int modifiedAccuracy)
|
||||
{
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User));
|
||||
modifiedAccuracy = (int)(modifiedAccuracy * 1.3f);
|
||||
|
||||
@@ -17,7 +17,7 @@ public class DarkAura : Script, IScriptChangeDamageModifier
|
||||
var auraModifier = 5448f / 4096f;
|
||||
var args = new CustomTriggers.ModifyAuraEffectArgs(move, target, hit, auraModifier);
|
||||
move.Battle.Sides.SelectMany(side => side.Pokemon).WhereNotNull()
|
||||
.RunScriptHook(x => x.CustomTrigger(CustomTriggers.ModifyAuraEffect, args));
|
||||
.RunScriptHook<IScriptCustomTrigger>(x => x.CustomTrigger(CustomTriggers.ModifyAuraEffect, args));
|
||||
auraModifier = args.AuraEffect;
|
||||
modifier *= auraModifier;
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User));
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Early_Bird_(Ability)">Bulbapedia - Early Bird</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "early_bird")]
|
||||
public class EarlyBird : Script
|
||||
public class EarlyBird : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifySleepTurns)
|
||||
return;
|
||||
|
||||
@@ -18,7 +18,7 @@ public class FairyAura : Script, IScriptChangeDamageModifier
|
||||
var auraModifier = 5448f / 4096f;
|
||||
var args = new CustomTriggers.ModifyAuraEffectArgs(move, target, hit, auraModifier);
|
||||
move.Battle.Sides.SelectMany(side => side.Pokemon).WhereNotNull()
|
||||
.RunScriptHook(x => x.CustomTrigger(CustomTriggers.ModifyAuraEffect, args));
|
||||
.RunScriptHook<IScriptCustomTrigger>(x => x.CustomTrigger(CustomTriggers.ModifyAuraEffect, args));
|
||||
auraModifier = args.AuraEffect;
|
||||
modifier *= auraModifier;
|
||||
move.Battle.EventHook.Invoke(new AbilityTriggerEvent(move.User));
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Flower_Gift_(Ability)">Bulbapedia - Flower Gift</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "flower_gift")]
|
||||
public class FlowerGift : Script
|
||||
public class FlowerGift : Script, IScriptOnWeatherChange
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -22,7 +22,7 @@ public class FlowerGift : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnWeatherChange(IBattle battle, StringKey? weatherName, StringKey? oldWeatherName)
|
||||
public void OnWeatherChange(IBattle battle, StringKey? weatherName, StringKey? oldWeatherName)
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Forecast_(Ability)">Bulbapedia - Forecast</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "forecast")]
|
||||
public class Forecast : Script, IScriptOnSwitchIn
|
||||
public class Forecast : Script, IScriptOnSwitchIn, IScriptOnWeatherChange
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Forecast : Script, IScriptOnSwitchIn
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnWeatherChange(IBattle battle, StringKey? weatherName, StringKey? oldWeatherName)
|
||||
public void OnWeatherChange(IBattle battle, StringKey? weatherName, StringKey? oldWeatherName)
|
||||
{
|
||||
if (_pokemon is null)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Heavy_Metal_(Ability)">Bulbapedia - Heavy Metal</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "heavy_metal")]
|
||||
public class HeavyMetal : Script
|
||||
public class HeavyMetal : Script, IScriptModifyWeight
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ModifyWeight(ref float weight)
|
||||
public void ModifyWeight(ref float weight)
|
||||
{
|
||||
weight *= 2f;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Hustle_(Ability)">Bulbapedia - Hustle</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "hustle")]
|
||||
public class Hustle : Script, IScriptChangeOffensiveStatValue
|
||||
public class Hustle : Script, IScriptChangeOffensiveStatValue, IScriptChangeAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
|
||||
@@ -20,8 +20,7 @@ public class Hustle : Script, IScriptChangeOffensiveStatValue
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
public void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy)
|
||||
{
|
||||
if (executingMove.UseMove.Category == MoveCategory.Physical)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Ice_Body_(Ability)">Bulbapedia - Ice Body</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "ice_body")]
|
||||
public class IceBody : Script, IScriptOnEndTurn
|
||||
public class IceBody : Script, IScriptOnEndTurn, IScriptCustomTrigger
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class IceBody : Script, IScriptOnEndTurn
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.IgnoreHail || args is not CustomTriggers.IgnoreHailArgs ignoreHailArgs)
|
||||
return;
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Immunity_(Ability)">Bulbapedia - Immunity</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "immunity")]
|
||||
public class Immunity : Script
|
||||
public class Immunity : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Poisoned>() ||
|
||||
status == ScriptUtils.ResolveName<Status.BadlyPoisoned>())
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Infiltrator_(Ability)">Bulbapedia - Infiltrator</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "infiltrator")]
|
||||
public class Infiltrator : Script
|
||||
public class Infiltrator : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSubstitute && args is CustomTriggers.BypassSubstituteArgs bypassArgs)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Inner_Focus_(Ability)">Bulbapedia - Inner Focus</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "inner_focus")]
|
||||
public class InnerFocus : Script
|
||||
public class InnerFocus : Script, IScriptPreventVolatileAdd
|
||||
{
|
||||
private IPokemon? _pokemon;
|
||||
|
||||
@@ -21,7 +21,7 @@ public class InnerFocus : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
public void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
{
|
||||
if (script is not FlinchEffect)
|
||||
return;
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Insomnia_(Ability)">Bulbapedia - Insomnia</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "insomnia")]
|
||||
public class Insomnia : Script
|
||||
public class Insomnia : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status != ScriptUtils.ResolveName<Status.Sleep>())
|
||||
return;
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Leaf_Guard_(Ability)">Bulbapedia - Leaf Guard</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "leaf_guard")]
|
||||
public class LeafGuard : Script
|
||||
public class LeafGuard : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (pokemon.BattleData?.Battle.WeatherName != ScriptUtils.ResolveName<Weather.HarshSunlight>())
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Levitate_(Ability)">Bulbapedia - Levitate</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "levitate")]
|
||||
public class Levitate : Script
|
||||
public class Levitate : Script, IScriptIsFloating
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void IsFloating(IPokemon pokemon, ref bool isFloating)
|
||||
public void IsFloating(IPokemon pokemon, ref bool isFloating)
|
||||
{
|
||||
isFloating = true;
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Light_Metal_(Ability)">Bulbapedia - Light Metal</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "light_metal")]
|
||||
public class LightMetal : Script
|
||||
public class LightMetal : Script, IScriptModifyWeight
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ModifyWeight(ref float weight)
|
||||
public void ModifyWeight(ref float weight)
|
||||
{
|
||||
weight *= 0.5f;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Limber_(Ability)">Bulbapedia - Limber</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "limber")]
|
||||
public class Limber : Script
|
||||
public class Limber : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status != ScriptUtils.ResolveName<Status.Paralyzed>())
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Liquid_Ooze_(Ability)">Bulbapedia - Liquid Ooze</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "liquid_ooze")]
|
||||
public class LiquidOoze : Script
|
||||
public class LiquidOoze : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifyDrain || args is not CustomTriggers.ModifyDrainArgs parameters)
|
||||
return;
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Long_Reach_(Ability)">Bulbapedia - Long Reach</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "long_reach")]
|
||||
public class LongReach : Script
|
||||
public class LongReach : Script, IScriptModifyIsContact
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ModifyIsContact(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref bool isContact)
|
||||
public void ModifyIsContact(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool isContact)
|
||||
{
|
||||
isContact = false;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Magma_Armor_(Ability)">Bulbapedia - Magma Armor</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "magma_armor")]
|
||||
public class MagmaArmor : Script, IScriptOnSwitchIn
|
||||
public class MagmaArmor : Script, IScriptOnSwitchIn, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Frozen>())
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Mega_Launcher_(Ability)">Bulbapedia - Mega Launcher</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "mega_launcher")]
|
||||
public class MegaLauncher : Script, IScriptChangeBasePower
|
||||
public class MegaLauncher : Script, IScriptChangeBasePower, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
@@ -18,7 +18,7 @@ public class MegaLauncher : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifyHealPercent || args is not CustomTriggers.ModifyHealPercentArgs healArgs)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Multitype_(Ability)">Bulbapedia - Multitype</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "multitype")]
|
||||
public class Multitype : Script
|
||||
public class Multitype : Script, IScriptOnAfterHeldItemChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
||||
public void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
||||
{
|
||||
if (pokemon.Species.Name != "arceus")
|
||||
return;
|
||||
|
||||
@@ -6,18 +6,17 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/No_Guard_(Ability)">Bulbapedia - No Guard</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "no_guard")]
|
||||
public class NoGuard : Script
|
||||
public class NoGuard : Script, IScriptChangeAccuracy, IScriptChangeIncomingAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
{
|
||||
modifiedAccuracy = 2000;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
public void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy)
|
||||
{
|
||||
modifiedAccuracy = 2000;
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Oblivious_(Ability)">Bulbapedia - Oblivious</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "oblivious")]
|
||||
public class Oblivious : Script
|
||||
public class Oblivious : Script, IScriptPreventVolatileAdd
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
public void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
{
|
||||
preventVolatileAdd = script switch
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Overcoat_(Ability)">Bulbapedia - Overcoat</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "overcoat")]
|
||||
public class Overcoat : Script, IScriptIsInvulnerableToMove
|
||||
public class Overcoat : Script, IScriptIsInvulnerableToMove, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.IgnoreHail && args is CustomTriggers.IgnoreHailArgs hailArgs)
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Own_Tempo_(Ability)">Bulbapedia - Own Tempo</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "own_tempo")]
|
||||
public class OwnTempo : Script
|
||||
public class OwnTempo : Script, IScriptPreventVolatileAdd
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
public void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd)
|
||||
{
|
||||
if (script is Pokemon.Confusion)
|
||||
preventVolatileAdd = true;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Poison_Heal_(Ability)">Bulbapedia - Poison Heal</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "poison_heal")]
|
||||
public class PoisonHeal : Script
|
||||
public class PoisonHeal : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.PoisonedDamage)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Pressure_(Ability)">Bulbapedia - Pressure</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "pressure")]
|
||||
public class Pressure : Script
|
||||
public class Pressure : Script, IScriptModifyPPUsedForIncomingMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ModifyPPUsedForIncomingMove(IExecutingMove executingMove, ref byte ppUsed)
|
||||
public void ModifyPPUsedForIncomingMove(IExecutingMove executingMove, ref byte ppUsed)
|
||||
{
|
||||
if (ppUsed == byte.MaxValue)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/RKS_System_(Ability)">Bulbapedia - RKS System</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "rks_system")]
|
||||
public class RKSSystem : Script
|
||||
public class RKSSystem : Script, IScriptOnAfterHeldItemChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
||||
public void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item)
|
||||
{
|
||||
if (pokemon.Species.Name != "silvally")
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Rock_Head_(Ability)">Bulbapedia - Rock Head</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "rock_head")]
|
||||
public class RockHead : Script
|
||||
public class RockHead : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.ModifyRecoil)
|
||||
return;
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Force_(Ability)">Bulbapedia - Sand Force</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sand_force")]
|
||||
public class SandForce : Script, IScriptChangeBasePower
|
||||
public class SandForce : Script, IScriptChangeBasePower, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower)
|
||||
@@ -23,7 +23,7 @@ public class SandForce : Script, IScriptChangeBasePower
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSandstormDamage &&
|
||||
args is CustomTriggers.BypassSandstormDamageArgs bypassArgs)
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Rush_(Ability)">Bulbapedia - Sand Rush</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sand_rush")]
|
||||
public class SandRush : Script, IScriptChangeSpeed
|
||||
public class SandRush : Script, IScriptChangeSpeed, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void ChangeSpeed(ITurnChoice choice, ref uint speed)
|
||||
@@ -18,7 +18,7 @@ public class SandRush : Script, IScriptChangeSpeed
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSandstormDamage &&
|
||||
args is CustomTriggers.BypassSandstormDamageArgs bypassArgs)
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sand_Veil_(Ability)">Bulbapedia - Sand Veil</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sand_veil")]
|
||||
public class SandVeil : Script
|
||||
public class SandVeil : Script, IScriptCustomTrigger, IScriptChangeIncomingAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
{
|
||||
if (executingMove.Battle.WeatherName != ScriptUtils.ResolveName<Weather.Sandstorm>())
|
||||
@@ -19,7 +19,7 @@ public class SandVeil : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.BypassSandstormDamage &&
|
||||
args is CustomTriggers.BypassSandstormDamageArgs bypassArgs)
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Scrappy_(Ability)">Bulbapedia - Scrappy</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "scrappy")]
|
||||
public class Scrappy : Script
|
||||
public class Scrappy : Script, IScriptChangeTypesForMove
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
IList<TypeIdentifier> types)
|
||||
{
|
||||
var hitType = executingMove.GetHitData(target, hitIndex).Type;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Skill_Link_(Ability)">Bulbapedia - Skill Link</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "skill_link")]
|
||||
public class SkillLink : Script
|
||||
public class SkillLink : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.Modify2_5HitMove)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Snow_Cloak_(Ability)">Bulbapedia - Snow Cloak</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "snow_cloak")]
|
||||
public class SnowCloak : Script
|
||||
public class SnowCloak : Script, IScriptCustomTrigger, IScriptChangeIncomingAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
{
|
||||
// If the weather is hail, increase evasion by 20%
|
||||
@@ -19,7 +19,7 @@ public class SnowCloak : Script
|
||||
}
|
||||
}
|
||||
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName == CustomTriggers.IgnoreHail && args is CustomTriggers.IgnoreHailArgs hailArgs)
|
||||
hailArgs.Ignore = true;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Steadfast_(Ability)">Bulbapedia - Steadfast</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "steadfast")]
|
||||
public class Steadfast : Script
|
||||
public class Steadfast : Script, IScriptCustomTrigger
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if (eventName != CustomTriggers.OnFlinch)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sticky_Hold_(Ability)">Bulbapedia - Sticky Hold</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sticky_hold")]
|
||||
public class StickyHold : Script
|
||||
public class StickyHold : Script, IScriptPreventHeldItemSteal
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void PreventHeldItemSteal(IPokemon pokemon, IItem heldItem, ref bool prevent)
|
||||
public void PreventHeldItemSteal(IPokemon pokemon, IItem heldItem, ref bool prevent)
|
||||
{
|
||||
prevent = true;
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Sweet_Veil_(Ability)">Bulbapedia - Sweet Veil</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "sweet_veil")]
|
||||
public class SweetVeil : Script
|
||||
public class SweetVeil : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Sleep>())
|
||||
{
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Synchronize_(Ability)">Bulbapedia - Synchronize</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "synchronize")]
|
||||
public class Synchronize : Script
|
||||
public class Synchronize : Script, IScriptOnAfterStatusChange
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterStatusChange(IPokemon pokemon, StringKey status, IPokemon? originPokemon)
|
||||
public void OnAfterStatusChange(IPokemon pokemon, StringKey status, IPokemon? originPokemon)
|
||||
{
|
||||
if (originPokemon == null || pokemon == originPokemon)
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Tangled_Feet_(Ability)">Bulbapedia - Tangled Feet</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "tangled_feet")]
|
||||
public class TangledFeet : Script
|
||||
public class TangledFeet : Script, IScriptChangeIncomingAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
{
|
||||
if (modifiedAccuracy != 255 && target.Volatile.Contains<Pokemon.Confusion>())
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Teravolt_(Ability)">Bulbapedia - Teravolt</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "teravolt")]
|
||||
public class Teravolt : Script
|
||||
public class Teravolt : Script, IScriptOnBeforeMoveChoice, IScriptOnAfterMoveChoice
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMoveChoice(IMoveChoice moveChoice)
|
||||
public void OnBeforeMoveChoice(IMoveChoice moveChoice)
|
||||
{
|
||||
var battleData = moveChoice.User.BattleData;
|
||||
if (battleData is null)
|
||||
@@ -25,7 +25,7 @@ public class Teravolt : Script
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void OnAfterMoveChoice(IMoveChoice move)
|
||||
public void OnAfterMoveChoice(IMoveChoice move)
|
||||
{
|
||||
var battleData = move.User.BattleData;
|
||||
if (battleData is null)
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Victory_Star_(Ability)">Bulbapedia - Victory Star</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "victory_star")]
|
||||
public class VictoryStar : Script
|
||||
public class VictoryStar : Script, IScriptChangeAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
public void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy)
|
||||
{
|
||||
modifiedAccuracy = modifiedAccuracy.MultiplyOrMax(1.1f);
|
||||
}
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Vital_Spirit_(Ability)">Bulbapedia - Vital Spirit</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "vital_spirit")]
|
||||
public class VitalSpirit : Script
|
||||
public class VitalSpirit : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Sleep>() && !selfInflicted)
|
||||
{
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Water_Bubble_(Ability)">Bulbapedia - Water Bubble</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "water_bubble")]
|
||||
public class WaterBubble : Script, IScriptChangeIncomingMoveDamage, IScriptChangeMoveDamage
|
||||
public class WaterBubble : Script, IScriptChangeIncomingMoveDamage, IScriptChangeMoveDamage, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Burned>())
|
||||
preventStatus = true;
|
||||
|
||||
@@ -6,11 +6,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Water_Veil_(Ability)">Bulbapedia - Water Veil</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "water_veil")]
|
||||
public class WaterVeil : Script
|
||||
public class WaterVeil : Script, IScriptPreventStatusChange
|
||||
{
|
||||
/// <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 (status == ScriptUtils.ResolveName<Status.Burned>())
|
||||
preventStatus = true;
|
||||
|
||||
@@ -8,10 +8,10 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Wonder_Skin_(Ability)">Bulbapedia - Wonder Skin</see>
|
||||
/// </summary>
|
||||
[Script(ScriptCategory.Ability, "wonder_skin")]
|
||||
public class WonderSkin : Script
|
||||
public class WonderSkin : Script, IScriptChangeIncomingAccuracy
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
public void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex,
|
||||
ref int modifiedAccuracy)
|
||||
{
|
||||
if (executingMove.UseMove.Category == MoveCategory.Status && executingMove.UseMove.Accuracy != 255)
|
||||
|
||||
Reference in New Issue
Block a user