载入中...
搜索中...
未找到
eve::rpg::AttributeSystem类 参考

RPG-facing attribute operations backed by the canonical AttributeSet. 更多...

#include <AttributeSystem.h>

静态 Public 成员函数

static AttributeOpTable & customOps ()
 Process-wide custom policy registry used only for Custom modifiers.
 
static void setBase (RPGActor *actor, const std::string &attribute, double value)
 Set a base value; invalid actor or attribute is a compatibility no-op.
 
static double getBase (RPGActor *actor, const std::string &attribute)
 Read a base value, returning zero for a missing actor/attribute.
 
static void modifyBase (RPGActor *actor, const std::string &attribute, double delta)
 Add a delta to a base value.
 
static bool hasAttribute (RPGActor *actor, const std::string &attribute)
 Query whether an attribute exists on the actor.
 
static eve::Result< ModifierId > addModifier (RPGActor *actor, AttributeModifier modifier)
 Add one canonical modifier to an actor.
 
static std::string addModifier (RPGActor *actor, const std::string &attribute, const std::string &source, const std::string &operation, double value, int priority=0)
 Compatibility string facade for existing RPG/effects callers.
 
static eve::Result< void > removeModifier (RPGActor *actor, const ModifierId &modifierId)
 Remove by canonical modifier id with a structured result.
 
static bool removeModifier (RPGActor *actor, const std::string &attribute, const std::string &modifierId)
 Compatibility boolean removal facade.
 
static eve::Result< int > removeModifiersBySource (RPGActor *actor, const std::string &attribute, const std::string &source)
 Remove source modifiers with a structured count result.
 
static int removeAllModifiersBySource (RPGActor *actor, const std::string &source)
 Compatibility all-attribute source removal facade.
 
static double getFinal (RPGActor *actor, const std::string &attribute)
 Compute the final value through the canonical attributes engine.
 
static void invalidate (RPGActor *actor, const std::string &attribute)
 Mark a canonical attribute value dirty for its next built-in read.
 

详细描述

RPG-facing attribute operations backed by the canonical AttributeSet.

The string overloads are retained for existing scripts and effects. New C++ code should use the Result overloads and AttributeOperation enum.

在文件 AttributeSystem.h 第 29 行定义.

成员函数说明

◆ addModifier() [1/2]

eve::Result< ModifierId > eve::rpg::AttributeSystem::addModifier ( RPGActor *  actor,
AttributeModifier  modifier 
)
static

Add one canonical modifier to an actor.

返回
The generated or supplied modifier id, or structured rejection.

在文件 AttributeSystem.cpp 第 49 行定义.

被这些函数引用 eve::rpg::RPGActor::addAttributeModifier(), eve::rpg::RPGActor::addAttributeModifier(), addModifier(), eve::rpg::TraitSystem::apply() , 以及 eve::rpg::EquipmentSystem::syncEquipModifiers().

◆ addModifier() [2/2]

std::string eve::rpg::AttributeSystem::addModifier ( RPGActor *  actor,
const std::string &  attribute,
const std::string &  source,
const std::string &  operation,
double  value,
int  priority = 0 
)
static

◆ customOps()

AttributeOpTable & eve::rpg::AttributeSystem::customOps ( )
static

Process-wide custom policy registry used only for Custom modifiers.

在文件 AttributeSystem.cpp 第 28 行定义.

引用了 eve::rpg::table().

被这些函数引用 addModifier() , 以及 getFinal().

◆ getBase()

double eve::rpg::AttributeSystem::getBase ( RPGActor *  actor,
const std::string &  attribute 
)
static

Read a base value, returning zero for a missing actor/attribute.

在文件 AttributeSystem.cpp 第 37 行定义.

被这些函数引用 eve::rpg::RPGActor::getBaseAttribute().

◆ getFinal()

double eve::rpg::AttributeSystem::getFinal ( RPGActor *  actor,
const std::string &  attribute 
)
static

Compute the final value through the canonical attributes engine.

在文件 AttributeSystem.cpp 第 103 行定义.

引用了 customOps().

被这些函数引用 eve::rpg::SkillConditionContext::attribute(), eve::rpg::RPGActor::getFinalAttribute(), eve::rpg::VitalsSystem::getMax(), eve::rpg::BattleSystem::resolveHit() , 以及 eve::rpg::Battle::startRound().

◆ hasAttribute()

bool eve::rpg::AttributeSystem::hasAttribute ( RPGActor *  actor,
const std::string &  attribute 
)
static

Query whether an attribute exists on the actor.

在文件 AttributeSystem.cpp 第 45 行定义.

被这些函数引用 eve::rpg::SkillConditionContext::attribute() , 以及 eve::rpg::RPGActor::hasAttribute().

◆ invalidate()

void eve::rpg::AttributeSystem::invalidate ( RPGActor *  actor,
const std::string &  attribute 
)
static

Mark a canonical attribute value dirty for its next built-in read.

在文件 AttributeSystem.cpp 第 107 行定义.

◆ modifyBase()

void eve::rpg::AttributeSystem::modifyBase ( RPGActor *  actor,
const std::string &  attribute,
double  delta 
)
static

Add a delta to a base value.

在文件 AttributeSystem.cpp 第 41 行定义.

被这些函数引用 eve::rpg::RPGActor::modifyBaseAttribute().

◆ removeAllModifiersBySource()

int eve::rpg::AttributeSystem::removeAllModifiersBySource ( RPGActor *  actor,
const std::string &  source 
)
static

◆ removeModifier() [1/2]

eve::Result< void > eve::rpg::AttributeSystem::removeModifier ( RPGActor *  actor,
const ModifierId &  modifierId 
)
static

Remove by canonical modifier id with a structured result.

在文件 AttributeSystem.cpp 第 81 行定义.

被这些函数引用 eve::rpg::RPGActor::removeAttributeModifier() , 以及 eve::rpg::RPGActor::removeAttributeModifier().

◆ removeModifier() [2/2]

bool eve::rpg::AttributeSystem::removeModifier ( RPGActor *  actor,
const std::string &  attribute,
const std::string &  modifierId 
)
static

Compatibility boolean removal facade.

在文件 AttributeSystem.cpp 第 86 行定义.

◆ removeModifiersBySource()

eve::Result< int > eve::rpg::AttributeSystem::removeModifiersBySource ( RPGActor *  actor,
const std::string &  attribute,
const std::string &  source 
)
static

Remove source modifiers with a structured count result.

在文件 AttributeSystem.cpp 第 92 行定义.

引用了 source.

被这些函数引用 eve::rpg::RPGActor::removeAttributeModifiersBySource().

◆ setBase()

void eve::rpg::AttributeSystem::setBase ( RPGActor *  actor,
const std::string &  attribute,
double  value 
)
static

Set a base value; invalid actor or attribute is a compatibility no-op.

在文件 AttributeSystem.cpp 第 33 行定义.

引用了 value.

被这些函数引用 eve::rpg::RPGActor::setBaseAttribute().


该类的文档由以下文件生成: