using PkmnLib.Dynamic.Models; using PkmnLib.Dynamic.Models.Choices; using PkmnLib.Static; using PkmnLib.Static.Moves; using PkmnLib.Static.Utils; namespace PkmnLib.Dynamic.ScriptHandling; /// /// This interface is used to allow scripts to run when they are removed from their owner. /// public interface IScriptOnRemove { /// /// This function is ran when this script stops being in effect, and is removed from its owner. /// void OnRemove(); } /// /// This interface is used to allow scripts to run before any hook is invoked. This allows for /// suppressing certain categories of scripts, which can be useful for preventing certain effects /// from running. /// public interface IScriptOnBeforeAnyHookInvoked { /// /// This function is ran before any hook is invoked. This allows for suppressing certain categories /// of scripts. This is useful for example to prevent certain effects from running. /// void OnBeforeAnyHookInvoked(ref List? suppressedCategories); } /// /// This interface is used to allow scripts to run when they are initialized. This allows for /// setting up the script with parameters that are passed to it. /// public interface IScriptOnInitialize { /// /// This function is ran when the script is initialized. This allows for setting up the script /// with parameters that are passed to it. /// void OnInitialize(IReadOnlyDictionary? parameters); } /// /// This interface is used to allow scripts to prevent a move from being selected. /// public interface IScriptPreventMoveSelection { /// /// Override to customize whether the move can be selected at all. /// void PreventMoveSelection(IMoveChoice choice, ref bool prevent); } /// /// This interface is used to allow scripts to force a certain turn choice to be selected. /// public interface IScriptForceTurnSelection { /// /// Force a certain move choice to be selected. If the choice is set, the Pokemon will be forced /// to use it, and will not be able to select any other choice. /// void ForceTurnSelection(IBattle battle, byte sideIndex, byte position, ref ITurnChoice? choice); } /// /// This interface is used to allow scripts to run before the start of a turn. /// public interface IScriptOnBeforeTurnStart { /// /// This function is ran just before the start of the turn. Everyone has made its choices here, /// and the turn is about to start. This is a great place to initialize data if you need to know /// something has happened during a turn. /// void OnBeforeTurnStart(ITurnChoice choice); } /// /// This interface allows scripts to modify the effective speed of the Pokemon. /// public interface IScriptChangeSpeed { /// /// This function allows you to modify the effective speed of the Pokemon. This is run before /// turn ordering, so overriding here will allow you to put certain Pokemon before others. /// void ChangeSpeed(ITurnChoice choice, ref uint speed); } /// /// This interface allows scripts to modify the effective priority of the Pokemon. /// public interface IScriptChangePriority { /// /// This function allows you to modify the effective priority of the Pokemon. This is run before /// turn ordering, so overriding here will allow you to put certain Pokemon before others. Note /// that this is only relevant on move choices, as other turn choice types do not have a priority. /// void ChangePriority(IMoveChoice choice, ref sbyte priority); } /// /// This interface allows scripts to change the move that is used during execution. /// public interface IScriptChangeMove { /// /// This function allows you to change the move that is used during execution. This is useful for /// moves such as metronome, where the move chosen actually differs from the move used. /// void ChangeMove(IMoveChoice choice, ref StringKey moveName); } /// /// This interface allows scripts to change the targets of a move choice. /// public interface IScriptChangeTargets { /// /// Changes the targets of a move choice. This allows for changing the targets of a move before the move starts. /// void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList targets); } /// /// This interface allows scripts to change the incoming targets of a move choice. /// public interface IScriptChangeIncomingTargets { /// /// This function allows you to change the targets of a move choice before the move starts. /// void ChangeIncomingTargets(IMoveChoice moveChoice, ref IReadOnlyList targets); } /// /// This interface allows scripts to change a move into a multi-hit move. /// public interface IScriptChangeNumberOfHits { /// /// This function allows you to change a move into a multi-hit move. The number of hits set here /// gets used as the number of hits. If set to 0, this will behave as if the move missed on its /// first hit. /// void ChangeNumberOfHits(IMoveChoice choice, ref byte numberOfHits); } /// /// This interface allows scripts to prevent a move from running. /// public interface IScriptPreventMove { /// /// This function allows you to prevent a move from running. If this gets set to true, the move /// ends execution here. No PP will be decreased in this case. /// void PreventMove(IExecutingMove move, ref bool prevent); } /// /// This interface allows scripts to make the move fail. /// public interface IScriptFailMove { /// /// This function makes the move fail. If the fail field gets set to true, the move ends execution, /// and fail events get triggered. /// void FailMove(IExecutingMove move, ref bool fail); } /// /// This interface allows scripts to stop execution of the move before it starts. /// public interface IScriptStopBeforeMove { /// /// Similar to . This function will also stop execution of the move, but /// PP will still be decreased. /// void StopBeforeMove(IExecutingMove move, ref bool stop); } /// /// This interface allows scripts to run just before the move starts its execution. /// public interface IScriptOnBeforeMove { /// /// This function runs just before the move starts its execution. /// void OnBeforeMove(IExecutingMove move); } /// /// This interface allows scripts to run immediately after all targets have had their hits executed. /// public interface IScriptOnAfterMove { /// /// This function runs immediately after all targets have had their hits executed. /// void OnAfterMove(IExecutingMove move); } /// /// This interface allows scripts to change the type of a move that is used on a target. /// public interface IScriptChangeMoveType { /// /// This function allows the script to change the actual type that is used for the move on a target. /// If this is set to null, the move will be treated as a typeless move. /// void ChangeMoveType(IExecutingMove move, IPokemon target, byte hit, ref TypeIdentifier? typeIdentifier); } /// /// This interface allows scripts to change the effectiveness of a move on a target. /// public interface IScriptChangeEffectiveness { /// /// This function allows the script to change how effective a move is on a target. /// void ChangeEffectiveness(IExecutingMove move, IPokemon target, byte hit, ref float effectiveness); } /// /// This interface allows scripts to change the effectiveness of a move on a target. /// public interface IScriptChangeIncomingEffectiveness { /// /// This function allows the script to override how effective a move is on a target. /// void ChangeIncomingEffectiveness(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref float effectiveness); } /// /// This interface allows scripts to block a critical hit from being applied to a move. /// public interface IScriptBlockCriticalHit { /// /// This function allows a script to block an outgoing move from being critical. /// void BlockCriticalHit(IExecutingMove move, IPokemon target, byte hit, ref bool block); } /// /// This interface allows scripts to block an incoming critical hit from being applied to a move. /// public interface IScriptBlockIncomingCriticalHit { /// /// This function allows a script to block an incoming move from being critical. /// void BlockIncomingCriticalHit(IExecutingMove move, IPokemon target, byte hit, ref bool block); } /// /// This interface allows scripts to run when an incoming hit happens. /// public interface IScriptOnIncomingHit { /// /// This function triggers when an incoming hit happens. This triggers after the damage is done, /// but before the secondary effect of the move happens. /// void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit); } /// /// This interface allows scripts to run when an opponent faints due to the move that is being executed. /// public interface IScriptOnOpponentFaints { /// /// This function triggers when an opponent on the f ield faints due to the move that is being executed. /// void OnOpponentFaints(IExecutingMove move, IPokemon target, byte hit); } /// /// This interface allows scripts to run when the move uses its secondary effect. /// public interface IScriptOnSecondaryEffect { /// /// This function triggers when the move uses its secondary effect. Moves should implement their /// secondary effects here. Status moves should implement their actual functionality in this /// function as well, as status moves effects are defined as secondary effects for simplicity. /// void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit); } /// /// This interface allows scripts to run when a move fails to hit its target. /// public interface IScriptFailIncomingMove { /// /// This function allows a script to prevent a move that is targeted at its owner. If set to true /// the move fails, and fail events get triggered. /// void FailIncomingMove(IExecutingMove move, IPokemon target, ref bool fail); } /// /// This interface allows scripts to run making the owner invulnerable to an incoming move. /// public interface IScriptIsInvulnerableToMove { /// /// This function allows a script to make its owner invulnerable to an incoming move. /// void IsInvulnerableToMove(IExecutingMove move, IPokemon target, ref bool invulnerable); } /// /// This interface allows scripts to run when a move misses its target. /// public interface IScriptOnMoveMiss { /// /// This function allows a script to run when a move misses its target. This is used for moves /// that have a secondary effect that should run even if the move misses, such as Spore. /// void OnMoveMiss(IExecutingMove move, IPokemon target); } /// /// This interface allows scripts to modify the accuracy modifier of a move. /// public interface IScriptChangeAccuracyModifier { /// /// This function allows a script to modify the accuracy of a move used. This value represents /// the percentage accuracy, so anything above 100% will make it always hit. /// void ChangeAccuracyModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier); } /// /// This interface allows scripts to change the critical stage of a move. /// public interface IScriptChangeCriticalStage { /// /// This function allows a script to change the critical stage of the move used. /// void ChangeCriticalStage(IExecutingMove move, IPokemon target, byte hit, ref byte stage); } /// /// This interface allows scripts to change the damage modifier of a critical hit. /// public interface IScriptChangeCriticalModifier { /// /// This function allows a script to change the damage modifier of a critical hit. This will only /// run when a hit is critical. /// void ChangeCriticalModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier); } /// /// This interface allows scripts to change the STAB (Same Type Attack Bonus) modifier. /// public interface IScriptChangeStabModifier { /// /// This function allows a script to change the damage modifier of a Same Type Attack Bonus, which /// occurs when the user has the move type as one of its own types. /// void ChangeStabModifier(IExecutingMove executingMove, IPokemon target, byte hitNumber, bool isStab, ref float modifier); } /// /// This interface allows scripts to change the effective base power of a move. /// public interface IScriptChangeBasePower { /// /// This function allows a script to change the effective base power of a move hit. /// void ChangeBasePower(IExecutingMove move, IPokemon target, byte hit, ref ushort basePower); } /// /// This interface allows scripts to bypass defensive stat boosts for a move hit. /// public interface IScriptBypassDefensiveStatBoosts { /// /// This function allows a script to bypass defensive stat boosts for a move hit. /// If this is true, the damage will be calculated as if the target has no positive stat boosts. Negative /// stat boosts will still be applied. /// void BypassDefensiveStatBoosts(IExecutingMove move, IPokemon target, byte hit, ref bool bypass); } /// /// This interface allows scripts to bypass evasion stat boosts for a move hit. /// public interface IScriptBypassEvasionStatBoosts { /// /// This function allows a script to bypass evasion stat boosts for a move hit. /// If this is true, the move will handle the evasion stat boosts as if the target has no positive stat boosts. /// void BypassEvasionStatBoosts(IExecutingMove move, IPokemon target, byte hitIndex, ref bool bypass); } /// /// This interface allows scripts to bypass offensive stat boosts for a move hit. /// public interface IScriptBypassOffensiveStatBoosts { /// /// This function allows a script to bypass offensive stat boosts for a move hit. /// If this is true, the damage will be calculated as if the user has no negative offensive stat boosts. Positive /// stat boosts will still be applied. /// void BypassOffensiveStatBoosts(IExecutingMove move, IPokemon target, byte hit, ref bool bypass); } /// /// This interface allows scripts to change the actual offensive stat values used when calculating damage. /// public interface IScriptChangeOffensiveStatValue { /// /// This function allows a script to change the actual offensive stat values used when calculating damage /// void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat, ImmutableStatisticSet targetStats, Statistic stat, ref uint value); } /// /// This interface allows scripts to change the actual defensive stat values used when calculating damage. /// public interface IScriptChangeDefensiveStatValue { /// /// This function allows a script to change the actual defensive stat values used when calculating damage. /// void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat, ImmutableStatisticSet targetStats, Statistic stat, ref uint value); } /// /// This interface allows scripts to change the offensive stat value of an incoming move. /// public interface IScriptChangeIncomingMoveOffensiveStatValue { /// /// This function allows a script to change the offensive stat value of an incoming move. /// void ChangeIncomingMoveOffensiveStatValue(IExecutingMove executingMove, IPokemon target, byte hitNumber, uint defensiveStat, StatisticSet targetStats, Statistic offensive, ref uint offensiveStat); } /// /// This interface allows scripts to change the defensive stat value of an incoming move. /// public interface IScriptChangeIncomingMoveDefensiveStatValue { /// /// This function allows a script to change the defensive stat value of an incoming move. /// void ChangeIncomingMoveDefensiveStatValue(IExecutingMove executingMove, IPokemon target, byte hitNumber, uint origOffensiveStat, StatisticSet targetStats, Statistic defensive, ref uint defensiveStat); } /// /// This interface allows scripts to change the raw modifier retrieved from the stats of the defender and attacker. /// public interface IScriptChangeDamageStatModifier { /// /// This function allows a script to change the raw modifier we retrieved from the stats of the /// defender and attacker. The default value is the offensive stat divided by the defensive stat. /// void ChangeDamageStatModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier); } /// /// This interface allows scripts to apply a raw multiplier to the damage done by a move. /// public interface IScriptChangeDamageModifier { /// /// This function allows a script to apply a raw multiplier to the damage done by a move. /// void ChangeDamageModifier(IExecutingMove move, IPokemon target, byte hit, ref float modifier); } /// /// This interface allows scripts to change the damage modifier of an incoming move. /// public interface IScriptChangeIncomingMoveDamageModifier { /// /// This function allows a script to change the damage modifier of an incoming move. /// void ChangeIncomingMoveDamageModifier(IExecutingMove executingMove, IPokemon target, byte hitNumber, ref float modifier); } /// /// This interface allows scripts to modify the outgoing damage done by a move. /// public interface IScriptChangeMoveDamage { /// /// This function allows a script to modify the outgoing damage done by a move. /// void ChangeMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage); } /// /// This interface allows scripts to modify the incoming damage done by a move. /// public interface IScriptChangeIncomingMoveDamage { /// /// This function allows a script to modify the incoming damage done by a move. /// void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage); } /// /// This interface allows scripts attached to a Pokemon or its parents to prevent stat boost changes. /// public interface IScriptPreventStatBoostChange { /// /// This function allows a script attached to a Pokemon or its parents to prevent stat boost /// changes on that Pokemon. /// void PreventStatBoostChange(IPokemon target, Statistic stat, sbyte amount, bool selfInflicted, ref bool prevent); } /// /// This interface allows scripts attached to a Pokemon or its parents to modify stat boost changes. /// public interface IScriptChangeStatBoostChange { /// /// This function allows a script attached to a Pokemon or its parents to modify the amount by /// which the stat boost will change. If the stat boost is done by the user itself, self /// inflicted will be true, otherwise it will be false. /// void ChangeStatBoostChange(IPokemon target, Statistic stat, bool selfInflicted, ref sbyte amount); } /// /// This interface allows scripts to run after a stat boost change has been applied. /// public interface IScriptOnAfterStatBoostChange { /// /// This function allows a script to run after a stat boost change has been applied. /// void OnAfterStatBoostChange(IPokemon pokemon, Statistic stat, bool selfInflicted, sbyte change); } /// /// This interface allows scripts to prevent a secondary effect of a move from being applied. /// public interface IScriptPreventSecondaryEffect { /// /// This function allows a script to prevent a secondary effect of a move from being applied. /// This means the move will still hit and do damage, but not trigger its secondary effect. Note that this /// function is not called for status moves. /// void PreventSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent); } /// /// This interface allows scripts attached to a Pokemon or its parents to prevent incoming secondary effects. /// public interface IScriptPreventIncomingSecondaryEffect { /// /// This function allows a script attached to a Pokemon or its parents to prevent an incoming /// secondary effect. This means the move will still hit and do damage, but not trigger its /// secondary effect. Note that this function is not called for status moves. /// void PreventIncomingSecondaryEffect(IExecutingMove move, IPokemon target, byte hit, ref bool prevent); } /// /// This interface allows scripts attached to a move or its parents to change the chance of secondary effects. /// public interface IScriptChangeEffectChance { /// /// This function allows a script attached to a move or its parents to change the chance the /// secondary effect of a move will trigger. The chance is depicted in percentage here, so /// changing this to above or equal to 100 will make it always hit, while setting it to equal or /// below 0 will make it never hit. /// void ChangeEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance); } /// /// This interface allows scripts attached to a Pokemon or its parents to change the chance of incoming secondary effects. /// public interface IScriptChangeIncomingEffectChance { /// /// This function allows a script attached to a Pokemon or its parents to change the chance the /// secondary effect of an incoming move will trigger. The chance is depicted in percentage here, /// so changing this to above or equal to 100 will make it always hit, while setting it to equal /// or below 0 will make it never hit. /// void ChangeIncomingEffectChance(IExecutingMove move, IPokemon target, byte hit, ref float chance); } /// /// This interface allows scripts to trigger when all hits on a target are finished. /// public interface IScriptOnAfterHits { /// /// This function triggers on a move or its parents when all hits on a target are finished. /// void OnAfterHits(IExecutingMove move, IPokemon target); } /// /// This interface allows scripts to trigger at the end of each turn. /// public interface IScriptOnEndTurn { /// /// This function id triggered on all scripts active in the battle after all choices have finished /// running. Note that choices are not active anymore here, so their scripts do not call this /// function. /// void OnEndTurn(IScriptSource owner, IBattle battle); } /// /// This interface allows scripts to prevent the Pokemon it is attached to from being able to switch out. /// public interface IScriptPreventSelfSwitch { /// /// This function prevents the Pokemon it is attached to from being able to switch out. /// void PreventSelfSwitch(ISwitchChoice choice, ref bool prevent); } /// /// This interface allows scripts to prevent switching for any opponent. /// public interface IScriptPreventOpponentSwitch { /// /// This function allows the prevention of switching for any opponent. /// void PreventOpponentSwitch(ISwitchChoice choice, ref bool prevent); } /// /// This interface allows scripts to prevent the Pokemon its attached to from running away. /// public interface IScriptPreventSelfRunAway { /// /// This function allows preventing the running away of the Pokemon its attached to /// void PreventSelfRunAway(IFleeChoice choice, ref bool prevent); } /// /// This interface allows scripts to prevent a Pokemon on another side from running away. /// public interface IScriptPreventOpponentRunAway { /// /// This function prevents a Pokemon on another side than where its attached to from running away. /// void PreventOpponentRunAway(IFleeChoice choice, ref bool prevent); } /// /// This interface allows scripts to trigger when a Pokemon takes damage. /// public interface IScriptOnDamage { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon takes damage. /// void OnDamage(IPokemon pokemon, DamageSource source, uint oldHealth, uint newHealth); } /// /// This interface allows scripts to trigger when a Pokemon faints. /// public interface IScriptOnFaint { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon faints. /// void OnFaint(IPokemon pokemon, DamageSource source); } /// /// This interface allows scripts to trigger when an ally Pokemon faints. /// public interface IScriptOnAllyFaint { /// /// This function is triggered on a Pokemon when an ally Pokemon faints. /// void OnAllyFaint(IPokemon ally, IPokemon faintedPokemon); } /// /// This interface allows scripts to trigger when a Pokemon switches out of the battlefield. /// public interface IScriptOnSwitchOut { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon switches out /// of the battlefield. /// void OnSwitchOut(IPokemon oldPokemon, byte position); } /// /// This interface allows scripts to trigger when a Pokemon is switched into the battlefield. /// public interface IScriptOnSwitchIn { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon is switched into /// the battlefield. /// void OnSwitchIn(IPokemon pokemon, byte position); } /// /// This interface allows scripts to trigger when an opponent Pokemon switches in. /// public interface IScriptOnOpponentSwitchIn { /// /// This function is triggered on a Pokemon and its parents when an opponent switches in. /// void OnOpponentSwitchIn(IPokemon pokemon, byte position); } /// /// This interface allows scripts to stack when a volatile effect is added while already in place. /// public interface IScriptStack { /// /// This function is ran when a volatile effect is added while that volatile effect already is /// in place. Instead of adding the volatile effect twice, it will execute this function instead. /// void Stack(); } /// /// This interface allows scripts to trigger after a Pokemon consumes an item. /// public interface IScriptOnAfterItemConsume { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon consumes the /// held item it had. /// void OnAfterItemConsume(IPokemon pokemon, IItem item); } /// /// This interface allows scripts to block incoming hits on a target. /// public interface IScriptBlockIncomingHit { /// /// This function allows a script to block an incoming hit. /// void BlockIncomingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block); } /// /// This interface allows scripts to block outgoing hits from a move. /// public interface IScriptBlockOutgoingHit { /// /// This function allows a script to block an outgoing hit. /// void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block); } /// /// This interface allows scripts to prevent held item consumption. /// public interface IScriptPreventHeldItemConsume { /// /// This function allows a script to prevent a held item from being consumed. /// void PreventHeldItemConsume(IPokemon pokemon, IItem heldItem, ref bool prevented); } /// /// This interface allows scripts to change incoming damage to a Pokemon. /// public interface IScriptChangeIncomingDamage { /// /// This function allows a script to change any kind of damage that is incoming. /// void ChangeIncomingDamage(IPokemon pokemon, DamageSource source, ref uint damage); } /// /// This interface allows scripts to change the weather duration of a weather effect. /// public interface IScriptChangeWeatherDuration { /// /// This function allows a script to change the weather duration of a weather effect. /// void ChangeWeatherDuration(StringKey weatherName, ref int duration); } /// /// This interface allows scripts to prevent a Pokemon from being healed. /// public interface IScriptPreventHeal { /// /// This function allows a script to prevent a Pokemon from being healed. /// void PreventHeal(IPokemon pokemon, uint heal, bool allowRevive, ref bool prevented); } /// /// This interface allows scripts to change the types a target has for effectiveness calculation. /// public interface IScriptChangeTypesForMove { /// /// This function allows a script to change the types a target has. Multiple types can be set, and will be used /// for the effectiveness calculation. /// void ChangeTypesForMove(IExecutingMove executingMove, IPokemon target, byte hitIndex, IList types); } /// /// This interface allows scripts to change the types a Pokemon has for incoming moves. /// public interface IScriptChangeTypesForIncomingMove { /// /// This function allows a script to change the types a Pokemon has for a move that's incoming. Multiple types can /// be set, and will be used for the effectiveness calculation. /// void ChangeTypesForIncomingMove(IExecutingMove executingMove, IPokemon target, byte hitIndex, IList types); } /// /// This interface allows scripts to change the handling of the move category. /// public interface IScriptChangeCategory { /// /// This function allows a script to change the handling of the move category. This is used for moves that /// are sometimes a status move, and sometimes a damaging move, such as pollen puff. /// void ChangeCategory(IExecutingMove move, IPokemon target, byte hitIndex, ref MoveCategory category); } /// /// This interface allows scripts to trigger when about to hit a target. /// public interface IScriptOnBeforeHit { /// /// Triggers first when we're about to hit a target. /// void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex); } /// /// This interface allows scripts to prevent a Pokemon from being affected by a status condition. /// public interface IScriptPreventStatusChange { /// /// This function allows a script to prevent a Pokemon from being affected by a status condition. /// void PreventStatusChange(IPokemon pokemon, StringKey status, bool selfInflicted, ref bool preventStatus); } /// /// This interface allows scripts to trigger after a status condition has been applied. /// public interface IScriptOnAfterStatusChange { /// /// This function triggers after a status condition has been applied to a Pokemon. /// void OnAfterStatusChange(IPokemon pokemon, StringKey status, IPokemon? originPokemon); } /// /// This interface allows scripts to prevent a Pokemon from being affected by a volatile status condition. /// public interface IScriptPreventVolatileAdd { /// /// This function allows a script to prevent a Pokémon from being affected by a volatile status condition. /// void PreventVolatileAdd(IScriptSource parent, Script script, ref bool preventVolatileAdd); } /// /// This interface allows scripts to make the Pokemon float. /// public interface IScriptIsFloating { /// /// This function allows a script to make the Pokémon it is attached to float. This is used for moves /// such as levitate, and allows for moves such as earthquake to not hit the Pokémon. /// void IsFloating(IPokemon pokemon, ref bool isFloating); } /// /// This interface allows scripts to prevent weather from changing. /// public interface IScriptPreventWeatherChange { /// /// This function allows a script to prevent the weather from changing. This is used for abilities such as /// Delta Stream, which prevent the weather from changing to anything other than strong winds. /// void PreventWeatherChange(StringKey? weatherName, ref bool preventWeatherChange); } /// /// This interface allows scripts to trigger when the weather changes. /// public interface IScriptOnWeatherChange { /// /// This function triggers when the weather changes. /// void OnWeatherChange(IBattle battle, StringKey? weatherName, StringKey? oldWeatherName); } /// /// This interface allows scripts to modify the weight of a Pokemon. /// public interface IScriptModifyWeight { /// /// Modifies the weight of a Pokemon. /// void ModifyWeight(ref float weight); } /// /// This interface allows scripts to modify whether a move makes contact. /// public interface IScriptModifyIsContact { /// /// Modifies whether a move is a contact move or not. This is used for abilities such as Long Reach. /// void ModifyIsContact(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool isContact); } /// /// This interface allows scripts to prevent held item theft. /// public interface IScriptPreventHeldItemSteal { /// /// This function allows a script to prevent a held item from being stolen by an effect such as Thief or Covet. /// void PreventHeldItemSteal(IPokemon pokemon, IItem heldItem, ref bool prevent); } /// /// This interface allows scripts to trigger after held item changes. /// public interface IScriptOnAfterHeldItemChange { /// /// This function allows a script to run after a held item has changed. /// void OnAfterHeldItemChange(IPokemon pokemon, IItem? previous, IItem? item); } /// /// This interface allows scripts to modify the PP used by a move. /// public interface IScriptModifyPPUsed { /// /// This function allows a script to modify the PP used by a move. /// void ModifyPPUsed(IExecutingMove executingMove, ref byte ppUsed); } /// /// This interface allows scripts to modify the PP used by an incoming move. /// public interface IScriptModifyPPUsedForIncomingMove { /// /// This function allows a script to modify the PP used by an incoming move. This is used for abilities such as Pressure. /// void ModifyPPUsedForIncomingMove(IExecutingMove executingMove, ref byte ppUsed); } /// /// This interface allows scripts to trigger just before a move choice is executed. /// public interface IScriptOnBeforeMoveChoice { /// /// This function triggers just before a move choice is executed. /// void OnBeforeMoveChoice(IMoveChoice moveChoice); } /// /// This interface allows scripts to trigger after a move choice has been executed. /// public interface IScriptOnAfterMoveChoice { /// /// This function triggers after a move choice has been executed in its entirety. /// void OnAfterMoveChoice(IMoveChoice moveChoice); } /// /// This interface allows scripts to change the turn choice that is made by a Pokemon. /// public interface IScriptChangeTurnChoice { /// /// This function allows a script to change the turn choice that is made by a Pokemon. /// void ChangeTurnChoice(ref ITurnChoice choice); } /// /// This interface allows scripts to change the experience gained when a Pokemon faints. /// public interface IScriptChangeExperienceGained { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon gains experience, /// and allows for changing this amount of experience. /// void ChangeExperienceGained(IPokemon faintedPokemon, IPokemon winningPokemon, ref uint amount); } /// /// This interface allows scripts to share experience across multiple Pokemon. /// public interface IScriptShareExperience { /// /// This function is triggered on a Pokemon and its parents when the given Pokemon gains experience, /// and allows for making the experience be shared across multiple Pokemon. /// Amount is the modifier for how much experience is shared, with 1 being the default amount. /// void ShareExperience(IPokemon faintedPokemon, IPokemon winningPokemon, ref bool share, ref float amount); } /// /// This interface allows scripts to block weather changes. /// public interface IScriptBlockWeatherChange { /// /// This function allows a script to block weather changes. /// void BlockWeatherChange(IBattle battle, ref bool block); } /// /// This interface allows scripts to change the catch rate bonus when a Pokeball is thrown. /// public interface IScriptChangeCatchRateBonus { /// /// This function is called when a Pokeball is thrown at a Pokemon, and allows modifying the catch /// rate of this attempt. Pokeball modifier effects should be implemented here, as well as for /// example status effects that change capture rates. /// void ChangeCatchRateBonus(IPokemon pokemon, IItem pokeball, ref byte modifier); } /// /// This interface allows scripts to handle custom trigger events. /// public interface IScriptCustomTrigger { /// /// Custom triggers for scripts. This allows scripts to run custom events that are not part of the /// standard battle flow. /// void CustomTrigger(StringKey eventName, ICustomTriggerArgs args); } /// /// This interface allows scripts to change the accuracy of a move. /// public interface IScriptChangeAccuracy { /// /// This function allows a script to change the accuracy of a move used. The value for accuracy is in percentage. /// A custom case goes when 255 is returned, in which case the entire accuracy check is skipped, and the move /// will always hit. /// void ChangeAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy); } /// /// This interface allows scripts to change the accuracy of an incoming move. /// public interface IScriptChangeIncomingAccuracy { /// /// This function allows a script to change the accuracy of a move that is incoming. The value for accuracy is in percentage. /// A custom case goes when 255 is returned, in which case the entire accuracy check is skipped, and the move /// will always hit. /// void ChangeIncomingAccuracy(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref int modifiedAccuracy); }