Implements functions for getting display species and variant.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fbc4973e28
commit
8e53ffb53d
|
@ -6,11 +6,12 @@ class CreatureLibConan(ConanFile):
|
|||
license = "TODO"
|
||||
url = "https://git.p-epsilon.com/Deukhoofd/CreatureLib"
|
||||
description = "The core implementation for turn based battling using creatures."
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
settings = "compiler"
|
||||
options = {"shared": [True, False]}
|
||||
default_options = {"shared": False}
|
||||
generators = "cmake"
|
||||
exports_sources = "*"
|
||||
compiler = "clang"
|
||||
|
||||
def build(self):
|
||||
cmake = CMake(self)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include <algorithm>
|
||||
#include <utility>
|
||||
#include "../Models/Battle.hpp"
|
||||
#include "../ScriptHandling/ScriptMacros.cpp"
|
||||
|
||||
using namespace CreatureLib;
|
||||
|
||||
|
@ -152,3 +153,13 @@ 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);
|
||||
return species;
|
||||
}
|
||||
const Library::SpeciesVariant* Battling::Creature::GetDisplayVariant() {
|
||||
auto variant = __Variant;
|
||||
HOOK(OverrideDisplayVariant, this, this, &variant);
|
||||
return variant;
|
||||
}
|
||||
|
|
|
@ -95,6 +95,9 @@ namespace CreatureLib::Battling {
|
|||
|
||||
std::vector<LearnedAttack*>& GetAttacks() { return _attacks; }
|
||||
|
||||
const Library::CreatureSpecies* GetDisplaySpecies();
|
||||
const Library::SpeciesVariant* GetDisplayVariant();
|
||||
|
||||
// region Stat APIs
|
||||
|
||||
void ChangeStatBoost(Core::Statistic stat, int8_t diffAmount);
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include "../../Library/CreatureData/CreatureSpecies.hpp"
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class BaseTurnChoice;
|
||||
|
@ -24,6 +25,10 @@ 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