292 lines
8.1 KiB
C#
292 lines
8.1 KiB
C#
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;
|
|
|
|
/// <summary>
|
|
/// The data of a Pokemon.
|
|
/// </summary>
|
|
public interface IPokemon : IScriptSource
|
|
{
|
|
/// <summary>
|
|
/// The library data of the Pokemon.
|
|
/// </summary>
|
|
IDynamicLibrary Library { get; }
|
|
|
|
/// <summary>
|
|
/// The species of the Pokemon.
|
|
/// </summary>
|
|
ISpecies Species { get; }
|
|
|
|
/// <summary>
|
|
/// The form of the Pokemon.
|
|
/// </summary>
|
|
IForm Form { get; }
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
ISpecies? DisplaySpecies { get; }
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
IForm? DisplayForm { get; }
|
|
|
|
/// <summary>
|
|
/// The current level of the Pokemon.
|
|
/// </summary>
|
|
LevelInt Level { get; }
|
|
|
|
/// <summary>
|
|
/// The amount of experience of the Pokemon.
|
|
/// </summary>
|
|
uint Experience { get; }
|
|
|
|
/// <summary>
|
|
/// The personality value of the Pokemon.
|
|
/// </summary>
|
|
uint PersonalityValue { get; }
|
|
|
|
/// <summary>
|
|
/// The gender of the Pokemon.
|
|
/// </summary>
|
|
Gender Gender { get; }
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
byte Coloring { get; }
|
|
|
|
/// <summary>
|
|
/// The held item of the Pokemon.
|
|
/// </summary>
|
|
IItem? HeldItem { get; }
|
|
|
|
/// <summary>
|
|
/// The remaining health points of the Pokemon.
|
|
/// </summary>
|
|
uint CurrentHealth { get; }
|
|
|
|
/// <summary>
|
|
/// The weight of the Pokemon in kilograms.
|
|
/// </summary>
|
|
float WeightInKm { get; set; }
|
|
|
|
/// <summary>
|
|
/// The height of the Pokemon in meters.
|
|
/// </summary>
|
|
float HeightInMeters { get; set; }
|
|
|
|
/// <summary>
|
|
/// The happiness of the Pokemon. Also known as friendship.
|
|
/// </summary>
|
|
byte Happiness { get; }
|
|
|
|
/// <summary>
|
|
/// The stats of the Pokemon when disregarding any stat boosts.
|
|
/// </summary>
|
|
StatisticSet<uint> FlatStats { get; }
|
|
|
|
/// <summary>
|
|
/// The statistics boosts of the Pokemon. Will prevent the value from going above 6, and below
|
|
/// -6.
|
|
/// </summary>
|
|
StatBoostStatisticSet StatBoost { get; }
|
|
|
|
/// <summary>
|
|
/// The stats of the Pokemon including the stat boosts
|
|
/// </summary>
|
|
StatisticSet<uint> BoostedStats { get; }
|
|
|
|
/// <summary>
|
|
/// The individual values of the Pokemon.
|
|
/// </summary>
|
|
IndividualValueStatisticSet IndividualValues { get; }
|
|
|
|
/// <summary>
|
|
/// The effort values of the Pokemon.
|
|
/// </summary>
|
|
EffortValueStatisticSet EffortValues { get; }
|
|
|
|
/// <summary>
|
|
/// The nature of the Pokemon.
|
|
/// </summary>
|
|
INature Nature { get; }
|
|
|
|
/// <summary>
|
|
/// An optional nickname of the Pokemon.
|
|
/// </summary>
|
|
string? Nickname { get; }
|
|
|
|
/// <summary>
|
|
/// An index of the ability to find the actual ability on the form.
|
|
/// </summary>
|
|
AbilityIndex AbilityIndex { get; }
|
|
|
|
/// <summary>
|
|
/// An ability can be overriden to an arbitrary ability. This is for example used for the Mummy
|
|
/// ability.
|
|
/// </summary>
|
|
IAbility? OverrideAbility { get; }
|
|
|
|
/// <summary>
|
|
/// If in battle, we have additional data.
|
|
/// </summary>
|
|
IPokemonBattleData? BattleData { get; }
|
|
|
|
/// <summary>
|
|
/// The moves the Pokemon has learned. This is of a set length of <see cref="Const.MovesCount"/>. Empty move slots
|
|
/// are null.
|
|
/// </summary>
|
|
IReadOnlyList<ILearnedMove?> Moves { get; }
|
|
|
|
/// <summary>
|
|
/// Whether or not the Pokemon is allowed to gain experience.
|
|
/// </summary>
|
|
bool AllowedExperience { get; }
|
|
|
|
/// <summary>
|
|
/// The current types of the Pokemon.
|
|
/// </summary>
|
|
IReadOnlyList<TypeIdentifier> Types { get; }
|
|
|
|
/// <summary>
|
|
/// Whether or not this Pokemon is an egg.
|
|
/// </summary>
|
|
bool IsEgg { get; }
|
|
|
|
/// <summary>
|
|
/// Whether or not this Pokemon was caught this battle.
|
|
/// </summary>
|
|
bool IsCaught { get; }
|
|
|
|
/// <summary>
|
|
/// The script for the held item.
|
|
/// </summary>
|
|
ScriptContainer HeldItemTriggerScript { get; }
|
|
|
|
/// <summary>
|
|
/// The script for the ability.
|
|
/// </summary>
|
|
ScriptContainer AbilityScript { get; }
|
|
|
|
/// <summary>
|
|
/// The script for the status.
|
|
/// </summary>
|
|
ScriptContainer StatusScript { get; }
|
|
|
|
/// <summary>
|
|
/// The volatile status scripts of the Pokemon.
|
|
/// </summary>
|
|
IScriptSet Volatile { get; }
|
|
|
|
/// <summary>
|
|
/// Checks whether the Pokemon is holding an item with a specific name.
|
|
/// </summary>
|
|
bool HasHeldItem(string itemName);
|
|
|
|
/// <summary>
|
|
/// Changes the held item of the Pokemon. Returns the previously held item.
|
|
/// </summary>
|
|
[MustUseReturnValue] IItem? SetHeldItem(IItem? item);
|
|
|
|
/// <summary>
|
|
/// Removes the held item from the Pokemon. Returns the previously held item.
|
|
/// </summary>
|
|
[MustUseReturnValue] IItem? RemoveHeldItem();
|
|
|
|
/// <summary>
|
|
/// Makes the Pokemon uses its held item. Returns whether the item was consumed.
|
|
/// </summary>
|
|
bool ConsumeHeldItem();
|
|
|
|
/// <summary>
|
|
/// Change a boosted stat by a certain amount.
|
|
/// </summary>
|
|
/// <param name="stat">The stat to be changed</param>
|
|
/// <param name="change">The amount to change the stat by</param>
|
|
/// <param name="selfInflicted">Whether the change was self-inflicted. This can be relevant in scripts.</param>
|
|
void ChangeStatBoost(Statistic stat, sbyte change, bool selfInflicted);
|
|
|
|
/// <summary>
|
|
/// Returns the currently active ability.
|
|
/// </summary>
|
|
IAbility ActiveAbility { get; }
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
void RecalculateFlatStats();
|
|
|
|
/// <summary>
|
|
/// Calculates the boosted stats on the Pokemon, _without_ recalculating the flat stats.
|
|
/// This should be called when a stat boost changes.
|
|
/// </summary>
|
|
void RecalculateBoostedStats();
|
|
|
|
/// <summary>
|
|
/// Change the species of the Pokemon.
|
|
/// </summary>
|
|
void ChangeSpecies(ISpecies species, IForm form);
|
|
|
|
/// <summary>
|
|
/// Change the form of the Pokemon.
|
|
/// </summary>
|
|
void ChangeForm(IForm form);
|
|
|
|
/// <summary>
|
|
/// Whether the Pokemon is useable in a battle.
|
|
/// </summary>
|
|
bool IsUsable { get; }
|
|
|
|
/// <summary>
|
|
/// Whether the Pokemon is fainted.
|
|
/// </summary>
|
|
bool IsFainted { get; }
|
|
|
|
/// <summary>
|
|
/// Damages the Pokemon by a certain amount of damage, from a damage source.
|
|
/// </summary>
|
|
void Damage(uint damage, DamageSource source, EventBatchId batchId);
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
bool Heal(uint heal, bool allowRevive);
|
|
|
|
/// <summary>
|
|
/// Learn a move by name.
|
|
/// </summary>
|
|
void LearnMove(string moveName, MoveLearnMethod method, byte index);
|
|
|
|
/// <summary>
|
|
/// Removes the current non-volatile status from the Pokemon.
|
|
/// </summary>
|
|
void ClearStatus();
|
|
|
|
/// <summary>
|
|
/// Modifies the level by a certain amount
|
|
/// </summary>
|
|
void ChangeLevelBy(int change);
|
|
|
|
// TODO: (de)serialize
|
|
}
|
|
|
|
/// <summary>
|
|
/// The data of the Pokemon related to being in a battle.
|
|
/// </summary>
|
|
public interface IPokemonBattleData
|
|
{
|
|
IBattle? Battle { get; }
|
|
} |