22 #ifndef HARVESTER_PLAYER_H 23 #define HARVESTER_PLAYER_H 25 #include "harvester/scene/room_support.h" 31 namespace PlayerMovement {
32 struct MovementContext;
33 struct MovementPosition;
42 int combatLoadout = 0;
43 int animationRate = 17;
44 int evasiveState = -1;
45 int evasiveFirstFrame = -1;
46 int evasiveLastFrame = -1;
49 uint32 nextMovementTick = 0;
50 int keyboardWalkRequest = -1;
51 int walkHorizontalDirection = 0;
52 int walkDepthDirection = 0;
53 bool hasMoveTarget =
false;
55 int targetBottomY = 0;
57 bool moveTargetXReached =
false;
58 bool moveTargetZReached =
false;
65 bool turnActive =
false;
66 int turnTargetFacing = -1;
67 int turnFirstFrame = -1;
68 int turnLastFrame = -1;
69 int turnEndFrame = -1;
70 bool turnPlayBackwards =
false;
71 bool attackActive =
false;
72 int attackFirstFrame = -1;
73 int attackLastFrame = -1;
74 int attackContactFrame = -1;
75 int attackResumeFacing = -1;
76 bool attackSoundPlayed =
false;
77 int attackSoundPlaybackFrame = -1;
78 bool attackContactResolved =
false;
81 int attackTargetClassId = -1;
82 bool hitActive =
false;
83 int hitFirstFrame = -1;
84 int hitLastFrame = -1;
85 int hitResumeFacing = -1;
86 int hitKnockbackRemainingX = 0;
87 int hitKnockbackDecayStep = 0;
88 bool deathActive =
false;
89 int deathFirstFrame = -1;
90 int deathLastFrame = -1;
91 int deathDamageType = 0;
96 int restoreFacing = -1;
97 uint32 activityTick = 0;
99 uint32 triggerTick = 0;
101 bool loopStarted =
false;
102 bool exiting =
false;
114 bool isCombatLocked()
const;
115 void cancelMovement();
116 void cancelMovementForAttack();
117 bool cancelAttackAnimation();
118 void clearAttackTarget();
119 void captureAttackTarget(
const Common::String &name,
int classId);
120 void markAttackContactResolved();
121 void resetIdleState();
123 void cancelIdleAnimation();
127 void syncAnimationPlacement();
128 static float computeDepthScale(
const RoomSetupState &state,
float z);
129 static int resolveFacingFrame(
int facing);
130 static const char *describeCombatLoadout(
int loadout);
131 static const char *describeCombatDamageType(
int damageType);
132 static Common::String resolveCombatLoadoutResourcePath(
int loadout);
133 static int resolveCombatLoadoutDamageAmount(
int loadout);
134 static int resolveCombatLoadoutDamageType(
int loadout);
135 static int resolveCombatLoadoutContactFrameOffset(
int loadout);
136 static bool isProjectileCombatLoadout(
int loadout);
138 static uint32 getRuntimeClockTicks();
139 static bool isIdleAnimationExcludedRoom(
const Common::String &roomName);
141 void setMoveTarget(
const RoomSetupState &state,
int targetX,
float targetZ);
142 void setRegionMoveTarget(
const RoomSetupState &state,
int targetX,
float targetZ);
143 void setMoveTargetFromScreenPoint(
const RoomSetupState &state,
int targetX,
int targetBottomY);
148 static float resolveRegionTargetZ(
const RegionRecord ®ion);
151 bool setIdleAnimation(
int facing);
152 bool updateAnimationRate(
bool speedUp);
153 bool startEvasiveAnimation(
bool moveLeft,
bool moveRight,
bool moveUp,
bool moveDown);
157 bool attackLeft,
bool attackRight,
bool attackUp,
bool attackDown);
159 bool startHitAnimation(
HarvesterEngine &engine,
int monsterAttackFirstFrame);
162 bool startDeathAnimation(
int damageType,
bool goreEnabled);
163 bool updateDeathAnimationState();
164 bool startTurnAnimation(
int targetFacing);
165 bool updateTurnAnimationState();
168 int regionFacing = -1);
171 bool moveLeft,
bool moveRight,
bool moveUp,
bool moveDown);
189 #endif // HARVESTER_PLAYER_H
Definition: player_movement.h:30
Definition: harvester.h:47
Definition: player_movement.h:38