Add functions to add volatile scripts to Creature.cpp.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
32584ac406
commit
142889ad8a
|
@ -185,3 +185,9 @@ void Battling::Creature::SetHeldItem(const std::string& itemName) {
|
||||||
}
|
}
|
||||||
_heldItem = item;
|
_heldItem = item;
|
||||||
}
|
}
|
||||||
|
void Battling::Creature::AddVolatileScript(const std::string& name) {
|
||||||
|
auto script = this->_library->LoadScript(ScriptCategory::Creature, name);
|
||||||
|
_volatile.Add(script);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Battling::Creature::AddVolatileScript(Script* script) { _volatile.Add(script); }
|
||||||
|
|
|
@ -116,6 +116,8 @@ namespace CreatureLib::Battling {
|
||||||
|
|
||||||
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override;
|
void GetActiveScripts(std::vector<ScriptWrapper>& scripts) override;
|
||||||
void ClearVolatileScripts();
|
void ClearVolatileScripts();
|
||||||
|
void AddVolatileScript(const std::string& name);
|
||||||
|
void AddVolatileScript(Script* script);
|
||||||
|
|
||||||
std::vector<LearnedAttack*>& GetAttacks() { return _attacks; }
|
std::vector<LearnedAttack*>& GetAttacks() { return _attacks; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue