From d3262e924d04ca785efc471a8a59d9ed518ae313 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 19 Sep 2020 17:44:06 +0200 Subject: [PATCH] Implements core interfaces for better language server compiles. --- Scripts/Interfaces/BaseTurnChoice.as | 5 ++ Scripts/Interfaces/Battle.as | 12 ++++ Scripts/Interfaces/BattleItemCategory.as | 7 +++ Scripts/Interfaces/BattleLibrary.as | 8 +++ Scripts/Interfaces/BattleRandom.as | 6 ++ Scripts/Interfaces/ChoiceQueue.as | 4 ++ Scripts/Interfaces/DamageLibrary.as | 3 + Scripts/Interfaces/DamageSource.as | 4 ++ Scripts/Interfaces/EffectParameter.as | 7 +++ Scripts/Interfaces/EffectParameterType.as | 7 +++ Scripts/Interfaces/ExecutingMove.as | 6 ++ Scripts/Interfaces/Forme.as | 10 ++++ Scripts/Interfaces/Gender.as | 5 ++ Scripts/Interfaces/GrowthRate.as | 4 ++ Scripts/Interfaces/GrowthRateLibrary.as | 4 ++ Scripts/Interfaces/HitData.as | 7 +++ Scripts/Interfaces/Item.as | 7 +++ Scripts/Interfaces/ItemCategory.as | 10 ++++ Scripts/Interfaces/ItemLibrary.as | 3 + Scripts/Interfaces/LearnedMove.as | 6 ++ Scripts/Interfaces/LibrarySettings.as | 5 ++ Scripts/Interfaces/MoveCategory.as | 5 ++ Scripts/Interfaces/MoveData.as | 11 ++++ Scripts/Interfaces/MoveLearnMethod.as | 4 ++ Scripts/Interfaces/MoveLibrary.as | 3 + Scripts/Interfaces/MoveTarget.as | 14 +++++ Scripts/Interfaces/MoveTurnChoice.as | 7 +++ Scripts/Interfaces/PkmnScript.as | 64 ++++++++++---------- Scripts/Interfaces/Pokemon.as | 71 +++++++++++------------ Scripts/Interfaces/Species.as | 9 +++ Scripts/Interfaces/SpeciesLibrary.as | 3 + Scripts/Interfaces/StaticLibrary.as | 8 +++ Scripts/Interfaces/Statistic.as | 8 +++ Scripts/Interfaces/SwitchTurnChoice.as | 7 +++ Scripts/Interfaces/TurnChoiceKind.as | 7 +++ Scripts/Interfaces/TypeLibrary.as | 4 ++ Scripts/Interfaces/constString.as | 5 ++ Scripts/Moves/ChangeTargetDef.as | 2 +- 38 files changed, 292 insertions(+), 70 deletions(-) create mode 100644 Scripts/Interfaces/BaseTurnChoice.as create mode 100644 Scripts/Interfaces/Battle.as create mode 100644 Scripts/Interfaces/BattleItemCategory.as create mode 100644 Scripts/Interfaces/BattleLibrary.as create mode 100644 Scripts/Interfaces/BattleRandom.as create mode 100644 Scripts/Interfaces/ChoiceQueue.as create mode 100644 Scripts/Interfaces/DamageLibrary.as create mode 100644 Scripts/Interfaces/DamageSource.as create mode 100644 Scripts/Interfaces/EffectParameter.as create mode 100644 Scripts/Interfaces/EffectParameterType.as create mode 100644 Scripts/Interfaces/ExecutingMove.as create mode 100644 Scripts/Interfaces/Forme.as create mode 100644 Scripts/Interfaces/Gender.as create mode 100644 Scripts/Interfaces/GrowthRate.as create mode 100644 Scripts/Interfaces/GrowthRateLibrary.as create mode 100644 Scripts/Interfaces/HitData.as create mode 100644 Scripts/Interfaces/Item.as create mode 100644 Scripts/Interfaces/ItemCategory.as create mode 100644 Scripts/Interfaces/ItemLibrary.as create mode 100644 Scripts/Interfaces/LearnedMove.as create mode 100644 Scripts/Interfaces/LibrarySettings.as create mode 100644 Scripts/Interfaces/MoveCategory.as create mode 100644 Scripts/Interfaces/MoveData.as create mode 100644 Scripts/Interfaces/MoveLearnMethod.as create mode 100644 Scripts/Interfaces/MoveLibrary.as create mode 100644 Scripts/Interfaces/MoveTarget.as create mode 100644 Scripts/Interfaces/MoveTurnChoice.as create mode 100644 Scripts/Interfaces/Species.as create mode 100644 Scripts/Interfaces/SpeciesLibrary.as create mode 100644 Scripts/Interfaces/StaticLibrary.as create mode 100644 Scripts/Interfaces/Statistic.as create mode 100644 Scripts/Interfaces/SwitchTurnChoice.as create mode 100644 Scripts/Interfaces/TurnChoiceKind.as create mode 100644 Scripts/Interfaces/TypeLibrary.as create mode 100644 Scripts/Interfaces/constString.as diff --git a/Scripts/Interfaces/BaseTurnChoice.as b/Scripts/Interfaces/BaseTurnChoice.as new file mode 100644 index 0000000..d86811f --- /dev/null +++ b/Scripts/Interfaces/BaseTurnChoice.as @@ -0,0 +1,5 @@ +shared interface BaseTurnChoice { + TurnChoiceKind Kind { get const; } + Pokemon@ User { get const; } + MoveTurnChoice@ opCast(); +} diff --git a/Scripts/Interfaces/Battle.as b/Scripts/Interfaces/Battle.as new file mode 100644 index 0000000..532ef61 --- /dev/null +++ b/Scripts/Interfaces/Battle.as @@ -0,0 +1,12 @@ +shared interface Battle { + const BattleLibrary@ Library { get const; } + bool CanUse(BaseTurnChoice@ choice); + bool CanFlee { get const; } + BattleRandom@ Random { get const; } + ChoiceQueue@ TurnQueue { get const; } + void AddVolatile(const constString &in name) const; + void RemoveVolatile(const constString &in name) const; + void SetWeather(const constString &in name) const; + void ClearWeather(const constString &in name) const; + const constString& GetWeatherName() const; +} diff --git a/Scripts/Interfaces/BattleItemCategory.as b/Scripts/Interfaces/BattleItemCategory.as new file mode 100644 index 0000000..e8a04e5 --- /dev/null +++ b/Scripts/Interfaces/BattleItemCategory.as @@ -0,0 +1,7 @@ +shared enum BattleItemCategory { + None = 0, + Healing = 1, + StatusHealing = 2, + CaptureDevice = 3, + Misc = 4, +} diff --git a/Scripts/Interfaces/BattleLibrary.as b/Scripts/Interfaces/BattleLibrary.as new file mode 100644 index 0000000..141eb33 --- /dev/null +++ b/Scripts/Interfaces/BattleLibrary.as @@ -0,0 +1,8 @@ +shared interface BattleLibrary { + const LibrarySettings@ Settings { get const; } + const StaticLibrary@ StaticLibrary { get const; } + const SpeciesLibrary@ SpeciesLibrary { get const; } + const MoveLibrary@ MoveLibrary { get const; } + const ItemLibrary@ ItemLibrary { get const; } + const DamageLibrary@ DamageLibrary { get const; } +} diff --git a/Scripts/Interfaces/BattleRandom.as b/Scripts/Interfaces/BattleRandom.as new file mode 100644 index 0000000..5d222d4 --- /dev/null +++ b/Scripts/Interfaces/BattleRandom.as @@ -0,0 +1,6 @@ +shared interface BattleRandom { + bool EffectChance(float chance, ExecutingMove@ move, Pokemon@ target); + int Get(); + int Get(int max); + int Get(int min, int max); +} diff --git a/Scripts/Interfaces/ChoiceQueue.as b/Scripts/Interfaces/ChoiceQueue.as new file mode 100644 index 0000000..9944500 --- /dev/null +++ b/Scripts/Interfaces/ChoiceQueue.as @@ -0,0 +1,4 @@ +shared interface ChoiceQueue { + bool MovePokemonChoiceNext(Pokemon@ target); + const BaseTurnChoice@ Peek() const; +} diff --git a/Scripts/Interfaces/DamageLibrary.as b/Scripts/Interfaces/DamageLibrary.as new file mode 100644 index 0000000..8e2502f --- /dev/null +++ b/Scripts/Interfaces/DamageLibrary.as @@ -0,0 +1,3 @@ +shared interface DamageLibrary { + int GetDamage() const; +} diff --git a/Scripts/Interfaces/DamageSource.as b/Scripts/Interfaces/DamageSource.as new file mode 100644 index 0000000..ad889f0 --- /dev/null +++ b/Scripts/Interfaces/DamageSource.as @@ -0,0 +1,4 @@ +shared enum DamageSource { + AttackDamage = 0, + Struggle = 1, +} diff --git a/Scripts/Interfaces/EffectParameter.as b/Scripts/Interfaces/EffectParameter.as new file mode 100644 index 0000000..6861c80 --- /dev/null +++ b/Scripts/Interfaces/EffectParameter.as @@ -0,0 +1,7 @@ +shared interface EffectParameter { + EffectParameterType GetType() const; + bool AsBool() const; + int64 AsInt() const; + float AsFloat() const; + const constString& AsString() const; +} diff --git a/Scripts/Interfaces/EffectParameterType.as b/Scripts/Interfaces/EffectParameterType.as new file mode 100644 index 0000000..25edbe5 --- /dev/null +++ b/Scripts/Interfaces/EffectParameterType.as @@ -0,0 +1,7 @@ +shared enum EffectParameterType { + None = 0, + Bool = 1, + Int = 2, + Float = 3, + String = 4, +} diff --git a/Scripts/Interfaces/ExecutingMove.as b/Scripts/Interfaces/ExecutingMove.as new file mode 100644 index 0000000..8021173 --- /dev/null +++ b/Scripts/Interfaces/ExecutingMove.as @@ -0,0 +1,6 @@ +shared interface ExecutingMove { + HitData@ GetHitData(Pokemon@ target, uint8 hit) const; + bool IsPokemonTarget(Pokemon@ pkmn) const; + Pokemon@ User { get const; } + LearnedMove@ Move { get const; } +} diff --git a/Scripts/Interfaces/Forme.as b/Scripts/Interfaces/Forme.as new file mode 100644 index 0000000..a19c741 --- /dev/null +++ b/Scripts/Interfaces/Forme.as @@ -0,0 +1,10 @@ +shared interface Forme { + const constString& Name { get const; } + float Weight { get const; } + float Height { get const; } + uint BaseExperience { get const; } + int TypeCount { get const; } + uint8 GetType(int index) const; + uint GetStatistic(Statistic stat) const; + const constString& GetAbility(bool hidden, uint8 index) const; +} diff --git a/Scripts/Interfaces/Gender.as b/Scripts/Interfaces/Gender.as new file mode 100644 index 0000000..33165ca --- /dev/null +++ b/Scripts/Interfaces/Gender.as @@ -0,0 +1,5 @@ +shared enum Gender { + Male = 0, + Female = 1, + Genderless = 2, +} diff --git a/Scripts/Interfaces/GrowthRate.as b/Scripts/Interfaces/GrowthRate.as new file mode 100644 index 0000000..9432742 --- /dev/null +++ b/Scripts/Interfaces/GrowthRate.as @@ -0,0 +1,4 @@ +shared interface GrowthRate { + uint8 CalculateLevel(uint experience) const; + uint CalculateExperience(uint8 level) const; +} diff --git a/Scripts/Interfaces/GrowthRateLibrary.as b/Scripts/Interfaces/GrowthRateLibrary.as new file mode 100644 index 0000000..5263b2f --- /dev/null +++ b/Scripts/Interfaces/GrowthRateLibrary.as @@ -0,0 +1,4 @@ +shared interface GrowthRateLibrary { + uint8 CalculateLevel(const constString &in growthRate, uint experience) const; + uint CalculateExperience(const constString &in growthRate, uint8 experience) const; +} diff --git a/Scripts/Interfaces/HitData.as b/Scripts/Interfaces/HitData.as new file mode 100644 index 0000000..691aa24 --- /dev/null +++ b/Scripts/Interfaces/HitData.as @@ -0,0 +1,7 @@ +shared interface HitData { + bool IsCritical { get const; } + uint8 BasePower { get const; } + float Effectiveness { get const; } + uint Damage { get const; } + uint8 Type { get const; } +} diff --git a/Scripts/Interfaces/Item.as b/Scripts/Interfaces/Item.as new file mode 100644 index 0000000..2b84e35 --- /dev/null +++ b/Scripts/Interfaces/Item.as @@ -0,0 +1,7 @@ +shared interface Item { + const constString& Name { get const; } + ItemCategory Category { get const; } + BattleItemCategory BattleCategory { get const; } + int Price { get const; } + bool HasFlag(const constString &in flag) const; +} diff --git a/Scripts/Interfaces/ItemCategory.as b/Scripts/Interfaces/ItemCategory.as new file mode 100644 index 0000000..b4b8834 --- /dev/null +++ b/Scripts/Interfaces/ItemCategory.as @@ -0,0 +1,10 @@ +shared enum ItemCategory { + Misc = 0, + Pokeball = 1, + Medicine = 2, + Berry = 3, + TM = 4, + VariantChanger = 5, + KeyItem = 6, + Mail = 7, +} diff --git a/Scripts/Interfaces/ItemLibrary.as b/Scripts/Interfaces/ItemLibrary.as new file mode 100644 index 0000000..f32aa2d --- /dev/null +++ b/Scripts/Interfaces/ItemLibrary.as @@ -0,0 +1,3 @@ +shared interface ItemLibrary { + const Item@ Get(const constString &in name) const; +} diff --git a/Scripts/Interfaces/LearnedMove.as b/Scripts/Interfaces/LearnedMove.as new file mode 100644 index 0000000..7ef07a4 --- /dev/null +++ b/Scripts/Interfaces/LearnedMove.as @@ -0,0 +1,6 @@ +shared interface LearnedMove { + const MoveData@ MoveData { get const; } + uint8 MaxUses { get const; } + uint8 RemainingUses { get const; } + Gender LearnMethod { get const; } +} diff --git a/Scripts/Interfaces/LibrarySettings.as b/Scripts/Interfaces/LibrarySettings.as new file mode 100644 index 0000000..a97552a --- /dev/null +++ b/Scripts/Interfaces/LibrarySettings.as @@ -0,0 +1,5 @@ +shared interface LibrarySettings { + uint8 MaximalLevel { get const; } + uint8 MaximalMoves { get const; } + uint16 ShinyRate { get const; } +} diff --git a/Scripts/Interfaces/MoveCategory.as b/Scripts/Interfaces/MoveCategory.as new file mode 100644 index 0000000..07abd93 --- /dev/null +++ b/Scripts/Interfaces/MoveCategory.as @@ -0,0 +1,5 @@ +shared enum MoveCategory { + Physical = 0, + Special = 1, + Status = 2, +} diff --git a/Scripts/Interfaces/MoveData.as b/Scripts/Interfaces/MoveData.as new file mode 100644 index 0000000..e69d2d6 --- /dev/null +++ b/Scripts/Interfaces/MoveData.as @@ -0,0 +1,11 @@ +shared interface MoveData { + const constString& Name { get const; } + uint8 Type { get const; } + MoveCategory Category { get const; } + uint8 BasePower { get const; } + uint8 Accuracy { get const; } + uint8 BaseUsages { get const; } + MoveTarget Target { get const; } + int8 Priority { get const; } + bool HasFlag(const constString &in flag) const; +} diff --git a/Scripts/Interfaces/MoveLearnMethod.as b/Scripts/Interfaces/MoveLearnMethod.as new file mode 100644 index 0000000..a64b74a --- /dev/null +++ b/Scripts/Interfaces/MoveLearnMethod.as @@ -0,0 +1,4 @@ +shared enum MoveLearnMethod { + Unknown = 0, + Level = 1, +} diff --git a/Scripts/Interfaces/MoveLibrary.as b/Scripts/Interfaces/MoveLibrary.as new file mode 100644 index 0000000..c32311e --- /dev/null +++ b/Scripts/Interfaces/MoveLibrary.as @@ -0,0 +1,3 @@ +shared interface MoveLibrary { + const MoveData@ Get(const constString &in name) const; +} diff --git a/Scripts/Interfaces/MoveTarget.as b/Scripts/Interfaces/MoveTarget.as new file mode 100644 index 0000000..ab70902 --- /dev/null +++ b/Scripts/Interfaces/MoveTarget.as @@ -0,0 +1,14 @@ +shared enum MoveTarget { + Adjacent = 0, + AdjacentAlly = 1, + AdjacentAllySelf = 2, + AdjacentOpponent = 3, + All = 4, + AllAdjacent = 5, + AllAdjacentOpponent = 6, + AllAlly = 7, + AllOpponent = 8, + Any = 9, + RandomOpponent = 10, + Self = 11, +} diff --git a/Scripts/Interfaces/MoveTurnChoice.as b/Scripts/Interfaces/MoveTurnChoice.as new file mode 100644 index 0000000..8716d38 --- /dev/null +++ b/Scripts/Interfaces/MoveTurnChoice.as @@ -0,0 +1,7 @@ +shared interface MoveTurnChoice { + TurnChoiceKind Kind { get const; } + Pokemon@ User { get const; } + LearnedMove@ Move { get const; } + int8 Priority { get const; } + BaseTurnChoice@ opImplCast(); +} diff --git a/Scripts/Interfaces/PkmnScript.as b/Scripts/Interfaces/PkmnScript.as index f8709c4..f887386 100644 --- a/Scripts/Interfaces/PkmnScript.as +++ b/Scripts/Interfaces/PkmnScript.as @@ -1,32 +1,34 @@ shared abstract class PkmnScript { -// CreatureLib methods - void OnInitialize(const array &in parameters){}; - void Stack(){}; - void OnRemove(){}; - void PreventAttack(ExecutingMove@ attack, bool& result){}; - void FailAttack(ExecutingMove@ attack, bool& result){}; - void StopBeforeAttack(ExecutingMove@ attack, bool& result){}; - void OnBeforeAttack(ExecutingMove@ attack){}; - void FailIncomingAttack(ExecutingMove@ attack, Pokemon@ target, bool& result){}; - void IsInvulnerable(ExecutingMove@ attack, Pokemon@ target, bool& result){}; - void OnAttackMiss(ExecutingMove@ attack, Pokemon@ target){}; - void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType){}; - void OnStatusMove(ExecutingMove@ attack, Pokemon@ target, uint8 hit){}; - void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){}; - void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){}; - void OnAfterHits(ExecutingMove@ attack, Pokemon@ target){}; - - void ModifyEffectChance(ExecutingMove@ attack, Pokemon@ target, float& chance){}; - void ModifyIncomingEffectChance(ExecutingMove@ attack, Pokemon@ target, float& chance){}; - - void OverrideBasePower(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& chance){}; - void ChangeDamageStatsUser(ExecutingMove@ attack, Pokemon@ target, uint8 hit, Pokemon@& user){}; - void BypassDefensiveStat(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& bypass){}; - void BypassOffensiveStat(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& bypass){}; - void ModifyStatModifier(ExecutingMove@ attack, Pokemon@ target, uint8 hit, float& modifier){}; - void ModifyDamageModifier(ExecutingMove@ attack, Pokemon@ target, uint8 hit, float& modifier){}; - void OverrideDamage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, int& damage){}; - -// PkmnLib methods - void ModifyCriticalStage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& critStage){}; -} \ No newline at end of file + void OnInitialize(const EffectParameter@[] &in){}; + void Stack(){}; + void OnRemove(){}; + void OnBeforeTurn(BaseTurnChoice@){}; + void ChangeAttack(MoveTurnChoice@, constString &inout){}; + void PreventAttack(ExecutingMove@, bool &inout){}; + void FailAttack(ExecutingMove@, bool &inout){}; + void StopBeforeAttack(ExecutingMove@, bool &inout){}; + void OnBeforeAttack(ExecutingMove@){}; + void FailIncomingAttack(ExecutingMove@, Pokemon@, bool &inout){}; + void IsInvulnerable(ExecutingMove@, Pokemon@, bool &inout){}; + void OnAttackMiss(ExecutingMove@, Pokemon@){}; + void ChangeAttackType(ExecutingMove@, Pokemon@, uint8, uint8 &inout){}; + void ChangeEffectiveness(ExecutingMove@, Pokemon@, uint8, float &inout){}; + void PreventSecondaryEffects(ExecutingMove@, Pokemon@, uint8, bool &inout){}; + void OnSecondaryEffect(ExecutingMove@, Pokemon@, uint8){}; + void OnAfterHits(ExecutingMove@, Pokemon@){}; + void PreventSelfSwitch(SwitchTurnChoice@, bool &inout){}; + void ModifyEffectChance(ExecutingMove@, Pokemon@, float &inout){}; + void ModifyIncomingEffectChance(ExecutingMove@, Pokemon@, float &inout){}; + void OverrideBasePower(ExecutingMove@, Pokemon@, uint8, uint8 &inout){}; + void ChangeDamageStatsUser(ExecutingMove@, Pokemon@, uint8, Pokemon@ &inout){}; + void BypassDefensiveStat(ExecutingMove@, Pokemon@, uint8, bool &inout){}; + void BypassOffensiveStat(ExecutingMove@, Pokemon@, uint8, bool &inout){}; + void ModifyStatModifier(ExecutingMove@, Pokemon@, uint8, float &inout){}; + void ModifyDamageModifier(ExecutingMove@, Pokemon@, uint8, float &inout){}; + void OverrideDamage(ExecutingMove@, Pokemon@, uint8, uint &inout){}; + void ModifyCriticalStage(ExecutingMove@, Pokemon@, uint8, uint8 &inout){}; + void OverrideCriticalModifier(ExecutingMove@, Pokemon@, uint8, float &inout){}; + void OverrideSTABModifier(ExecutingMove@, Pokemon@, uint8, float &inout){}; + void ModifyExperienceGain(Pokemon@, Pokemon@, uint &inout){}; + void DoesShareExperience(Pokemon@, Pokemon@, bool &inout){}; +} diff --git a/Scripts/Interfaces/Pokemon.as b/Scripts/Interfaces/Pokemon.as index 48f0680..f8a623f 100644 --- a/Scripts/Interfaces/Pokemon.as +++ b/Scripts/Interfaces/Pokemon.as @@ -1,38 +1,33 @@ -interface Pokemon{ - const Species@ Species { get const; } - const Forme@ Forme { get const; } - const Species@ DisplaySpecies { get const; } - const Forme@ DisplayForme { get const; } - - uint8 Level { get const; } - uint32 Experience { get const; } - Gender Gender { get const; } - uint8 Coloring { get const; } - bool Shiny { get const; } - const Item@ HeldItem { get const; } - uint32 CurrentHealth{ get const; } - const string& Nickname { get const; } - const string& ActiveAbility { get const; } - bool IsFainted { get const; } - bool HasType(uint8) const; - uint32 MaxHealth{ get const; }; - const Species@ DisplaySpecies { get const; } - - uint8[]@ GetTypes() const; - LearnedMove@[]@ GetMoves() const - void ChangeStatBoost(Statistic stat, int8 amount); - uint32 GetFlatStat(Statistic stat) const; - uint32 GetBoostedStat(Statistic stat) const; - uint32 GetBaseStat(Statistic stat) const; - int8 GetStatBoost(Statistic stat) const; - - bool HasHeldItem(const string &in name) const; - - void Damage(uint32 amount, DamageSource source); - void Heal(uint32 amount); - void OverrideActiveAbility(const string &in ability); - void SetHeldItem(const string &in name); - void SetHeldItem(const Item@ name); - - Battle Battle{ get const; } -} \ No newline at end of file +shared interface Pokemon { + const Species@ Species { get const; } + const Forme@ Forme { get const; } + uint8 Level { get const; } + uint Experience { get const; } + Gender Gender { get const; } + uint8 Coloring { get const; } + bool Shiny { get const; } + const Item@ HeldItem { get const; } + bool HasHeldItem(const constString &in name) const; + void SetHeldItem(const string &in name); + void SetHeldItem(const Item@ item); + uint CurrentHealth { get const; } + const string& Nickname { get const; } + const constString& ActiveAbility { get const; } + bool IsFainted { get const; } + bool HasType(uint8 type) const; + uint MaxHealth { get const; } + void Damage(uint type, DamageSource source); + void Heal(uint type); + void OverrideActiveAbility(const string &in ability); + LearnedMove@[]@ GetMoves() const; + void ChangeStatBoost(Statistic stat, int8 amount); + const Species@ DisplaySpecies { get const; } + const Species@ DisplayForme { get const; } + uint GetFlatStat(Statistic stat) const; + uint GetBoostedStat(Statistic stat) const; + uint GetBaseStat(Statistic stat) const; + int8 GetStatBoost(Statistic stat) const; + void AddVolatile(const constString &in name) const; + void RemoveVolatile(const constString &in name) const; + const Battle@ Battle { get const; } +} diff --git a/Scripts/Interfaces/Species.as b/Scripts/Interfaces/Species.as new file mode 100644 index 0000000..bc87d23 --- /dev/null +++ b/Scripts/Interfaces/Species.as @@ -0,0 +1,9 @@ +shared interface Species { + const constString& Name { get const; } + uint16 Id { get const; } + float GenderRate { get const; } + uint8 CaptureRate { get const; } + Gender GetRandomGender() const; + const Forme@ GetForme(string key) const; + const Forme@ DefaultForme { get const; } +} diff --git a/Scripts/Interfaces/SpeciesLibrary.as b/Scripts/Interfaces/SpeciesLibrary.as new file mode 100644 index 0000000..84c0de3 --- /dev/null +++ b/Scripts/Interfaces/SpeciesLibrary.as @@ -0,0 +1,3 @@ +shared interface SpeciesLibrary { + const Species@ Get(const constString &in name) const; +} diff --git a/Scripts/Interfaces/StaticLibrary.as b/Scripts/Interfaces/StaticLibrary.as new file mode 100644 index 0000000..774ef36 --- /dev/null +++ b/Scripts/Interfaces/StaticLibrary.as @@ -0,0 +1,8 @@ +shared interface StaticLibrary { + const LibrarySettings@ Settings { get const; } + const SpeciesLibrary@ SpeciesLibrary { get const; } + const MoveLibrary@ MoveLibrary { get const; } + const ItemLibrary@ ItemLibrary { get const; } + const GrowthRateLibrary@ GrowthRateLibrary { get const; } + const TypeLibrary@ TypeLibrary { get const; } +} diff --git a/Scripts/Interfaces/Statistic.as b/Scripts/Interfaces/Statistic.as new file mode 100644 index 0000000..2999436 --- /dev/null +++ b/Scripts/Interfaces/Statistic.as @@ -0,0 +1,8 @@ +shared enum Statistic { + HP = 0, + Attack = 1, + Defense = 2, + SpecialAttack = 3, + SpecialDefense = 4, + Speed = 5, +} diff --git a/Scripts/Interfaces/SwitchTurnChoice.as b/Scripts/Interfaces/SwitchTurnChoice.as new file mode 100644 index 0000000..2261781 --- /dev/null +++ b/Scripts/Interfaces/SwitchTurnChoice.as @@ -0,0 +1,7 @@ +shared interface SwitchTurnChoice { + TurnChoiceKind Kind { get const; } + Pokemon@ User { get const; } + Pokemon@ NewPokemon { get const; } + MoveTurnChoice@ opCast(); + BaseTurnChoice@ opImplCast(); +} diff --git a/Scripts/Interfaces/TurnChoiceKind.as b/Scripts/Interfaces/TurnChoiceKind.as new file mode 100644 index 0000000..3d40a64 --- /dev/null +++ b/Scripts/Interfaces/TurnChoiceKind.as @@ -0,0 +1,7 @@ +shared enum TurnChoiceKind { + Pass = 0, + Attack = 1, + Item = 2, + Switch = 3, + Flee = 4, +} diff --git a/Scripts/Interfaces/TypeLibrary.as b/Scripts/Interfaces/TypeLibrary.as new file mode 100644 index 0000000..566d623 --- /dev/null +++ b/Scripts/Interfaces/TypeLibrary.as @@ -0,0 +1,4 @@ +shared interface TypeLibrary { + uint8 GetTypeId(const constString &in name) const; + float GetSingleEffectiveness(uint8 attacking, uint8 defensive) const; +} diff --git a/Scripts/Interfaces/constString.as b/Scripts/Interfaces/constString.as new file mode 100644 index 0000000..23155b4 --- /dev/null +++ b/Scripts/Interfaces/constString.as @@ -0,0 +1,5 @@ +shared interface constString { + bool opEquals(const constString &in) const; + bool opEquals(const string &in) const; + uint opImplConv(); +} diff --git a/Scripts/Moves/ChangeTargetDef.as b/Scripts/Moves/ChangeTargetDef.as index 2d0b002..91c2025 100644 --- a/Scripts/Moves/ChangeTargetDef.as +++ b/Scripts/Moves/ChangeTargetDef.as @@ -3,7 +3,7 @@ namespace Gen7 { shared class ChangeTargetDefense : PkmnScript{ int8 _amount; - void OnInitialize(const array &in parameters) override{ + void OnInitialize(const EffectParameter@[] &in parameters) override{ _amount = int8(parameters[0].AsInt()); }