annotate Engine/TurnEngine/TurnEngine.h @ 2553:48708da03b7f

Party Creation UI logic separated from MainMenu
author a.parshin
date Wed, 13 May 2015 02:20:05 +0200
parents 68cdef6879a0
children
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #pragma once
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4 enum TURN_ENGINE_FLAGS
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6 TE_FLAG_1 = 1,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
7 TE_HAVE_PENDING_ACTIONS = 2,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8 TE_PLAYER_TURN = 4,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 TE_FLAG_8 = 8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
12 enum TURN_ENGINE_AI_ACTION
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
13 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 TE_AI_STAND = 0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15 TE_AI_RANGED_ATTACK = 1,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 TE_AI_PURSUE = 2,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 TE_AI_MELEE_ATTACK = 3,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 TE_AI_FLEE = 4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21 enum TURN_ENGINE_TURN_STAGE
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 TE_NONE = 0,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24 TE_WAIT = 1,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 TE_ATTACK = 2,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 TE_MOVEMENT = 3,
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 /* 299 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31 struct TurnBased_QueueElem
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 inline TurnBased_QueueElem()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 uPackedID = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36 actor_initiative = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 uActionLength = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 AI_action_type = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 int uPackedID;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41 int actor_initiative; //act first who have less
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 int uActionLength;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
43 int AI_action_type;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
44 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
45 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
46
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
47 /* 254 */
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
48 #pragma pack(push, 1)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
49 struct stru262_TurnBased
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
50 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
51 inline stru262_TurnBased()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
52 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
53 turns_count = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
54 turn_stage = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
55 ai_turn_timer = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
56 uActorQueueSize = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
57 turn_initiative = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
58 uActionPointsLeft = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
59 field_18 = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
60 pending_actions = 0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
61 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
62
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
63 void SortTurnQueue();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
64 void ApplyPlayerAction();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
65 void Start();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
66 void End(bool bPlaySound);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
67 void AITurnBasedAction();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
68 void StartTurn();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
69 void NextTurn();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
70 bool StepTurnQueue();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
71 void _406457(int a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
72 void SetAIRecoveryTimes();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
73 void _4065B0();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
74 void AIAttacks(unsigned int queue_index);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
75 void AI_Action_(int queue_index);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
76 void ActorAISetMovementDecision();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
77 void ActorAIStopMovement();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
78 void ActorAIDoAdditionalMove();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
79 bool ActorMove(signed int a2);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
80 void ActorAIChooseNewTargets();
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
81
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
82
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
83 int turns_count;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
84 int turn_stage; //if = 2 - action
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
85 int ai_turn_timer;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
86 int uActorQueueSize; //c
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
87 int turn_initiative;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
88 int uActionPointsLeft; //14
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
89 int field_18;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
90 int pending_actions;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
91 TurnBased_QueueElem pQueue[530]; //20
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
92 };
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
93 #pragma pack(pop)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
94
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
95
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
96
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
97 extern struct stru262_TurnBased *pTurnEngine;