using JetBrains.Annotations;
using PkmnLib.Dynamic.Events;
using PkmnLib.Dynamic.Libraries;
using PkmnLib.Dynamic.ScriptHandling;
using PkmnLib.Static;
using PkmnLib.Static.Species;
namespace PkmnLib.Dynamic.Models;
///
/// The data of a Pokemon.
///
public interface IPokemon : IScriptSource
{
///
/// The library data of the Pokemon.
///
IDynamicLibrary Library { get; }
///
/// The species of the Pokemon.
///
ISpecies Species { get; }
///
/// The form of the Pokemon.
///
IForm Form { get; }
///
/// An optional display species of the Pokemon. If this is set, the client should display this
/// species. An example of usage for this is the Illusion ability.
///
ISpecies? DisplaySpecies { get; }
///
/// An optional display form of the Pokemon. If this is set, the client should display this
/// form. An example of usage for this is the Illusion ability.
///
IForm? DisplayForm { get; }
///
/// The current level of the Pokemon.
///
LevelInt Level { get; }
///
/// The amount of experience of the Pokemon.
///
uint Experience { get; }
///
/// The personality value of the Pokemon.
///
uint PersonalityValue { get; }
///
/// The gender of the Pokemon.
///
Gender Gender { get; }
///
/// The coloring of the Pokemon. Value 0 is the default, value 1 means shiny. Other values are
/// currently not used, and can be used for other implementations.
///
byte Coloring { get; }
///
/// The held item of the Pokemon.
///
IItem? HeldItem { get; }
///
/// The remaining health points of the Pokemon.
///
uint CurrentHealth { get; }
///
/// The weight of the Pokemon in kilograms.
///
float WeightInKm { get; set; }
///
/// The height of the Pokemon in meters.
///
float HeightInMeters { get; set; }
///
/// The happiness of the Pokemon. Also known as friendship.
///
byte Happiness { get; }
///
/// The stats of the Pokemon when disregarding any stat boosts.
///
StatisticSet FlatStats { get; }
///
/// The statistics boosts of the Pokemon. Will prevent the value from going above 6, and below
/// -6.
///
StatBoostStatisticSet StatBoost { get; }
///
/// The stats of the Pokemon including the stat boosts
///
StatisticSet BoostedStats { get; }
///
/// The individual values of the Pokemon.
///
IndividualValueStatisticSet IndividualValues { get; }
///
/// The effort values of the Pokemon.
///
EffortValueStatisticSet EffortValues { get; }
///
/// The nature of the Pokemon.
///
INature Nature { get; }
///
/// An optional nickname of the Pokemon.
///
string? Nickname { get; }
///
/// An index of the ability to find the actual ability on the form.
///
AbilityIndex AbilityIndex { get; }
///
/// An ability can be overriden to an arbitrary ability. This is for example used for the Mummy
/// ability.
///
IAbility? OverrideAbility { get; }
///
/// If in battle, we have additional data.
///
IPokemonBattleData? BattleData { get; }
///
/// The moves the Pokemon has learned. This is of a set length of . Empty move slots
/// are null.
///
IReadOnlyList Moves { get; }
///
/// Whether or not the Pokemon is allowed to gain experience.
///
bool AllowedExperience { get; }
///
/// The current types of the Pokemon.
///
IReadOnlyList Types { get; }
///
/// Whether or not this Pokemon is an egg.
///
bool IsEgg { get; }
///
/// Whether or not this Pokemon was caught this battle.
///
bool IsCaught { get; }
///
/// The script for the held item.
///
ScriptContainer HeldItemTriggerScript { get; }
///
/// The script for the ability.
///
ScriptContainer AbilityScript { get; }
///
/// The script for the status.
///
ScriptContainer StatusScript { get; }
///
/// The volatile status scripts of the Pokemon.
///
IScriptSet Volatile { get; }
///
/// Checks whether the Pokemon is holding an item with a specific name.
///
bool HasHeldItem(string itemName);
///
/// Changes the held item of the Pokemon. Returns the previously held item.
///
[MustUseReturnValue] IItem? SetHeldItem(IItem? item);
///
/// Removes the held item from the Pokemon. Returns the previously held item.
///
[MustUseReturnValue] IItem? RemoveHeldItem();
///
/// Makes the Pokemon uses its held item. Returns whether the item was consumed.
///
bool ConsumeHeldItem();
///
/// Change a boosted stat by a certain amount.
///
/// The stat to be changed
/// The amount to change the stat by
/// Whether the change was self-inflicted. This can be relevant in scripts.
void ChangeStatBoost(Statistic stat, sbyte change, bool selfInflicted);
///
/// Returns the currently active ability.
///
IAbility ActiveAbility { get; }
///
/// Calculates the flat stats on the Pokemon. This should be called when for example the base
/// stats, level, nature, IV, or EV changes. This has a side effect of recalculating the boosted
/// stats, as those depend on the flat stats.
///
void RecalculateFlatStats();
///
/// Calculates the boosted stats on the Pokemon, _without_ recalculating the flat stats.
/// This should be called when a stat boost changes.
///
void RecalculateBoostedStats();
///
/// Change the species of the Pokemon.
///
void ChangeSpecies(ISpecies species, IForm form);
///
/// Change the form of the Pokemon.
///
void ChangeForm(IForm form);
///
/// Whether the Pokemon is useable in a battle.
///
bool IsUsable { get; }
///
/// Whether the Pokemon is fainted.
///
bool IsFainted { get; }
///
/// Damages the Pokemon by a certain amount of damage, from a damage source.
///
void Damage(uint damage, DamageSource source, EventBatchId batchId);
///
/// Heals the Pokemon by a specific amount. Unless allow_revive is set to true, this will not
/// heal if the Pokemon has 0 health. If the amount healed is 0, this will return false.
///
bool Heal(uint heal, bool allowRevive);
///
/// Learn a move by name.
///
void LearnMove(string moveName, MoveLearnMethod method, byte index);
///
/// Removes the current non-volatile status from the Pokemon.
///
void ClearStatus();
///
/// Modifies the level by a certain amount
///
void ChangeLevelBy(int change);
// TODO: (de)serialize
}
///
/// The data of the Pokemon related to being in a battle.
///
public interface IPokemonBattleData
{
IBattle? Battle { get; }
}