diff --git a/src/Battling/Models/Creature.cpp b/src/Battling/Models/Creature.cpp index 72759ec..ae4fe3a 100644 --- a/src/Battling/Models/Creature.cpp +++ b/src/Battling/Models/Creature.cpp @@ -148,13 +148,15 @@ void Battling::Creature::AddExperience(uint32_t amount) { _experience = exp; _level = level; } -const Library::CreatureSpecies* Battling::Creature::GetDisplaySpecies() { - auto species = _species; - HOOK(OverrideDisplaySpecies, this, this, &species); +const Library::CreatureSpecies* Battling::Creature::GetDisplaySpecies() const { + auto species = _displaySpecies; + if (species == nullptr) + species = _species; return species; } -const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() { - auto variant = _variant; - HOOK(OverrideDisplayVariant, this, this, &variant); +const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() const { + auto variant = _displayVariant; + if (variant == nullptr) + variant = _variant; return variant; } diff --git a/src/Battling/Models/Creature.hpp b/src/Battling/Models/Creature.hpp index c73d6d1..1c0fcc6 100644 --- a/src/Battling/Models/Creature.hpp +++ b/src/Battling/Models/Creature.hpp @@ -22,6 +22,9 @@ namespace CreatureLib::Battling { const Library::CreatureSpecies* _species; const Library::SpeciesVariant* _variant; + const Library::CreatureSpecies* _displaySpecies = nullptr; + const Library::SpeciesVariant* _displayVariant = nullptr; + uint8_t _level; uint32_t _experience; uint32_t _uniqueIdentifier; @@ -106,8 +109,11 @@ namespace CreatureLib::Battling { std::vector& GetAttacks() { return _attacks; } - const Library::CreatureSpecies* GetDisplaySpecies(); - const Library::SpeciesVariant* GetDisplayVariant(); + const Library::CreatureSpecies* GetDisplaySpecies() const; + const Library::SpeciesVariant* GetDisplayVariant() const; + + const void SetDisplaySpecies(Library::CreatureSpecies* species) { _displaySpecies = species; } + const void SetDisplayVariant(Library::SpeciesVariant* variant) { _displayVariant = variant; }; // region Stat APIs diff --git a/src/Battling/ScriptHandling/Script.hpp b/src/Battling/ScriptHandling/Script.hpp index 1f0d4f2..f3ef5dd 100644 --- a/src/Battling/ScriptHandling/Script.hpp +++ b/src/Battling/ScriptHandling/Script.hpp @@ -25,10 +25,6 @@ namespace CreatureLib::Battling { const std::string& GetName() { return _name; } - virtual void OverrideDisplaySpecies(Creature* creature, - const CreatureLib::Library::CreatureSpecies** species){}; - virtual void OverrideDisplayVariant(Creature* creature, const CreatureLib::Library::SpeciesVariant** variant){}; - virtual void OnBeforeTurn(const BaseTurnChoice* choice){}; virtual void ChangeAttack(AttackTurnChoice* choice, std::string& attack){};