Skip to content

Commit 6e250b2

Browse files
tamlin-mikeXottab-DUTY
authored andcommitted
Put make_xrstr(EMonsterState state) in a separate source file.
1 parent 87e7a0b commit 6e250b2

File tree

4 files changed

+124
-115
lines changed

4 files changed

+124
-115
lines changed

src/xrGame/ai/monsters/state.cpp

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
#include "StdAfx.h"
2+
#include "xrGame/ai/monsters/state.h"
3+
4+
xr_string make_xrstr(EMonsterState state) noexcept
5+
{
6+
switch (state)
7+
{
8+
case eGlobalState: return "eGlobalState";
9+
case eStateRest: return "Rest";
10+
case eStateRest_WalkGraphPoint: return "Rest_WalkGraphPoint";
11+
case eStateRest_Idle: return "Rest_Idle";
12+
case eStateRest_Fun: return "Rest_Fun";
13+
case eStateRest_Sleep: return "Rest_Sleep";
14+
case eStateRest_MoveToHomePoint: return "Rest_MoveToHomePoint";
15+
case eStateRest_WalkToCover: return "Rest_WalkToCover";
16+
case eStateRest_LookOpenPlace: return "Rest_LookOpenPlace";
17+
case eStateEat: return "Eat";
18+
case eStateEat_CorpseApproachRun: return "Eat_CorpseApproachRun";
19+
case eStateEat_CorpseApproachWalk: return "Eat_CorpseApproachWalk";
20+
case eStateEat_CheckCorpse: return "Eat_CheckCorpse";
21+
case eStateEat_Eat: return "Eat_Eat";
22+
case eStateEat_WalkAway: return "Eat_WalkAway";
23+
case eStateEat_Rest: return "Eat_Rest";
24+
case eStateEat_Drag: return "Eat_Drag";
25+
case eStateAttack: return "Attack";
26+
case eStateAttack_Run: return "Attack_Run";
27+
case eStateAttack_Melee: return "Attack_Melee";
28+
case eStateAttack_RunAttack: return "Attack_RunAttack";
29+
case eStateAttack_RunAway: return "Attack_RunAway";
30+
case eStateAttack_FindEnemy: return "Attack_FindEnemy";
31+
case eStateAttack_Steal: return "Attack_Steal";
32+
case eStateAttack_AttackHidden: return "Attack_AttackHidden";
33+
case eStateAttack_Hide: return "Attack_Hide";
34+
case eStateAttack_HideInCover: return "Attack_HideInCover";
35+
case eStateAttack_MoveOut: return "Attack_MoveOut";
36+
case eStateAttack_CampInCover: return "Attack_CampInCover";
37+
case eStateAttack_ControlFire: return "Attack_ControlFire";
38+
case eStateAttack_ControlTube: return "Attack_ControlTube";
39+
case eStateAttack_HideInCoverLite: return "Attack_HideInCoverLite";
40+
case eStateAttackCamp: return "AttackCamp";
41+
case eStateAttackCamp_Hide: return "AttackCamp_Hide";
42+
case eStateAttackCamp_Camp: return "AttackCamp_Camp";
43+
case eStateAttackCamp_StealOut: return "AttackCamp_StealOut";
44+
case eStateAttack_Psy: return "Attack_Psy";
45+
case eStateAttack_MoveToHomePoint: return "Attack_MoveToHomePoint";
46+
case eStateAttack_HomePoint_Hide: return "Attack_HomePoint_Hide";
47+
case eStateAttack_HomePoint_Camp: return "Attack_HomePoint_Camp";
48+
case eStateAttack_HomePoint_LookOpenPlace: return "Attack_HomePoint_LookOpenPlace";
49+
case eStatePanic: return "Panic";
50+
case eStatePanic_Run: return "Panic_Run";
51+
case eStatePanic_FaceUnprotectedArea: return "Panic_FaceUnprotectedArea";
52+
case eStatePanic_MoveToHomePoint: return "Panic_MoveToHomePoint";
53+
case eStatePanic_HomePoint_Hide: return "Panic_HomePoint_Hide";
54+
case eStatePanic_HomePoint_LookOpenPlace: return "Panic_HomePoint_LookOpenPlace";
55+
case eStatePanic_HomePoint_Camp: return "Panic_HomePoint_Camp";
56+
case eStateHitted: return "Hitted";
57+
case eStateHitted_Hide: return "Hitted_Hide";
58+
case eStateHitted_MoveOut: return "Hitted_MoveOut";
59+
case eStateHitted_Home: return "Hitted_Home";
60+
case eStateHearDangerousSound: return "HearDangerousSound";
61+
case eStateHearDangerousSound_Hide: return "HearDangerousSound_Hide";
62+
case eStateHearDangerousSound_FaceOpenPlace: return "HearDangerousSound_FaceOpenPlace";
63+
case eStateHearDangerousSound_StandScared: return "HearDangerousSound_StandScared";
64+
case eStateHearDangerousSound_Home: return "HearDangerousSound_Home";
65+
case eStateHearInterestingSound: return "HearInterestingSound";
66+
case eStateHearInterestingSound_MoveToDest: return "HearInterestingSound_MoveToDest";
67+
case eStateHearInterestingSound_LookAround: return "HearInterestingSound_LookAround";
68+
case eStateHearHelpSound: return "HearHelpSound";
69+
case eStateHearHelpSound_MoveToDest: return "HearHelpSound_MoveToDest";
70+
case eStateHearHelpSound_LookAround: return "HearHelpSound_LookAround";
71+
case eStateControlled: return "Controlled";
72+
case eStateControlled_Follow: return "Controlled_Follow";
73+
case eStateControlled_Attack: return "Controlled_Attack";
74+
case eStateControlled_Follow_Wait: return "Controlled_Follow_Wait";
75+
case eStateControlled_Follow_WalkToObject: return "Controlled_Follow_WalkToObject";
76+
case eStateThreaten: return "Threaten";
77+
case eStateFindEnemy: return "FindEnemy";
78+
case eStateFindEnemy_Run: return "FindEnemy_Run";
79+
case eStateFindEnemy_LookAround: return "FindEnemy_LookAround";
80+
case eStateFindEnemy_Angry: return "FindEnemy_Angry";
81+
case eStateFindEnemy_WalkAround: return "FindEnemy_WalkAround";
82+
case eStateFindEnemy_LookAround_MoveToPoint: return "FindEnemy_LookAround_MoveToPoint";
83+
case eStateFindEnemy_LookAround_LookAround: return "FindEnemy_LookAround_LookAround";
84+
case eStateFindEnemy_LookAround_TurnToPoint: return "FindEnemy_LookAround_TurnToPoint";
85+
case eStateSquad: return "Squad";
86+
case eStateSquad_Rest: return "Squad_Rest";
87+
case eStateSquad_RestFollow: return "Squad_RestFollow";
88+
case eStateSquad_Rest_Idle: return "Squad_Rest_Idle";
89+
case eStateSquad_Rest_WalkAroundLeader: return "Squad_Rest_WalkAroundLeader";
90+
case eStateSquad_RestFollow_Idle: return "Squad_RestFollow_Idle";
91+
case eStateSquad_RestFollow_WalkToPoint: return "Squad_RestFollow_WalkToPoint";
92+
case eStateCustom: return "Custom";
93+
case eStateBurerScanning: return "BurerScanning";
94+
case eStateCustomMoveToRestrictor: return "CustomMoveToRestrictor";
95+
case eStateSmartTerrainTask: return "SmartTerrainTask";
96+
case eStateSmartTerrainTaskGamePathWalk: return "SmartTerrainTaskGamePathWalk";
97+
case eStateSmartTerrainTaskLevelPathWalk: return "SmartTerrainTaskLevelPathWalk";
98+
case eStateSmartTerrainTaskWaitCapture: return "SmartTerrainTaskWaitCapture";
99+
case eStateCustom_Vampire: return "Custom_Vampire";
100+
case eStateVampire_ApproachEnemy: return "Vampire_ApproachEnemy";
101+
case eStateVampire_Execute: return "Vampire_Execute";
102+
case eStateVampire_RunAway: return "Vampire_RunAway";
103+
case eStateVampire_Hide: return "Vampire_Hide";
104+
case eStateBurerAttack_Tele: return "BurerAttack_Tele";
105+
case eStateBurerAttack_Gravi: return "BurerAttack_Gravi";
106+
case eStateBurerAttack_RunAround: return "BurerAttack_RunAround";
107+
case eStateBurerAttack_FaceEnemy: return "BurerAttack_FaceEnemy";
108+
case eStateBurerAttack_Melee: return "BurerAttack_Melee";
109+
case eStateBurerAttack_Shield: return "BurerAttack_Shield";
110+
case eStateBurerAttack_AntiAim: return "BurerAttack_AntiAim";
111+
case eStatePredator_MoveToCover: return "Predator_MoveToCover";
112+
case eStatePredator_LookOpenPlace: return "Predator_LookOpenPlace";
113+
case eStatePredator_Camp: return "Predator_Camp";
114+
case eStatePredator: return "Predator";
115+
case eStateUnknown: return "Unknown";
116+
default: return "Undefined State";
117+
}
118+
}

src/xrGame/ai/monsters/state_defs.h

Lines changed: 2 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
2+
#include "xrCommon/xr_string.h"
23

34
enum EMonsterState
45
{
@@ -186,118 +187,4 @@ enum EMonsterState
186187
#define is_state(state, type) (((state & type) == type) && (state != eStateUnknown))
187188

188189
// Lain: added
189-
inline xr_string make_xrstr(EMonsterState state)
190-
{
191-
switch (state)
192-
{
193-
case eGlobalState: return "eGlobalState";
194-
case eStateRest: return "Rest";
195-
case eStateRest_WalkGraphPoint: return "Rest_WalkGraphPoint";
196-
case eStateRest_Idle: return "Rest_Idle";
197-
case eStateRest_Fun: return "Rest_Fun";
198-
case eStateRest_Sleep: return "Rest_Sleep";
199-
case eStateRest_MoveToHomePoint: return "Rest_MoveToHomePoint";
200-
case eStateRest_WalkToCover: return "Rest_WalkToCover";
201-
case eStateRest_LookOpenPlace: return "Rest_LookOpenPlace";
202-
case eStateEat: return "Eat";
203-
case eStateEat_CorpseApproachRun: return "Eat_CorpseApproachRun";
204-
case eStateEat_CorpseApproachWalk: return "Eat_CorpseApproachWalk";
205-
case eStateEat_CheckCorpse: return "Eat_CheckCorpse";
206-
case eStateEat_Eat: return "Eat_Eat";
207-
case eStateEat_WalkAway: return "Eat_WalkAway";
208-
case eStateEat_Rest: return "Eat_Rest";
209-
case eStateEat_Drag: return "Eat_Drag";
210-
case eStateAttack: return "Attack";
211-
case eStateAttack_Run: return "Attack_Run";
212-
case eStateAttack_Melee: return "Attack_Melee";
213-
case eStateAttack_RunAttack: return "Attack_RunAttack";
214-
case eStateAttack_RunAway: return "Attack_RunAway";
215-
case eStateAttack_FindEnemy: return "Attack_FindEnemy";
216-
case eStateAttack_Steal: return "Attack_Steal";
217-
case eStateAttack_AttackHidden: return "Attack_AttackHidden";
218-
case eStateAttack_Hide: return "Attack_Hide";
219-
case eStateAttack_HideInCover: return "Attack_HideInCover";
220-
case eStateAttack_MoveOut: return "Attack_MoveOut";
221-
case eStateAttack_CampInCover: return "Attack_CampInCover";
222-
case eStateAttack_ControlFire: return "Attack_ControlFire";
223-
case eStateAttack_ControlTube: return "Attack_ControlTube";
224-
case eStateAttack_HideInCoverLite: return "Attack_HideInCoverLite";
225-
case eStateAttackCamp: return "AttackCamp";
226-
case eStateAttackCamp_Hide: return "AttackCamp_Hide";
227-
case eStateAttackCamp_Camp: return "AttackCamp_Camp";
228-
case eStateAttackCamp_StealOut: return "AttackCamp_StealOut";
229-
case eStateAttack_Psy: return "Attack_Psy";
230-
case eStateAttack_MoveToHomePoint: return "Attack_MoveToHomePoint";
231-
case eStateAttack_HomePoint_Hide: return "Attack_HomePoint_Hide";
232-
case eStateAttack_HomePoint_Camp: return "Attack_HomePoint_Camp";
233-
case eStateAttack_HomePoint_LookOpenPlace: return "Attack_HomePoint_LookOpenPlace";
234-
case eStatePanic: return "Panic";
235-
case eStatePanic_Run: return "Panic_Run";
236-
case eStatePanic_FaceUnprotectedArea: return "Panic_FaceUnprotectedArea";
237-
case eStatePanic_MoveToHomePoint: return "Panic_MoveToHomePoint";
238-
case eStatePanic_HomePoint_Hide: return "Panic_HomePoint_Hide";
239-
case eStatePanic_HomePoint_LookOpenPlace: return "Panic_HomePoint_LookOpenPlace";
240-
case eStatePanic_HomePoint_Camp: return "Panic_HomePoint_Camp";
241-
case eStateHitted: return "Hitted";
242-
case eStateHitted_Hide: return "Hitted_Hide";
243-
case eStateHitted_MoveOut: return "Hitted_MoveOut";
244-
case eStateHitted_Home: return "Hitted_Home";
245-
case eStateHearDangerousSound: return "HearDangerousSound";
246-
case eStateHearDangerousSound_Hide: return "HearDangerousSound_Hide";
247-
case eStateHearDangerousSound_FaceOpenPlace: return "HearDangerousSound_FaceOpenPlace";
248-
case eStateHearDangerousSound_StandScared: return "HearDangerousSound_StandScared";
249-
case eStateHearDangerousSound_Home: return "HearDangerousSound_Home";
250-
case eStateHearInterestingSound: return "HearInterestingSound";
251-
case eStateHearInterestingSound_MoveToDest: return "HearInterestingSound_MoveToDest";
252-
case eStateHearInterestingSound_LookAround: return "HearInterestingSound_LookAround";
253-
case eStateHearHelpSound: return "HearHelpSound";
254-
case eStateHearHelpSound_MoveToDest: return "HearHelpSound_MoveToDest";
255-
case eStateHearHelpSound_LookAround: return "HearHelpSound_LookAround";
256-
case eStateControlled: return "Controlled";
257-
case eStateControlled_Follow: return "Controlled_Follow";
258-
case eStateControlled_Attack: return "Controlled_Attack";
259-
case eStateControlled_Follow_Wait: return "Controlled_Follow_Wait";
260-
case eStateControlled_Follow_WalkToObject: return "Controlled_Follow_WalkToObject";
261-
case eStateThreaten: return "Threaten";
262-
case eStateFindEnemy: return "FindEnemy";
263-
case eStateFindEnemy_Run: return "FindEnemy_Run";
264-
case eStateFindEnemy_LookAround: return "FindEnemy_LookAround";
265-
case eStateFindEnemy_Angry: return "FindEnemy_Angry";
266-
case eStateFindEnemy_WalkAround: return "FindEnemy_WalkAround";
267-
case eStateFindEnemy_LookAround_MoveToPoint: return "FindEnemy_LookAround_MoveToPoint";
268-
case eStateFindEnemy_LookAround_LookAround: return "FindEnemy_LookAround_LookAround";
269-
case eStateFindEnemy_LookAround_TurnToPoint: return "FindEnemy_LookAround_TurnToPoint";
270-
case eStateSquad: return "Squad";
271-
case eStateSquad_Rest: return "Squad_Rest";
272-
case eStateSquad_RestFollow: return "Squad_RestFollow";
273-
case eStateSquad_Rest_Idle: return "Squad_Rest_Idle";
274-
case eStateSquad_Rest_WalkAroundLeader: return "Squad_Rest_WalkAroundLeader";
275-
case eStateSquad_RestFollow_Idle: return "Squad_RestFollow_Idle";
276-
case eStateSquad_RestFollow_WalkToPoint: return "Squad_RestFollow_WalkToPoint";
277-
case eStateCustom: return "Custom";
278-
case eStateBurerScanning: return "BurerScanning";
279-
case eStateCustomMoveToRestrictor: return "CustomMoveToRestrictor";
280-
case eStateSmartTerrainTask: return "SmartTerrainTask";
281-
case eStateSmartTerrainTaskGamePathWalk: return "SmartTerrainTaskGamePathWalk";
282-
case eStateSmartTerrainTaskLevelPathWalk: return "SmartTerrainTaskLevelPathWalk";
283-
case eStateSmartTerrainTaskWaitCapture: return "SmartTerrainTaskWaitCapture";
284-
case eStateCustom_Vampire: return "Custom_Vampire";
285-
case eStateVampire_ApproachEnemy: return "Vampire_ApproachEnemy";
286-
case eStateVampire_Execute: return "Vampire_Execute";
287-
case eStateVampire_RunAway: return "Vampire_RunAway";
288-
case eStateVampire_Hide: return "Vampire_Hide";
289-
case eStateBurerAttack_Tele: return "BurerAttack_Tele";
290-
case eStateBurerAttack_Gravi: return "BurerAttack_Gravi";
291-
case eStateBurerAttack_RunAround: return "BurerAttack_RunAround";
292-
case eStateBurerAttack_FaceEnemy: return "BurerAttack_FaceEnemy";
293-
case eStateBurerAttack_Melee: return "BurerAttack_Melee";
294-
case eStateBurerAttack_Shield: return "BurerAttack_Shield";
295-
case eStateBurerAttack_AntiAim: return "BurerAttack_AntiAim";
296-
case eStatePredator_MoveToCover: return "Predator_MoveToCover";
297-
case eStatePredator_LookOpenPlace: return "Predator_LookOpenPlace";
298-
case eStatePredator_Camp: return "Predator_Camp";
299-
case eStatePredator: return "Predator";
300-
case eStateUnknown: return "Unknown";
301-
default: return "Undefined State";
302-
}
303-
}
190+
xr_string make_xrstr(EMonsterState state) noexcept;

src/xrGame/xrGame.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2038,6 +2038,7 @@
20382038
<PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName)_script.pch</PrecompiledHeaderOutputFile>
20392039
</ClCompile>
20402040
<ClCompile Include="ai\Monsters\Snork\snork_state_manager.cpp" />
2041+
<ClCompile Include="ai\monsters\state.cpp" />
20412042
<ClCompile Include="ai\Monsters\telekinesis.cpp" />
20422043
<ClCompile Include="ai\Monsters\telekinetic_object.cpp" />
20432044
<ClCompile Include="ai\Monsters\Tushkano\tushkano.cpp" />

src/xrGame/xrGame.vcxproj.filters

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10206,6 +10206,9 @@
1020610206
<Filter>UI\Common\PDA\FractionWar</Filter>
1020710207
</ClCompile>
1020810208
<ClCompile Include="game_type.cpp" />
10209+
<ClCompile Include="ai\monsters\state.cpp">
10210+
<Filter>AI\AMonsters\common\components\State</Filter>
10211+
</ClCompile>
1020910212
</ItemGroup>
1021010213
<ItemGroup>
1021110214
<CustomBuild Include="ai\monsters\chimera\chimera_attack_state.h">

0 commit comments

Comments
 (0)