Revert "Adds support for changing talent by its hash, adds support for loading scripts by their name hash."
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This reverts commit e3c997af31
.
This commit is contained in:
parent
e3c997af31
commit
c208394d18
|
@ -49,8 +49,3 @@ ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScript(const ArbUt::Op
|
|||
const ArbUt::StringView& scriptName) const {
|
||||
return _scriptResolver->LoadScript(owner, category, scriptName).TakeOwnership();
|
||||
}
|
||||
ArbUt::OptionalUniquePtr<BattleScript> BattleLibrary::LoadScriptByHash(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
u32 scriptNameHash) const {
|
||||
return _scriptResolver->LoadScriptByHash(owner, category, scriptNameHash).TakeOwnership();
|
||||
}
|
||||
|
|
|
@ -47,9 +47,6 @@ namespace CreatureLib::Battling {
|
|||
[[nodiscard]] ArbUt::OptionalUniquePtr<BattleScript> LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) const;
|
||||
[[nodiscard]] ArbUt::OptionalUniquePtr<BattleScript>
|
||||
LoadScriptByHash(const ArbUt::OptionalBorrowedPtr<void>& owner, ScriptCategory category,
|
||||
u32 scriptNameHash) const;
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -273,15 +273,6 @@ namespace CreatureLib::Battling {
|
|||
_overridenTalent = _library->GetStaticLib()->GetTalentLibrary()->Get(talent);
|
||||
}
|
||||
|
||||
void Creature::OverrideActiveTalentByHash(u32 talentHash) {
|
||||
_hasOverridenTalent = true;
|
||||
if (_activeTalent.HasValue()) {
|
||||
_activeTalent.GetValue()->OnRemove();
|
||||
_activeTalent = this->_library->LoadScriptByHash(this, ScriptCategory::Talent, talentHash).TakeOwnership();
|
||||
}
|
||||
_overridenTalent = _library->GetStaticLib()->GetTalentLibrary()->GetByHash(talentHash);
|
||||
}
|
||||
|
||||
void Creature::SetType(u8 index, u8 type) noexcept {
|
||||
if (_types.Count() > index) {
|
||||
_types[index] = type;
|
||||
|
|
|
@ -163,7 +163,6 @@ namespace CreatureLib::Battling {
|
|||
void Heal(u32 amount, bool canRevive = false);
|
||||
void RestoreAllAttackUses() noexcept;
|
||||
void OverrideActiveTalent(const ArbUt::StringView& talent);
|
||||
void OverrideActiveTalentByHash(u32 talentHash);
|
||||
void AddExperience(u32 amount);
|
||||
|
||||
void MarkOpponentAsSeen(ArbUt::BorrowedPtr<Creature> creature) { _battleData.SeenOpponents.insert(creature); }
|
||||
|
|
|
@ -18,20 +18,9 @@ namespace CreatureLib::Battling {
|
|||
virtual ~ScriptResolver() = default;
|
||||
|
||||
virtual void Initialize([[maybe_unused]] BattleLibrary* non_null library){};
|
||||
virtual ArbUt::OptionalUniquePtr<BattleScript> LoadScript(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category,
|
||||
const ArbUt::StringView& scriptName) {
|
||||
(void)owner;
|
||||
(void)category;
|
||||
(void)scriptName;
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
virtual ArbUt::OptionalUniquePtr<BattleScript> LoadScriptByHash(const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
ScriptCategory category, u32 scriptNameHash) {
|
||||
(void)owner;
|
||||
(void)category;
|
||||
(void)scriptNameHash;
|
||||
virtual ArbUt::OptionalUniquePtr<BattleScript>
|
||||
LoadScript([[maybe_unused]] const ArbUt::OptionalBorrowedPtr<void>& owner,
|
||||
[[maybe_unused]] ScriptCategory category, [[maybe_unused]] const ArbUt::StringView& scriptName) {
|
||||
return nullptr;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue