Update to newer Arbutils version.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -60,7 +60,7 @@ void TurnHandler::ExecuteAttackChoice(AttackTurnChoice* choice) {
|
||||
|
||||
// FIXME: Resolve all targets
|
||||
auto target = choice->GetUser()->GetBattle()->GetCreature(choice->GetTarget());
|
||||
Arbutils::Collections::List<Creature*> targets = {target};
|
||||
ArbUt::List<Creature*> targets = {target};
|
||||
|
||||
auto attack = new ExecutingAttack(targets, 1, choice->GetUser(), choice->GetAttack(), choice->GetAttackScript());
|
||||
bool prevented = false;
|
||||
|
||||
@@ -29,6 +29,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void TurnOrdering::OrderChoices(std::vector<BaseTurnChoice*>& vec, Arbutils::Random& rand) {
|
||||
void TurnOrdering::OrderChoices(std::vector<BaseTurnChoice*>& vec, ArbUt::Random& rand) {
|
||||
std::sort(vec.begin(), vec.end(), ChoiceCompare());
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
namespace CreatureLib::Battling {
|
||||
class TurnOrdering {
|
||||
public:
|
||||
static void OrderChoices(std::vector<BaseTurnChoice*>& vec, Arbutils::Random& rand);
|
||||
static void OrderChoices(std::vector<BaseTurnChoice*>& vec, ArbUt::Random& rand);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,6 @@ const std::unique_ptr<const DamageLibrary>& BattleLibrary::GetDamageLibrary() co
|
||||
|
||||
const std::unique_ptr<const MiscLibrary>& BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
|
||||
|
||||
Script* BattleLibrary::LoadScript(ScriptCategory category,
|
||||
const Arbutils::CaseInsensitiveConstString& scriptName) const {
|
||||
Script* BattleLibrary::LoadScript(ScriptCategory category, const ArbUt::CaseInsensitiveConstString& scriptName) const {
|
||||
return _scriptResolver->LoadScript(category, scriptName);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace CreatureLib::Battling {
|
||||
}
|
||||
|
||||
[[nodiscard]] Script* LoadScript(ScriptCategory category,
|
||||
const Arbutils::CaseInsensitiveConstString& scriptName) const;
|
||||
const ArbUt::CaseInsensitiveConstString& scriptName) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ bool CreatureLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Execu
|
||||
static CreatureLib::Battling::LearnedAttack* _replacementAttack = nullptr;
|
||||
static std::unique_ptr<const CreatureLib::Library::AttackData> _replacementAttackData = nullptr;
|
||||
|
||||
static borrowed_ptr<const CreatureLib::Library::AttackData> GetReplacementAttackData() {
|
||||
static ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData> GetReplacementAttackData() {
|
||||
if (_replacementAttackData == nullptr) {
|
||||
_replacementAttackData =
|
||||
std::unique_ptr<const CreatureLib::Library::AttackData>(new CreatureLib::Library::AttackData(
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
using namespace CreatureLib;
|
||||
using namespace CreatureLib::Battling;
|
||||
|
||||
const BattleLibrary* Battle::GetLibrary() const noexcept { return _library; }
|
||||
const ArbUt::BorrowedPtr<const BattleLibrary>& Battle::GetLibrary() const noexcept { return _library; }
|
||||
|
||||
bool Battle::CanUse(const BaseTurnChoice* choice) {
|
||||
AssertNotNull(choice)
|
||||
@@ -86,7 +86,7 @@ bool Battle::CreatureInField(const Creature* creature) const {
|
||||
void Battle::ForceRecall(uint8_t side, uint8_t index) { _sides[side]->SetCreature(nullptr, index); }
|
||||
|
||||
size_t Battle::ScriptCount() const { return 1; }
|
||||
void Battle::GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) {
|
||||
void Battle::GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) {
|
||||
scripts.Append(ScriptWrapper::FromSet(&_volatile));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <Arbutils/Assert.hpp>
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include <memory>
|
||||
#include "../EventHooks/EventHook.hpp"
|
||||
#include "../Flow/ChoiceQueue.hpp"
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
@@ -13,17 +14,15 @@
|
||||
#include "BattleSide.hpp"
|
||||
#include "CreatureIndex.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class Battle : public ScriptSource {
|
||||
protected:
|
||||
const BattleLibrary* _library;
|
||||
List<BattleParty*> _parties;
|
||||
ArbUt::BorrowedPtr<const BattleLibrary> _library;
|
||||
ArbUt::List<std::unique_ptr<BattleParty>> _parties;
|
||||
bool _canFlee;
|
||||
uint8_t _numberOfSides;
|
||||
uint8_t _creaturesPerSide;
|
||||
List<BattleSide*> _sides;
|
||||
ArbUt::List<BattleSide*> _sides;
|
||||
BattleRandom _random;
|
||||
ChoiceQueue* _currentTurnQueue = nullptr;
|
||||
bool _hasEnded = false;
|
||||
@@ -34,14 +33,17 @@ namespace CreatureLib::Battling {
|
||||
ScriptSet _volatile;
|
||||
|
||||
public:
|
||||
Battle(const BattleLibrary* library, List<BattleParty*> parties, bool canFlee = true, uint8_t numberOfSides = 2,
|
||||
uint8_t creaturesPerSide = 1)
|
||||
: _library(library), _parties(std::move(parties)), _canFlee(canFlee), _numberOfSides(numberOfSides),
|
||||
Battle(const BattleLibrary* library, ArbUt::List<BattleParty*> parties, bool canFlee = true,
|
||||
uint8_t numberOfSides = 2, uint8_t creaturesPerSide = 1)
|
||||
: _library(library), _parties(parties.Count()), _canFlee(canFlee), _numberOfSides(numberOfSides),
|
||||
_creaturesPerSide(creaturesPerSide) {
|
||||
AssertNotNull(_library);
|
||||
AssertAllNotNull(parties);
|
||||
for (size_t i = 0; i < parties.Count(); i++) {
|
||||
_parties.GetStdList().push_back(std::unique_ptr<BattleParty>(parties[i]));
|
||||
}
|
||||
|
||||
_sides = List<BattleSide*>(numberOfSides);
|
||||
_sides = ArbUt::List<BattleSide*>(numberOfSides);
|
||||
for (size_t i = 0; i < numberOfSides; i++) {
|
||||
_sides.Append(new BattleSide(i, this, creaturesPerSide));
|
||||
}
|
||||
@@ -51,13 +53,10 @@ namespace CreatureLib::Battling {
|
||||
for (auto s : _sides) {
|
||||
delete s;
|
||||
}
|
||||
for (auto party : _parties) {
|
||||
delete party;
|
||||
}
|
||||
delete _currentTurnQueue;
|
||||
}
|
||||
|
||||
[[nodiscard]] const BattleLibrary* GetLibrary() const noexcept;
|
||||
[[nodiscard]] const ArbUt::BorrowedPtr<const BattleLibrary>& GetLibrary() const noexcept;
|
||||
[[nodiscard]] uint32_t GetCurrentTurn() const noexcept { return _currentTurn; }
|
||||
|
||||
virtual bool CanUse(const BaseTurnChoice* choice);
|
||||
@@ -82,14 +81,14 @@ namespace CreatureLib::Battling {
|
||||
bool CanSlotBeFilled(uint8_t side, uint8_t index) const;
|
||||
|
||||
size_t ScriptCount() const override;
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override;
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override;
|
||||
|
||||
void ValidateBattleState();
|
||||
inline bool HasEnded() const noexcept { return _hasEnded; }
|
||||
inline const BattleResult& GetResult() const noexcept { return _battleResult; }
|
||||
|
||||
const List<BattleParty*>& GetParties() const noexcept { return _parties; }
|
||||
const List<BattleSide*>& GetSides() const noexcept { return _sides; }
|
||||
const ArbUt::List<std::unique_ptr<BattleParty>>& GetParties() const noexcept { return _parties; }
|
||||
const ArbUt::List<BattleSide*>& GetSides() const noexcept { return _sides; }
|
||||
Script* GetVolatileScript(const ConstString& key) const { return _volatile.Get(key); }
|
||||
Script* GetVolatileScript(uint32_t keyHash) const noexcept { return _volatile.Get(keyHash); }
|
||||
void AddVolatileScript(const ConstString& key);
|
||||
|
||||
@@ -6,21 +6,19 @@
|
||||
#include "CreatureIndex.hpp"
|
||||
#include "CreatureParty.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class BattleParty {
|
||||
CreatureParty* _party;
|
||||
List<CreatureIndex> _responsibleIndices;
|
||||
ArbUt::List<CreatureIndex> _responsibleIndices;
|
||||
|
||||
public:
|
||||
BattleParty(CreatureParty* party, const List<CreatureIndex>& responsibleIndices)
|
||||
BattleParty(CreatureParty* party, const ArbUt::List<CreatureIndex>& responsibleIndices)
|
||||
: _party(party), _responsibleIndices(responsibleIndices) {
|
||||
AssertNotNull(_party)
|
||||
}
|
||||
|
||||
inline CreatureParty* GetParty() const { return _party; }
|
||||
inline const List<CreatureIndex>& GetResponsibleIndices() const { return _responsibleIndices; }
|
||||
inline const ArbUt::List<CreatureIndex>& GetResponsibleIndices() const { return _responsibleIndices; }
|
||||
|
||||
inline bool IsResponsibleForIndex(const CreatureIndex& index) const {
|
||||
return _responsibleIndices.Contains(index);
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
class BattleRandom {
|
||||
private:
|
||||
Arbutils::Random _random;
|
||||
ArbUt::Random _random;
|
||||
|
||||
public:
|
||||
BattleRandom() noexcept : _random() {}
|
||||
@@ -19,7 +19,7 @@ namespace CreatureLib::Battling {
|
||||
int32_t Get() noexcept { return _random.Get(); }
|
||||
int32_t Get(int32_t max) noexcept { return _random.Get(max); }
|
||||
int32_t Get(int32_t min, int32_t max) noexcept { return _random.Get(min, max); }
|
||||
Arbutils::Random& GetRNG() noexcept { return _random; }
|
||||
ArbUt::Random& GetRNG() noexcept { return _random; }
|
||||
uint_fast32_t GetSeed() const noexcept { return _random.GetSeed(); }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ void BattleSide::ResetChoices() noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
const List<BaseTurnChoice*>& BattleSide::GetChoices() const noexcept { return _choices; }
|
||||
const ArbUt::List<BaseTurnChoice*>& BattleSide::GetChoices() const noexcept { return _choices; }
|
||||
|
||||
void BattleSide::SetChoice(BaseTurnChoice* choice) {
|
||||
AssertNotNull(choice)
|
||||
@@ -69,7 +69,7 @@ bool BattleSide::CreatureOnSide(const Creature* creature) const {
|
||||
|
||||
Creature* BattleSide::GetCreature(uint8_t index) const { return _creatures[index]; }
|
||||
|
||||
void BattleSide::GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) {
|
||||
void BattleSide::GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) {
|
||||
scripts.Append(ScriptWrapper::FromSet(&_volatile));
|
||||
_battle->GetActiveScripts(scripts);
|
||||
}
|
||||
|
||||
@@ -7,15 +7,13 @@
|
||||
#include "../TurnChoices/BaseTurnChoice.hpp"
|
||||
#include "Creature.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class BattleSide : public ScriptSource {
|
||||
uint8_t _index;
|
||||
uint8_t _creaturesPerSide;
|
||||
List<Creature*> _creatures;
|
||||
List<BaseTurnChoice*> _choices;
|
||||
List<bool> _fillableSlots;
|
||||
ArbUt::List<Creature*> _creatures;
|
||||
ArbUt::List<BaseTurnChoice*> _choices;
|
||||
ArbUt::List<bool> _fillableSlots;
|
||||
uint8_t _choicesSet = 0;
|
||||
ScriptSet _volatile;
|
||||
Battle* _battle;
|
||||
@@ -36,7 +34,7 @@ namespace CreatureLib::Battling {
|
||||
virtual ~BattleSide() = default;
|
||||
|
||||
[[nodiscard]] bool AllChoicesSet() const noexcept;
|
||||
[[nodiscard]] const List<BaseTurnChoice*>& GetChoices() const noexcept;
|
||||
[[nodiscard]] const ArbUt::List<BaseTurnChoice*>& GetChoices() const noexcept;
|
||||
|
||||
[[nodiscard]] bool AllPossibleSlotsFilled() const;
|
||||
|
||||
@@ -49,9 +47,9 @@ namespace CreatureLib::Battling {
|
||||
bool CreatureOnSide(const Creature* creature) const;
|
||||
|
||||
size_t ScriptCount() const override;
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override;
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override;
|
||||
|
||||
const List<Creature*>& GetCreatures() { return _creatures; }
|
||||
const ArbUt::List<Creature*>& GetCreatures() { return _creatures; }
|
||||
|
||||
uint8_t GetSideIndex() noexcept { return _index; }
|
||||
uint8_t GetCreatureIndex(Creature* c) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
using namespace CreatureLib::Battling;
|
||||
|
||||
CreateCreature CreateCreature::WithVariant(const Arbutils::CaseInsensitiveConstString& variant) {
|
||||
CreateCreature CreateCreature::WithVariant(const ArbUt::CaseInsensitiveConstString& variant) {
|
||||
this->_variant = variant;
|
||||
return *this;
|
||||
}
|
||||
@@ -20,7 +20,7 @@ CreateCreature CreateCreature::WithGender(Library::Gender gender) {
|
||||
return *this;
|
||||
}
|
||||
|
||||
CreateCreature CreateCreature::WithAttack(const Arbutils::CaseInsensitiveConstString& attackName,
|
||||
CreateCreature CreateCreature::WithAttack(const ArbUt::CaseInsensitiveConstString& attackName,
|
||||
AttackLearnMethod learnMethod) {
|
||||
if (_attacks.Count() >= _library->GetSettings()->GetMaximalMoves())
|
||||
throw CreatureException("You have already set the maximum amount of allowed moves.");
|
||||
@@ -31,7 +31,7 @@ CreateCreature CreateCreature::WithAttack(const Arbutils::CaseInsensitiveConstSt
|
||||
}
|
||||
|
||||
Creature* CreateCreature::Create() {
|
||||
auto rand = Arbutils::Random();
|
||||
auto rand = ArbUt::Random();
|
||||
auto species = this->_library->GetSpeciesLibrary()->Get(this->_species.GetHash());
|
||||
auto variant = species->GetVariant(this->_variant);
|
||||
Library::TalentIndex talent;
|
||||
@@ -48,7 +48,7 @@ Creature* CreateCreature::Create() {
|
||||
if (gender == static_cast<Library::Gender>(-1)) {
|
||||
gender = species->GetRandomGender(rand);
|
||||
}
|
||||
borrowed_ptr<const Library::Item> heldItem;
|
||||
ArbUt::BorrowedPtr<const Library::Item> heldItem;
|
||||
if (!this->_heldItem.Empty()) {
|
||||
if (!_library->GetItemLibrary()->TryGet(this->_heldItem.GetHash(), heldItem)) {
|
||||
throw CreatureException("Invalid held item.");
|
||||
@@ -56,7 +56,7 @@ Creature* CreateCreature::Create() {
|
||||
}
|
||||
auto experience = _library->GetGrowthRateLibrary()->CalculateExperience(species->GetGrowthRate(), _level);
|
||||
|
||||
auto attacks = List<LearnedAttack*>(_attacks.Count());
|
||||
auto attacks = ArbUt::List<LearnedAttack*>(_attacks.Count());
|
||||
for (size_t i = 0; i < _attacks.Count(); i++) {
|
||||
auto kv = _attacks[i];
|
||||
attacks.Append(new LearnedAttack(std::get<0>(kv), std::get<1>(kv)));
|
||||
|
||||
@@ -6,33 +6,30 @@
|
||||
#include "../Library/BattleLibrary.hpp"
|
||||
#include "Creature.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class CreateCreature {
|
||||
const BattleLibrary* _library;
|
||||
Arbutils::CaseInsensitiveConstString _species;
|
||||
Arbutils::CaseInsensitiveConstString _variant = "default"_cnc;
|
||||
ArbUt::CaseInsensitiveConstString _species;
|
||||
ArbUt::CaseInsensitiveConstString _variant = "default"_cnc;
|
||||
uint8_t _level;
|
||||
std::string _nickname = "";
|
||||
|
||||
Arbutils::CaseInsensitiveConstString _talent = ""_cnc;
|
||||
ArbUt::CaseInsensitiveConstString _talent = ""_cnc;
|
||||
Library::Gender _gender = static_cast<Library::Gender>(-1);
|
||||
uint8_t _coloring = 0;
|
||||
Arbutils::CaseInsensitiveConstString _heldItem = ""_cnc;
|
||||
ArbUt::CaseInsensitiveConstString _heldItem = ""_cnc;
|
||||
uint32_t _identifier = 0;
|
||||
List<std::tuple<borrowed_ptr<const Library::AttackData>, AttackLearnMethod>> _attacks;
|
||||
ArbUt::List<std::tuple<ArbUt::BorrowedPtr<const Library::AttackData>, AttackLearnMethod>> _attacks;
|
||||
|
||||
public:
|
||||
CreateCreature(const BattleLibrary* library, const Arbutils::CaseInsensitiveConstString& species, uint8_t level)
|
||||
CreateCreature(const BattleLibrary* library, const ArbUt::CaseInsensitiveConstString& species, uint8_t level)
|
||||
: _library(library), _species(species), _level(level), _attacks(library->GetSettings()->GetMaximalMoves()) {
|
||||
}
|
||||
|
||||
CreateCreature WithVariant(const Arbutils::CaseInsensitiveConstString& variant);
|
||||
CreateCreature WithVariant(const ArbUt::CaseInsensitiveConstString& variant);
|
||||
CreateCreature WithNickname(std::string nickname);
|
||||
CreateCreature WithGender(Library::Gender gender);
|
||||
CreateCreature WithAttack(const Arbutils::CaseInsensitiveConstString& attackName,
|
||||
AttackLearnMethod learnMethod);
|
||||
CreateCreature WithAttack(const ArbUt::CaseInsensitiveConstString& attackName, AttackLearnMethod learnMethod);
|
||||
|
||||
Creature* Create();
|
||||
};
|
||||
|
||||
@@ -6,11 +6,12 @@
|
||||
|
||||
using namespace CreatureLib;
|
||||
|
||||
Battling::Creature::Creature(const BattleLibrary* library, const borrowed_ptr<const Library::CreatureSpecies>& species,
|
||||
const borrowed_ptr<const Library::SpeciesVariant>& variant, uint8_t level,
|
||||
Battling::Creature::Creature(const BattleLibrary* library,
|
||||
const ArbUt::BorrowedPtr<const Library::CreatureSpecies>& species,
|
||||
const ArbUt::BorrowedPtr<const Library::SpeciesVariant>& variant, uint8_t level,
|
||||
uint32_t experience, uint32_t uid, Library::Gender gender, uint8_t coloring,
|
||||
const borrowed_ptr<const Library::Item> heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, const List<LearnedAttack*>& attacks,
|
||||
const ArbUt::BorrowedPtr<const Library::Item> heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, const ArbUt::List<LearnedAttack*>& attacks,
|
||||
bool allowedExperienceGain)
|
||||
: _library(library), _species(species), _variant(variant), _level(level), _experience(experience),
|
||||
_uniqueIdentifier(uid), _gender(gender), _coloring(coloring), _heldItem(heldItem), _nickname(std::move(nickname)),
|
||||
@@ -146,7 +147,7 @@ void Battling::Creature::OverrideActiveTalent(const ConstString& talent) {
|
||||
_activeTalent = this->_library->LoadScript(ScriptCategory::Talent, talent);
|
||||
}
|
||||
|
||||
const List<uint8_t>& Battling::Creature::GetTypes() const noexcept {
|
||||
const ArbUt::List<uint8_t>& Battling::Creature::GetTypes() const noexcept {
|
||||
// HOOK: override types.
|
||||
return this->_variant->GetTypes();
|
||||
}
|
||||
@@ -164,7 +165,7 @@ size_t Battling::Creature::ScriptCount() const {
|
||||
return c;
|
||||
}
|
||||
|
||||
void Battling::Creature::GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) {
|
||||
void Battling::Creature::GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) {
|
||||
scripts.Append(ScriptWrapper::FromScript(&_activeTalent));
|
||||
scripts.Append(ScriptWrapper::FromScript(&_status));
|
||||
scripts.Append(ScriptWrapper::FromSet(&_volatile));
|
||||
@@ -186,27 +187,27 @@ void Battling::Creature::AddExperience(uint32_t amount) {
|
||||
_experience = exp;
|
||||
_level = level;
|
||||
}
|
||||
borrowed_ptr<const Library::CreatureSpecies> Battling::Creature::GetDisplaySpecies() const noexcept {
|
||||
ArbUt::BorrowedPtr<const Library::CreatureSpecies> Battling::Creature::GetDisplaySpecies() const noexcept {
|
||||
auto species = _displaySpecies;
|
||||
if (species == nullptr)
|
||||
species = _species;
|
||||
return species;
|
||||
}
|
||||
borrowed_ptr<const Library::SpeciesVariant> Battling::Creature::GetDisplayVariant() const noexcept {
|
||||
ArbUt::BorrowedPtr<const Library::SpeciesVariant> Battling::Creature::GetDisplayVariant() const noexcept {
|
||||
auto variant = _displayVariant;
|
||||
if (variant == nullptr)
|
||||
variant = _variant;
|
||||
return variant;
|
||||
}
|
||||
void Battling::Creature::SetHeldItem(const ConstString& itemName) {
|
||||
borrowed_ptr<const Library::Item> item;
|
||||
ArbUt::BorrowedPtr<const Library::Item> item;
|
||||
if (!_library->GetItemLibrary()->TryGet(itemName.GetHash(), item)) {
|
||||
throw CreatureException("Item not found.");
|
||||
}
|
||||
_heldItem = item;
|
||||
}
|
||||
void Battling::Creature::SetHeldItem(uint32_t itemNameHash) {
|
||||
borrowed_ptr<const Library::Item> item;
|
||||
ArbUt::BorrowedPtr<const Library::Item> item;
|
||||
if (!_library->GetItemLibrary()->TryGet(itemNameHash, item)) {
|
||||
throw CreatureException("Item not found.");
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define CREATURELIB_BATTLECREATURE_HPP
|
||||
|
||||
#include <Arbutils/Collections/List.hpp>
|
||||
#include <Arbutils/Memory/borrowed_ptr.hpp>
|
||||
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||
#include "../../Library/ClampedStatisticSet.hpp"
|
||||
#include "../../Library/CreatureData/CreatureSpecies.hpp"
|
||||
#include "../../Library/Items/Item.hpp"
|
||||
@@ -12,8 +12,6 @@
|
||||
#include "DamageSource.hpp"
|
||||
#include "LearnedAttack.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
// Forward declare battle class
|
||||
class Battle;
|
||||
@@ -24,18 +22,18 @@ namespace CreatureLib::Battling {
|
||||
protected:
|
||||
const BattleLibrary* _library;
|
||||
|
||||
borrowed_ptr<const Library::CreatureSpecies> _species;
|
||||
borrowed_ptr<const Library::SpeciesVariant> _variant;
|
||||
ArbUt::BorrowedPtr<const Library::CreatureSpecies> _species;
|
||||
ArbUt::BorrowedPtr<const Library::SpeciesVariant> _variant;
|
||||
|
||||
borrowed_ptr<const Library::CreatureSpecies> _displaySpecies = nullptr;
|
||||
borrowed_ptr<const Library::SpeciesVariant> _displayVariant = nullptr;
|
||||
ArbUt::BorrowedPtr<const Library::CreatureSpecies> _displaySpecies = nullptr;
|
||||
ArbUt::BorrowedPtr<const Library::SpeciesVariant> _displayVariant = nullptr;
|
||||
|
||||
uint8_t _level;
|
||||
uint32_t _experience;
|
||||
uint32_t _uniqueIdentifier;
|
||||
Library::Gender _gender;
|
||||
uint8_t _coloring;
|
||||
borrowed_ptr<const Library::Item> _heldItem;
|
||||
ArbUt::BorrowedPtr<const Library::Item> _heldItem;
|
||||
uint32_t _currentHealth;
|
||||
|
||||
Library::ClampedStatisticSet<int8_t, -6, 6> _statBoost;
|
||||
@@ -51,10 +49,10 @@ namespace CreatureLib::Battling {
|
||||
Script* _activeTalent = nullptr;
|
||||
|
||||
bool _hasOverridenTalent;
|
||||
ConstString _overridenTalentName = ""_cnc;
|
||||
ArbUt::CaseInsensitiveConstString _overridenTalentName = ""_cnc;
|
||||
std::unordered_set<Creature*> _seenOpponents = {};
|
||||
|
||||
List<LearnedAttack*> _attacks;
|
||||
ArbUt::List<LearnedAttack*> _attacks;
|
||||
bool _allowedExperienceGain;
|
||||
|
||||
Script* _status = nullptr;
|
||||
@@ -64,11 +62,11 @@ namespace CreatureLib::Battling {
|
||||
void OnFaint();
|
||||
|
||||
public:
|
||||
Creature(const BattleLibrary* library, const borrowed_ptr<const Library::CreatureSpecies>& species,
|
||||
const borrowed_ptr<const Library::SpeciesVariant>& variant, uint8_t level, uint32_t experience,
|
||||
Creature(const BattleLibrary* library, const ArbUt::BorrowedPtr<const Library::CreatureSpecies>& species,
|
||||
const ArbUt::BorrowedPtr<const Library::SpeciesVariant>& variant, uint8_t level, uint32_t experience,
|
||||
uint32_t uid, Library::Gender gender, uint8_t coloring,
|
||||
const borrowed_ptr<const Library::Item> heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, const List<LearnedAttack*>& attacks,
|
||||
const ArbUt::BorrowedPtr<const Library::Item> heldItem, std::string nickname,
|
||||
const Library::TalentIndex& talent, const ArbUt::List<LearnedAttack*>& attacks,
|
||||
bool allowedExperienceGain = true);
|
||||
|
||||
virtual ~Creature() {
|
||||
@@ -84,22 +82,24 @@ namespace CreatureLib::Battling {
|
||||
_currentHealth = GetBoostedStat(Library::Statistic::Health);
|
||||
}
|
||||
|
||||
inline const borrowed_ptr<const Library::CreatureSpecies>& GetSpecies() const noexcept { return _species; }
|
||||
inline const borrowed_ptr<const Library::SpeciesVariant>& GetVariant() const noexcept { return _variant; }
|
||||
inline const ArbUt::BorrowedPtr<const Library::CreatureSpecies>& GetSpecies() const noexcept {
|
||||
return _species;
|
||||
}
|
||||
inline const ArbUt::BorrowedPtr<const Library::SpeciesVariant>& GetVariant() const noexcept { return _variant; }
|
||||
inline uint8_t GetLevel() const noexcept { return _level; }
|
||||
inline uint32_t GetExperience() const noexcept { return _experience; }
|
||||
inline Library::Gender GetGender() const noexcept { return _gender; }
|
||||
inline uint8_t GetColoring() const noexcept { return _coloring; }
|
||||
inline bool HasHeldItem(const ConstString& name) const noexcept {
|
||||
inline bool HasHeldItem(const ArbUt::CaseInsensitiveConstString& name) const noexcept {
|
||||
return _heldItem != nullptr && _heldItem->GetName() == name;
|
||||
}
|
||||
inline bool HasHeldItem(uint32_t nameHash) const noexcept {
|
||||
return _heldItem != nullptr && _heldItem->GetName() == nameHash;
|
||||
}
|
||||
inline const borrowed_ptr<const Library::Item>& GetHeldItem() const noexcept { return _heldItem; }
|
||||
void SetHeldItem(const ConstString& itemName);
|
||||
inline const ArbUt::BorrowedPtr<const Library::Item>& GetHeldItem() const noexcept { return _heldItem; }
|
||||
void SetHeldItem(const ArbUt::CaseInsensitiveConstString& itemName);
|
||||
void SetHeldItem(uint32_t itemNameHash);
|
||||
inline void SetHeldItem(const borrowed_ptr<const Library::Item>& item) noexcept { _heldItem = item; };
|
||||
inline void SetHeldItem(const ArbUt::BorrowedPtr<const Library::Item>& item) noexcept { _heldItem = item; };
|
||||
|
||||
inline uint32_t GetCurrentHealth() const noexcept { return _currentHealth; }
|
||||
|
||||
@@ -110,37 +110,37 @@ namespace CreatureLib::Battling {
|
||||
bool IsOnBattleField() const { return _onBattleField; }
|
||||
|
||||
const std::string& GetNickname() const noexcept { return _nickname; }
|
||||
const ConstString& GetActiveTalent() const;
|
||||
const ArbUt::CaseInsensitiveConstString& GetActiveTalent() const;
|
||||
|
||||
[[nodiscard]] bool IsFainted() const noexcept;
|
||||
[[nodiscard]] const List<uint8_t>& GetTypes() const noexcept;
|
||||
[[nodiscard]] const ArbUt::List<uint8_t>& GetTypes() const noexcept;
|
||||
[[nodiscard]] bool HasType(uint8_t type) const noexcept;
|
||||
|
||||
uint32_t GetMaxHealth() const noexcept { return _boostedStats.GetHealth(); }
|
||||
void ChangeLevelBy(int8_t amount);
|
||||
void Damage(uint32_t damage, DamageSource source);
|
||||
void Heal(uint32_t amount, bool canRevive = false);
|
||||
void OverrideActiveTalent(const ConstString& talent);
|
||||
void OverrideActiveTalent(const ArbUt::CaseInsensitiveConstString& talent);
|
||||
void AddExperience(uint32_t amount);
|
||||
|
||||
void MarkOpponentAsSeen(Creature* creature) { _seenOpponents.insert(creature); }
|
||||
const std::unordered_set<Creature*>& GetSeenOpponents() const { return _seenOpponents; }
|
||||
|
||||
size_t ScriptCount() const override;
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override;
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override;
|
||||
void ClearVolatileScripts();
|
||||
void AddVolatileScript(const ConstString& name);
|
||||
void AddVolatileScript(const ArbUt::CaseInsensitiveConstString& name);
|
||||
void AddVolatileScript(Script* script);
|
||||
void RemoveVolatileScript(const ConstString& name);
|
||||
void RemoveVolatileScript(const ArbUt::CaseInsensitiveConstString& name);
|
||||
void RemoveVolatileScript(Script* script);
|
||||
bool HasVolatileScript(const ConstString& name) const;
|
||||
bool HasVolatileScript(const ArbUt::CaseInsensitiveConstString& name) const;
|
||||
|
||||
const List<LearnedAttack*>& GetAttacks() noexcept { return _attacks; }
|
||||
const ArbUt::List<LearnedAttack*>& GetAttacks() noexcept { return _attacks; }
|
||||
|
||||
borrowed_ptr<const Library::CreatureSpecies> GetDisplaySpecies() const noexcept;
|
||||
borrowed_ptr<const Library::SpeciesVariant> GetDisplayVariant() const noexcept;
|
||||
ArbUt::BorrowedPtr<const Library::CreatureSpecies> GetDisplaySpecies() const noexcept;
|
||||
ArbUt::BorrowedPtr<const Library::SpeciesVariant> GetDisplayVariant() const noexcept;
|
||||
|
||||
void SetDisplaySpecies(const borrowed_ptr<const Library::CreatureSpecies>& species) noexcept {
|
||||
void SetDisplaySpecies(const ArbUt::BorrowedPtr<const Library::CreatureSpecies>& species) noexcept {
|
||||
_displaySpecies = species;
|
||||
}
|
||||
void SetDisplayVariant(const Library::SpeciesVariant* variant) noexcept { _displayVariant = variant; };
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class CreatureParty {
|
||||
Arbutils::Collections::List<Creature*> _party;
|
||||
ArbUt::List<Creature*> _party;
|
||||
|
||||
public:
|
||||
CreatureParty(size_t size) noexcept : _party(size) {}
|
||||
CreatureParty(Arbutils::Collections::List<Creature*> party) noexcept : _party(party) {}
|
||||
CreatureParty(ArbUt::List<Creature*> party) noexcept : _party(party) {}
|
||||
CreatureParty(std::initializer_list<Creature*> party) noexcept : _party(party) {}
|
||||
|
||||
virtual ~CreatureParty() noexcept {
|
||||
@@ -38,8 +38,8 @@ namespace CreatureLib::Battling {
|
||||
return false;
|
||||
}
|
||||
|
||||
Arbutils::Collections::List<Creature*>& GetParty() noexcept { return _party; }
|
||||
const Arbutils::Collections::List<Creature*>& GetParty() const noexcept { return _party; }
|
||||
ArbUt::List<Creature*>& GetParty() noexcept { return _party; }
|
||||
const ArbUt::List<Creature*>& GetParty() const noexcept { return _party; }
|
||||
|
||||
size_t GetLength() const noexcept { return _party.Count(); }
|
||||
};
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include <vector>
|
||||
#include "Creature.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class ExecutingAttack : public ScriptSource {
|
||||
public:
|
||||
@@ -38,16 +36,16 @@ namespace CreatureLib::Battling {
|
||||
};
|
||||
|
||||
private:
|
||||
List<Creature*> _targets;
|
||||
ArbUt::List<Creature*> _targets;
|
||||
uint8_t _numberHits;
|
||||
List<HitData> _hits;
|
||||
ArbUt::List<HitData> _hits;
|
||||
Creature* _user;
|
||||
LearnedAttack* _attack;
|
||||
Script* _script;
|
||||
|
||||
public:
|
||||
ExecutingAttack(const List<Creature*>& targets, uint8_t numberHits, Creature* user, LearnedAttack* attack,
|
||||
Script* script)
|
||||
ExecutingAttack(const ArbUt::List<Creature*>& targets, uint8_t numberHits, Creature* user,
|
||||
LearnedAttack* attack, Script* script)
|
||||
: _targets(targets.Count()), _numberHits(numberHits), _hits(targets.Count() * numberHits), _user(user),
|
||||
_attack(attack), _script(script) {
|
||||
AssertNotNull(user)
|
||||
@@ -79,7 +77,7 @@ namespace CreatureLib::Battling {
|
||||
}
|
||||
|
||||
bool IsCreatureTarget(Creature* creature) noexcept { return _targets.IndexOf(creature) != (size_t)-1; }
|
||||
const List<Creature*>& GetTargets() noexcept { return _targets; }
|
||||
const ArbUt::List<Creature*>& GetTargets() noexcept { return _targets; }
|
||||
uint8_t GetNumberOfHits() const noexcept { return _numberHits; }
|
||||
|
||||
Creature* GetUser() noexcept { return _user; }
|
||||
@@ -88,7 +86,7 @@ namespace CreatureLib::Battling {
|
||||
size_t ScriptCount() const override { return _user->ScriptCount() + 1; }
|
||||
|
||||
protected:
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override {
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override {
|
||||
scripts.Append(ScriptWrapper::FromScript(&_script));
|
||||
_user->GetActiveScripts(scripts);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
#include "LearnedAttack.hpp"
|
||||
#include <Arbutils/Assert.hpp>
|
||||
CreatureLib::Battling::LearnedAttack::LearnedAttack(const borrowed_ptr<const CreatureLib::Library::AttackData>& attack,
|
||||
uint8_t maxUses, AttackLearnMethod learnMethod)
|
||||
CreatureLib::Battling::LearnedAttack::LearnedAttack(
|
||||
const ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>& attack, uint8_t maxUses,
|
||||
AttackLearnMethod learnMethod)
|
||||
: _attack(attack), _maxUses(maxUses), _remainingUses(maxUses), _learnMethod(learnMethod) {
|
||||
AssertNotNull(_attack)
|
||||
}
|
||||
|
||||
CreatureLib::Battling::LearnedAttack::LearnedAttack(const borrowed_ptr<const CreatureLib::Library::AttackData>& attack,
|
||||
AttackLearnMethod learnMethod)
|
||||
CreatureLib::Battling::LearnedAttack::LearnedAttack(
|
||||
const ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>& attack, AttackLearnMethod learnMethod)
|
||||
: _attack(attack), _maxUses(attack->GetBaseUsages()), _remainingUses(_maxUses), _learnMethod(learnMethod) {
|
||||
AssertNotNull(_attack)
|
||||
}
|
||||
|
||||
const borrowed_ptr<const CreatureLib::Library::AttackData>&
|
||||
const ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>&
|
||||
CreatureLib::Battling::LearnedAttack::GetAttack() const noexcept {
|
||||
return _attack;
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
#ifndef CREATURELIB_LEARNEDATTACK_HPP
|
||||
#define CREATURELIB_LEARNEDATTACK_HPP
|
||||
|
||||
#include <Arbutils/Memory/borrowed_ptr.hpp>
|
||||
#include <Arbutils/Memory/BorrowedPtr.hpp>
|
||||
#include <memory>
|
||||
#include "../../Library/Attacks/AttackData.hpp"
|
||||
#include "AttackLearnMethod.hpp"
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class LearnedAttack {
|
||||
borrowed_ptr<const Library::AttackData> _attack;
|
||||
ArbUt::BorrowedPtr<const Library::AttackData> _attack;
|
||||
uint8_t _maxUses;
|
||||
uint8_t _remainingUses;
|
||||
AttackLearnMethod _learnMethod;
|
||||
|
||||
public:
|
||||
LearnedAttack(const borrowed_ptr<const CreatureLib::Library::AttackData>& attack, uint8_t maxUses,
|
||||
LearnedAttack(const ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>& attack, uint8_t maxUses,
|
||||
AttackLearnMethod learnMethod);
|
||||
LearnedAttack(const borrowed_ptr<const CreatureLib::Library::AttackData>& attack,
|
||||
LearnedAttack(const ArbUt::BorrowedPtr<const CreatureLib::Library::AttackData>& attack,
|
||||
AttackLearnMethod learnMethod);
|
||||
|
||||
virtual ~LearnedAttack() = default;
|
||||
|
||||
const borrowed_ptr<const Library::AttackData>& GetAttack() const noexcept;
|
||||
const ArbUt::BorrowedPtr<const Library::AttackData>& GetAttack() const noexcept;
|
||||
uint8_t GetMaxUses() const noexcept;
|
||||
uint8_t GetRemainingUses() const noexcept;
|
||||
AttackLearnMethod GetLearnMethod() const noexcept;
|
||||
|
||||
@@ -5,8 +5,6 @@
|
||||
#include <Arbutils/ConstString.hpp>
|
||||
#include "../../Library/EffectParameter.hpp"
|
||||
|
||||
using ConstString = Arbutils::CaseInsensitiveConstString;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class BaseTurnChoice;
|
||||
class AttackTurnChoice;
|
||||
@@ -21,13 +19,12 @@ namespace CreatureLib::Battling {
|
||||
virtual void Stack(){};
|
||||
virtual void OnRemove(){};
|
||||
|
||||
virtual const ConstString& GetName() const noexcept = 0;
|
||||
virtual const ArbUt::CaseInsensitiveConstString& GetName() const noexcept = 0;
|
||||
|
||||
virtual void
|
||||
OnInitialize(const Arbutils::Collections::List<CreatureLib::Library::EffectParameter*>& parameters){};
|
||||
virtual void OnInitialize(const ArbUt::List<CreatureLib::Library::EffectParameter*>& parameters){};
|
||||
virtual void OnBeforeTurn(const BaseTurnChoice* choice){};
|
||||
|
||||
virtual void ChangeAttack(AttackTurnChoice* choice, ConstString* outAttack){};
|
||||
virtual void ChangeAttack(AttackTurnChoice* choice, ArbUt::CaseInsensitiveConstString* outAttack){};
|
||||
virtual void PreventAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
virtual void FailAttack(ExecutingAttack* attack, bool* outFailed){};
|
||||
virtual void StopBeforeAttack(ExecutingAttack* attack, bool* outResult){};
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "ScriptSet.hpp"
|
||||
#include "ScriptWrapper.hpp"
|
||||
|
||||
using namespace Arbutils::Collections;
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptAggregator {
|
||||
const ScriptWrapper* _scripts;
|
||||
@@ -18,7 +16,7 @@ namespace CreatureLib::Battling {
|
||||
|
||||
public:
|
||||
ScriptAggregator(){};
|
||||
explicit ScriptAggregator(const List<ScriptWrapper>& scripts)
|
||||
explicit ScriptAggregator(const ArbUt::List<ScriptWrapper>& scripts)
|
||||
: _scripts(scripts.RawData()), _size(scripts.Count()){};
|
||||
|
||||
inline void Reset() {
|
||||
|
||||
@@ -14,7 +14,9 @@ namespace CreatureLib::Battling {
|
||||
virtual ~ScriptResolver() = default;
|
||||
|
||||
virtual void Initialize(BattleLibrary* library){};
|
||||
virtual Script* LoadScript(ScriptCategory category, const ConstString& scriptName) const { return nullptr; };
|
||||
virtual Script* LoadScript(ScriptCategory category, const ArbUt::CaseInsensitiveConstString& scriptName) const {
|
||||
return nullptr;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptSet {
|
||||
Arbutils::Collections::List<Script*> _scripts;
|
||||
Arbutils::Collections::Dictionary<uint32_t, size_t> _lookup;
|
||||
ArbUt::List<Script*> _scripts;
|
||||
ArbUt::Dictionary<uint32_t, size_t> _lookup;
|
||||
|
||||
public:
|
||||
~ScriptSet() {
|
||||
@@ -33,7 +33,7 @@ namespace CreatureLib::Battling {
|
||||
_lookup.Insert(script->GetName(), _scripts.Count() - 1);
|
||||
}
|
||||
|
||||
Script* Get(const ConstString& key) const { return Get(key.GetHash()); }
|
||||
Script* Get(const ArbUt::CaseInsensitiveConstString& key) const { return Get(key.GetHash()); }
|
||||
|
||||
Script* Get(uint32_t keyHash) const noexcept {
|
||||
size_t v;
|
||||
@@ -43,7 +43,7 @@ namespace CreatureLib::Battling {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Remove(const ConstString& key) { Remove(key.GetHash()); }
|
||||
void Remove(const ArbUt::CaseInsensitiveConstString& key) { Remove(key.GetHash()); }
|
||||
|
||||
void Remove(uint32_t keyHash) {
|
||||
size_t v;
|
||||
@@ -65,13 +65,13 @@ namespace CreatureLib::Battling {
|
||||
_lookup.Clear();
|
||||
}
|
||||
|
||||
bool Has(const ConstString& key) const { return _lookup.Has(key); }
|
||||
bool Has(const ArbUt::CaseInsensitiveConstString& key) const { return _lookup.Has(key); }
|
||||
|
||||
bool Has(uint32_t keyHash) const { return _lookup.Has(keyHash); }
|
||||
|
||||
inline size_t Count() const { return _scripts.Count(); }
|
||||
|
||||
const Arbutils::Collections::List<Script*>* GetIterator() const { return &_scripts; }
|
||||
const ArbUt::List<Script*>* GetIterator() const { return &_scripts; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
namespace CreatureLib::Battling {
|
||||
class ScriptSource {
|
||||
bool _areScriptsInitialized = false;
|
||||
List<ScriptWrapper> _scripts;
|
||||
ArbUt::List<ScriptWrapper> _scripts;
|
||||
ScriptAggregator _scriptsIterator;
|
||||
|
||||
protected:
|
||||
virtual void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) = 0;
|
||||
virtual void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) = 0;
|
||||
void ResetActiveScripts() { _areScriptsInitialized = false; }
|
||||
|
||||
public:
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace CreatureLib::Battling {
|
||||
size_t ScriptCount() const override { return 1 + GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override {
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override {
|
||||
scripts.Append(ScriptWrapper::FromScript(&_attackScript));
|
||||
GetUser()->GetActiveScripts(scripts);
|
||||
}
|
||||
|
||||
@@ -13,9 +13,7 @@ namespace CreatureLib::Battling {
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override {
|
||||
GetUser()->GetActiveScripts(scripts);
|
||||
}
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override { GetUser()->GetActiveScripts(scripts); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -12,9 +12,7 @@ namespace CreatureLib::Battling {
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override {
|
||||
GetUser()->GetActiveScripts(scripts);
|
||||
}
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override { GetUser()->GetActiveScripts(scripts); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -16,9 +16,7 @@ namespace CreatureLib::Battling {
|
||||
size_t ScriptCount() const override { return GetUser()->ScriptCount(); }
|
||||
|
||||
protected:
|
||||
void GetActiveScripts(Arbutils::Collections::List<ScriptWrapper>& scripts) override {
|
||||
GetUser()->GetActiveScripts(scripts);
|
||||
}
|
||||
void GetActiveScripts(ArbUt::List<ScriptWrapper>& scripts) override { GetUser()->GetActiveScripts(scripts); }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user