Many more tests and fixes
All checks were successful
Build / Build (push) Successful in 3m12s

This commit is contained in:
2026-08-27 17:11:12 +02:00
parent 32b3ef9c4a
commit d2a82b5fe3
204 changed files with 20255 additions and 242 deletions

View File

@@ -40,6 +40,9 @@ public static class AIHelpers
/// <inheritdoc />
public uint Damage => 0;
/// <inheritdoc />
public bool HasExecuted => false;
/// <inheritdoc />
public TypeIdentifier? Type { get; init; }

View File

@@ -142,6 +142,7 @@ public static class MoveTurnExecutor
if (isInvulnerable)
{
battle.EventHook.Invoke(new MoveInvulnerableEvent(executingMove, target));
executingMove.RunScriptHook<IScriptOnAfterHits>(x => x.OnAfterHits(executingMove, target));
return;
}
@@ -311,6 +312,7 @@ public static class MoveTurnExecutor
}
}
}
hitData.HasExecuted = true;
}
if (numberOfHits == 0)

View File

@@ -32,6 +32,11 @@ public interface IHitData
/// </summary>
uint Damage { get; }
/// <summary>
/// Gets set to true after the hit has fully executed, and has not been interrupted by anything.
/// </summary>
bool HasExecuted { get; }
/// <summary>
/// The type of the hit. Null if the move is typeless.
/// </summary>
@@ -78,6 +83,9 @@ public record HitData : IHitData
/// <inheritdoc />
public uint Damage { get; internal set; }
/// <inheritdoc />
public bool HasExecuted { get; internal set; }
/// <inheritdoc />
public TypeIdentifier? Type { get; internal set; }

View File

@@ -14,6 +14,13 @@ public abstract class Script : IDeepCloneable, IScriptOnRemove
{
internal event Action<Script>? OnRemoveEvent;
/// <summary>
/// Whether the script is a charge script that's considered a semi-invulnerable turn, such as fly, dig, etc.
///
/// see also: <a href="https://bulbapedia.bulbagarden.net/wiki/Semi-invulnerable_turn">Semi-invulnerable turn</a>
/// </summary>
public virtual bool IsSemiInvulnerableTurn => false;
/// <summary>
/// Remove the script from its owner.
/// </summary>