#pragma once #include #include #include "Entity.h" #include "ModifierInstance.h" #include "EntityTemplate.h" #include "UpgradeTriggerType.h" #include namespace nejlika { class AdditionalEntityData { public: AdditionalEntityData() = default; AdditionalEntityData(LWOOBJID id, LOT lot) : id(id), lot(lot) {} float CalculateModifier(ModifierType type, ModifierOperator op, bool resistance) const; float CalculateModifier(ModifierType type, std::vector& additionalModifiers, ModifierOperator op, bool resistance) const; float CalculateModifier(ModifierType type, int32_t level) const; float CalculateModifier(ModifierType type) const; float CalculateModifier(ModifierType type, std::vector& additionalModifiers, int32_t level) const; float CalculateResistance(ModifierType type) const; void ApplyToEntity(); void CheckForRescale(AdditionalEntityData* other); int32_t GetLevel() const { return level; } LWOOBJID GetID() const { return id; } LOT GetLOT() const { return lot; } const std::unordered_set& GetUpgradeItems() const { return upgradeItems; } void AddUpgradeItem(LWOOBJID id) { upgradeItems.insert(id); } void RemoveUpgradeItem(LWOOBJID id) { upgradeItems.erase(id); } std::vector TriggerUpgradeItems(UpgradeTriggerType triggerType); private: void RollStandardModifiers(int32_t level); bool initialized = false; std::vector standardModifiers; std::vector activeModifiers; std::unordered_set upgradeItems; LWOOBJID id; LOT lot; int32_t level = 1; }; }