载入中...
搜索中...
未找到
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 <optional>
19#include <string>
20#include <vector>
21
22namespace eve::combat {
23
24class CombatActionWindowState;
25
32
38 std::vector<DamageOutcome> outcomes;
39 std::vector<GuardEvaluation> guards;
40 std::vector<CombatPerfectDodge> perfectDodges;
41 std::vector<CombatCancelResolution> cancels;
42 std::vector<CombatEnemySteering> enemySteering;
44};
45
55public:
57 void setCharacters(CombatCharacterRuntime& characters) noexcept { characters_ = &characters; }
59 void setMelee(MeleeHitRuntime& melee) noexcept { melee_ = &melee; }
61 void setWindows(const CombatActionWindowState* windows) noexcept { windows_ = windows; }
63 void setGuards(const GuardWindowState* guards) noexcept { guards_ = guards; }
65 void setFeel(HitFeelRuntime* feel) noexcept { feel_ = feel; }
67 void setTargets(CombatTargetRuntime* targets) noexcept { targets_ = targets; }
69 void setCameraFocus(SubjectRef player) noexcept { cameraFocus_ = player; }
71 void setDamageStates(std::map<std::string, CombatState, std::less<>>* states) noexcept { states_ = states; }
73 void setCancelResolver(CombatCancelResolver* cancels) noexcept { cancelResolver_ = cancels; }
75 void setCancelSubject(SubjectRef subject) noexcept { cancelSubject_ = subject; }
77 void setCancelAbility(LogicalId ability) noexcept { cancelAbility_ = std::move(ability); }
79 void setEnemyAI(CombatEnemyIntentSource* enemies) noexcept { enemies_ = enemies; }
80
88 [[nodiscard]] Result<CombatLoopFrame> advance(const SimulationStep& step);
89
90private:
91 CombatCharacterRuntime* characters_ = nullptr;
92 MeleeHitRuntime* melee_ = nullptr;
93 const CombatActionWindowState* windows_ = nullptr;
94 const GuardWindowState* guards_ = nullptr;
95 HitFeelRuntime* feel_ = nullptr;
96 CombatTargetRuntime* targets_ = nullptr;
97 std::map<std::string, CombatState, std::less<>>* states_ = nullptr;
98 CombatCancelResolver* cancelResolver_ = nullptr;
99 CombatEnemyIntentSource* enemies_ = nullptr;
100 SubjectRef cameraFocus_;
101 SubjectRef cancelSubject_;
102 LogicalId cancelAbility_;
103 std::optional<SimulationTick> lastAdvanceTick_;
104};
105
106} // 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
std::vector< FieldTarget > targets
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:451
Human-readable, scoped identifier in the form namespace:name.
Definition Identity.h:414
Move-only operation result carrying either a value or Status.
Definition Result.h:176
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:54
void setFeel(HitFeelRuntime *feel) noexcept
Sets the feel.
Definition CombatLoop.h:65
void setGuards(const GuardWindowState *guards) noexcept
Sets the guards.
Definition CombatLoop.h:63
void setWindows(const CombatActionWindowState *windows) noexcept
Sets the windows.
Definition CombatLoop.h:61
void setCancelSubject(SubjectRef subject) noexcept
Sets the cancel subject.
Definition CombatLoop.h:75
void setCancelAbility(LogicalId ability) noexcept
Sets the cancel ability.
Definition CombatLoop.h:77
void setTargets(CombatTargetRuntime *targets) noexcept
Sets the targets.
Definition CombatLoop.h:67
void setMelee(MeleeHitRuntime &melee) noexcept
Sets the melee.
Definition CombatLoop.h:59
void setCameraFocus(SubjectRef player) noexcept
Sets the camera focus.
Definition CombatLoop.h:69
void setCharacters(CombatCharacterRuntime &characters) noexcept
Sets the characters.
Definition CombatLoop.h:57
void setCancelResolver(CombatCancelResolver *cancels) noexcept
Sets the cancel resolver.
Definition CombatLoop.h:73
void setDamageStates(std::map< std::string, CombatState, std::less<> > *states) noexcept
Borrow the map of CombatState values mutated by melee hits.
Definition CombatLoop.h:71
void setEnemyAI(CombatEnemyIntentSource *enemies) noexcept
Sets the enemy ai.
Definition CombatLoop.h:79
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:34
std::vector< CombatEnemySteering > enemySteering
Definition CombatLoop.h:42
std::vector< GuardEvaluation > guards
Definition CombatLoop.h:39
std::vector< CombatPerfectDodge > perfectDodges
Definition CombatLoop.h:40
std::vector< DamageOutcome > outcomes
Definition CombatLoop.h:38
CombatCameraView camera
Definition CombatLoop.h:43
CombatCharacterAdvance locomotion
Definition CombatLoop.h:36
std::vector< CombatCancelResolution > cancels
Definition CombatLoop.h:41
Owning audit that a dodging i-frame negated a melee hit.
Definition CombatLoop.h:27
Mutable combat state owned by the gameplay domain for one subject.
Definition Damage.h:38
Complete owning result of one melee advance.
Definition MeleeHit.h:101