using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Static;
using PkmnLib.Static.Moves;
namespace PkmnLib.Dynamic.Models;
///
/// A hit data is the data for a single hit, on a single target.
///
public record HitData
{
///
/// Whether the hit is critical.
///
public bool IsCritical { get; internal set; }
///
/// The base power of the hit.
///
public byte BasePower { get; internal set; }
///
/// The effectiveness of the hit.
///
public float Effectiveness { get; internal set; }
///
/// The damage done by the hit.
///
public uint Damage { get; internal set; }
///
/// The type of the hit.
///
public TypeIdentifier Type { get; internal set; }
///
/// Whether the hit has failed.
///
public bool HasFailed { get; private set; }
///
/// Fails the hit.
///
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);
}