载入中...
搜索中...
未找到
CombatLoop.h
浏览该文件的文档.
1#pragma once
2#include "common/Export.h"
3
10#include "combat/CombatTarget.h"
11#include "combat/Damage.h"
13#include "combat/HitFeel.h"
14#include "combat/MeleeHit.h"
15#include "common/Identity.h"
16
17#include <map>
18#include <string>
19#include <vector>
20
21namespace eve::combat {
22
23class CombatActionWindowState;
24
31
37 std::vector<DamageOutcome> outcomes;
38 std::vector<GuardEvaluation> guards;
39 std::vector<CombatPerfectDodge> perfectDodges;
40 std::vector<CombatCancelResolution> cancels;
41 std::vector<CombatEnemySteering> enemySteering;
43};
44
54public:
56 void setCharacters(CombatCharacterRuntime& characters) noexcept { characters_ = &characters; }
58 void setMelee(MeleeHitRuntime& melee) noexcept { melee_ = &melee; }
60 void setWindows(const CombatActionWindowState* windows) noexcept { windows_ = windows; }
62 void setGuards(const GuardWindowState* guards) noexcept { guards_ = guards; }
64 void setFeel(HitFeelRuntime* feel) noexcept { feel_ = feel; }
66 void setTargets(CombatTargetRuntime* targets) noexcept { targets_ = targets; }
68 void setCameraFocus(SubjectRef player) noexcept { cameraFocus_ = player; }
70 void setDamageStates(std::map<std::string, CombatState, std::less<>>* states) noexcept { states_ = states; }
72 void setCancelResolver(CombatCancelResolver* cancels) noexcept { cancelResolver_ = cancels; }
74 void setCancelSubject(SubjectRef subject) noexcept { cancelSubject_ = subject; }
76 void setCancelAbility(LogicalId ability) noexcept { cancelAbility_ = std::move(ability); }
78 void setEnemyAI(CombatEnemyIntentSource* enemies) noexcept { enemies_ = enemies; }
79
84 [[nodiscard]] Result<CombatLoopFrame> advance(const SimulationStep& step);
85
86private:
87 CombatCharacterRuntime* characters_ = nullptr;
88 MeleeHitRuntime* melee_ = nullptr;
89 const CombatActionWindowState* windows_ = nullptr;
90 const GuardWindowState* guards_ = nullptr;
91 HitFeelRuntime* feel_ = nullptr;
92 CombatTargetRuntime* targets_ = nullptr;
93 std::map<std::string, CombatState, std::less<>>* states_ = nullptr;
94 CombatCancelResolver* cancelResolver_ = nullptr;
95 CombatEnemyIntentSource* enemies_ = nullptr;
96 SubjectRef cameraFocus_;
97 SubjectRef cancelSubject_;
98 LogicalId cancelAbility_;
99};
100
101} // namespace eve::combat
int subject
Definition AnimSmr.cpp:163
Lock-on framing math owned by combat, consumed by any camera.
Cancel buffer + windows + combo graph resolution.
3D action-combat character controller.
Minimal ring-based combat enemy intent source.
Soft/hard lock-on ownership for action combat.
Deterministic damage, poise, hit-reaction and knockback resolution.
#define EVENGINE_API_BACKENDS
Definition Export.h:108
Block and parry windows projected from Montage state.
Deterministic hitstop and hitstun ownership for combat.
Strong identity values shared by persistence, content and logical-name APIs.
Deterministic bone-agnostic melee hitbox/hurtbox sweep.
float step
Definition TreeMesh.cpp:314
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:411
Move-only operation result carrying either a value or Status.
Definition Result.h:155
Strong, domain-neutral reference to a runtime subject.
Definition SubjectRef.h:26
Authoritative combat projection of active Montage hitbox and invulnerability windows.
Compose buffered input, cancel/combo windows and ComboGraph without activating abilities.
Owner-thread 3D character authority for action combat.
Deterministic enemy intent source for arena vertical slices.
Owner-thread coordinator that welds combat runtimes for one arena tick.
Definition CombatLoop.h:53
void setFeel(HitFeelRuntime *feel) noexcept
Sets the feel.
Definition CombatLoop.h:64
void setGuards(const GuardWindowState *guards) noexcept
Sets the guards.
Definition CombatLoop.h:62
void setWindows(const CombatActionWindowState *windows) noexcept
Sets the windows.
Definition CombatLoop.h:60
void setCancelSubject(SubjectRef subject) noexcept
Sets the cancel subject.
Definition CombatLoop.h:74
void setCancelAbility(LogicalId ability) noexcept
Sets the cancel ability.
Definition CombatLoop.h:76
void setTargets(CombatTargetRuntime *targets) noexcept
Sets the targets.
Definition CombatLoop.h:66
void setMelee(MeleeHitRuntime &melee) noexcept
Sets the melee.
Definition CombatLoop.h:58
void setCameraFocus(SubjectRef player) noexcept
Sets the camera focus.
Definition CombatLoop.h:68
void setCharacters(CombatCharacterRuntime &characters) noexcept
Sets the characters.
Definition CombatLoop.h:56
void setCancelResolver(CombatCancelResolver *cancels) noexcept
Sets the cancel resolver.
Definition CombatLoop.h:72
void setDamageStates(std::map< std::string, CombatState, std::less<> > *states) noexcept
Borrow the map of CombatState values mutated by melee hits.
Definition CombatLoop.h:70
void setEnemyAI(CombatEnemyIntentSource *enemies) noexcept
Sets the enemy ai.
Definition CombatLoop.h:78
Owner-thread lock-on authority.
Authoritative projection of active block/parry Montage windows.
Owner-thread hitstop/hitstun coordinator.
Definition HitFeel.h:61
Owner-thread authority for hurtboxes, hitbox catalogs and sweep hits.
Definition MeleeHit.h:132
static constexpr StrongUint64 zero() noexcept
Returns the zero value for this strong type.
One deterministic fixed-step emitted by SimulationClock.
Definition Time.h:158
Owning eye/look-at pair; camera modules apply this without owning combat state.
Complete owning result of one character advance.
Owning audit of one composed combat frame.
Definition CombatLoop.h:33
std::vector< CombatEnemySteering > enemySteering
Definition CombatLoop.h:41
std::vector< GuardEvaluation > guards
Definition CombatLoop.h:38
std::vector< CombatPerfectDodge > perfectDodges
Definition CombatLoop.h:39
std::vector< DamageOutcome > outcomes
Definition CombatLoop.h:37
CombatCameraView camera
Definition CombatLoop.h:42
CombatCharacterAdvance locomotion
Definition CombatLoop.h:35
std::vector< CombatCancelResolution > cancels
Definition CombatLoop.h:40
Owning audit that a dodging i-frame negated a melee hit.
Definition CombatLoop.h:26
Mutable combat state owned by the gameplay domain for one subject.
Definition Damage.h:37
Complete owning result of one melee advance.
Definition MeleeHit.h:101