annotate TurnEngine.h @ 2424:255168c31655

* Added win 8.1 support to builds * Removed strict requirement so that display/os should support 16 bit resolutions (even if they aren't really used)
author a.parshin
date Wed, 23 Jul 2014 12:58:30 +0300
parents c4f87fb3cfee
children
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2
Ritor1
parents:
diff changeset
3
1332
1e35cfed7928 turn engine file added
Gloval
parents: 1331
diff changeset
4 enum TURN_ENGINE_FLAGS
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
5 {
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
6 TE_FLAG_1 = 1,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
7 TE_HAVE_PENDING_ACTIONS = 2,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
8 TE_PLAYER_TURN = 4,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
9 TE_FLAG_8 = 8
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
10 };
1332
1e35cfed7928 turn engine file added
Gloval
parents: 1331
diff changeset
11
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
12 enum TURN_ENGINE_AI_ACTION
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
13 {
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
14 TE_AI_STAND = 0,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
15 TE_AI_RANGED_ATTACK = 1,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
16 TE_AI_PURSUE = 2,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
17 TE_AI_MELEE_ATTACK = 3,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
18 TE_AI_FLEE = 4
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
19 };
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
20
2242
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
21 enum TURN_ENGINE_TURN_STAGE
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
22 {
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
23 TE_NONE = 0,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
24 TE_WAIT = 1,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
25 TE_ATTACK = 2,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
26 TE_MOVEMENT = 3,
c4f87fb3cfee for NextTurn()
Ritor1
parents: 2114
diff changeset
27 };
0
Ritor1
parents:
diff changeset
28
Ritor1
parents:
diff changeset
29 /* 299 */
Ritor1
parents:
diff changeset
30 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
31 struct TurnBased_QueueElem
Ritor1
parents:
diff changeset
32 {
372
Nomad
parents: 370
diff changeset
33 inline TurnBased_QueueElem()
Nomad
parents: 370
diff changeset
34 {
Nomad
parents: 370
diff changeset
35 uPackedID = 0;
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
36 actor_initiative = 0;
372
Nomad
parents: 370
diff changeset
37 uActionLength = 0;
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
38 AI_action_type = 0;
372
Nomad
parents: 370
diff changeset
39 }
0
Ritor1
parents:
diff changeset
40 int uPackedID;
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
41 int actor_initiative; //act first who have less
0
Ritor1
parents:
diff changeset
42 int uActionLength;
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
43 int AI_action_type;
0
Ritor1
parents:
diff changeset
44 };
Ritor1
parents:
diff changeset
45 #pragma pack(pop)
Ritor1
parents:
diff changeset
46
Ritor1
parents:
diff changeset
47 /* 254 */
Ritor1
parents:
diff changeset
48 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
49 struct stru262_TurnBased
Ritor1
parents:
diff changeset
50 {
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
51 inline stru262_TurnBased()
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
52 {
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
53 turns_count = 0;
1340
22cb507446a4 turnengine refactoring continue
Gloval
parents: 1332
diff changeset
54 turn_stage = 0;
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
55 ai_turn_timer = 0;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
56 uActorQueueSize = 0;
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
57 turn_initiative = 0;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
58 uActionPointsLeft = 0;
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
59 field_18 = 0;
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
60 pending_actions = 0;
370
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
61 }
7f817679b60e _42777D_CastSpell_UseWand_ShootArrow
Nomad
parents: 322
diff changeset
62
1679
4da5644df18f Cosmetics
Nomad
parents: 1456
diff changeset
63 void SortTurnQueue();
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
64 void ApplyPlayerAction();
1679
4da5644df18f Cosmetics
Nomad
parents: 1456
diff changeset
65 void Start();
0
Ritor1
parents:
diff changeset
66 void End(bool bPlaySound);
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
67 void AITurnBasedAction();
1341
67e47fc3133d TE refactiring continue
Gloval
parents: 1340
diff changeset
68 void StartTurn();
0
Ritor1
parents:
diff changeset
69 void NextTurn();
1679
4da5644df18f Cosmetics
Nomad
parents: 1456
diff changeset
70 bool StepTurnQueue();
1340
22cb507446a4 turnengine refactoring continue
Gloval
parents: 1332
diff changeset
71 void _406457(int a2);
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
72 void SetAIRecoveryTimes();
322
ce39b96acf5c Killing friendly peasants subs
Nomad
parents: 0
diff changeset
73 void _4065B0();
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
74 void AIAttacks(unsigned int queue_index);
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
75 void AI_Action_(int queue_index);
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
76 void ActorAISetMovementDecision();
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
77 void ActorAIStopMovement();
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
78 void ActorAIDoAdditionalMove();
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
79 bool ActorMove(signed int a2);
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
80 void ActorAIChooseNewTargets();
0
Ritor1
parents:
diff changeset
81
Ritor1
parents:
diff changeset
82
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
83 int turns_count;
2114
68fbaf45ef66 _42FB5C_check_spell cleaned
Ritor1
parents: 1679
diff changeset
84 int turn_stage; //if = 2 - action
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
85 int ai_turn_timer;
1330
82431a85b28e turnbased start part cleaning
Gloval
parents: 372
diff changeset
86 int uActorQueueSize; //c
1448
5a5d0c713d47 some turn engine renaming
Gloval
parents: 1367
diff changeset
87 int turn_initiative;
1330
82431a85b28e turnbased start part cleaning
Gloval
parents: 372
diff changeset
88 int uActionPointsLeft; //14
0
Ritor1
parents:
diff changeset
89 int field_18;
1450
8ff3c675a726 more renaming TE
Gloval
parents: 1448
diff changeset
90 int pending_actions;
1456
5c95f2246c2a TE mostly working
Gloval
parents: 1450
diff changeset
91 TurnBased_QueueElem pQueue[530]; //20
0
Ritor1
parents:
diff changeset
92 };
Ritor1
parents:
diff changeset
93 #pragma pack(pop)
Ritor1
parents:
diff changeset
94
Ritor1
parents:
diff changeset
95
Ritor1
parents:
diff changeset
96
Ritor1
parents:
diff changeset
97 extern struct stru262_TurnBased *pTurnEngine;