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

Translate a committed action death into the existing atomic victory transaction. 更多...

#include <ActionKillReward.h>

静态 Public 成员函数

static Result< BattleVictoryReceipt > settle (const RPGDamageTarget &recipient, GameState &gameState, Tracker &tracker, const RPGActionDamageReceipt &death, std::string_view encounterId)
 Grant XP, class skills, gold and quest progress once for a committed death.
 

详细描述

Translate a committed action death into the existing atomic victory transaction.

备注
Uses single-member EncounterCatalogue definitions as reward templates. Templates satisfy BattleVictory preconditions; an empty requiredQuestId allows ordinary kills. GameState owns the durable consumed fact under reserved scope rpg.action-kill.v1; the target SubjectRef identifies one life, independent of execution, tick or map. No additional registry, actor mirror, RNG or save format is introduced.

在文件 ActionKillReward.h 第 23 行定义.

成员函数说明

◆ settle()

Result< BattleVictoryReceipt > eve::rpg::ActionKillReward::settle ( const RPGDamageTarget &  recipient,
GameState &  gameState,
Tracker &  tracker,
const RPGActionDamageReceipt &  death,
std::string_view  encounterId 
)
static

Grant XP, class skills, gold and quest progress once for a committed death.

参数
recipientBorrowed value identifying the live reward actor and its stable subject.
gameStateBorrowed owner of persistent reward and consumed facts.
trackerBorrowed owner of quest progress.
deathBorrowed trusted local receipt emitted by RPGActionDamageSink.
encounterIdBorrowed single-member reward template ID, not retained.
返回
Applied with a victory receipt, NoOp with zero gains if already consumed, or structured failure leaving reward participants and the consumed fact unchanged. @ownership All participants remain caller-owned; no references survive this call. @lifetime The recipient ECS generation is checked before use. The killed actor may already have been destroyed. The host must never reuse a victim subject for a new life. @thread Owning simulation thread only, including content registries. @reentrancy No callbacks or scripts are invoked. @cost Copies game/quest state through BattleVictory, much more than an identity query; call only for death receipts, not every simulation tick.
备注
This is not a network authorization boundary: callers must authenticate receipts before admission. Keep a failed receipt for retry. Persist actor, tracker and GameState together through RPGSaveSession; saving only the consumed marker can lose rewards. Duplicate detection precedes template and quest checks so a successful retry remains NoOp after quest completion or content removal. Loot/party reward distribution is not included.

在文件 ActionKillReward.cpp 第 13 行定义.

引用了 eve::rpg::RPGDamageTarget::actor, eve::rpg::RPGActionDamageReceipt::applied, eve::rpg::detail::encounterVictoryRequest(), eve::Diagnostic::error(), eve::Result< T >::failure(), eve::rpg::EncounterCatalogue::find(), eve::SubjectRef::format(), eve::InvalidArgument, eve::SubjectRef::isValid(), eve::rpg::RPGActionDamageReceipt::killed, eve::NoOp, eve::NotFound, request, scope, eve::rpg::BattleVictory::settle(), eve::rpg::RPGActionDamageReceipt::source, eve::StaleHandle, eve::rpg::RPGDamageTarget::subject, eve::Status::success(), eve::Result< T >::success(), eve::rpg::RPGActionDamageReceipt::target , 以及 eve::Unsupported.

被这些函数引用 eve::rpg::ActionEncounter::claim().


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