#pragma once #include #include #include "Entity.h" #include "ModifierInstance.h" #include "EntityTemplate.h" #include "UpgradeTriggerType.h" #include "TriggerParameters.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; /** * @brief Calculate the multiplier for a given modifier type. With a base value of 1.0. * * @param type The modifier type. * @return The multiplier. */ float CalculateMultiplier(ModifierType type) const; /** * @brief Calculate the multiplier for a given modifier type. With a base value of 1.0. * * @param type The modifier type. * @param additionalModifiers Additional modifiers to apply. * @return The multiplier. */ float CalculateMultiplier(ModifierType type, std::vector& additionalModifiers) const; /** * @brief Calculate damage conversation mapping. * * @param additionalModifiers Additional modifiers to apply. * * @return The damage conversion mapping. */ std::unordered_map> CalculateDamageConversion(std::vector& additionalModifiers) 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, const TriggerParameters& params); std::vector TriggerUpgradeItems(UpgradeTriggerType triggerType); void InitializeSkills(); void AddSkills(LWOOBJID item); void RemoveSkills(LOT lot); 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; }; }