This commit is contained in:
@@ -40,6 +40,9 @@ public static class AIHelpers
|
||||
/// <inheritdoc />
|
||||
public uint Damage => 0;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool HasExecuted => false;
|
||||
|
||||
/// <inheritdoc />
|
||||
public TypeIdentifier? Type { get; init; }
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user