annotate TurnEngine.cpp @ 1332:1e35cfed7928

turn engine file added
author Gloval
date Fri, 05 Jul 2013 01:46:44 +0400
parents
children d14bc530cddb
rev   line source
1332
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
2 #include "MM7.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
3 #include "mm7_data.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
4 #include "Actor.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
5 #include "Player.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
6 #include "Party.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
7 #include "AudioPlayer.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
8 #include "SpriteObject.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
9 #include "Time.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
10 #include "stru298.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
11 #include "IconFrameTable.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
12 #include "Viewport.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
13 #include "FactionTable.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
15 #include "TurnEngine.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
18 #include "TurnEngine.h"
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
19 struct stru262_TurnBased *pTurnEngine = new stru262_TurnBased;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
20
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
22 //----- (00404544) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
23 void stru262_TurnBased::SortTurnQueue()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
24 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
25
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
26 int active_actors;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
27 TurnBased_QueueElem *v7; // eax@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
28 TurnBased_QueueElem *v8; // ecx@18
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
29 TurnBased_QueueElem temp_elem;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
30 int i,j;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
31 unsigned int p_type;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
32 unsigned int p_id;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
34 active_actors = this->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
35
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
36 for( i=0; i<uActorQueueSize; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
37 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
38 p_type = PID_TYPE(pQueue[i].uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
39 p_id = PID_ID(pQueue[i].uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
40
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
41 if ( p_type == OBJECT_Actor )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
42 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
43 pActors[p_id].uAttributes |= 0x80u;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
44 if ( !pActors[p_id].CanAct() )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
45 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
46 --active_actors;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
47 pQueue[i].field_4 = 1001;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
48 pActors[p_id].uAttributes &= ~0x80;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
49 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
50 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
51 else if ( p_type == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
52 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
53 if ( !pParty->pPlayers[p_id].CanAct() )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
54 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
55 --active_actors;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
56 pQueue[i].field_4 = 1001;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
57 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
58 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
59 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
60 //sort
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
61 if (uActorQueueSize>0)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
62 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
63
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
64 for( i=0; i<uActorQueueSize-1; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
65 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
66 v7=&pQueue[i];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
67 for(j=i+1; j<uActorQueueSize;++j )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
68 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
69 v8=&pQueue[j];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
70 if ( v8->field_4 < v7->field_4 ||
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
71 ((v8->field_4 == v7->field_4) &&
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
72 (
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
73 ((PID_TYPE(v8->uPackedID) == OBJECT_Player) && (PID_TYPE(v7->uPackedID) == OBJECT_Actor)) ||
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
74 ((PID_TYPE(v8->uPackedID) == PID_TYPE(v7->uPackedID)) && (PID_ID(v8->uPackedID) < PID_ID(v7->uPackedID)))
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
75 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
76 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
77 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
78 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
79 memcpy(&temp_elem,v7,sizeof(TurnBased_QueueElem));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
80 memcpy(v7,v8, sizeof(TurnBased_QueueElem));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
81 memcpy(v8, &temp_elem, sizeof(TurnBased_QueueElem));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
82 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
83 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
84 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
85 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
86
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
87 uActorQueueSize = active_actors;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
88
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
89 if ( PID_TYPE(pQueue[0].uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
90 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
91 uActiveCharacter = PID_ID(pQueue[0].uPackedID)+1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
92 field_18 |= TE_PLAYER_TURN;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
93 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
94 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
95 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
96 uActiveCharacter = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
97 field_18 &= ~TE_PLAYER_TURN;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
98 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
99
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
100 for(i=0; i<uActorQueueSize; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
101 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
102 if ( PID_TYPE(pQueue[i].uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
103 pParty->pPlayers[PID_ID(pQueue[i].uPackedID)].uTimeToRecovery = (signed __int64)((double)pQueue[i].field_4 * 0.46875);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
104 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
105
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
106
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
107 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
108
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
109 //----- (0040471C) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
110 void stru262_TurnBased::_40471C()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
111 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
112 if ( pParty->bTurnBasedModeOn == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
113 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
114 if ( pTurnEngine->field_4 == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
115 _406457(0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
116 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
117 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
118
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
119 //----- (004059DB) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
120 void stru262_TurnBased::Start()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
121 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
122 //stru262_TurnBased *v1; // ebx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
123 int v3; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
124 int v4; // eax@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
125 unsigned int actor_id; // esi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
126 Actor *pActor; // edi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
127 unsigned int v7; // eax@9
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
128 unsigned int v8; // edx@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
129 //unsigned __int8 v9; // zf@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
130 //unsigned __int8 v10; // sf@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
131 //unsigned __int8 v11; // of@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
132 //char *v12; // esi@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
133 //int v13; // ecx@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
134 //unsigned __int16 v14; // ax@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
135 int v15; // ecx@18
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
136 signed __int64 v16; // qax@19
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
137 int v17; // edx@22
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
138 unsigned int v18; // esi@27
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
139 char *v19; // esi@32
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
140 int v20; // edx@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
141 char *v21; // eax@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
142 int v22; // ecx@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
143 int v23; // eax@34
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
144 char *v24; // eax@34
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
145 char *v25; // ecx@34
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
146 int v26; // edx@34
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
147 int v27; // eax@38
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
148 int v28; // ecx@38
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
149 AIDirection v30; // [sp+Ch] [bp-68h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
150 AIDirection v31; // [sp+28h] [bp-4Ch]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
151 AIDirection a3; // [sp+44h] [bp-30h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
152 //int v33; // [sp+60h] [bp-14h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
153 int *v34; // [sp+64h] [bp-10h]@6
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
154 int v35; // [sp+68h] [bp-Ch]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
155 Player *pPlayer; // [sp+6Ch] [bp-8h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
156 int v40b;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
157 unsigned int v37; // [sp+70h] [bp-4h]@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
158 int activ_players[4];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
159 int players_recovery_time[4];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
160 int a_players_count;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
161 int i,j;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
162 int temp;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
163
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
164
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
165 pTurnEngine->field_18 &= ~TE_FLAG_2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
166 //v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
167 pEventTimer->TrackGameTime();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
168 pAudioPlayer->StopChannels(-1, -1);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
169 pAudioPlayer->PlaySound(SOUND_207, 0, 0, -1, 0, 0, 0, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
170 pPlayer = pParty->pPlayers;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
171 dword_50C998_turnbased_icon_1A = 8 * pIconsFrameTable->pIcons[uIconID_TurnStart].uAnimLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
172 dword_50C994 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
173
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
174 this->field_10 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
175 this->field_0 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
176 this->field_8 = 64;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
177 this->field_4 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
178 this->uActorQueueSize = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
179
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
180 for ( v3 = 0; v3 < 4 ; ++v3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
181 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
182 if ( pParty->pPlayers[v3].CanAct() )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
183 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
184 this->pQueue[this->uActorQueueSize].uPackedID = PID(OBJECT_Player,v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
185 this->pQueue[this->uActorQueueSize].field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
186 this->pQueue[this->uActorQueueSize].uActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
187 pParty->pTurnBasedPlayerRecoveryTimes[this->uActorQueueSize] = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
188 ++this->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
189 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
190 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
191
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
192 for ( v3 = 0; v3 < ai_arrays_size ; ++v3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
193 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
194 actor_id = ai_near_actors_ids[v3];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
195 if (actor_id == 10)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
196 continue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
197 if ( pActors[actor_id].CanAct() )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
198 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
199 if ( pActors[actor_id].uAttributes & 0x8000 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
200 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
201 v8 = ai_near_actors_targets_pid[actor_id];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
202 pActors[actor_id].uAttributes |= 0x80;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
203 memcpy(&v31, Actor::GetDirectionInfo(PID(OBJECT_Actor,actor_id), v8, &a3, 0), sizeof(AIDirection));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
204 memcpy(&v30, &v31, sizeof(AIDirection));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
205 Actor::AI_StandOrBored(actor_id, 4, 32, &v30);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
206 this->pQueue[this->uActorQueueSize].uPackedID = PID(OBJECT_Actor,actor_id);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
207 this->pQueue[this->uActorQueueSize].field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
208 this->pQueue[this->uActorQueueSize].uActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
209 ++this->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
210 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
211 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
212 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
213
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
214 a_players_count=0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
215 for ( v40b = 0; v40b < this->uActorQueueSize; ++v40b )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
216 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
217 //v13 = PID_TYPE(this->pQueue[0].uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
218 if ( PID_TYPE(this->pQueue[v40b].uPackedID) == OBJECT_Player )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
219 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
220 if ( pPlayers[PID_ID(this->pQueue[v40b].uPackedID) + 1]->uTimeToRecovery != 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
221 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
222 //v33 = pPlayers[(this->pQueue[0].uPackedID >> 3) + 1]->uTimeToRecovery;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
223 v16 = (signed int)((double)pPlayers[PID_ID(this->pQueue[v40b].uPackedID) + 1]->uTimeToRecovery * 0.46875);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
224 this->pQueue[v40b].field_4 = v16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
225 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
226 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
227 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
228 activ_players[a_players_count] = v40b;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
229 ++a_players_count;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
230 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
231 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
232 else if ( PID_TYPE(this->pQueue[v40b].uPackedID) == OBJECT_Actor )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
233 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
234 v17 = rand() % 99;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
235 if ( v17 < 33 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
236 this->pQueue[v40b].field_4 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
237 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
238 this->pQueue[v40b].field_4= (v17 >= 66)? 5 : 3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
239 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
240 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
241 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
242 this->pQueue[v40b].field_4 = 666;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
243 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
244 this->pQueue[v40b].field_4 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
245 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
246
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
247
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
248 if ( a_players_count > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
249 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
250 for (i=0; i<a_players_count; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
251 players_recovery_time[i] = pParty->pPlayers[PID_ID(this->pQueue[activ_players[i]].uPackedID)].GetAttackRecoveryTime(0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
252 //sort players by recovery time
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
253 for (i=0; i < a_players_count-1; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
254 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
255 for(j=i+1; j<a_players_count;++j )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
256 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
257 if (players_recovery_time[j] < players_recovery_time[i]) //swap values
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
258 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
259 temp = players_recovery_time[i];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
260 players_recovery_time[i] = players_recovery_time[j];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
261 players_recovery_time[j] = temp;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
262
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
263 temp = activ_players[i];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
264 activ_players[i] = activ_players[j];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
265 activ_players[j] = temp;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
266 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
267 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
268 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
269
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
270 for (i=0; i<a_players_count; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
271 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
272 this->pQueue[activ_players[i]].field_4 = i+2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
273 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
274 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
275 this->SortTurnQueue();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
276 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
277
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
278
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
279
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
280 //----- (00405CFF) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
281 void stru262_TurnBased::End(bool bPlaySound)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
282 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
283
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
284 ObjectType objType; // eax@13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
285 int objID; // esi@13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
286 int i;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
287
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
288 this->field_4 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
289
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
290 for( i=0; i<uActorQueueSize; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
291 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
292 if ( PID_TYPE(pQueue[i].uPackedID) == OBJECT_Actor )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
293 pActors[PID_ID(pQueue[i].uPackedID)].uAttributes &= ~0x80;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
294 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
295
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
296 for( i=0; i<uNumSpriteObjects; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
297 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
298 if (pSpriteObjects[i].uAttributes & 4)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
299 pSpriteObjects[i].uAttributes &= ~0x04;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
300 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
301
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
302 for( i=0; i<uActorQueueSize; ++i)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
303 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
304 objType = (ObjectType)PID_TYPE(pQueue[i].uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
305 objID = PID_ID(pQueue[i].uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
306 if ( objType == OBJECT_Player )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
307 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
308 pPlayers[objID + 1]->uTimeToRecovery = (signed __int64)((double)pQueue[i].field_4 * 2.133333333333333);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
309 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
310 else if ( objType == OBJECT_Actor )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
311 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
312 pActors[objID].pMonsterInfo.uRecoveryTime = (signed __int64)((double)pQueue[i].field_4 * 2.133333333333333);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
313 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
314 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
315
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
316 pAudioPlayer->StopChannels(-1, -1);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
317 if ( bPlaySound != 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
318 pAudioPlayer->PlaySound(SOUND_206, 0, 0, -1, 0, 0, 0, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
319 pTurnEngine->field_18 &= ~TE_FLAG_2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
320 pEventTimer->StopGameTime();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
321 dword_50C994 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
322 dword_50C998_turnbased_icon_1A = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
323 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
324 // 50C994: using guessed type int dword_50C994;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
325 // 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
326
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
327 //----- (00405E14) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
328 void stru262_TurnBased::_405E14()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
329 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
330 stru262_TurnBased *v1; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
331 int v2; // ecx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
332 SpellBuff *v3; // edi@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
333 Actor *v4; // ebx@3
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
334 signed int v5; // edx@20
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
335 AIDirection *v6; // esi@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
336 int v7; // eax@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
337 int v8; // eax@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
338 int v9; // eax@22
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
339 int v10; // eax@23
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
340 int v11; // eax@37
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
341 int v12; // eax@44
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
342 AIDirection a3; // [sp+4h] [bp-68h]@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
343 AIDirection v14; // [sp+20h] [bp-4Ch]@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
344 AIDirection v15; // [sp+3Ch] [bp-30h]@21
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
345 Actor *v16; // [sp+58h] [bp-14h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
346 int v17; // [sp+5Ch] [bp-10h]@6
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
347 stru262_TurnBased *v18; // [sp+60h] [bp-Ch]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
348 int v19; // [sp+64h] [bp-8h]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
349 unsigned int v20; // [sp+68h] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
350
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
351 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
352 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
353 v18 = v1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
354 v20 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
355 if ( (signed int)uNumActors > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
356 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
357 //v3 = pActors;//[0].pActorBuffs;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
358 v16 = pActors.data();//[0].pActorBuffs;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
359 v3 = v16->pActorBuffs;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
360 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
361 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
362 v4 = v16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
363 if ( SHIDWORD(v3[3].uExpireTime) < v2 || SHIDWORD(v3[3].uExpireTime) <= v2 && LODWORD(v3[3].uExpireTime) <= v2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
364 v17 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
365 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
366 v17 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
367 v19 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
368 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
369 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
370 if ( v19 != 10 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
371 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
372 v3->_4585CA(pParty->uTimePlayed);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
373 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
374 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
375 ++v19;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
376 ++v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
377 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
378 while ( v19 < 22 );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
379 if ( v17 != 0
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
380 && SHIDWORD(v4->pActorBuffs[3].uExpireTime) <= 0
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
381 && (SHIDWORD(v4->pActorBuffs[3].uExpireTime) < 0 || LODWORD(v4->pActorBuffs[3].uExpireTime) <= 0) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
382 v4->uActorHeight = pMonsterList->pMonsters[v4->pMonsterInfo.uID - 1].uMonsterHeight;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
383 if ( !(v4->uAttributes & 0x80) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
384 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
385 if ( !v4->pActorBuffs[5].uExpireTime )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
386 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
387 if ( !v4->pActorBuffs[6].uExpireTime )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
388 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
389 v5 = v4->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
390 v4->uCurrentActionTime += pMiscTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
391 if ( (signed int)v4->uCurrentActionTime >= v5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
392 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
393 v17 = ai_near_actors_targets_pid[v20];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
394 v6 = Actor::GetDirectionInfo(PID(OBJECT_Actor,v20), v17, &a3, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
395 v7 = v4->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
396 memcpy(&v15, v6, sizeof(v15));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
397 v8 = v7 - 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
398 memcpy(&v14, &v15, sizeof(v14));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
399 if ( v8 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
400 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
401 v9 = v8 - 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
402 if ( v9 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
403 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
404 v10 = v9 - 6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
405 if ( v10 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
406 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
407 if ( v10 != 8 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
408 Actor::AI_StandOrBored(v20, v17, 32, &v14);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
409 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
410 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
411 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
412 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
413 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
414 v4->uCurrentActionTime = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
415 v4->uCurrentActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
416 v4->uAIState = Dead;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
417 v4->UpdateAnimation();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
418 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
419 v1 = v18;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
420 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
421 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
422 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
423 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
424 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
425 ++v20;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
426 v3 = v16[1].pActorBuffs;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
427 ++v16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
428 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
429 while ( (signed int)v20 < (signed int)uNumActors );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
430 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
431 if ( v1->field_4 == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
432 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
433 v12 = v1->field_8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
434 if ( v12 == 64 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
435 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
436 v1->_406A63();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
437 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
438 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
439 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
440 if ( v12 > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
441 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
442 v1->_406B9F();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
443 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
444 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
445 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
446 v1->_406AFE();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
447 v1->field_10 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
448 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
449 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
450 v1->field_8 -= pEventTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
451 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
452 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
453 if ( v1->field_4 == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
454 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
455 if ( !(v1->field_18 & TE_FLAG_1) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
456 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
457 v11 = v1->field_10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
458 if ( v11 == 100 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
459 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
460 v1->StartTurn();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
461 LABEL_39:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
462 v1->_40652A();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
463 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
464 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
465 if ( v11 > 0 || v1->pQueue[0].field_4 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
466 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
467 v1->_4065B0();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
468 goto LABEL_39;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
469 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
470 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
471 v1->NextTurn();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
472 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
473 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
474 if ( v1->field_4 == 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
475 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
476 if ( v1->uActionPointsLeft <= 0 || v1->field_18 & TE_FLAG_8 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
477 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
478 v1->field_18 &= ~TE_FLAG_8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
479 v1->field_4 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
480 v1->field_8 = 64;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
481 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
482 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
483 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
484 v1->_406FA8();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
485 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
486 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
487 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
488
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
489
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
490 //----- (00406051) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
491 __int16 stru262_TurnBased::StartTurn()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
492 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
493 stru262_TurnBased *v1; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
494 int v2; // ecx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
495 int v3; // ebx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
496 char *v4; // edi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
497 int v5; // eax@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
498 int v6; // eax@12
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
499 char *v7; // eax@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
500 TurnBased_QueueElem *v8; // edi@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
501 unsigned int v9; // edx@23
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
502 char *v10; // eax@26
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
503 int v11; // eax@30
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
504 int v12; // ebx@30
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
505 char *v13; // edi@31
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
506 int v15; // [sp+Ch] [bp-10h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
507 TurnBased_QueueElem *v16; // [sp+10h] [bp-Ch]@3
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
508 int v17; // [sp+14h] [bp-8h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
509 int v18; // [sp+14h] [bp-8h]@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
510 signed int v19; // [sp+18h] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
511 int v20; // [sp+18h] [bp-4h]@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
512
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
513 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
514 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
515 v19 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
516 v3 = v1->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
517 v1->field_1C = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
518 v4 = (char *)&v1->pQueue[v3].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
519 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
520 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
521 v17 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
522 if ( v1->uActorQueueSize <= v2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
523 goto LABEL_11;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
524 v16 = v1->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
525 while ( 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
526 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
527 v5 = v16->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
528 if ( PID_TYPE(v16->uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
529 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
530 LABEL_8:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
531 ++v17;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
532 ++v16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
533 if ( v17 >= v1->uActorQueueSize )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
534 goto LABEL_11;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
535 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
536 v15 = PID_ID(v5);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
537 if ( !pPlayers[(PID_ID(v5)) + 1]->CanAct() || v19 != v15 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
538 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
539 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
540 goto LABEL_8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
541 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
542 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
543 LABEL_11:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
544 if ( v17 == v1->uActorQueueSize )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
545 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
546 *(int *)v4 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
547 v6 = 8 * v19;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
548 LOBYTE(v6) = PID(OBJECT_Player,v19);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
549 *((int *)v4 + 2) = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
550 *((int *)v4 - 1) = v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
551 *((int *)v4 + 1) = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
552 ++v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
553 v4 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
554 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
555 ++v19;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
556 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
557 while ( v19 < 4 );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
558 v1->uActorQueueSize = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
559 v20 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
560 if ( ai_arrays_size > v2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
561 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
562 v7 = (char *)&v1->pQueue[v3].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
563 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
564 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
565 v18 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
566 if ( v1->uActorQueueSize > v2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
567 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
568 v8 = v1->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
569 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
570 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
571 if ( PID_TYPE(v8->uPackedID) == OBJECT_Actor && ai_near_actors_ids[v20] == PID_ID(v8->uPackedID) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
572 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
573 ++v18;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
574 ++v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
575 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
576 while ( v18 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
577 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
578 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
579 if ( v18 == v1->uActorQueueSize )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
580 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
581 v9 = ai_near_actors_ids[v20];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
582 *(int *)v7 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
583 *((int *)v7 + 2) = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
584 *((int *)v7 - 1) = PID(OBJECT_Actor,v9);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
585 *((int *)v7 + 1) = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
586 ++v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
587 v7 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
588 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
589 ++v20;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
590 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
591 while ( v20 < ai_arrays_size );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
592 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
593 ++v1->field_0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
594 v1->uActorQueueSize = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
595 v1->field_10 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
596 if ( v3 > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
597 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
598 v10 = (char *)&v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
599 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
600 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
601 if ( *(int *)v10 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
602 *(int *)v10 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
603 ++v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
604 v10 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
605 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
606 while ( v2 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
607 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
608 LOWORD(v11) = v1->_4063A1();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
609 v12 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
610 if ( v1->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
611 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
612 v13 = (char *)&v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
613 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
614 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
615 v11 = PID_TYPE(*((int *)v13 - 1));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
616 if ( (char)v11 == 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
617 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
618 if ( *(int *)v13 > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
619 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
620 LOWORD(v11) = v1->_40680F(v12++);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
621 v13 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
622 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
623 while ( v12 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
624 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
625 return v11;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
626 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
627 // 4F75D8: using guessed type int ai_arrays_size;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
628
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
629 //----- (004061CA) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
630 void stru262_TurnBased::NextTurn()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
631 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
632 stru262_TurnBased *v1; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
633 TurnBased_QueueElem *v2; // ebp@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
634 int v3; // ebx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
635 int v4; // edi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
636 Actor *v5; // eax@9
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
637 int v6; // ecx@9
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
638 signed int v7; // ebx@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
639 int v8; // ebp@27
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
640 TurnBased_QueueElem *v9; // edi@28
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
641 int v10; // ecx@30
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
642 unsigned __int16 v11; // ax@30
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
643 signed int v12; // edx@35
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
644 signed int v13; // [sp+10h] [bp-4h]@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
645
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
646 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
647 SortTurnQueue();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
648 v2 = v1->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
649 v3 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
650 if (PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
651 uActiveCharacter = PID_ID(v1->pQueue[0].uPackedID) + 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
652 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
653 uActiveCharacter = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
654 viewparams->bRedrawGameUI = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
655 if ( v1->field_1C )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
656 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
657 pTurnEngine->field_18 |= TE_FLAG_2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
658 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
659 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
660 pTurnEngine->field_18 &= ~TE_FLAG_2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
661 if ( v1->pQueue[0].field_4 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
662 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
663 v4 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
664 v13 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
665 if ( v1->uActorQueueSize <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
666 goto LABEL_27;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
667 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
668 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
669 if (PID_TYPE(v2->uPackedID) != OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
670 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
671 v5 = &pActors[PID_ID(v2->uPackedID)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
672 LOWORD(v6) = v5->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
673 if ( (short)v6 == 4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
674 || (short)v6 == 8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
675 || (short)v6 == 2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
676 || (short)v6 == 3
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
677 || (short)v6 == 12
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
678 || (short)v6 == 13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
679 || (short)v6 == 18
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
680 || (short)v6 == 17 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
681 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
682 v7 = v5->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
683 v5->uCurrentActionTime += pEventTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
684 if ( (signed int)v5->uCurrentActionTime < v7 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
685 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
686 v13 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
687 LABEL_19:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
688 v3 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
689 goto LABEL_20;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
690 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
691 v6 = (signed __int16)v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
692 if ( (signed __int16)v6 == 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
693 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
694 v3 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
695 v5->uAIState = Dead;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
696 v5->uCurrentActionTime = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
697 v5->uCurrentActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
698 v5->UpdateAnimation();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
699 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
700 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
701 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
702 if ( v6 != 8 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
703 goto LABEL_19;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
704 v3 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
705 Actor::AI_StandOrBored(PID_ID(v2->uPackedID), ai_near_actors_targets_pid[PID_ID(v2->uPackedID)], 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
706 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
707 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
708 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
709 LABEL_20:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
710 ++v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
711 ++v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
712 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
713 while ( v4 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
714
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
715 if ( v13 != v3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
716 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
717 v1->field_18 |= TE_FLAG_1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
718 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
719 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
720 LABEL_27:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
721 v1->field_18 &= ~TE_FLAG_1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
722 v8 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
723 if ( v1->uActorQueueSize > v3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
724 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
725 v9 = v1->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
726 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
727 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
728 if (PID_TYPE(v9->uPackedID) != OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
729 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
730 v10 = PID_ID(v9->uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
731 v11 = pActors[v10].uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
732 if ( v11 != 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
733 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
734 if ( v11 != 4 && v11 != 11 && v11 != 19 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
735 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
736 if ( v11 != 17 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
737 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
738 v12 = ai_near_actors_targets_pid[v10];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
739 v9->uActionLength = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
740 Actor::AI_StandOrBored(v10, v12, 32, (AIDirection *)v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
741 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
742 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
743 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
744 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
745 ++v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
746 ++v9;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
747 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
748 while ( v8 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
749 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
750 v1->field_4 = 3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
751 pParty->uTimePlayed += __PAIR__(v3, 213);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
752 _494035_timed_effects__water_walking_damage__etc();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
753 v1->uActionPointsLeft = 130;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
754 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
755
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
756 //----- (004063A1) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
757 int stru262_TurnBased::_4063A1()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
758 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
759 stru262_TurnBased *v1; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
760 int v2; // ebp@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
761 signed int result; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
762 int v4; // edx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
763 int v5; // edx@3
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
764 int v6; // edi@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
765 int v7; // ecx@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
766 Actor *v8; // ecx@11
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
767 unsigned __int16 v9; // dx@12
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
768 int v10; // edi@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
769 int v11; // edx@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
770 char v12; // zf@18
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
771
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
772 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
773 SortTurnQueue();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
774 v2 = (int)&v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
775 result = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
776 viewparams->bRedrawGameUI = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
777 v4 = v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
778 if ( v4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
779 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
780 if (PID_TYPE(v1->pQueue[0].uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
781 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
782 v5 = v1->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
783 while ( 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
784 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
785 v6 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
786 if ( v5 > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
787 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
788 v7 = (int)&v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
789 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
790 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
791 --*(int *)v7;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
792 v5 = v1->uActorQueueSize;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
793 ++v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
794 v7 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
795 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
796 while ( v6 < v5 );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
797 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
798 --v1->field_10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
799 if ( v1->field_10 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
800 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
801 if ( !*(int *)v2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
802 goto LABEL_9;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
803 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
804 LABEL_24:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
805 result = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
806 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
807 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
808 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
809 v8 = &pActors[PID_ID(v1->pQueue[0].uPackedID)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
810 if ( v4 > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
811 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
812 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
813 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
814 v9 = v8->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
815 if ( v9 == 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
816 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
817 if ( v9 == 4 || v9 == 19 || v9 == 11 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
818 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
819 v10 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
820 if ( v1->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
821 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
822 v11 = (int)&v1->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
823 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
824 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
825 v12 = (*(int *)v11)-- == 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
826 if ( v12 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
827 *(int *)(v11 + 4) = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
828 ++v10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
829 v11 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
830 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
831 while ( v10 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
832 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
833 --v1->field_10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
834 if ( v1->field_10 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
835 goto LABEL_24;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
836 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
837 while ( *(int *)v2 > 0 );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
838 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
839 LABEL_9:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
840 result = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
841 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
842 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
843 return result;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
844 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
845
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
846 //----- (00406457) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
847 int stru262_TurnBased::_406457(int a2)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
848 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
849 stru262_TurnBased *v2; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
850 signed int v3; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
851 signed int v4; // ecx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
852 char *v5; // edx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
853 signed int v6; // eax@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
854 int result; // eax@11
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
855 int v8; // edx@13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
856 int v9; // ecx@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
857 char v10; // zf@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
858
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
859 v2 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
860 v3 = *(&this->field_0 + 4 * (a2 + 2));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
861 if ( (*((char *)&this->field_0 + 16 * PID_TYPE(a2 + 2))) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
862 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
863 v4 = PID_ID(v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
864 v5 = (char *)&pParty->pTurnBasedPlayerRecoveryTimes[PID_ID(v3)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
865 v6 = *(int *)v5;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
866 if ( *(int *)v5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
867 *(int *)v5 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
868 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
869 v6 = pPlayers[v4 + 1]->GetAttackRecoveryTime(0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
870 if ( v6 < 30 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
871 v6 = 30;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
872 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
873 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
874 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
875 v6 = pMonsterStats->pInfos[pActors[PID_ID(v3)].pMonsterInfo.uID].uRecoveryTime;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
876 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
877 v2->pQueue[a2].field_4 = v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
878 v2->SortTurnQueue();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
879 if (PID_TYPE(v2->pQueue[0].uPackedID) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
880 uActiveCharacter = PID_ID(v2->pQueue[0].uPackedID) + 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
881 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
882 uActiveCharacter = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
883 result = (int)&v2->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
884 viewparams->bRedrawGameUI = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
885 while ( *(int *)result > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
886 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
887 if ( v2->field_10 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
888 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
889 v8 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
890 if ( v2->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
891 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
892 v9 = (int)&v2->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
893 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
894 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
895 v10 = (*(int *)v9)-- == 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
896 if ( v10 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
897 *(int *)(v9 + 4) = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
898 ++v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
899 v9 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
900 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
901 while ( v8 < v2->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
902 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
903 --v2->field_10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
904 if ( v2->field_10 <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
905 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
906 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
907 return result;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
908 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
909
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
910 //----- (0040652A) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
911 void stru262_TurnBased::_40652A()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
912 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
913 int *v1; // edx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
914 Actor *v2; // eax@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
915 unsigned __int16 v3; // si@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
916 unsigned int v4; // esi@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
917 int v5; // [sp+Ch] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
918
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
919 v5 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
920 if ( this->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
921 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
922 v1 = &this->pQueue[0].field_4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
923 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
924 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
925 if ( !*(int *)v1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
926 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
927 if ( PID_TYPE(*(v1 - 4)) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
928 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
929 v2 = &pActors[PID_ID(*(v1 - 1))];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
930 v3 = v2->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
931 if (v3 == Standing || v3 == Fleeing || v3 == Fidgeting)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
932 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
933 v4 = pMonsterStats->pInfos[v2->pMonsterInfo.uID].uRecoveryTime;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
934 *(int *)v1 = v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
935 if ( (signed __int64)v2->pActorBuffs[7].uExpireTime > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
936 *(int *)v1 = 2 * v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
937 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
938 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
939 ++v5;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
940 v1 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
941 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
942 while ( v5 < this->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
943 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
944 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
945
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
946 //----- (004065B0) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
947 void stru262_TurnBased::_4065B0()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
948 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
949 stru262_TurnBased *v1; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
950 signed int v2; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
951 int v3; // ebx@6
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
952 int v4; // edi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
953 unsigned int v5; // edi@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
954
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
955 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
956 SortTurnQueue();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
957 if ( v1->pQueue[0].field_4 <= 0
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
958 || ((_4063A1(), v2 = v1->pQueue[0].uPackedID, PID_TYPE(v1->pQueue[0].uPackedID) != OBJECT_Player) ?
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
959 (uActiveCharacter = 0) : (v2 = (PID_ID(v2)) + 1, uActiveCharacter = v2),
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
960 viewparams->bRedrawGameUI = 1,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
961 v1->pQueue[0].field_4 <= 0) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
962 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
963 v3 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
964 if ( v1->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
965 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
966 v4 = (int)v1->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
967 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
968 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
969 v2 = *(int *)v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
970 if ( PID_TYPE(*(char *)v4) == OBJECT_Player || *(int *)(v4 + 4) > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
971 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
972 if ( *(int *)(v4 + 8) <= 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
973 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
974 LOWORD(v2) = v2 & 3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
975 if ( (char)v2 == 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
976 LOWORD(v2) = v1->_40680F(v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
977 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
978 ++v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
979 v4 += 16;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
980 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
981 while ( v3 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
982 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
983 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
984 v5 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
985 if ( v1->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
986 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
987 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
988 v1->_406648(v5++);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
989 while ( (signed int)v5 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
990 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
991 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
992
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
993 //----- (00406648) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
994 void stru262_TurnBased::_406648(unsigned int a2)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
995 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
996 TurnBased_QueueElem *v1; // ecx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
997 int v3; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
998 unsigned int v4; // ebx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
999 Actor *v5; // esi@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1000 signed int v6; // edi@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1001 int v7; // ecx@6
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1002 int v8; // eax@6
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1003 int v9; // eax@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1004 int v10; // eax@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1005 int v11; // eax@9
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1006 int v12; // eax@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1007 int v13; // eax@11
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1008 int v14; // eax@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1009 unsigned int v15; // ecx@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1010 unsigned int v16; // edx@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1011 int v17; // eax@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1012 int v18; // eax@20
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1013 char v19; // al@24
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1014 unsigned int v21; // [sp-8h] [bp-50h]@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1015 int v22; // [sp-8h] [bp-50h]@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1016 AIDirection *v23; // [sp-4h] [bp-4Ch]@14
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1017 unsigned int v24; // [sp-4h] [bp-4Ch]@17
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1018 char v25; // [sp-4h] [bp-4Ch]@20
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1019 AIDirection a3; // [sp+Ch] [bp-3Ch]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1020 AIDirection a4; // [sp+28h] [bp-20h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1021 TurnBased_QueueElem *v28; // [sp+44h] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1022 unsigned int a2a; // [sp+50h] [bp+8h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1023
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1024 v1 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1025 v28 = v1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1026 v3 = v1->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1027 if (PID_TYPE(v1->uPackedID) != OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1028 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1029 v4 = PID_ID(v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1030 a2a = ai_near_actors_targets_pid[PID_ID(v3)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1031 memcpy(&a3, Actor::GetDirectionInfo(v1->uPackedID, ai_near_actors_targets_pid[PID_ID(v3)], &a3, 0), sizeof(a3));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1032 memcpy(&a4, &a3, sizeof(a4));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1033 v5 = &pActors[PID_ID(v3)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1034 LOWORD(v3) = v5->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1035 if ( (short)v3 != Dead )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1036 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1037 if ( (short)v3 != Disabled )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1038 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1039 if ( (short)v3 != Removed )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1040 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1041 v6 = v5->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1042 v5->uCurrentActionTime += pEventTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1043 if ( (signed int)v5->uCurrentActionTime >= v6 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1044 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1045 v7 = (signed __int16)v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1046 v8 = (signed __int16)v3 - 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1047 if ( !v8 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1048 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1049 v19 = stru_50C198.special_ability_use_check(&pActors[v4], v4);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1050 stru_50FE08.Add(
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1051 v28->uPackedID,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1052 5120,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1053 v5->vPosition.x,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1054 v5->vPosition.y,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1055 v5->vPosition.z + ((signed int)v5->uActorHeight >> 1),
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1056 v19,
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1057 1);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1058 goto LABEL_25;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1059 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1060 v9 = v8 - 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1061 if ( v9 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1062 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1063 v10 = v9 - 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1064 if ( !v10 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1065 goto LABEL_21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1066 v11 = v10 - 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1067 if ( !v11 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1068 goto LABEL_25;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1069 v12 = v11 - 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1070 if ( v12 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1071 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1072 v13 = v12 - 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1073 if ( v13 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1074 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1075 if ( v13 != Dead )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1076 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1077 if ( v7 != 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1078 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1079 v14 = rand();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1080 v15 = v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1081 v23 = &a4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1082 v16 = a2a;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1083 if ( !(v14 % 2) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1084 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1085 Actor::AI_Bored(v4, a2a, &a4);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1086 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1087 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1088 v21 = 64;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1089 LABEL_26:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1090 Actor::AI_Stand(v15, v16, v21, v23);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1091 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1092 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1093 LABEL_21:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1094 v5->uCurrentActionTime = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1095 v5->uCurrentActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1096 v5->uAIState = Dead;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1097 pActors[v4].UpdateAnimation();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1098 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1099 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1100 v24 = v5->pMonsterInfo.uSpellSkillAndMastery2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1101 v22 = 3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1102 v17 = v5->pMonsterInfo.uSpell2ID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1103 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1104 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1105 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1106 v24 = v5->pMonsterInfo.uSpellSkillAndMastery1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1107 v22 = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1108 v17 = v5->pMonsterInfo.uSpell1ID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1109 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1110 Actor::AI_SpellAttack(v4, &a4, v17, v22, v24);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1111 LABEL_25:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1112 v16 = a2a;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1113 v23 = &a4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1114 v21 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1115 v15 = v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1116 goto LABEL_26;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1117 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1118 v18 = v5->pMonsterInfo.uMissleAttack2Type;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1119 v25 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1120 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1121 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1122 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1123 v18 = v5->pMonsterInfo.uMissleAttack1Type;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1124 v25 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1125 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1126 Actor::AI_RangedAttack(v4, &a4, v18, v25);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1127 goto LABEL_25;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1128 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1129 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1130 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1131 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1132 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1133 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1134 // 50FE08: using guessed type stru298 stru_50FE08;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1135
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1136 //----- (0040680F) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1137 __int16 stru262_TurnBased::_40680F(int a2)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1138 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1139 TurnBased_QueueElem *v2; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1140 unsigned int v3; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1141 unsigned int v4; // edi@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1142 Actor *v5; // ebx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1143 unsigned int *v6; // esi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1144 AIDirection *v7; // esi@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1145 int v8; // eax@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1146 unsigned int v9; // ecx@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1147 signed int v10; // eax@13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1148 unsigned __int8 v11; // sf@19
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1149 unsigned __int8 v12; // of@19
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1150 int v13; // esi@29
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1151 bool v14; // eax@29
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1152 unsigned __int8 v15; // cl@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1153 AIDirection a3; // [sp+Ch] [bp-44h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1154 AIDirection v18; // [sp+28h] [bp-28h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1155 int a2a; // [sp+44h] [bp-Ch]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1156 unsigned int v20; // [sp+48h] [bp-8h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1157 TurnBased_QueueElem *v21; // [sp+4Ch] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1158 signed int v22; // [sp+58h] [bp+8h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1159
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1160 v2 = (TurnBased_QueueElem *)((char *)this + 16 * (a2 + 2));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1161 v21 = v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1162 v2->uActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1163 v3 = v2->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1164 if ( (unsigned __int8)v3 & 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1165 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1166 v3 = PID_ID(v3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1167 v4 = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1168 a2a = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1169 v5 = &pActors[v3];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1170 LOWORD(v3) = v5->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1171 if ( (short)v3 != 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1172 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1173 if ( (short)v3 != 4 && (short)v3 != 11 && (short)v3 != 19 && (short)v3 != 17 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1174 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1175 v6 = (unsigned int *)&ai_near_actors_targets_pid[(int)v4];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1176 Actor::_SelectTarget((unsigned int)v4, &ai_near_actors_targets_pid[(int)v4], true);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1177 if ( v5->pMonsterInfo.uHostilityType && !*v6 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1178 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1179 v22 = *v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1180 v7 = Actor::GetDirectionInfo(PID(OBJECT_Actor,(int)v4), *v6, &a3, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1181 v8 = v5->uActorRadius;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1182 memcpy(&a3, v7, sizeof(a3));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1183 memcpy(&v18, &a3, sizeof(v18));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1184 v9 = a3.uDistance - v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1185 v20 = a3.uDistance - v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1186 if ( ((a3.uDistance - v8) & 0x80000000u) != 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1187 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1188 v9 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1189 v20 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1190 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1191 if (PID_TYPE(v22) == OBJECT_Actor)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1192 //v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1193 v10 = pFactionTable->relations[(pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID) / 3 + 1][(v5->pMonsterInfo.uID - 1) / 3 + 1];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1194 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1195 v10 = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1196 if ( v10 == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1197 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1198 if ( (double)(signed int)v20 < 307.2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1199 goto LABEL_25;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1200 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1201 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1202 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1203 if ( v10 == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1204 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1205 v12 = __OFSUB__(v9, 1024);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1206 v11 = ((v9 - 1024) & 0x80000000u) != 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1207 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1208 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1209 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1210 if ( v10 == 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1211 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1212 v12 = __OFSUB__(v9, 2560);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1213 v11 = ((v9 - 2560) & 0x80000000u) != 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1214 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1215 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1216 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1217 if ( v10 != 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1218 goto LABEL_26;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1219 v12 = __OFSUB__(v9, 5120);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1220 v11 = ((v9 - 5120) & 0x80000000u) != 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1221 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1222 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1223 if ( v11 ^ v12 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1224 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1225 LABEL_25:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1226 v5->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1227 goto LABEL_26;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1228 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1229 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1230 LABEL_26:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1231 if ( v5->pMonsterInfo.uHostilityType != 4 || !v22 || (signed int)v9 >= 5120 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1232 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1233 v13 = a2a;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1234 goto LABEL_47;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1235 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1236 v13 = a2a;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1237 v14 = stru_50C198.special_ability_use_check(v5, a2a);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1238 if ( v14 == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1239 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1240 if ( v5->pMonsterInfo.uMissleAttack2Type )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1241 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1242 Actor::AI_MissileAttack2(v13, v22, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1243 goto LABEL_43;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1244 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1245 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1246 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1247 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1248 if ( v14 > 1 && v14 <= 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1249 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1250 if ( v14 == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1251 v15 = v5->pMonsterInfo.uSpell1ID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1252 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1253 v15 = v5->pMonsterInfo.uSpell2ID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1254 if ( v15 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1255 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1256 if ( v14 == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1257 Actor::AI_SpellAttack1(v13, v22, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1258 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1259 Actor::AI_SpellAttack2(v13, v22, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1260 goto LABEL_43;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1261 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1262 goto LABEL_44;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1263 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1264 if ( v5->pMonsterInfo.uMissleAttack1Type )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1265 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1266 Actor::AI_MissileAttack1(v13, v22, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1267 LABEL_43:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1268 //v3 = v21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1269 v21->field_C = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1270 LABEL_48:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1271 v21->uActionLength = v5->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1272 //return (signed __int16)v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1273 return (signed __int16)&v21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1274 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1275 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1276 LABEL_44:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1277 if ( (double)(signed int)v20 < 307.2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1278 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1279 Actor::AI_MeleeAttack(v13, v22, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1280 //v3 = v21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1281 v21->field_C = 3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1282 goto LABEL_48;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1283 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1284 LABEL_47:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1285 Actor::AI_Stand(v13, v22, 0x40u, &v18);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1286 //v3 = v21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1287 v21->field_C = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1288 goto LABEL_48;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1289 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1290 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1291 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1292 return (signed __int16)v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1293 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1294
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1295 //----- (00406A63) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1296 void stru262_TurnBased::_406A63()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1297 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1298 stru262_TurnBased *v1; // ebx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1299 int v2; // esi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1300 unsigned __int8 v3; // zf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1301 unsigned __int8 v4; // sf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1302 signed int v5; // ecx@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1303 AIDirection a3; // [sp+8h] [bp-44h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1304 AIDirection v7; // [sp+24h] [bp-28h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1305 unsigned int v8; // [sp+40h] [bp-Ch]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1306 signed int a2; // [sp+44h] [bp-8h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1307 TurnBased_QueueElem *v10; // [sp+48h] [bp-4h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1308
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1309 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1310 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1311 this->field_8 = 64;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1312 dword_50C994 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1313 uActiveCharacter = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1314 v3 = this->uActorQueueSize == 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1315 v4 = this->uActorQueueSize < 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1316 a2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1317 if ( !(v4 | v3) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1318 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1319 v10 = this->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1320 while ( 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1321 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1322 v5 = v10->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1323 if (PID_TYPE(v10->uPackedID) == OBJECT_Actor)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1324 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1325 v8 = ai_near_actors_targets_pid[PID_ID(v5)];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1326 memcpy(&v7, Actor::GetDirectionInfo(v5, v8, &a3, v2), sizeof(v7));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1327 if ( !v1->ActorTurn(a2) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1328 Actor::AI_Stand(PID_ID(v10->uPackedID), v8, 32, &v7);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1329 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1330 ++a2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1331 ++v10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1332 if ( a2 >= v1->uActorQueueSize )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1333 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1334 v2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1335 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1336 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1337 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1338 // 50C994: using guessed type int dword_50C994;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1339
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1340 //----- (00406AFE) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1341 void stru262_TurnBased::_406AFE()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1342 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1343 stru262_TurnBased *v1; // edi@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1344 TurnBased_QueueElem *v2; // ebx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1345 int v3; // esi@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1346 int v4; // ecx@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1347 AIDirection a3; // [sp+4h] [bp-48h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1348 AIDirection v6; // [sp+20h] [bp-2Ch]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1349 stru262_TurnBased *v7; // [sp+3Ch] [bp-10h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1350 unsigned int v8; // [sp+40h] [bp-Ch]@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1351 unsigned int v9; // [sp+44h] [bp-8h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1352 int v10; // [sp+48h] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1353
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1354 v10 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1355 v1 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1356 v7 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1357 if ( this->uActorQueueSize > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1358 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1359 v2 = this->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1360 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1361 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1362 if (PID_TYPE(v2->uPackedID) == OBJECT_Actor)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1363 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1364 v3 = PID_ID(v2->uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1365 v8 = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1366 if ( pActors[v3].CanAct() )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1367 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1368 v4 = v2->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1369 v9 = ai_near_actors_targets_pid[v3];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1370 memcpy(&v6, Actor::GetDirectionInfo(v4, v9, &a3, 0), sizeof(v6));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1371 Actor::AI_Stand(v8, v9, 32, &v6);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1372 v2->field_C = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1373 v2->uActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1374 v1 = v7;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1375 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1376 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1377 ++v10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1378 ++v2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1379 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1380 while ( v10 < v1->uActorQueueSize );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1381 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1382 v1->field_4 = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1383 v1->field_8 = 100;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1384 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1385
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1386 //----- (00406B9F) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1387 int stru262_TurnBased::_406B9F()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1388 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1389 signed int result; // eax@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1390 unsigned __int8 v2; // zf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1391 unsigned __int8 v3; // sf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1392 int v4; // esi@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1393 unsigned int v5; // esi@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1394 Actor *v6; // ebx@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1395 unsigned __int16 v7; // cx@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1396 AIDirection a3; // [sp+0h] [bp-50h]@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1397 AIDirection v9; // [sp+1Ch] [bp-34h]@15
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1398 signed int a1; // [sp+38h] [bp-18h]@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1399 stru262_TurnBased *thisa; // [sp+3Ch] [bp-14h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1400 unsigned int v12; // [sp+40h] [bp-10h]@5
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1401 unsigned int v13; // [sp+44h] [bp-Ch]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1402 TurnBased_QueueElem *v14; // [sp+48h] [bp-8h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1403 signed int a2; // [sp+4Ch] [bp-4h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1404
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1405 result = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1406 thisa = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1407 v2 = this->uActorQueueSize == 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1408 v3 = this->uActorQueueSize < 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1409 a2 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1410 if ( !(v3 | v2) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1411 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1412 v14 = this->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1413 while ( 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1414 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1415 v4 = v14->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1416 a1 = v14->uPackedID;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1417 if (PID_TYPE(a1) != OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1418 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1419 v5 = PID_ID(v4);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1420 v12 = v5;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1421 v6 = &pActors[v5];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1422 if ( SHIDWORD(v6->pActorBuffs[5].uExpireTime) < result
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1423 || SHIDWORD(v6->pActorBuffs[5].uExpireTime) <= result && LODWORD(v6->pActorBuffs[5].uExpireTime) <= result )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1424 v13 = result;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1425 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1426 v13 = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1427 if ( SHIDWORD(v6->pActorBuffs[6].uExpireTime) >= result
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1428 && (SHIDWORD(v6->pActorBuffs[6].uExpireTime) > result || LODWORD(v6->pActorBuffs[6].uExpireTime) > result) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1429 result = 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1430 if ( !(v13 != 0 || result || v6->uAIState == 5 || v6->uAIState == 11 || v6->uAIState == 19) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1431 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1432 v13 = ai_near_actors_targets_pid[v5];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1433 memcpy(&v9, Actor::GetDirectionInfo(a1, v13, &a3, 0), sizeof(v9));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1434 v7 = v6->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1435 if ( v7 == 6 || v7 == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1436 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1437 if ( (double)(signed int)v9.uDistance < 307.2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1438 goto LABEL_26;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1439 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1440 v6->uCurrentActionTime += pEventTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1441 if ( (signed int)v6->uCurrentActionTime > v6->uCurrentActionLength )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1442 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1443 if ( v7 == 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1444 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1445 v6->uCurrentActionTime = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1446 v6->uCurrentActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1447 v6->uAIState = Dead;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1448 v6->UpdateAnimation();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1449 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1450 if ( !thisa->ActorTurn(a2) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1451 LABEL_26:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1452 Actor::AI_Stand(v12, v13, 32, &v9);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1453 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1454 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1455 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1456 ++a2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1457 result = (signed int)thisa;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1458 ++v14;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1459 if ( a2 >= thisa->uActorQueueSize )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1460 break;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1461 result = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1462 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1463 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1464 return result;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1465 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1466
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1467 //----- (00406D10) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1468 bool stru262_TurnBased::ActorTurn(signed int a2)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1469 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1470 int v2; // ecx@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1471 //int v3; // ecx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1472 Actor *actor; // ebx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1473 //unsigned __int16 v5; // dx@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1474 int *v6; // esi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1475 TurnBased_QueueElem *v7; // edi@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1476 int v8; // eax@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1477 AIDirection *v9; // esi@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1478 int v10; // eax@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1479 unsigned int v11; // ecx@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1480 unsigned __int8 pHostileType; // al@12
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1481 unsigned __int8 v13; // sf@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1482 unsigned __int8 v14; // of@16
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1483 unsigned int v15; // edx@22
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1484 unsigned int v16; // ecx@23
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1485 TurnBased_QueueElem *v17; // eax@25
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1486 double v18; // st7@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1487 double v19; // st6@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1488 int v21; // [sp-8h] [bp-5Ch]@23
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1489 int v22; // [sp-8h] [bp-5Ch]@26
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1490 AIDirection *v23; // [sp-4h] [bp-58h]@23
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1491 int v24; // [sp-4h] [bp-58h]@26
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1492 AIDirection a3; // [sp+Ch] [bp-48h]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1493 AIDirection pDir; // [sp+28h] [bp-2Ch]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1494 int v27; // [sp+44h] [bp-10h]@33
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1495 unsigned int v28; // [sp+48h] [bp-Ch]@10
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1496 TurnBased_QueueElem *v29; // [sp+4Ch] [bp-8h]@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1497 unsigned int uActorID; // [sp+50h] [bp-4h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1498 unsigned int a2a; // [sp+5Ch] [bp+8h]@7
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1499
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1500 // __debugbreak();//ñðàáàòûâàåò ïðè ïîøàãîâîì ðåæèìå ïîñëå ïÿòè øàãîâ
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1501 v2 = *(&this->field_0 + 4 * (a2 + 2));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1502 if (PID_TYPE(v2) == OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1503 return 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1504 uActorID = PID_ID(v2);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1505 //uActorID = v3;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1506 actor = &pActors[uActorID];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1507 //v5 = v4->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1508 if ( actor->uAIState == 5 || actor->uAIState == 4 || actor->uAIState == 11 || actor->uAIState == 19 || actor->uAIState == 17 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1509 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1510 v6 = &ai_near_actors_targets_pid[uActorID];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1511 v7 = &pTurnEngine->pQueue[a2];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1512 v8 = *v6;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1513 v29 = &pTurnEngine->pQueue[a2];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1514 a2a = v8;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1515 Actor::_SelectTarget(uActorID, &ai_near_actors_targets_pid[uActorID], true);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1516 if ( actor->pMonsterInfo.uHostilityType && !*v6 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1517 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1518 v9 = Actor::GetDirectionInfo(v7->uPackedID, a2a, &a3, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1519 v10 = actor->uActorRadius;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1520 memcpy(&a3, v9, sizeof(a3));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1521 memcpy(&pDir, &a3, sizeof(pDir));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1522 v11 = a3.uDistance - v10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1523 v28 = a3.uDistance - v10;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1524 if ( ((a3.uDistance - v10) & 0x80000000u) != 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1525 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1526 v11 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1527 v28 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1528 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1529 pHostileType = actor->pMonsterInfo.uHostilityType;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1530 if ( pHostileType == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1531 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1532 if ( (double)(signed int)v28 >= 307.2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1533 goto LABEL_21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1534 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1535 goto LABEL_21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1536 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1537 if ( pHostileType == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1538 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1539 v14 = __OFSUB__(v11, 1024);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1540 v13 = ((v11 - 1024) & 0x80000000u) != 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1541 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1542 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1543 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1544 if ( pHostileType != 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1545 goto LABEL_21;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1546 v14 = __OFSUB__(v11, 2560);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1547 v13 = ((v11 - 2560) & 0x80000000u) != 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1548 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1549 if ( v13 ^ v14 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1550 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1551 actor->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Long;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1552 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1553 LABEL_21:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1554 if ( (signed __int64)actor->pActorBuffs[4].uExpireTime > 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1555 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1556 if ( (signed int)v11 < 10240 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1557 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1558 Actor::AI_Flee(uActorID, a2a, 0, &pDir);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1559 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1560 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1561 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1562 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1563 Actor::AI_4032B2(uActorID, a2a, 1024, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1564 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1565 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1566 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1567 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1568 if ( actor->pMonsterInfo.uHostilityType != 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1569 goto LABEL_46;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1570 if ( !(actor->uAttributes & 0x020000) || actor->pMonsterInfo.uAIType == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1571 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1572 if ( actor->pMonsterInfo.uAIType == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1573 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1574 if ( actor->pMonsterInfo.uMovementType == 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1575 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1576 Actor::AI_Stand(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1577 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1578 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1579 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1580 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1581 Actor::AI_Flee(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1582 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1583 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1584 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1585 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1586 if ( actor->pMonsterInfo.uAIType == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1587 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1588 v27 = actor->sCurrentHP;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1589 v18 = (double)v27;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1590 v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1591 if ( v19 > v18 && (signed int)v11 < 10240 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1592 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1593 if ( actor->pMonsterInfo.uMovementType == 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1594 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1595 Actor::AI_Stand(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1596 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1597 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1598 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1599 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1600 Actor::AI_Flee(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1601 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1602 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1603 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1604 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1605 goto LABEL_39;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1606 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1607 if ( actor->pMonsterInfo.uAIType == 3 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1608 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1609 v27 = actor->sCurrentHP;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1610 v18 = (double)v27;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1611 v19 = (double)(signed int)actor->pMonsterInfo.uHP * 0.1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1612 if ( v19 > v18 && (signed int)v11 < 10240 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1613 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1614 if ( actor->pMonsterInfo.uMovementType == 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1615 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1616 Actor::AI_Stand(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1617 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1618 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1619 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1620 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1621 Actor::AI_Flee(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1622 v29->field_C = 4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1623 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1624 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1625 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1626 goto LABEL_39;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1627 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1628 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1629 LABEL_39:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1630 if ( (double)(signed int)v28 < 307.2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1631 return 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1632 if ( (signed int)v11 < 5120 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1633 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1634 if ( actor->pMonsterInfo.uMissleAttack1Type && (signed int)v11 < 1024 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1635 Actor::AI_Pursue1(uActorID, a2a, uActorID, 32, &pDir);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1636 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1637 Actor::AI_Pursue2(uActorID, a2a, 32, &pDir, 307);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1638 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1639 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1640 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1641 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1642 LABEL_46:
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1643 if ( actor->pMonsterInfo.uMovementType == 0 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1644 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1645 Actor::AI_4032B2(uActorID, a2a, 1024, 32);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1646 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1647 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1648 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1649 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1650 if ( actor->pMonsterInfo.uMovementType == 1 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1651 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1652 Actor::AI_4032B2(uActorID, a2a, 2560, 32);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1653 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1654 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1655 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1656 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1657 if ( actor->pMonsterInfo.uMovementType == 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1658 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1659 Actor::AI_4032B2(uActorID, a2a, 5120, 32);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1660 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1661 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1662 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1663 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1664 if ( actor->pMonsterInfo.uMovementType == 4 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1665 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1666 Actor::AI_4032B2(uActorID, a2a, 10240, 32);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1667 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1668 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1669 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1670 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1671 if ( actor->pMonsterInfo.uMovementType == 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1672 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1673 Actor::AI_Stand(uActorID, a2a, 32, 0);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1674 v29->field_C = 2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1675 v29->uActionLength = actor->uCurrentActionLength;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1676 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1677 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1678 return 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1679 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1680
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1681 //----- (00406FA8) --------------------------------------------------------
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1682 void stru262_TurnBased::_406FA8()
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1683 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1684 unsigned __int8 v1; // zf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1685 unsigned __int8 v2; // sf@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1686 TurnBased_QueueElem *v3; // edi@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1687 int v4; // eax@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1688 Actor *v5; // ebx@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1689 unsigned __int16 v6; // cx@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1690 unsigned int *v7; // edx@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1691 unsigned int v8; // esi@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1692 unsigned __int8 v9; // of@13
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1693 AIDirection a3; // [sp+Ch] [bp-6Ch]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1694 AIDirection v11; // [sp+28h] [bp-50h]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1695 AIDirection a4; // [sp+44h] [bp-34h]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1696 stru262_TurnBased *v13; // [sp+60h] [bp-18h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1697 TurnBased_QueueElem *v14; // [sp+64h] [bp-14h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1698 int uActorID; // [sp+68h] [bp-10h]@4
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1699 unsigned int a2; // [sp+6Ch] [bp-Ch]@8
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1700 int v17; // [sp+70h] [bp-8h]@1
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1701 unsigned int v18; // [sp+74h] [bp-4h]@2
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1702
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1703 v17 = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1704 v1 = this->uActorQueueSize == 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1705 v2 = this->uActorQueueSize < 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1706 v13 = this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1707 if ( !(v2 | v1) )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1708 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1709 v3 = this->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1710 v18 = (char *)&pTurnEngine - (char *)this;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1711 v14 = this->pQueue;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1712 do
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1713 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1714 if (PID_TYPE(v3->uPackedID) != OBJECT_Player)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1715 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1716 v4 = PID_ID(v3->uPackedID);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1717 uActorID = v4;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1718 v5 = &pActors[v4];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1719 v6 = v5->uAIState;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1720 if ( v6 != 5 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1721 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1722 if ( v6 != 11 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1723 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1724 if ( v6 != 19 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1725 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1726 if ( v6 != 17 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1727 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1728 v7 = (unsigned int *)&ai_near_actors_targets_pid[v4];
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1729 a2 = *v7;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1730 v8 = a2;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1731 Actor::_SelectTarget(v4, (int *)v7, true);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1732 memcpy(&v11, Actor::GetDirectionInfo(*(int *)((char *)&v3->uPackedID + v18), v8, &a3, 0), sizeof(v11));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1733 memcpy(&a4, &v11, sizeof(a4));
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1734 v5->uCurrentActionTime += pMiscTimer->uTimeElapsed;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1735 if ( (signed int)v5->uCurrentActionTime >= v5->uCurrentActionLength )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1736 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1737 if (v5->uAIState == Dying)
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1738 {
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1739 v5->uCurrentActionTime = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1740 v5->uCurrentActionLength = 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1741 v5->uAIState = Dead;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1742 v5->UpdateAnimation();
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1743 return;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1744 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1745 if ( rand() % 2 )
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1746 Actor::AI_Stand(uActorID, a2, 64, &a4);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1747 else
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1748 Actor::AI_Bored(uActorID, a2, &a4);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1749 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1750 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1751 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1752 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1753 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1754 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1755 ++v17;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1756 v3 = v14 + 1;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1757 v9 = __OFSUB__(v17, v13->uActorQueueSize);
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1758 v2 = v17 - v13->uActorQueueSize < 0;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1759 ++v14;
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1760 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1761 while ( v2 ^ v9 );
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1762 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1763 }
1e35cfed7928 turn engine file added
Gloval
parents:
diff changeset
1764