2024-02-25 14:46:47 +00:00
|
|
|
#pragma once
|
2023-06-20 04:33:09 +00:00
|
|
|
|
|
|
|
#include "StarThread.hpp"
|
|
|
|
#include "StarStatusTypes.hpp"
|
|
|
|
|
|
|
|
namespace Star {
|
|
|
|
|
|
|
|
STAR_EXCEPTION(StatusEffectDatabaseException, StarException);
|
|
|
|
|
|
|
|
STAR_CLASS(StatusEffectDatabase);
|
|
|
|
|
|
|
|
// Named, unique, unstackable scripted effects.
|
|
|
|
struct UniqueStatusEffectConfig {
|
|
|
|
String name;
|
|
|
|
Maybe<String> blockingStat;
|
|
|
|
Json effectConfig;
|
|
|
|
float defaultDuration;
|
|
|
|
StringList scripts;
|
|
|
|
unsigned scriptDelta;
|
|
|
|
Maybe<String> animationConfig;
|
|
|
|
|
|
|
|
String label;
|
|
|
|
String description;
|
|
|
|
Maybe<String> icon;
|
|
|
|
};
|
|
|
|
|
|
|
|
class StatusEffectDatabase {
|
|
|
|
public:
|
|
|
|
StatusEffectDatabase();
|
|
|
|
|
|
|
|
bool isUniqueEffect(UniqueStatusEffect const& effect) const;
|
|
|
|
|
|
|
|
UniqueStatusEffectConfig uniqueEffectConfig(UniqueStatusEffect const& effect) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
UniqueStatusEffectConfig parseUniqueEffect(Json const& config, String const& path) const;
|
|
|
|
|
|
|
|
HashMap<UniqueStatusEffect, UniqueStatusEffectConfig> m_uniqueEffects;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|