More moves implemented

This commit is contained in:
2025-02-01 15:00:22 +01:00
parent 3a75493912
commit 00fe08dcd4
50 changed files with 1146 additions and 139 deletions

View File

@@ -121,6 +121,13 @@ public abstract class Script : IDeepCloneable
public virtual void ChangeMove(IMoveChoice choice, ref StringKey moveName)
{
}
/// <summary>
/// Changes the targets of a move choice. This allows for changing the targets of a move before the move starts.
/// </summary>
public virtual void ChangeTargets(IMoveChoice moveChoice, ref IReadOnlyList<IPokemon?> targets)
{
}
/// <summary>
/// This function allows you to change a move into a multi-hit move. The number of hits set here
@@ -260,6 +267,14 @@ public abstract class Script : IDeepCloneable
public virtual void BypassDefensiveStatBoosts(IExecutingMove move, IPokemon target, byte hit, ref bool bypass)
{
}
/// <summary>
/// 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.
/// </summary>
public virtual void BypassEvasionStatBoosts(IExecutingMove move, IPokemon target, byte hitIndex, ref bool bypass)
{
}
/// <summary>
/// This function allows a script to bypass offensive stat boosts for a move hit.
@@ -513,6 +528,21 @@ public abstract class Script : IDeepCloneable
{
}
public virtual void BlockOutgoingHit(IExecutingMove executingMove, IPokemon target, byte hitIndex, ref bool block)
{
}
/// <summary>
/// Custom triggers for scripts. This allows scripts to run custom events that are not part of the
/// standard battle flow.
/// </summary>
/// <param name="eventName">
/// The name of the event that is triggered. This should be unique for each different event. Overriding scripts
/// should validate the event name is one they should handle.
/// </param>
/// <param name="parameters">
/// The parameters that are passed to the event. This can be null if no parameters are passed.
/// </param>
public virtual void CustomTrigger(StringKey eventName, IDictionary<StringKey, object?>? parameters)
{
}

View File

@@ -16,42 +16,49 @@ public enum ScriptCategory
/// <see cref="IMoveChoice"/> and <see cref="IExecutingMove"/>
/// </summary>
Move = 0,
/// <summary>
/// A volatile script effect that is attached to a move choice.
/// </summary>
MoveVolatile = 1,
/// <summary>
/// An ability script. Scripts in this category are always abilities, and therefore always
/// attached to a Pokemon.
/// </summary>
Ability = 1,
Ability = 2,
/// <summary>
/// A non volatile status script. Scripts in this category are always non volatile statuses, and
/// therefore always attached to a Pokemon.
/// </summary>
Status = 2,
Status = 3,
/// <summary>
/// A volatile status script. Scripts in this category are always volatile status effects, and
/// therefore always attached to a Pokemon.
/// </summary>
Pokemon = 3,
Pokemon = 4,
/// <summary>
/// A script that can be attached to an entire side.
/// </summary>
Side = 4,
Side = 5,
/// <summary>
/// A script that can be attached to the entire battle.
/// </summary>
Battle = 5,
Battle = 6,
/// <summary>
/// A special script for weather, for use on battles.
/// </summary>
Weather = 6,
Weather = 7,
Terrain = 8,
/// <summary>
/// A special script for held items. As they're part of a held item, they're attached to a Pokemon.
/// </summary>
ItemBattleTrigger = 7,
ItemBattleTrigger = 9,
}