Remove display script hook functions, replace them with easy to use interface on Creature class.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
07700008f7
commit
c4d0a73df6
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<LearnedAttack*>& 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
|
||||
|
||||
|
|
|
@ -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){};
|
||||
|
|
Loading…
Reference in New Issue