DarkflameServer/dGame/UpgradeTemplate.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
1.1 KiB
C
Raw Normal View History

2024-06-02 13:43:35 +00:00
#pragma once
#include <cstdint>
#include <string>
#include <vector>
#include "json.hpp"
#include "UpgradeEffect.h"
#include "TriggerParameters.h"
2024-06-02 13:43:35 +00:00
namespace nejlika
{
class UpgradeTemplate
{
public:
UpgradeTemplate() = default;
UpgradeTemplate(const nlohmann::json& json);
nlohmann::json ToJson() const;
void Load(const nlohmann::json& json);
const std::string& GetName() const { return name; }
int32_t GetLot() const { return lot; }
int32_t GetMaxLevel() const { return maxLevel; }
const std::vector<UpgradeEffect>& GetPassives() const { return passives; }
const std::vector<ModifierTemplate>& GetModifiers() const { return modifiers; }
2024-06-02 13:43:35 +00:00
std::vector<ModifierInstance> Trigger(int32_t level, UpgradeTriggerType triggerType, LWOOBJID origin, const TriggerParameters& params) const;
std::vector<ModifierInstance> GenerateModifiers(int32_t level) const;
2024-06-02 13:43:35 +00:00
2024-06-08 15:31:22 +00:00
void AddSkills(LWOOBJID origin) const;
void RemoveSkills(LWOOBJID origin) const;
2024-06-02 13:43:35 +00:00
private:
std::string name = "";
int32_t lot = 0;
int32_t maxLevel = 0;
std::vector<UpgradeEffect> passives;
std::vector<ModifierTemplate> modifiers;
2024-06-02 13:43:35 +00:00
};
}