nw::kernel::EffectSystem

struct EffectSystem : public nw::kernel::Service

Public Functions

EffectSystem(MemoryResource *scope)
virtual ~EffectSystem() = default
bool add(EffectType type, EffectFunc apply, EffectFunc remove)

Adds an effect type to the registry.

bool add(ItemPropertyType type, ItemPropFunc generator)

Adds an item property type to the registry.

bool apply(ObjectBase *obj, Effect *effect)

Applies an effect to an object.

Effect *create(EffectType type)

Creates an effect.

void destroy(Effect *effect)

Destroys an effect.

Effect *generate(const ItemProperty &property, EquipIndex index, BaseItem baseitem) const

Generates an effect from an item property.

virtual void initialize(ServiceInitTime time) override

Initialize effect system.

const StaticTwoDA *ip_cost_table(size_t table) const

Gets an item property cost table.

const ItemPropertyDefinition *ip_definition(ItemPropertyType type) const

Gets an item property definition.

const StaticTwoDA *ip_param_table(size_t table) const

Gets an item property param table.

bool remove(ObjectBase *obj, Effect *effect)

Removes an effect to an object.

EffectSystemStats stats() const noexcept

Gets stats regarding the effect system.

MemoryResource *allocator() const noexcept

Gets the memory allocator for the servce.

Public Members

EffectLimits limits

Effect related limits.

Public Static Attributes

static const std::type_index type_index = {typeid(EffectSystem)}