#pragma once #include "ModifierTemplate.h" #include "UpgradeTriggerType.h" #include "UpgradeTriggerCondition.h" #include #include namespace nejlika { class UpgradeEffect { public: UpgradeEffect(const nlohmann::json& json); nlohmann::json ToJson() const; std::vector GenerateModifiers(int32_t level) const; void Load(const nlohmann::json& json); float CalculateChance(int32_t level) const; bool CheckConditions(LWOOBJID origin) const; void OnTrigger(LWOOBJID origin) const; static std::vector Trigger(const std::vector& modifiers, int32_t level, UpgradeTriggerType triggerType, LWOOBJID origin); // Getters const std::vector& GetModifiers() const { return modifiers; } UpgradeTriggerType GetTriggerType() const { return triggerType; } private: struct UpgradeScale { int32_t level; float value; }; std::vector chance; std::vector conditions; UpgradeTriggerType triggerType; int32_t equipSkillID = 0; bool unequipSkill = false; BehaviorSlot equipSkillSlot = BehaviorSlot::Invalid; std::vector modifiers; int32_t effectID = 0; std::string effectType = ""; }; }