载入中...
搜索中...
未找到
eve::rpg 命名空间参考

RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。 更多...

命名空间

namespace  BattleSide
 阵营是任意整数 id(0/1 仅为常见约定的便捷常量,可自定义更多阵营)。
 

类

class  AttributeSystem
 RPG-facing attribute operations backed by the canonical AttributeSet. 更多...
 
class  Battle
 一场回合制战斗(任意阵营数)。 @ownership 由调用方创建/销毁;Battle 不持有参与者的所有权(参与者为借用 ECS actor)。 @thread 在单一模拟线程上驱动整场战斗。 更多...
 
class  BattleControl
 Explicit stable-identity adapter over one caller-owned RPG battle. 更多...
 
struct  BattleEvent
 一次战斗反馈事件。 更多...
 
class  BattleSystem
 战斗数值:公式求值 + 技能伤害注册 + 结算。 @thread 纯计算,可在任意线程执行。 更多...
 
struct  BattleTacticRule
 One ordered tactic rule; an empty condition resource is an unconditional default. 更多...
 
class  BattleTacticsCatalogue
 Process-local strict catalogue that selects and queues companion/AI actions. 更多...
 
struct  BattleTacticsDefinition
 One immutable ordered tactic definition. 更多...
 
class  BattleVictory
 Product transaction boundary for post-battle rewards and encounter lifecycle. 更多...
 
struct  BattleVictoryReceipt
 Observable summary returned after a complete victory settlement. 更多...
 
struct  BattleVictoryRequest
 Complete data needed to settle one victorious persistent encounter. 更多...
 
struct  CastingState
 施法状态:同一时间每个 actor 只有一个进行中的引导/读条(可按需扩展为多槽)。 更多...
 
struct  ClassDefinition
 数据驱动的职业模板。 更多...
 
struct  ClassLearnSkill
 一条"升到 level 级可学 skillId"的规格。 更多...
 
class  ClassRegistry
 进程级职业定义注册表。 更多...
 
class  ClassSystem
 职业系统。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。 更多...
 
class  Crafting
 Composes RPG recipes with existing production and inventory owners. 更多...
 
struct  CraftingReceipt
 Receipt for an accepted recipe job. 更多...
 
struct  CraftingRecipe
 Validated recipe projection used by crafting, alchemy, brewing and cooking. 更多...
 
struct  CraftingRequest
 Borrowed inputs for atomically paying ingredients and enqueuing recipe work. 更多...
 
struct  DamageResult
 一次命中结算结果。 更多...
 
struct  EffectDefinition
 EVENGINE_API_PLATFORM public API. 更多...
 
struct  EffectModifierSpec
 效果里携带的一条属性修改规格(应用到 AttributeSystem::addModifier)。 更多...
 
class  EffectRegistry
 全局效果定义表:进程级单例,供任意模块 / 脚本按 id 引用。 更多...
 
class  EncounterCatalogue
 Process-local strict encounter content catalogue. 更多...
 
struct  EncounterDefinition
 One immutable, fully specified encounter composition and settlement definition. 更多...
 
struct  EncounterMemberDefinition
 One immutable enemy member inside an encounter composition. 更多...
 
struct  EquipmentStat
 一件物品的一条属性加成规格。 更多...
 
class  EquipmentSystem
 装备加成系统。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。 更多...
 
class  GameState
 一份游戏状态(开关/变量/独立变量)。 更多...
 
class  LevelSystem
 成长系统:读写 RPGActor::Progression 并驱动升级事件。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。 更多...
 
struct  LevelUpEvent
 升级事件。 更多...
 
struct  LootEntry
 掉落表里的一条掉落。 更多...
 
class  LootSystem
 掉落系统:进程级掉落表 + 随机 roll 入包。 @thread roll 使用调用方提供的 rng(命名随机流),可在任意线程执行。 更多...
 
struct  LootTableDefinition
 掉落表定义。 更多...
 
struct  ObjectiveRuntime
 单条目标的运行时进度。 更多...
 
class  Party
 Authoritative ordered relationship between stable party member IDs and RPG actors. @ownership Party owns only stable IDs and generation-qualified links; the RPG ECS world owns actors. @thread Use on the actors' owning simulation thread. 更多...
 
class  PreparedProgressionGain
 Move-only progression gain prepared against one actor revision. 更多...
 
class  ProductControl
 Host-neutral adapter joining shop, quest-reward and world-loot transactions. 更多...
 
struct  QuestDefinition
 数据驱动的任务模板。 更多...
 
struct  QuestEvent
 追踪器事件:activate | progress | ready | complete | fail | reset | reject。 无关字段为空 / 0。 更多...
 
struct  QuestObjective
 一条目标:听哪个 notify、要多少次。target 空 = 只匹配 topic。 更多...
 
class  QuestRegistry
 进程级任务定义注册表。 更多...
 
class  QuestReward
 Product-level transaction boundary for quest completion and rewards. 更多...
 
struct  QuestRuntime
 一条任务在本 Tracker 上的运行时状态。 更多...
 
class  QuestSystem
 EVENGINE_API_PLATFORM public API. 更多...
 
struct  RewardSpec
 奖励规格(定义侧数据)。引擎不发奖,仅提供查询。 更多...
 
class  RPG
 RPG 模块(eve.RPG):Actor 工厂 + 定义注册 + 帧调度 + 事件缓存。 更多...
 
class  RPGActor
 属性 / 状态 / 技能三表合一的 ECS 实体。 更多...
 
class  RPGSaveSession
 A non-owning save boundary for the persistent classic-RPG state owners. 更多...
 
class  RPGSettlementAdapter
 Settles damage/healing against one RPG actor's AttributeSet. 更多...
 
struct  RpgStoryBinding
 Borrowed domain objects an RPG story step runs against. 更多...
 
class  RpgStoryCatalogue
 Strict process-local catalogue of .dnut story assets. 更多...
 
class  RpgStorySession
 Caller-owned cursor over one published .dnut story. 更多...
 
struct  SettlementContext
 结算上下文:通用的读写数据袋,字段完全由调用方与各阶段自行约定。 更多...
 
class  SettlementPipeline
 Compatibility-only named calculator retained for existing RPG scripts. 更多...
 
class  ShopCatalogue
 Process-local validated offer catalogue used by RPG shop transactions and UI. 更多...
 
struct  ShopOffer
 One immutable offer in the process-local shop catalogue. 更多...
 
class  ShopTransaction
 Product transaction boundary for an RPG shop trade. 更多...
 
class  SkillActionAdapter
 Translates a SkillDefinition into the common gameplay action model. 更多...
 
struct  SkillCastEvent
 技能释放结算事件:由 SkillSystem 在读条完成 / 瞬发技能释放时产生。 更多...
 
class  SkillConditionAdapter
 Evaluates a condition using RPG Skill state without mutating it. 更多...
 
class  SkillConditionContext
 EvaluationContext backed by one borrowed RPG actor and SkillDefinition. 更多...
 
struct  SkillConditionQueries
 Read-only extension points for authority and policy queries. 更多...
 
struct  SkillDamageSpec
 一次技能命中的伤害规格。 更多...
 
struct  SkillDefinition
 SkillDefinition public API. 更多...
 
class  SkillDefinitionRuntime
 Typed SkillDefinition-to-runtime adapter. 更多...
 
class  SkillRegistry
 EVENGINE_API_PLATFORM public API. 更多...
 
struct  SkillRuntime
 单个已学会技能的运行时状态(冷却)。 更多...
 
struct  SkillRuntimeState
 Mutable state belonging to one learned skill instance. 更多...
 
class  SkillSystem
 EVENGINE_API_PLATFORM public API. 更多...
 
struct  StatusChangeEvent
 状态生命周期变更事件(施加 / 刷新 / 叠层 / 延长 / 移除 / 到期 / 拒绝)。 与 StatusTickEvent 分开:tick 是周期性数值触发,change 是实例结构变化。 更多...
 
struct  StatusExecutorMetadata
 RPG executor state associated with one canonical effect instance id. 更多...
 
struct  StatusInstance
 Legacy RPG projection of one effects::EffectInstance. 更多...
 
class  StatusSystem
 EVENGINE_API_PLATFORM public API. 更多...
 
struct  StatusTickEvent
 周期性状态触发的 tick 事件。周期效果(period > 0)不会自动修改属性, 而是每个周期产生一个 tick 事件交给上层(脚本或 C++ 结算系统)处理—— 这样伤害/治疗类周期效果可以完整地走 Settlement 流水线(护甲、抗性、暴击……), 而不是被引擎硬编码为直接扣血。 更多...
 
struct  StatusUpdateSummary
 Summary returned by the checked RPG status executor update. 更多...
 
struct  StoryAnimationRequest
 One animation step request, expressed in the host's own animation space. 更多...
 
class  StoryEventCatalogue
 Strict process-local catalogue for versioned story-event content. 更多...
 
struct  StoryEventDefinition
 One immutable, ordered and resumable story-event definition. 更多...
 
class  StoryEventSession
 Caller-owned runtime cursor over a copied story-event definition. 更多...
 
struct  StoryEventStep
 One immutable presentation command owned by a story-event definition. 更多...
 
struct  StoryMoveRequest
 One move step request, expressed in the host's own movement space. 更多...
 
class  Tracker
 一份任务进度 + 本实例事件队列。 更多...
 
struct  TraitDefinition
 数据驱动的特征模板。 更多...
 
class  TraitRegistry
 进程级特征定义注册表。 更多...
 
struct  TraitSpec
 特征承载的一条能力规格。 更多...
 
class  TraitSystem
 特征系统。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。 更多...
 
struct  VitalsEvent
 生命等资源事件:damage | heal | death | revive。 更多...
 
class  VitalsSystem
 当前资源系统:读写 RPGActor::Vitals 并发出事件。 @thread 调用线程应与 RPGActor 的 ECS 线程一致。 更多...
 
class  WorldInteraction
 Product transaction boundary for persistent world-object rewards. 更多...
 
struct  WorldLootRequest
 Complete data needed to settle one persistent loot object. 更多...
 
class  WorldState
 Non-owning typed adapter for persistent per-map object lifecycle state. 更多...
 

类型定义

using AttributeId = ::eve::attributes::AttributeId
 
using ModifierId = ::eve::attributes::ModifierId
 
using SourceId = ::eve::attributes::SourceId
 
using AttributeOperation = ::eve::attributes::AttributeOperation
 
using AttributeModifier = ::eve::attributes::AttributeModifier
 
using AttributeValue = ::eve::attributes::AttributeValue
 
using AttributeOpTable = ::eve::attributes::AttributeOperationRegistry
 
using StoryMoveHandler = std::function< eve::Result< StoryMoveStatus >(const StoryMoveRequest &)>
 Host movement controller invoked by the move step.
 
using StoryAnimationHandler = std::function< eve::Result< StoryAnimationStatus >(const StoryAnimationRequest &)>
 Host animation controller invoked by the animation step.
 

枚举

enum class  BattleTargetPolicy { Auto , Self , LowestHealthAlly , LowestHealthEnemy }
 Deterministic target-selection policies for queued battle actions. 更多...
 
enum class  StoryMoveStatus : std::uint8_t { Arrived , Travelling , Unreachable }
 Terminal state of one requested actor move. 更多...
 
enum class  StoryAnimationStatus : std::uint8_t { Finished , Playing , Unavailable }
 Terminal state of one requested animation playback. 更多...
 
enum class  RPGSaveIdDomain {
  Item , Quest , QuestObjective , Skill ,
  Class , Trait , TraitSource , EquipmentSlot
}
 Definition-reference field kinds supported by direct RPG save ID migrations. 更多...
 
enum class  StoryEventStepKind {
  Dialogue , Message , Wait , Move ,
  Camera
}
 Closed set of UI-neutral presentation commands emitted by a story event. 更多...
 

函数

std::unordered_map< std::string, QuestDefinition > & questTable ()
 
 Module_IMPL (RPG, new RPG())
 
StepKindRegistry & rpgStoryStepRegistry ()
 Process-local step vocabulary for the RPG story dialect.
 
EVENGINE_API_PLATFORM bool captureRpgState (StateValue &out)
 Compatibility facade for RPGActor skill-state serialization during state hot reload.
 
EVENGINE_API_PLATFORM bool restoreRpgState (const StateValue &in, std::string *err=nullptr)
 Restore rpg state.
 
EVENGINE_API_PLATFORM bool resetRpgState ()
 Resets rpg state.
 
eve::Result< settlement::SettlementRequest > makeStatusTickSettlementRequest (const StatusTickEvent &tick, SubjectRef source, SubjectRef target, SimulationTick simulationTick)
 Project one configured RPG status tick into the canonical settlement request.
 
std::unordered_map< std::string, SkillDefinition > & table ()
 
eve::Result< eve::Value > encodeSkillCondition (const eve::decision::Condition &condition)
 Encode one validated Skill condition tree as an owning Value.
 
eve::Result< eve::decision::Condition > decodeSkillCondition (const eve::Value &value)
 Decode one Skill condition tree from an owning Value.
 
std::vector< std::string > matchingIds (const RPGActor::Statuses &statuses, const std::function< bool(const LifecycleInstance &)> &predicate)
 
int removeMatching (RPGActor *actor, const std::vector< std::string > &canonicalIds)
 

详细描述

RPG 模块的基础实体:把属性 / 状态 / 技能三张表挂到一个 ECS 实体上。

与引擎其他模块一致(参考 particles/ParticleEmitter、map/TileLayer), 组件是纯数据结构体,行为都放在对应的 *System 静态类里。

可扩展性:游戏可以直接使用 RPGActor,也可以仿照 docs/游戏模型设计.md 的示例,从 RPGActor 派生出自己的实体类型 (例如 Player : public RPGActor / Monster : public RPGActor), 在子类上追加自己的组件,同时天然复用属性/状态/技能三大组件与配套 System (View<RPGActor, RPGActor::Attributes> 等能看到所有派生实体)。

类型定义说明

◆ AttributeId

在文件 AttributeTypes.h 第 17 行定义.

◆ AttributeModifier

◆ AttributeOperation

◆ AttributeOpTable

◆ AttributeValue

◆ ModifierId

在文件 AttributeTypes.h 第 18 行定义.

◆ SourceId

在文件 AttributeTypes.h 第 19 行定义.

◆ StoryAnimationHandler

Host animation controller invoked by the animation step.

@ownership Borrowed callback; the binding keeps it alive for the whole session. @thread Invoked on the session's owner thread, synchronously. @reentrancy Must not re-enter the session that invoked it.

Returning Finished completes the step inline, so a host whose playback is instantaneous — an applied pose, a zero-length clip, a purely cosmetic flicker — needs no host loop at all. Returning Playing suspends the story until the host acknowledges the step. Returning Unavailable fails the step with a diagnostic naming the target and the clip, and the session keeps its cursor so the caller can decide whether to retry or abandon. A failed Result is reported verbatim instead, so a reason such as "the clip library is still streaming" is never swallowed.

在文件 RpgDialect.h 第 158 行定义.

◆ StoryMoveHandler

Host movement controller invoked by the move step.

@ownership Borrowed callback; the binding keeps it alive for the whole session. @thread Invoked on the session's owner thread, synchronously. @reentrancy Must not re-enter the session that invoked it.

Returning Arrived completes the step inline, so a host whose movement is instantaneous — teleport, snap, an already-satisfied target — needs no host loop at all. Returning Travelling suspends the story until the host acknowledges the step. Returning Unreachable fails the step with a diagnostic naming the actor and the destination, and the session keeps its cursor so the caller can decide whether to retry or abandon. A failed Result is reported verbatim instead, so a reason such as "the navigation service is not loaded" is never swallowed.

在文件 RpgDialect.h 第 93 行定义.

枚举类型说明

◆ BattleTargetPolicy

enum class eve::rpg::BattleTargetPolicy
strong

Deterministic target-selection policies for queued battle actions.

枚举值
Auto 
Self 
LowestHealthAlly 
LowestHealthEnemy 

在文件 Battle.h 第 36 行定义.

◆ RPGSaveIdDomain

enum class eve::rpg::RPGSaveIdDomain
strong

Definition-reference field kinds supported by direct RPG save ID migrations.

枚举值
Item 

Item definition IDs in bag and equipment stacks.

Quest 

Quest definition IDs in tracker entries.

QuestObjective 

Objective IDs nested in tracker entries.

Skill 

Learned skill definition IDs.

Class 

Player class definition ID.

Trait 

Player trait definition IDs.

TraitSource 

Trait source identifiers when their owner identity changed.

EquipmentSlot 

Equipment slot names persisted by InventorySaveSession.

在文件 RPGSaveSession.h 第 30 行定义.

◆ StoryAnimationStatus

enum class eve::rpg::StoryAnimationStatus : std::uint8_t
strong

Terminal state of one requested animation playback.

枚举值
Finished 

The clip was applied instantaneously, so the step completes inline.

Playing 

Playback was accepted and is still running; the host acknowledges the step when it ends.

Unavailable 

The target or the clip cannot be played, so the animation step fails.

在文件 RpgDialect.h 第 96 行定义.

◆ StoryEventStepKind

enum class eve::rpg::StoryEventStepKind
strong

Closed set of UI-neutral presentation commands emitted by a story event.

枚举值
Dialogue 
Message 
Wait 
Move 
Camera 

在文件 StoryEvent.h 第 17 行定义.

◆ StoryMoveStatus

enum class eve::rpg::StoryMoveStatus : std::uint8_t
strong

Terminal state of one requested actor move.

枚举值
Arrived 

The actor is already at the destination, so the step completes inline.

Travelling 

The move was accepted and is still running; the host acknowledges the step when it ends.

Unreachable 

The destination cannot be reached, so the move step fails.

在文件 RpgDialect.h 第 35 行定义.

函数说明

◆ captureRpgState()

bool eve::rpg::captureRpgState ( StateValue &  out)

Compatibility facade for RPGActor skill-state serialization during state hot reload.

Captures per-actor known-skill cooldowns and the in-flight casting state. Casting targets are raw pointers and are not serialized (restored as null). The bool result is kept for the StateProvider compatibility surface; new state systems should expose structured Result diagnostics at their boundary.

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

引用了 eve::StateValue::array(), eve::StateValue::boolean(), c, eve::rpg::RPGActor::liveActors(), eve::StateValue::number(), eve::StateValue::object(), eve::StateValue::pushBack(), eve::StateValue::set() , 以及 eve::StateValue::string().

◆ decodeSkillCondition()

eve::Result< eve::decision::Condition > eve::rpg::decodeSkillCondition ( const eve::Value &  value)

Decode one Skill condition tree from an owning Value.

参数
valueNode-shaped Value from a canonical Skill definition.
返回
Validated condition tree, or a structured parse failure.

在文件 SkillConditionCodec.cpp 第 299 行定义.

引用了 value.

◆ encodeSkillCondition()

eve::Result< eve::Value > eve::rpg::encodeSkillCondition ( const eve::decision::Condition &  condition)

◆ makeStatusTickSettlementRequest()

EVENGINE_API_PLATFORM eve::Result< settlement::SettlementRequest > eve::rpg::makeStatusTickSettlementRequest ( const StatusTickEvent &  tick,
SubjectRef  source,
SubjectRef  target,
SimulationTick  simulationTick 
)

Project one configured RPG status tick into the canonical settlement request.

参数
tickOwning lifecycle event produced by StatusSystem.
sourceStable source identity supplied by the owning game; it may be nil when unknown.
targetStable target identity resolving to tick.actor.
simulationTickDeterministic scheduler tick for replay and event ordering.
返回
Request decoded from the effect definition's strict settlement.tick JSON object.
备注
The object requires kind, resource, and non-negative magnitude; optional tags and context are copied. Magnitude is multiplied by the captured status stack count. @thread Call on the RPG registry thread while the referenced definition remains registered. @reentrancy Does not invoke callbacks or mutate StatusSystem, the actor, or the registry. @cost Linear in JSON and tag/context size; call once per emitted tick, outside Settlement's hot stages.

在文件 SettlementAdapter.cpp 第 50 行定义.

引用了 context, fields, eve::rpg::EffectRegistry::find(), eve::Value::fromJson(), index, eve::InvalidArgument, kind, name, eve::NotFound, object, request, resource, source, eve::settlement::SettlementRequest::source, eve::Result< T >::success(), tag, target, tick , 以及 value.

被这些函数引用 eve::rpg::Battle::settleStatusTick().

◆ matchingIds()

std::vector< std::string > eve::rpg::matchingIds ( const RPGActor::Statuses &  statuses,
const std::function< bool(const LifecycleInstance &)> &  predicate 
)

◆ Module_IMPL()

eve::rpg::Module_IMPL ( RPG  ,
new   RPG() 
)

◆ questTable()

◆ removeMatching()

int eve::rpg::removeMatching ( RPGActor *  actor,
const std::vector< std::string > &  canonicalIds 
)

◆ resetRpgState()

bool eve::rpg::resetRpgState ( )

Resets rpg state.

在文件 RpgStateProvider.cpp 第 111 行定义.

引用了 eve::rpg::SkillSystem::cancelCast() , 以及 eve::rpg::RPGActor::liveActors().

◆ restoreRpgState()

◆ rpgStoryStepRegistry()

eve::dnut::StepKindRegistry & eve::rpg::rpgStoryStepRegistry ( )

Process-local step vocabulary for the RPG story dialect.

The registry owns the descriptors (field schema and domain invariants) and the handlers for every domain step. Handlers read their per-run domain objects from StepContext::host, which must point at an RpgStoryBinding.

返回
Borrowed registry owned by this module for the process lifetime. @ownership Borrowed; never destroy or move it. @thread First call initializes the registry; call it on one thread before others use it.

在文件 RpgDialect.cpp 第 548 行定义.

被这些函数引用 eve::rpg::RpgStorySession::Impl::configureRuntime() , 以及 eve::rpg::RpgStoryCatalogue::replaceFromDnutStrict().

◆ table()