using PkmnLib.Dynamic.ScriptHandling; using PkmnLib.Static; using PkmnLib.Static.Moves; namespace PkmnLib.Dynamic.Models; /// /// Data for a single hit on a target. /// public interface IHitData { /// /// Whether the hit is critical. /// bool IsCritical { get; } /// /// The base power of the hit. /// byte BasePower { get; } /// /// The effectiveness of the hit. /// float Effectiveness { get; } /// /// The damage done by the hit. /// uint Damage { get; } /// /// The type of the hit. /// TypeIdentifier Type { get; } /// /// Whether the hit has failed. /// bool HasFailed { get; } /// /// Fails the hit. /// void Fail(); } /// public record HitData : IHitData { /// public bool IsCritical { get; internal set; } /// public byte BasePower { get; internal set; } /// public float Effectiveness { get; internal set; } /// public uint Damage { get; internal set; } /// public TypeIdentifier Type { get; internal set; } /// public bool HasFailed { get; private set; } /// public void Fail() => HasFailed = true; } /// /// An executing move is the data of the move for while it is executing. /// public interface IExecutingMove : IScriptSource { /// /// The number of targets this move has. /// int TargetCount { get; } /// /// The number of hits this move has per target. /// byte NumberOfHits { get; } /// /// The user of the move. /// IPokemon User { get; } /// /// The move the user has actually chosen to do. /// ILearnedMove ChosenMove { get; } /// /// The move that the user is actually going to do. This can be different from the chosen move, for example /// when metronome is used, in which case the chosen move will be metronome, and the movedata will be the /// move that metronome has chosen. /// IMoveData UseMove { get; } /// /// The script of the move. /// ScriptContainer Script { get; } /// /// Gets a hit data for a target, with a specific index. /// HitData GetHitData(IPokemon target, byte hit); /// /// Checks whether a Pokémon is a target for this move. /// bool IsPokemonTarget(IPokemon target); /// /// Gets the index of the hits in this move where the hits for a specific target start. /// int GetTargetIndex(IPokemon target); /// /// Gets a hit based on its raw index. /// HitData GetDataFromRawIndex(int index); }