annotate Arcomage.cpp @ 1489:a27cdb3d753e

Cleanup of LevelDecoration and related.
author yoctozepto
date Thu, 29 Aug 2013 22:22:33 +0200
parents 845907a747d3
children 3c33f3e44f71
rev   line source
1165
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1138
diff changeset
1 #ifdef _MSC_VER
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1138
diff changeset
2 #define _CRT_SECURE_NO_WARNINGS
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1138
diff changeset
3 #endif
29a8defbad9e temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents: 1138
diff changeset
4
0
Ritor1
parents:
diff changeset
5 #include <string>
1033
3a5c8df8381d * UI cleans and moves
Nomad
parents: 1016
diff changeset
6 #include <assert.h>
0
Ritor1
parents:
diff changeset
7
1254
b9747d9e9b4e more included header cleanup
Grumpy7
parents: 1247
diff changeset
8 #include "Render.h"
0
Ritor1
parents:
diff changeset
9 #include "Arcomage.h"
Ritor1
parents:
diff changeset
10 #include "VideoPlayer.h"
Ritor1
parents:
diff changeset
11 #include "AudioPlayer.h"
Ritor1
parents:
diff changeset
12 #include "Mouse.h"
Ritor1
parents:
diff changeset
13 #include "Game.h"
Ritor1
parents:
diff changeset
14 #include "Viewport.h"
Ritor1
parents:
diff changeset
15 #include "Time.h"
Ritor1
parents:
diff changeset
16 #include "GUIFont.h"
Ritor1
parents:
diff changeset
17 #include "Party.h"
Ritor1
parents:
diff changeset
18 #include "GUIWindow.h"
Ritor1
parents:
diff changeset
19 #include "Events2D.h"
Ritor1
parents:
diff changeset
20 #include "VectorTypes.h"
189
038a4d09406f new texts file, fix text rendender error
Gloval
parents: 0
diff changeset
21 #include "texts.h"
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
22 #include <windef.h>
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1257
diff changeset
23 #include "mm7_data.h"
0
Ritor1
parents:
diff changeset
24
Ritor1
parents:
diff changeset
25
Ritor1
parents:
diff changeset
26
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
27 void SetStartConditions();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
28 void SetStartGameData();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
29 void FillPlayerDeck();
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
30 void InitalHandsFill();
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
31 void GetNextCardFromDeck(int player_num);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
32 int GetEmptyCardSlotIndex(int player_num);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
33 void IncreaseResourcesInTurn(int player_num);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
34 void TurnChange();
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
35 bool IsGameOver();
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
36 int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
37 char PlayerTurn(int player_num);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
38 void DrawGameUI(int animation_stage);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
39 void DrawSparks();
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
40 void DrawRectanglesForText();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
41 void DrawPlayersText();
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
42 void DrawPlayerLevels(int a1, char *text, POINT *pXY);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
43 void DrawBricksCount(int a1, char* text, POINT *pXY);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
44 void DrawGemsCount(int a1, char* text, POINT* pXY);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
45 void DrawBeastsCount(int a1, char *text, POINT *pXY);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
46 void DrawPlayersTowers();
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
47 void DrawPlayersWall();
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
48 void DrawCards();
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
49 void DrawCardAnimation(int a1);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
50 int GetPlayerHandCardCount(int player_num);
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
51 signed int DrawCardsRectangles(int player_num);
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
52 bool DiscardCard(int player_num, signed int card_slot_index);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
53 bool PlayCard(int player_num, signed int card_slot_num);
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
54 bool CanCardBePlayed(int player_num, int hand_card_indx);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
55 void ApplyCardToPlayer(int player_num, unsigned int uCardID);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
56 int am_40D2B4(POINT* a1, int a2); // weak
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
57 int ApplyDamageToBuildings(int player_num, int damage); // weak
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
58 void GameResultsApply();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
59
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
60 void pPrimaryWindow_draws_text(int a1, const char *pText, POINT *pXY);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1393
diff changeset
61 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3); // idb
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
62 void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
63 void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3);
1458
934074e7fcc1 ModalWindow
Nomad
parents: 1393
diff changeset
64 void am_EndScene();
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
65 void DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
66 void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor );
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
67 void SetPixel(POINT *pTargetXY, unsigned __int16 uColor);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
68 int rand_interval(int min, int max); // idb
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
69 void __fastcall intToString(int val, char *pOut);
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
70
1393
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
71 //----- (0040DEDB) --------------------------------------------------------
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
72 unsigned int R8G8B8_to_TargetFormat(int uColor)
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
73 {
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
74 return TargetColor(LOBYTE(uColor), BYTE1(uColor), BYTE2(uColor));
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
75 }
28f87f5234a1 More hardcoded UI colors moved to varibables.
Nomad
parents: 1303
diff changeset
76
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
77 /* 388 */
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
78 #pragma pack(push, 1)
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
79 struct ArcomageStartConditions
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
80 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
81 __int16 max_tower;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
82 __int16 max_resources;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
83 __int16 tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
84 __int16 wall_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
85 __int16 quarry_level;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
86 __int16 magic_level;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
87 __int16 zoo_level;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
88 __int16 bricks_amount;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
89 __int16 gems_amount;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
90 __int16 beasts_amount;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
91 int mastery_lvl;
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
92 };
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
93 #pragma pack(pop)
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
94 const ArcomageStartConditions start_conditions[13] =
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
95 {
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
96 { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
97 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
98 { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
99 { 75, 200, 25, 10, 3, 3, 3, 5, 5, 5, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
100 { 75, 200, 20, 10, 3, 3, 3, 5, 5, 5, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
101 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
102 {100, 300, 30, 15, 4, 4, 4, 10, 10, 10, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
103 {150, 400, 20, 10, 5, 5, 5, 25, 25, 25, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
104 {200, 500, 20, 10, 1, 1, 1, 15, 15, 15, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
105 {100, 300, 20, 50, 1, 1, 5, 5, 5, 25, 0},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
106 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 2},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
107 {125, 350, 10, 20, 3, 1, 2, 15, 5, 10, 1},
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
108 {100, 300, 50, 50, 5, 3, 5, 20, 10, 20, 0}
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
109 };
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
110
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
111 #define SIG_trpg 0x67707274
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
112 #define SIG_xxxx 0x78787878
0
Ritor1
parents:
diff changeset
113
Ritor1
parents:
diff changeset
114 ArcomageGame *pArcomageGame = new ArcomageGame;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
115
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
116 ArcomagePlayer am_Players[2];
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
117 Acromage_st1 shown_cards[10]; //amuint_4FAA78; // weak
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
118 stru272 array_4FABD0[10];
935
b462b598b97a stru272.h removed, stuff moved to arcomage
Nomad
parents: 856
diff changeset
119
1201
Gloval
parents: 1200
diff changeset
120
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
121 ArcomageDeck playDeck;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
122 ArcomageDeck deckMaster;
1201
Gloval
parents: 1200
diff changeset
123
Gloval
parents: 1200
diff changeset
124 char Player2Name[] = "Enemy";
Gloval
parents: 1200
diff changeset
125 char Player1Name[] = "Player";
Gloval
parents: 1200
diff changeset
126 char pDeckMaster[] = "Master Deck";
0
Ritor1
parents:
diff changeset
127
Ritor1
parents:
diff changeset
128 /* 267 */
Ritor1
parents:
diff changeset
129 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
130 struct stru273
Ritor1
parents:
diff changeset
131 {
Ritor1
parents:
diff changeset
132 bool _40DD2F();
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
133 bool Inside(RECT*pXYZW);
0
Ritor1
parents:
diff changeset
134
Ritor1
parents:
diff changeset
135 int x;
Ritor1
parents:
diff changeset
136 int y;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
137 char curr_mouse_left;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
138 char mouse_left_state_changed;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
139 char curr_mouse_right;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
140 char mouse_right_state_changed;
0
Ritor1
parents:
diff changeset
141 };
Ritor1
parents:
diff changeset
142 #pragma pack(pop)
Ritor1
parents:
diff changeset
143
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
144
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
145 #pragma pack(push, 1)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
146 struct am_2
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
147 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
148 int slot_index;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
149 int card_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
150 };
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
151 #pragma pack(pop)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
152
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
153 am_2 cards_power[10];
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
154 std::array<__int16, 12> am_sounds;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
155
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
156 char byte_4E185C = 1; // weak
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
157 char am_byte_4E185D = 1; // weak
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
158 char use_start_bonus = 1; // weak
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
159
1201
Gloval
parents: 1200
diff changeset
160 int start_tower_height;
Gloval
parents: 1200
diff changeset
161 int start_wall_height;
Gloval
parents: 1200
diff changeset
162 int start_quarry_level;
Gloval
parents: 1200
diff changeset
163 int start_magic_level;
Gloval
parents: 1200
diff changeset
164 int start_zoo_level;
Gloval
parents: 1200
diff changeset
165
Gloval
parents: 1200
diff changeset
166
Gloval
parents: 1200
diff changeset
167 int minimum_cards_at_hand = 5;
Gloval
parents: 1200
diff changeset
168 int quarry_bonus = 1;
Gloval
parents: 1200
diff changeset
169 int magic_bonus = 1;
Gloval
parents: 1200
diff changeset
170 int zoo_bonus = 1;
Gloval
parents: 1200
diff changeset
171
Gloval
parents: 1200
diff changeset
172 int max_tower_height = 50;
Gloval
parents: 1200
diff changeset
173 int max_resources_amount = 100 ;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
174
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
175 int opponent_mastery = 1 ; // weak
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
176
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
177 char byte_4FAA2C; // weak
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
178 char byte_4FAA2D; // weak
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
179
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
180 int current_player_num; // idb
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
181 char need_to_discard_card; // weak
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
182
1201
Gloval
parents: 1200
diff changeset
183 signed int current_card_slot_index;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
184 int played_card_id; // idb 4FABC0
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
185 int uCardID; // idb 4FAA50
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
186
1201
Gloval
parents: 1200
diff changeset
187 int deck_walk_index;
Gloval
parents: 1200
diff changeset
188
Gloval
parents: 1200
diff changeset
189 int start_bricks_amount;
Gloval
parents: 1200
diff changeset
190 int start_gems_amount;
Gloval
parents: 1200
diff changeset
191 int start_beasts_amount;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
192
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
193 POINT amuint_4FAA3C_blt_xy;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
194 POINT am_uint_4FAA44_blt_xy;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
195 POINT amuint_4FAA54_blt_xy;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
196 POINT amuint_4FAA5C_blt_xy;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
197
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
198 int dword_4FAA64; // weak
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
199 int dword_4FAA68; // weak
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
200
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
201 int dword_4FABB8; // weak
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
202
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
203 char byte_4FAA00; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
204
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
205 int amuint_4FAA34; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
206 int amuint_4FAA38; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
207 int amuint_4FAA4C; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
208
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
209 char byte_4FAA2E; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
210
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
211 int dword_4FAA70; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
212 char byte_4FAA74; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
213 char am_byte_4FAA75; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
214 char am_byte_4FAA76; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
215
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
216 int amuint_4FABC4; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
217
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
218
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
219 char byte_505880; // weak
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
220 char byte_505881; // weak
0
Ritor1
parents:
diff changeset
221
Ritor1
parents:
diff changeset
222 //----- (0040DD2F) --------------------------------------------------------
Ritor1
parents:
diff changeset
223 bool stru273::_40DD2F()
Ritor1
parents:
diff changeset
224 {
Ritor1
parents:
diff changeset
225
Ritor1
parents:
diff changeset
226 this->x = pArcomageGame->mouse_x;
Ritor1
parents:
diff changeset
227 this->y = pArcomageGame->mouse_y;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
228 this->curr_mouse_left = pArcomageGame->mouse_left;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
229 this->mouse_left_state_changed = pArcomageGame->mouse_left == pArcomageGame->prev_mouse_left;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
230 this->curr_mouse_right = pArcomageGame->mouse_right;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
231 this->mouse_right_state_changed = pArcomageGame->mouse_right == pArcomageGame->prev_mouse_right;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
232 pArcomageGame->prev_mouse_left = pArcomageGame->mouse_left;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
233 pArcomageGame->prev_mouse_right = pArcomageGame->mouse_right;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
234 return true;
0
Ritor1
parents:
diff changeset
235 }
Ritor1
parents:
diff changeset
236
Ritor1
parents:
diff changeset
237 //----- (0040DD93) --------------------------------------------------------
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
238 bool stru273::Inside(RECT*pXYZW )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
239 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
240
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
241 return (x >= pXYZW->left) && (x <= pXYZW->right) &&
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
242 (y>= pXYZW->top) && (y <= pXYZW->bottom);
0
Ritor1
parents:
diff changeset
243 }
Ritor1
parents:
diff changeset
244
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
245 //----- (0040DFD1) --------------------------------------------------------
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
246 void stru272_stru0::Ctor(stru272_stru0 **a1)
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
247 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
248 stru272_stru0 *v2; // eax@1
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
249 v2 = (stru272_stru0 *)malloc(0x5Cu);
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
250 *a1 = v2;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
251 v2->signature = SIG_trpg;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
252 v2->position_in_sparks_arr = 0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
253 v2->field_30 = 0.0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
254 v2->field_58 = 0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
255 v2->field_59 = 0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
256 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
257
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
258 //----- (0040DFFE) --------------------------------------------------------
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
259 int stru272_stru0::Dtor()
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
260 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
261
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
262 if ( this->signature == SIG_trpg )
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
263 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
264 this->signature = SIG_xxxx;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
265 free(this);
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
266 return 0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
267 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
268 else
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
269 return 2;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
270
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
271 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
272
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
273 //----- (0040E01A) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
274 int stru272_stru0::StartFill( stru272_stru2* a2 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
275 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
276 auto a1 = this;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
277 if ( a1->signature == SIG_trpg )
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
278 {
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
279 a1->field_4 = a2->field_20;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
280 a1->field_C = a2->effect_area.left << 16;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
281 a1->field_10 = a2->effect_area.top << 16;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
282 a1->field_14 = a2->effect_area.right << 16;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
283 a1->field_18 = a2->effect_area.bottom << 16;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
284 a1->field_1C = a2->field_10;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
285 a1->field_20 = a2->field_14;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
286 a1->field_24 = a2->field_18;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
287 a1->field_28 = (float)(a2->field_1Cf * 65536.0);
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
288 a1->field_2C = a2->field_24f;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
289 a1->field_34 = (int)(a2->field_28f * 65536.0);
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
290 a1->field_38 = (int)(a2->field_2Cf * 65536.0);
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
291 a1->field_3C = a2->field_30;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
292 a1->field_40 = a2->field_34;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
293 a1->field_54 = a2->sparks_array;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
294 a1->field_59 = 1;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
295
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
296 return 0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
297 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
298 else
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
299 return 2;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
300 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
301
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
302 //----- (0040E0F5) --------------------------------------------------------
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
303 int stru272_stru0::Empty(char a2, char a3)
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
304 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
305 if ( signature == SIG_trpg)
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
306 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
307 if ( a2 )
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
308 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
309 position_in_sparks_arr = 0;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
310 field_30 = 0.0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
311 }
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
312 if ( field_59 && a3 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
313 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
314
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
315 for (int i=0; i<field_4; ++i)
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
316 field_54[i].have_spark = 0;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
317 field_58 = 0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
318 }
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
319 return 0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
320 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
321 else
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
322 return 2;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
323 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
324
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
325 //----- (0040E133) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
326 int stru272_stru0::DrawEffect()
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
327 {
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
328
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
329 stru272_stru0 *v1; // edi@1
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
330 int v3; // ST18_4@3
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
331 double v4; // st7@3
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
332 double v5; // st6@4
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
333 char v6; // bl@8
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
334 stru272_stru1 *v7; // esi@8
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
335 int v8; // ecx@10
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
336 signed int v9; // eax@10
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
337 int v10; // ecx@10
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
338 signed int v11; // eax@10
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
339 int v12; // ebx@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
340 int v13; // ST1C_4@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
341 int v14; // ebx@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
342 int v15; // ST1C_4@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
343 signed int v16; // edx@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
344 int v17; // ebx@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
345 int v18; // ST1C_4@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
346 signed int v19; // edx@12
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
347 int v20; // [sp+8h] [bp-10h]@8
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
348 int v21; // [sp+Ch] [bp-Ch]@8
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
349 float v22; // [sp+14h] [bp-4h]@3
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
350
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
351 v1 = this;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
352 if ( this->signature != SIG_trpg )
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
353 return 2;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
354 v3 = this->position_in_sparks_arr;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
355 v22 = this->field_30;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
356 v4 = v3;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
357 if ( v3 > 0 )
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
358 {
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
359 v5 = v22 + this->field_2C;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
360 v22 = v5;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
361 if ( v5 > v4 )
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
362 v22 = v4;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
363 }
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
364 if ( v22 >= 1.0 || this->field_58 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
365 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
366 v6 = 0;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
367 v7 = this->field_54;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
368 v20 = this->field_28;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
369 v21 = this->field_4;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
370 while ( v7->have_spark <= 0 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
371 {
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
372 if ( v22 >= 1.0 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
373 {
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
374 v12 = v1->field_40;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
375 v13 = v1->field_3C;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
376 v7->have_spark = rand_interval(v13,v12);
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
377 v7->field_14 = (rand() % 17 - 8) << 16;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
378 v7->field_18 = (rand() % 17 - 8) << 16;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
379
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
380 v14 = v1->field_14 - 1;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
381 v15 = v1->field_C;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
382 v16 = rand_interval(v15,v14);
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
383 v7->field_C = v16;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
384 v7->spark_position.x = v16 >> 16;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
385
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
386 v17 = v1->field_18 - 1;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
387 v18 = v1->field_10;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
388 v19 = rand_interval(v17, v18);
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
389 v7->field_10 = v19;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
390 v7->spark_position.y = v19 >> 16;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
391 --v1->position_in_sparks_arr;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
392 v22 = v22 - 1.0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
393 goto LABEL_13;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
394 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
395 LABEL_14:
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
396 ++v7;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
397 --v21;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
398 if ( !v21 )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
399 {
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
400 v1->field_58 = v6;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
401 v1->field_30 = v22;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
402 return 0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
403 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
404 }
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
405 v8 = v7->field_14;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
406 --v7->have_spark;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
407 v9 = v8 + v7->field_C;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
408
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
409 v10 = v20 + v7->field_18;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
410 v7->field_C = v9;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
411 v7->spark_position.x = v9 >> 16;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
412
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
413 v11 = v10 + v7->field_10;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
414 v7->field_18 = v10;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
415 v7->field_10 = v11;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
416 v7->spark_position.y = v11 >> 16;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
417 LABEL_13:
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
418 v6 = 1;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
419 goto LABEL_14;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
420 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
421 return 0;
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
422 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
423
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
424 //----- (0040E2A7) --------------------------------------------------------
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
425 int stru272_stru0::_40E2A7()
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
426 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
427
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
428 if (signature == SIG_trpg )
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
429 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
430 if ( position_in_sparks_arr <= 0 )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
431 return field_58 != 0 ? 2 : 0;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
432 else
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
433 return 1;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
434 }
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
435 else
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
436 return 3;
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
437 }
0
Ritor1
parents:
diff changeset
438
Ritor1
parents:
diff changeset
439
Ritor1
parents:
diff changeset
440 //----- (0040DFAF) --------------------------------------------------------
Ritor1
parents:
diff changeset
441 void ArcomageGame::OnMouseClick(char right_left, bool bDown)
Ritor1
parents:
diff changeset
442 {
Ritor1
parents:
diff changeset
443 if ( right_left )
Ritor1
parents:
diff changeset
444 pArcomageGame->mouse_right = bDown;
Ritor1
parents:
diff changeset
445 else
Ritor1
parents:
diff changeset
446 pArcomageGame->mouse_left = bDown;
Ritor1
parents:
diff changeset
447 }
Ritor1
parents:
diff changeset
448
Ritor1
parents:
diff changeset
449 //----- (0040DFC1) --------------------------------------------------------
Ritor1
parents:
diff changeset
450 void ArcomageGame::OnMouseMove(POINT *pXY)
Ritor1
parents:
diff changeset
451 {
Ritor1
parents:
diff changeset
452 pArcomageGame->mouse_x = pXY->x;
Ritor1
parents:
diff changeset
453 pArcomageGame->mouse_y = pXY->y;
Ritor1
parents:
diff changeset
454 }
Ritor1
parents:
diff changeset
455
Ritor1
parents:
diff changeset
456
Ritor1
parents:
diff changeset
457 //----- (0040DF47) --------------------------------------------------------
Ritor1
parents:
diff changeset
458 void DoBlt_Copy(unsigned __int16 *pPixels)
Ritor1
parents:
diff changeset
459 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
460 RECT pSrcRect;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
461 POINT pTargetPoint; // [sp+1Ch] [bp-8h]@1
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
462
0
Ritor1
parents:
diff changeset
463 pRenderer->Present();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
464
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
465 pTargetPoint.x = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
466 pTargetPoint.y = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
467
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
468 pSrcRect.left = 0;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
469 pSrcRect.top = 0;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
470 pSrcRect.right = 640;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
471 pSrcRect.bottom = 480;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
472
0
Ritor1
parents:
diff changeset
473 pRenderer->BeginScene();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
474 pArcomageGame->pBlit_Copy_pixels = pPixels;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
475 Blt_Copy(&pSrcRect, &pTargetPoint, 2);
0
Ritor1
parents:
diff changeset
476 pRenderer->EndScene();
Ritor1
parents:
diff changeset
477 pArcomageGame->pBlit_Copy_pixels = 0;
Ritor1
parents:
diff changeset
478 }
Ritor1
parents:
diff changeset
479
Ritor1
parents:
diff changeset
480 //----- (0040DDC9) --------------------------------------------------------
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
481 void ArcomageGame::PlaySound( unsigned int event_id )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
482 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
483 SoundID play_sound_id; // eax@10
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
484
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
485 switch ( event_id )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
486 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
487 case 40:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
488 case 43:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
489 case 46:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
490 play_sound_id = SOUND_Arcomage_LoseResources;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
491 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
492 case 39:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
493 case 41:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
494 case 42:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
495 case 44:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
496 case 45:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
497 case 47:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
498 play_sound_id = SOUND_Arcomage_AddResources;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
499 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
500 case 0:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
501 case 12:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
502 case 14:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
503 case 15:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
504 case 16:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
505 case 48:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
506 case 50:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
507 case 53:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
508 play_sound_id = SOUND_Arcomage_TowerWallDamage;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
509 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
510 case 21:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
511 case 22:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
512 case 23:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
513 play_sound_id = SOUND_Arcomage_DrawCard;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
514 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
515 case 56:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
516 play_sound_id = SOUND_Arcomage_124;
0
Ritor1
parents:
diff changeset
517 break;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
518 case 31:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
519 case 34:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
520 case 37:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
521 play_sound_id = SOUND_Arcomage_ProductionDamage;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
522 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
523 case 1:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
524 case 30:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
525 case 32:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
526 case 33:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
527 case 35:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
528 case 36:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
529 case 38:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
530 play_sound_id = SOUND_Arcomage_ProductionUpgrade;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
531 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
532 case 20:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
533 play_sound_id = SOUND_Arcomage_127;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
534 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
535 case 3:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
536 play_sound_id = SOUND_Arcomage_128;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
537 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
538 case 52:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
539 case 54:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
540 play_sound_id = SOUND_Arcomage_TowerUpgrade;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
541 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
542 case 10:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
543 case 11:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
544 case 13:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
545 play_sound_id = SOUND_Arcomage_130;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
546 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
547 case 55u:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
548 play_sound_id = SOUND_Arcomage_131;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
549 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
550 case 49:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
551 case 51:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
552 play_sound_id = SOUND_Arcomage_WallUpgrade;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
553 break;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
554 default:
0
Ritor1
parents:
diff changeset
555 return;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
556 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
557 pAudioPlayer->PlaySound(play_sound_id, 0, 0, -1, 0, 0, 0, 0);
0
Ritor1
parents:
diff changeset
558 }
Ritor1
parents:
diff changeset
559
Ritor1
parents:
diff changeset
560 //----- (0040DC2D) --------------------------------------------------------
Ritor1
parents:
diff changeset
561 bool ArcomageGame::MsgLoop(int a1, ArcomageGame_stru1 *a2)
Ritor1
parents:
diff changeset
562 {
Ritor1
parents:
diff changeset
563 void *v2; // ebp@1
Ritor1
parents:
diff changeset
564 BOOL v3; // eax@1
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
565 //int v4; // edx@6
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
566 //int v5; // edx@6
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
567 //int v6; // eax@6
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
568 //int v7; // edx@7
0
Ritor1
parents:
diff changeset
569
Ritor1
parents:
diff changeset
570 v2 = a2;
Ritor1
parents:
diff changeset
571 pArcomageGame->field_0 = 0;
Ritor1
parents:
diff changeset
572 pArcomageGame->stru1.field_0 = 0;
Ritor1
parents:
diff changeset
573 v3 = PeekMessageA(&pArcomageGame->msg, 0, 0, 0, PM_REMOVE);
Ritor1
parents:
diff changeset
574 if ( pArcomageGame->msg.message == WM_QUIT )
Ritor1
parents:
diff changeset
575 Game_DeinitializeAndTerminate(0);
Ritor1
parents:
diff changeset
576 if ( v3 > 0 )
Ritor1
parents:
diff changeset
577 {
Ritor1
parents:
diff changeset
578 TranslateMessage(&pArcomageGame->msg);
Ritor1
parents:
diff changeset
579 DispatchMessageA(&pArcomageGame->msg);
Ritor1
parents:
diff changeset
580 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
581 /*if (pAsyncMouse)
0
Ritor1
parents:
diff changeset
582 {
Ritor1
parents:
diff changeset
583 EnterCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
Ritor1
parents:
diff changeset
584 v4 = *((unsigned int *)pAsyncMouse + 7);
Ritor1
parents:
diff changeset
585 pArcomageGame->mouse_x = *((unsigned int *)pAsyncMouse + 6);
Ritor1
parents:
diff changeset
586 pArcomageGame->mouse_y = v4;
Ritor1
parents:
diff changeset
587 v5 = *((unsigned int *)pAsyncMouse + 27);
Ritor1
parents:
diff changeset
588 v6 = *(unsigned int *)v5;
Ritor1
parents:
diff changeset
589 if ( *(unsigned int *)v5 != v5 )
Ritor1
parents:
diff changeset
590 {
Ritor1
parents:
diff changeset
591 do
Ritor1
parents:
diff changeset
592 {
Ritor1
parents:
diff changeset
593 v7 = *(unsigned int *)(v6 + 20);
Ritor1
parents:
diff changeset
594 if ( v7 & 1 )
Ritor1
parents:
diff changeset
595 {
Ritor1
parents:
diff changeset
596 pArcomageGame->stru1.field_0 = 7;
Ritor1
parents:
diff changeset
597 }
Ritor1
parents:
diff changeset
598 else
Ritor1
parents:
diff changeset
599 {
Ritor1
parents:
diff changeset
600 if ( v7 & 2 )
Ritor1
parents:
diff changeset
601 pArcomageGame->stru1.field_0 = 8;
Ritor1
parents:
diff changeset
602 }
Ritor1
parents:
diff changeset
603 v6 = *(unsigned int *)v6;
Ritor1
parents:
diff changeset
604 }
Ritor1
parents:
diff changeset
605 while ( v6 != *((unsigned int *)pAsyncMouse + 27) );
Ritor1
parents:
diff changeset
606 }
Ritor1
parents:
diff changeset
607 pAsyncMouse->_46B944();
Ritor1
parents:
diff changeset
608 if ( !*((unsigned char *)pAsyncMouse + 90) )
Ritor1
parents:
diff changeset
609 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
610 LeaveCriticalSection(&pGame->pThreadWardInstance->csAsyncMouse);
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
611 }*/
0
Ritor1
parents:
diff changeset
612 memcpy(v2, &pArcomageGame->stru1, 0xCu);
Ritor1
parents:
diff changeset
613 return pArcomageGame->stru1.field_0 != 0;
Ritor1
parents:
diff changeset
614 }
Ritor1
parents:
diff changeset
615
Ritor1
parents:
diff changeset
616
Ritor1
parents:
diff changeset
617 //----- (0040D7D5) --------------------------------------------------------
Ritor1
parents:
diff changeset
618 void am_BeginScene(unsigned __int16 *pPcxPixels, int a2, int a3)
Ritor1
parents:
diff changeset
619 {
Ritor1
parents:
diff changeset
620 pRenderer->BeginScene();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
621 pArcomageGame->pBlit_Copy_pixels = pPcxPixels;
0
Ritor1
parents:
diff changeset
622 }
Ritor1
parents:
diff changeset
623
Ritor1
parents:
diff changeset
624 //----- (0040D7EC) --------------------------------------------------------
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
625 void __fastcall Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode)
0
Ritor1
parents:
diff changeset
626 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
627
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
628 unsigned __int16 *pSrc; // eax@2
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
629 unsigned __int16 *dest_surf_pos; // edi@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
630 int uSrcTotalWidth; // ecx@4
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
631 unsigned int v10; // esi@9
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
632 int v21; // [sp+Ch] [bp-18h]@8
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
633 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
634 __int32 src_width; // [sp+14h] [bp-10h]@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
635 __int32 src_height; // [sp+18h] [bp-Ch]@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
636 int uSrcPitch; // [sp+1Ch] [bp-8h]@5
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
637
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
638
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
639 if ( !pRenderer->uNumSceneBegins )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
640 return;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
641 if ( !pArcomageGame->pBlit_Copy_pixels )
0
Ritor1
parents:
diff changeset
642 return;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
643
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
644 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch];
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
645 src_width = pSrcRect->right - pSrcRect->left;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
646 src_height = pSrcRect->bottom - pSrcRect->top;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
647
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
648 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
649 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
650 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
651 uSrcTotalWidth = pArcomageGame->pSprites.uWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
652
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
653 //v20 = 157;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
654 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp";
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
655 //v21 = &v18;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
656 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
657 //466D09_xcpt_string(&v21, v18, v19, v20);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
658 //pSrc = pArcomageGame.pBlit_Copy_pixels;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
659 //LABEL_9:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
660 pSrc = pArcomageGame->pBlit_Copy_pixels;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
661 uSrcPitch = uSrcTotalWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
662
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
663 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top];
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
664 v10 = 0xFFu >> (8 - (unsigned __int8)pRenderer->uTargetBBits);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
665 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
666
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
667
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
668 if ( blend_mode == 2 )
0
Ritor1
parents:
diff changeset
669 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
670 uSrcPitch = (uSrcPitch - src_width);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
671 for (int i=0; i< src_height; ++i)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
672 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
673 for (int j=0; j< src_width; ++j)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
674 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
675 if ( *src_surf_pos != v10 )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
676 *dest_surf_pos = *src_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
677 ++dest_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
678 ++src_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
679 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
680 src_surf_pos+=uSrcPitch;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
681 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
682 }
0
Ritor1
parents:
diff changeset
683 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
684 else
0
Ritor1
parents:
diff changeset
685 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
686 uSrcPitch = (uSrcPitch - src_width);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
687 for (int i=0; i< src_height; ++i)
0
Ritor1
parents:
diff changeset
688 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
689 for (int j=0; j< src_width; ++j)
0
Ritor1
parents:
diff changeset
690 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
691 if ( *src_surf_pos != v10 )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
692 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1));
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
693 ++dest_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
694 ++src_surf_pos;
0
Ritor1
parents:
diff changeset
695 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
696 src_surf_pos+=uSrcPitch;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
697 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width;
0
Ritor1
parents:
diff changeset
698 }
Ritor1
parents:
diff changeset
699 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
700
0
Ritor1
parents:
diff changeset
701 }
Ritor1
parents:
diff changeset
702
Ritor1
parents:
diff changeset
703 //----- (0040D9B1) --------------------------------------------------------
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
704 void Blt_Copy( RECT *pSrcRect, POINT *pTargetPoint, int blend_mode )
0
Ritor1
parents:
diff changeset
705 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
706
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
707 unsigned __int16 *pSrc; // eax@2
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
708 unsigned __int16 *dest_surf_pos; // edi@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
709 int uSrcTotalWidth; // ecx@4
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
710 int v21; // [sp+Ch] [bp-18h]@8
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
711 unsigned __int16 *src_surf_pos; // [sp+10h] [bp-14h]@9
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
712 __int32 src_width; // [sp+14h] [bp-10h]@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
713 __int32 src_height; // [sp+18h] [bp-Ch]@3
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
714 int uSrcPitch; // [sp+1Ch] [bp-8h]@5
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
715
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
716 if ( !pRenderer->uNumSceneBegins )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
717 return;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
718 if ( !pArcomageGame->pBlit_Copy_pixels )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
719 return;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
720
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
721 dest_surf_pos = &pRenderer->pTargetSurface[pTargetPoint->x + pTargetPoint->y * pRenderer->uTargetSurfacePitch];
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
722 src_width = pSrcRect->right - pSrcRect->left;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
723 src_height = pSrcRect->bottom - pSrcRect->top;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
724
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
725 if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pBackgroundPixels )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
726 uSrcTotalWidth = pArcomageGame->pGameBackground.uWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
727 else if ( pArcomageGame->pBlit_Copy_pixels == pArcomageGame->pSpritesPixels )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
728 uSrcTotalWidth = pArcomageGame->pSprites.uWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
729
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
730 //v20 = 157;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
731 //v19 = "E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\am_nw.cpp";
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
732 //v21 = &v18;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
733 //std__string_char_40E2C8(&v18, "Problem in Blit_Chroma", &a3a);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
734 //466D09_xcpt_string(&v21, v18, v19, v20);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
735 //pSrc = pArcomageGame.pBlit_Copy_pixels;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
736 //LABEL_9:
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
737 pSrc = pArcomageGame->pBlit_Copy_pixels;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
738 uSrcPitch = uSrcTotalWidth;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
739
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
740 src_surf_pos = &pSrc[pSrcRect->left + uSrcPitch * pSrcRect->top];
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
741 v21 = (pRenderer->uTargetGBits != 6 ? 0x31EF : 0x7BEF);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
742
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
743 if ( blend_mode == 2 )
0
Ritor1
parents:
diff changeset
744 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
745 uSrcPitch = (uSrcPitch - src_width);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
746 for (int i=0; i< src_height; ++i)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
747 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
748 for (int j=0; j< src_width; ++j)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
749 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
750 *dest_surf_pos = *src_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
751 ++dest_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
752 ++src_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
753 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
754 src_surf_pos+=uSrcPitch;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
755 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
756 }
0
Ritor1
parents:
diff changeset
757 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
758 else
0
Ritor1
parents:
diff changeset
759 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
760 uSrcPitch = (uSrcPitch - src_width);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
761 for (int i=0; i< src_height; ++i)
0
Ritor1
parents:
diff changeset
762 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
763 for (int j=0; j< src_width; ++j)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
764 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
765 *dest_surf_pos = (v21 & (*dest_surf_pos >> 1)) + (v21 & (*src_surf_pos >> 1));
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
766 ++dest_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
767 ++src_surf_pos;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
768 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
769 src_surf_pos+=uSrcPitch;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
770 dest_surf_pos += pRenderer->uTargetSurfacePitch - src_width;
0
Ritor1
parents:
diff changeset
771 }
Ritor1
parents:
diff changeset
772 }
Ritor1
parents:
diff changeset
773 }
Ritor1
parents:
diff changeset
774
Ritor1
parents:
diff changeset
775 //----- (0040DB10) --------------------------------------------------------
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
776 void am_EndScene()
0
Ritor1
parents:
diff changeset
777 {
Ritor1
parents:
diff changeset
778 pRenderer->EndScene();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
779 pArcomageGame->pBlit_Copy_pixels = NULL;
0
Ritor1
parents:
diff changeset
780 }
Ritor1
parents:
diff changeset
781
Ritor1
parents:
diff changeset
782 //----- (0040D7B7) --------------------------------------------------------
Ritor1
parents:
diff changeset
783 bool ArcomageGame::LoadSprites()
Ritor1
parents:
diff changeset
784 {
Ritor1
parents:
diff changeset
785 pArcomageGame->pSprites.Load("sprites.pcx", 2);
Ritor1
parents:
diff changeset
786 pArcomageGame->pSpritesPixels = pArcomageGame->pSprites.pPixels;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
787 return true;
0
Ritor1
parents:
diff changeset
788 }
Ritor1
parents:
diff changeset
789
Ritor1
parents:
diff changeset
790 //----- (0040D799) --------------------------------------------------------
Ritor1
parents:
diff changeset
791 bool ArcomageGame::LoadBackground()
Ritor1
parents:
diff changeset
792 {
Ritor1
parents:
diff changeset
793 pArcomageGame->pGameBackground.Load("layout.pcx", 2);
Ritor1
parents:
diff changeset
794 pArcomageGame->pBackgroundPixels = pArcomageGame->pGameBackground.pPixels;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
795 return true;
0
Ritor1
parents:
diff changeset
796 }
Ritor1
parents:
diff changeset
797
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
798 int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
799 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
800 enum V_INDX{
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
801 P_TOWER_M10,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
802 P_WALL_M10,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
803 E_TOWER,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
804 E_WALL,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
805 E_BUILDINGS,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
806 E_QUARRY,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
807 E_MAGIC,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
808 E_ZOO,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
809 E_RES,
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
810 V_INDEX_MAX
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
811 };
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
812
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
813 const int mastery_coeff[V_INDEX_MAX][2]= {{10, 5}, //P_TOWER_M10
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
814 {2, 1}, //P_WALL_M10
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
815 {1, 10}, //E_TOWER
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
816 {1, 3}, //E_WALL
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
817 {1, 7}, //E_BUILDINGS
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
818 {1, 5}, //E_QUARRY
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
819 {1, 40}, //E_MAGIC
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
820 {1, 40}, //E_ZOO
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
821 {1, 2} //E_RES
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
822 };
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
823 int card_power= 0;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
824 int element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
825
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
826
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
827 if ( pCard->to_player_tower == 99 || pCard->to_pl_enm_tower == 99||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
828 pCard->to_player_tower2 == 99 || pCard->to_pl_enm_tower2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
829 element_power = enemy->tower_height - player->tower_height;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
830 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
831 element_power = pCard->to_player_tower + pCard->to_pl_enm_tower + pCard->to_player_tower2 + pCard->to_pl_enm_tower2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
832
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
833 if ( player->tower_height >= 10 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
834 card_power += mastery_coeff[P_TOWER_M10][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
835 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
836 card_power += 20*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
837
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
838
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
839 if ( pCard->to_player_wall == 99 || pCard->to_pl_enm_wall == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
840 pCard->to_player_wall2 == 99 || pCard->to_pl_enm_wall2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
841 element_power = enemy->wall_height - player->wall_height;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
842 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
843 element_power = pCard->to_player_wall + pCard->to_pl_enm_wall +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
844 pCard->to_player_wall2 + pCard->to_pl_enm_wall2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
845 if ( player->wall_height >= 10 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
846 card_power += mastery_coeff[P_WALL_M10][mastery]*element_power; //1
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
847 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
848 card_power += 5*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
849
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
850
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
851 card_power += 7 * (pCard->to_player_buildings + pCard->to_pl_enm_buildings +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
852 pCard->to_player_buildings2 + pCard->to_pl_enm_buildings2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
853
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
854 if ( pCard->to_player_quarry_lvl == 99 || pCard->to_pl_enm_quarry_lvl == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
855 pCard->to_player_quarry_lvl2 == 99 || pCard->to_pl_enm_quarry_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
856 element_power = enemy->quarry_level - player->quarry_level;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
857 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
858 element_power = pCard->to_player_quarry_lvl + pCard->to_pl_enm_quarry_lvl +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
859 pCard->to_player_quarry_lvl2 + pCard->to_pl_enm_quarry_lvl;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
860
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
861 card_power += 40 * element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
862
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
863 if ( pCard->to_player_magic_lvl == 99 || pCard->to_pl_enm_magic_lvl == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
864 pCard->to_player_magic_lvl2 == 99 || pCard->to_pl_enm_magic_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
865 element_power = enemy->magic_level - player->magic_level;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
866 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
867 element_power = pCard->to_player_magic_lvl + pCard->to_pl_enm_magic_lvl +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
868 pCard->to_player_magic_lvl2 + pCard->to_pl_enm_magic_lvl2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
869 card_power += 40 *element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
870
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
871 if ( pCard->to_player_zoo_lvl == 99 || pCard->to_pl_enm_zoo_lvl == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
872 pCard->to_player_zoo_lvl2 == 99 || pCard->to_pl_enm_zoo_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
873 element_power = enemy->zoo_level - player->zoo_level;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
874 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
875 element_power = pCard->to_player_zoo_lvl + pCard->to_pl_enm_zoo_lvl +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
876 pCard->to_player_zoo_lvl2 + pCard->to_pl_enm_zoo_lvl2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
877 card_power += 40 *element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
878
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
879 if ( pCard->to_player_bricks == 99 || pCard->to_pl_enm_bricks == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
880 pCard->to_player_bricks2 == 99 || pCard->to_pl_enm_bricks2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
881 element_power = enemy->resource_bricks - player->resource_bricks;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
882 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
883 element_power = pCard->to_player_bricks + pCard->to_pl_enm_bricks +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
884 pCard->to_player_bricks2 + pCard->to_pl_enm_bricks2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
885 card_power += 2 *element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
886
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
887
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
888 if ( pCard->to_player_gems == 99 || pCard->to_pl_enm_gems == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
889 pCard->to_player_gems2 == 99 || pCard->to_pl_enm_gems2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
890 element_power = enemy->resource_gems - player->resource_gems;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
891 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
892 element_power = pCard->to_player_gems + pCard->to_pl_enm_gems +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
893 pCard->to_player_gems2 + pCard->to_pl_enm_gems2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
894 card_power += 2 *element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
895
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
896 if ( pCard->to_player_beasts == 99 || pCard->to_pl_enm_beasts == 99 ||
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
897 pCard->to_player_beasts2 == 99 || pCard->to_pl_enm_beasts2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
898 element_power = enemy->resource_beasts - player->resource_beasts;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
899 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
900 element_power = pCard->to_player_beasts + pCard->to_pl_enm_beasts +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
901 pCard->to_player_beasts2 + pCard->to_pl_enm_beasts2;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
902 card_power += 2 *element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
903
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
904 if ( pCard->to_enemy_tower == 99 || pCard->to_enemy_tower2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
905 element_power = player->tower_height - enemy->tower_height;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
906 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
907 element_power = -(pCard->to_enemy_tower + pCard->to_enemy_tower2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
908 card_power += mastery_coeff[E_TOWER][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
909
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
910 if ( pCard->to_enemy_wall == 99 || pCard->to_enemy_wall2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
911 element_power = player->wall_height - enemy->wall_height;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
912 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
913 element_power = -(pCard->to_enemy_wall + pCard->to_enemy_wall2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
914 card_power += mastery_coeff[E_WALL][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
915
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
916 card_power -= mastery_coeff[E_BUILDINGS][mastery]*(pCard->to_enemy_buildings + pCard->to_enemy_buildings2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
917
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
918 if ( pCard->to_enemy_quarry_lvl == 99 || pCard->to_enemy_quarry_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
919 element_power = player->quarry_level - enemy->quarry_level; //5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
920 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
921 element_power = -(pCard->to_enemy_quarry_lvl + pCard->to_enemy_quarry_lvl2); //5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
922 card_power += mastery_coeff[E_QUARRY][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
923
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
924 if ( pCard->to_enemy_magic_lvl == 99 || pCard->to_enemy_magic_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
925 element_power = player->magic_level - enemy->magic_level; //40
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
926 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
927 element_power = -(pCard->to_enemy_magic_lvl + pCard->to_enemy_magic_lvl2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
928 card_power += mastery_coeff[E_MAGIC][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
929
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
930 if ( pCard->to_enemy_zoo_lvl == 99 || pCard->to_enemy_zoo_lvl2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
931 element_power = player->zoo_level - enemy->zoo_level; //40
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
932 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
933 element_power = -(pCard->to_enemy_zoo_lvl + pCard->to_enemy_zoo_lvl2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
934 card_power += mastery_coeff[E_ZOO][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
935
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
936 if ( pCard->to_enemy_bricks == 99 || pCard->to_enemy_bricks2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
937 element_power = player->resource_bricks - enemy->resource_bricks; //2
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
938 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
939 element_power = -(pCard->to_enemy_bricks + pCard->to_enemy_bricks2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
940 card_power += mastery_coeff[E_RES][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
941
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
942 if ( pCard->to_enemy_gems == 99 || pCard->to_enemy_gems2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
943 element_power = player->resource_gems - enemy->resource_gems; //2
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
944 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
945 element_power = -(pCard->to_enemy_gems + pCard->to_enemy_gems2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
946 card_power += mastery_coeff[E_RES][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
947
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
948 if ( pCard->to_enemy_beasts == 99 || pCard->to_enemy_beasts2 == 99 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
949 element_power = player->resource_beasts - enemy->resource_beasts; //2
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
950 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
951 element_power = -(pCard->to_enemy_beasts + pCard->to_enemy_beasts2);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
952 card_power += mastery_coeff[E_RES][mastery]*element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
953
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
954 if ( pCard->field_30 || pCard->field_4D )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
955 card_power *= 10;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
956
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
957 if ( pCard->field_24 == 1 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
958 element_power = player->resource_bricks - pCard->needed_bricks;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
959 else if ( pCard->field_24 == 2 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
960 element_power = player->resource_gems - pCard->needed_gems;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
961 else if (pCard->field_24 == 3)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
962 element_power = player->resource_beasts - pCard->needed_beasts;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
963 if ( element_power > 3 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
964 element_power = 3;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
965 card_power += 5 * element_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
966
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
967 if ( enemy->tower_height <= pCard->to_enemy_tower2 + pCard->to_enemy_tower )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
968 card_power += 9999;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
969
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
970 if (pCard->to_enemy_tower2 + pCard->to_enemy_tower +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
971 pCard->to_enemy_wall + pCard->to_enemy_wall2 +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
972 pCard->to_enemy_buildings + pCard->to_enemy_buildings2 >= enemy->wall_height + enemy->tower_height)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
973 card_power += 9999;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
974
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
975 if ( (pCard->to_player_tower2 + pCard->to_pl_enm_tower2 +
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
976 pCard->to_player_tower + pCard->to_pl_enm_tower + player->tower_height) >= max_tower_height )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
977 card_power += 9999;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
978
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
979 return card_power;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
980 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
981
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
982
0
Ritor1
parents:
diff changeset
983 //----- (00408BB4) --------------------------------------------------------
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
984 bool OpponentsAITurn(int player_num)
0
Ritor1
parents:
diff changeset
985 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
986
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
987 char result; // al@3
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
988 signed int v2; // ebx@8
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
989 int v3; // esi@8
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
990 int all_player_cards_count; // eax@9
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
991 int random_card_slot; // edi@9
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
992 int v6; // eax@11
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
993 signed int v7; // eax@11
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
994 int v8; // ebx@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
995 int v9; // eax@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
996 int v10; // ecx@18
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
997 int v11; // eax@20
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
998 ArcomageCard *v12; // ecx@20
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
999 char v13; // dl@20
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1000 char v14; // dl@24
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1001 int v15; // edx@25
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1002 int v16; // edx@27
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1003 char v17; // dl@31
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1004 int v18; // edx@32
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1005 char v19; // dl@35
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1006 char v20; // dl@39
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1007 int v21; // edx@40
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1008 char v22; // dl@45
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1009 int v23; // edx@46
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1010 char v24; // dl@52
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1011 int v25; // edx@53
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1012 char v26; // dl@58
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1013 int v27; // edx@59
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1014 char v28; // dl@64
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1015 int v29; // edx@65
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1016 char v30; // dl@70
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1017 int v31; // edx@71
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1018 char v32; // dl@76
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1019 int v33; // edx@77
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1020 char v34; // dl@82
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1021 int v35; // edx@83
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1022 char v36; // dl@86
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1023 char v37; // dl@90
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1024 int v38; // edi@93
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1025 char v39; // dl@93
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1026 int v40; // esi@93
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1027 char v41; // bl@94
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1028 char v42; // dl@98
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1029 char v43; // dl@102
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1030 char v44; // dl@106
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1031 char v45; // dl@110
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1032 char v46; // dl@114
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1033 ArcomagePlayer *v47; // ebx@115
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1034 ArcomagePlayer *v48; // edx@115
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1035 int v49; // esi@123
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1036 int v50; // edx@123
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1037 int v51; // edx@126
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1038 int v52; // esi@129
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1039 int v53; // edi@137
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1040 int j; // esi@137
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1041 am_2 *v55; // eax@139
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1042 int v56; // ecx@141
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1043 int v57; // edx@141
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1044 int v58; // ebx@141
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1045 int v59; // eax@144
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1046 int v60; // esi@145
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1047 int v61; // ebx@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1048 int v62; // eax@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1049 int v63; // ecx@167
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1050 int v64; // eax@169
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1051 ArcomageCard *pCard; // ecx@169
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1052 char v66; // dl@169
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1053 char v67; // dl@173
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1054 int v68; // edx@174
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1055 int v69; // edx@176
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1056 char v70; // dl@180
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1057 char v71; // dl@183
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1058 char v72; // dl@187
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1059 int v73; // edx@188
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1060 char v74; // dl@193
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1061 char v75; // dl@199
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1062 int v76; // edx@200
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1063 char v77; // dl@205
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1064 int v78; // edx@206
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1065 char v79; // dl@211
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1066 int v80; // edx@212
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1067 char v81; // dl@217
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1068 int v82; // edx@218
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1069 char v83; // dl@223
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1070 int v84; // edx@224
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1071 char v85; // dl@229
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1072 int v86; // edx@230
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1073 char v87; // dl@233
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1074 int v88; // edx@234
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1075 char v89; // dl@237
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1076 int v90; // edx@238
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1077 int v91; // esi@240
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1078 char v92; // dl@240
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1079 int v93; // esi@240
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1080 char v94; // bl@241
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1081 int v95; // edx@243
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1082 int v96; // edi@244
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1083 char v97; // dl@245
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1084 int v98; // edx@246
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1085 char v99; // dl@249
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1086 int v100; // edx@250
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1087 char v101; // dl@253
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1088 int v102; // edx@254
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1089 char v103; // dl@257
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1090 int v104; // edx@258
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1091 char v105; // dl@261
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1092 ArcomagePlayer *v106; // ebx@262
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1093 ArcomagePlayer *v107; // edx@262
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1094 int v108; // esi@270
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1095 int v109; // edx@270
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1096 int v110; // edx@273
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1097 int v111; // esi@276
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1098 int v112; // edi@284
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1099 // int j; // esi@284
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1100 am_2 *v114; // eax@286
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1101 int v115; // ecx@288
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1102 int v116; // edx@288
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1103 int v117; // ebx@288
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1104 int v118; // eax@291
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1105 int v119; // esi@292
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1106 int v120; // [sp-28h] [bp-28h]@129
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1107 int v121; // [sp-28h] [bp-28h]@276
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1108 int k; // [sp-24h] [bp-24h]@18
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1109 int i; // [sp-24h] [bp-24h]@167
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1110 int v124; // [sp-20h] [bp-20h]@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1111 int v125; // [sp-20h] [bp-20h]@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1112 int v126; // [sp-1Ch] [bp-1Ch]@17
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1113 int v127; // [sp-1Ch] [bp-1Ch]@139
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1114 int v128; // [sp-1Ch] [bp-1Ch]@166
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1115 int v129; // [sp-1Ch] [bp-1Ch]@286
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1116 int v130; // [sp-18h] [bp-18h]@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1117 int cards_count; // [sp-18h] [bp-18h]@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1118 int v132; // [sp-14h] [bp-14h]@0
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1119 int v133; // [sp-14h] [bp-14h]@93
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1120 int v134; // [sp-14h] [bp-14h]@129
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1121 int v135; // [sp-14h] [bp-14h]@240
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1122 int v136; // [sp-14h] [bp-14h]@276
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1123 ArcomagePlayer *enemy; // [sp-10h] [bp-10h]@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1124 ArcomagePlayer *enemy1; // [sp-10h] [bp-10h]@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1125 ArcomagePlayer *player; // [sp-Ch] [bp-Ch]@5
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1126 ArcomagePlayer *player1; // [sp-Ch] [bp-Ch]@4
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1127 char v141; // [sp-8h] [bp-8h]@35
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1128 char v142; // [sp-8h] [bp-8h]@183
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1129 char v143; // [sp-5h] [bp-5h]@20
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1130 char v144; // [sp-5h] [bp-5h]@169
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1131
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1132 byte_4FAA00 = 1;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1133 if ( opponent_mastery == 0)
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1134 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1135 if ( need_to_discard_card==0 ) //am_byte_4FAA77
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1136 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1137 for(int i = 0; i<10 ; ++i )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1138 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1139 all_player_cards_count = GetPlayerHandCardCount(player_num);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1140 random_card_slot = rand_interval(0, all_player_cards_count - 1);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1141 if ( CanCardBePlayed(player_num, random_card_slot) )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1142 return PlayCard(player_num, random_card_slot);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1143 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1144 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1145 all_player_cards_count = GetPlayerHandCardCount(player_num);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1146 random_card_slot= rand_interval(0, all_player_cards_count - 1);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1147 return DiscardCard(player_num, random_card_slot);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1148 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1149 else if (( opponent_mastery == 1 )|| ( opponent_mastery == 2 ))
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1150 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1151 player = &am_Players[player_num];
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1152 enemy = &am_Players[(player_num + 1) % 2];
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1153 all_player_cards_count = GetPlayerHandCardCount(player_num);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1154 for(int i = 0; i<10 ; ++i )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1155 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1156 if ( i >= all_player_cards_count )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1157 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1158 cards_power[i].slot_index = -1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1159 cards_power[i].card_power = -9999;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1160 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1161 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1162 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1163 cards_power[i].slot_index = i;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1164 cards_power[i].card_power = 0;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1165 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1166 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1167 for(int i = 0; i< all_player_cards_count ; ++i )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1168 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1169 v12 = &pCards[am_Players[player_num].cards_at_hand[cards_power[i].slot_index]];
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1170 cards_power[i].card_power = CalculateCardPower(player, enemy, v12, opponent_mastery-1);
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1171 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1172
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1173 for (int j = all_player_cards_count - 1; j >= 0; --j )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1174 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1175 for (int m=0; m<j; ++m )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1176 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1177 if ( cards_power[m].card_power < cards_power[m+1].card_power )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1178 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1179 v56 = cards_power[m].slot_index;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1180 v57 = cards_power[m].card_power;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1181 cards_power[m].slot_index = cards_power[m+1].slot_index;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1182 cards_power[m].card_power = cards_power[m+1].card_power;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1183 cards_power[m+1].slot_index = v56;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1184 cards_power[m+1].card_power = v57;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1185 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1186 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1187 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1188 v59 = all_player_cards_count - 1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1189 if ( need_to_discard_card )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1190 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1191 if ( all_player_cards_count - 1 >= 0 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1192 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1193 while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1194 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1195 --v59;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1196 if ( v59 < 0 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1197 return DiscardCard(player_num, v132);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1198 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1199 v132 = cards_power[v59].slot_index;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1200 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1201 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1202 else
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1203 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1204 v60 = 0;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1205 if ( all_player_cards_count - 1 >= 0 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1206 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1207 while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1208 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1209 --v59;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1210 if ( v59 < 0 )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1211 goto LABEL_150;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1212 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1213 v132 = cards_power[v59].slot_index;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1214 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1215 LABEL_150:
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1216 if ( (all_player_cards_count - 1)> 0 )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1217 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1218 while ( !CanCardBePlayed(player_num, cards_power[v60].slot_index) || cards_power[v60].card_power < 0 )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1219 {
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1220 ++v60;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1221 if ( v60 >= all_player_cards_count - 1 )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1222 return DiscardCard(player_num, v132);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1223 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1224 return PlayCard(player_num, cards_power[v60].slot_index);
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1225 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1226 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1227 return DiscardCard(player_num, v132);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1228 }
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1229
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1230
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1231 return true;//result != 0;
0
Ritor1
parents:
diff changeset
1232 }
Ritor1
parents:
diff changeset
1233
Ritor1
parents:
diff changeset
1234
Ritor1
parents:
diff changeset
1235
Ritor1
parents:
diff changeset
1236 //----- (00409E6A) --------------------------------------------------------
Ritor1
parents:
diff changeset
1237 void ArcomageGame::Loop()
Ritor1
parents:
diff changeset
1238 {
Ritor1
parents:
diff changeset
1239 int v0; // edx@2
Ritor1
parents:
diff changeset
1240 int v1; // ecx@14
Ritor1
parents:
diff changeset
1241 signed int v2; // eax@15
Ritor1
parents:
diff changeset
1242 stru272 *v3; // esi@17
Ritor1
parents:
diff changeset
1243 __int16 *v4; // esi@23
Ritor1
parents:
diff changeset
1244
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1245 while ( !pArcomageGame->GameOver )
0
Ritor1
parents:
diff changeset
1246 {
Ritor1
parents:
diff changeset
1247 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1248 byte_4FAA24 = 1;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1249 IncreaseResourcesInTurn(current_player_num);
0
Ritor1
parents:
diff changeset
1250 LABEL_8:
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1251 while ( byte_4FAA24 )
0
Ritor1
parents:
diff changeset
1252 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1253 played_card_id = -1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1254 GetNextCardFromDeck(current_player_num);
0
Ritor1
parents:
diff changeset
1255 while ( 1 )
Ritor1
parents:
diff changeset
1256 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1257 byte_4FAA24 = PlayerTurn(current_player_num);
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1258 if ( GetPlayerHandCardCount(current_player_num) <= minimum_cards_at_hand )
0
Ritor1
parents:
diff changeset
1259 break;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1260 need_to_discard_card = 1;
0
Ritor1
parents:
diff changeset
1261 if ( pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1262 goto LABEL_8;
Ritor1
parents:
diff changeset
1263 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1264 need_to_discard_card = 0;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1265 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1266 pArcomageGame->GameOver = IsGameOver();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1267 if ( !pArcomageGame->GameOver )
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1268 TurnChange();
0
Ritor1
parents:
diff changeset
1269 if ( pArcomageGame->field_F4 )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1270 pArcomageGame->GameOver = 1;
0
Ritor1
parents:
diff changeset
1271 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1272 GameResultsApply();
0
Ritor1
parents:
diff changeset
1273 if ( byte_4FAA2C )
Ritor1
parents:
diff changeset
1274 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1275 dword_4FAA70 = 0;
0
Ritor1
parents:
diff changeset
1276 }
Ritor1
parents:
diff changeset
1277 else
Ritor1
parents:
diff changeset
1278 {
Ritor1
parents:
diff changeset
1279 dword_4FAA70 = -1;
Ritor1
parents:
diff changeset
1280 }
Ritor1
parents:
diff changeset
1281 pVideoPlayer->BinkUpdatePalette(dword_4FAA28);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1282
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
1283 for(int i=0; i<10; ++i)
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
1284 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1285 array_4FABD0[i].field_40->Empty(1,1);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1286 array_4FABD0[i].field_40->Dtor();
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
1287 }
1038
39f42990698f Cleanings
Nomad
parents: 1033
diff changeset
1288
0
Ritor1
parents:
diff changeset
1289 pArcomageGame->pGameBackground.Release();
Ritor1
parents:
diff changeset
1290 pArcomageGame->pSprites.Release();
Ritor1
parents:
diff changeset
1291 pArcomageGame->bGameInProgress = 0;
Ritor1
parents:
diff changeset
1292 viewparams->bRedrawGameUI = 1;
Ritor1
parents:
diff changeset
1293 if ( pVideoPlayer->AnyMovieLoaded() )
Ritor1
parents:
diff changeset
1294 pVideoPlayer->_4BF5B2();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1295 for(int i=0; i<12; ++i)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1296 pSoundList->UnloadSound(am_sounds[i], 1);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1297
0
Ritor1
parents:
diff changeset
1298 }
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1299
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1300
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
1301
0
Ritor1
parents:
diff changeset
1302
Ritor1
parents:
diff changeset
1303 //----- (00409FE9) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1304 void SetStartGameData()
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1305 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1306
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1307 signed int j; // edx@7
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1308 int card_id_counter; // edx@13
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1309 signed int i; // ecx@13
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1310 signed int card_dispenser_counter; // eax@13
0
Ritor1
parents:
diff changeset
1311
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1312 current_player_num = dword_505890;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1313 SetStartConditions();
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1314 for(i=0; i<2; ++i )
0
Ritor1
parents:
diff changeset
1315 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1316 if ( i )
0
Ritor1
parents:
diff changeset
1317 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1318 strcpy(am_Players[1].pPlayerName, pArcomageGame->pPlayer2Name);
0
Ritor1
parents:
diff changeset
1319 if ( byte_4E185C )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1320 am_Players[1].IsHisTurn = 0;
0
Ritor1
parents:
diff changeset
1321 else
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1322 am_Players[1].IsHisTurn = 1;
0
Ritor1
parents:
diff changeset
1323 }
Ritor1
parents:
diff changeset
1324 else
Ritor1
parents:
diff changeset
1325 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1326 strcpy(am_Players[0].pPlayerName, pArcomageGame->pPlayer1Name);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1327 am_Players[0].IsHisTurn = 1;
0
Ritor1
parents:
diff changeset
1328 }
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1329 am_Players[i].tower_height = start_tower_height;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1330 am_Players[i].wall_height = start_wall_height;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1331 am_Players[i].quarry_level = start_quarry_level;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1332 am_Players[i].magic_level = start_magic_level;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1333 am_Players[i].zoo_level = start_zoo_level;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1334 am_Players[i].resource_bricks = start_bricks_amount;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1335 am_Players[i].resource_gems = start_gems_amount;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1336 am_Players[i].resource_beasts = start_beasts_amount;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1337
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1338 for (j=0; j<10; ++j )
0
Ritor1
parents:
diff changeset
1339 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1340 am_Players[i].cards_at_hand[j] = -1;
0
Ritor1
parents:
diff changeset
1341 if ( am_byte_4E185D )
Ritor1
parents:
diff changeset
1342 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1343 am_Players[i].card_shift[j].x = -1;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1344 am_Players[i].card_shift[j].y = -1;
0
Ritor1
parents:
diff changeset
1345 }
Ritor1
parents:
diff changeset
1346 else
Ritor1
parents:
diff changeset
1347 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1348 am_Players[i].card_shift[j].x = 0;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1349 am_Players[i].card_shift[j].y = 0;
0
Ritor1
parents:
diff changeset
1350 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1351 }
0
Ritor1
parents:
diff changeset
1352 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1353 strcpy(deckMaster.name, pDeckMaster);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1354 for (i=0, card_dispenser_counter=-2, card_id_counter=0; i<DECK_SIZE; ++i, ++card_dispenser_counter)
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1355 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1356 deckMaster.cardsInUse[i] = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1357 deckMaster.cards_IDs[i] =card_id_counter;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1358 switch ( card_dispenser_counter )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1359 {
0
Ritor1
parents:
diff changeset
1360 case 0:
Ritor1
parents:
diff changeset
1361 case 2:
Ritor1
parents:
diff changeset
1362 case 6:
Ritor1
parents:
diff changeset
1363 case 9:
Ritor1
parents:
diff changeset
1364 case 13:
Ritor1
parents:
diff changeset
1365 case 18:
Ritor1
parents:
diff changeset
1366 case 23:
Ritor1
parents:
diff changeset
1367 case 33:
Ritor1
parents:
diff changeset
1368 case 36:
Ritor1
parents:
diff changeset
1369 case 38:
Ritor1
parents:
diff changeset
1370 case 44:
Ritor1
parents:
diff changeset
1371 case 46:
Ritor1
parents:
diff changeset
1372 case 52:
Ritor1
parents:
diff changeset
1373 case 57:
Ritor1
parents:
diff changeset
1374 case 69:
Ritor1
parents:
diff changeset
1375 case 71:
Ritor1
parents:
diff changeset
1376 case 75:
Ritor1
parents:
diff changeset
1377 case 79:
Ritor1
parents:
diff changeset
1378 case 81:
Ritor1
parents:
diff changeset
1379 case 84:
Ritor1
parents:
diff changeset
1380 case 89:
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1381 break;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1382 default:
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1383 ++card_id_counter;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1384 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1385 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1386
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1387 FillPlayerDeck();
0
Ritor1
parents:
diff changeset
1388 }
Ritor1
parents:
diff changeset
1389
Ritor1
parents:
diff changeset
1390 //----- (0040A198) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1391 void FillPlayerDeck()
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1392 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1393 signed int m;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1394 int rand_deck_pos;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1395 char card_taken_flags[DECK_SIZE];
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1396 int i,j;
0
Ritor1
parents:
diff changeset
1397
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1398 ArcomageGame::PlaySound(20);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1399 memset(deckMaster.cardsInUse, 0,DECK_SIZE );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1400 memset(card_taken_flags, 0, DECK_SIZE);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1401
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1402 for (i=0; i<2; ++i)
0
Ritor1
parents:
diff changeset
1403 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1404 for (j=0; j<10; ++j)
0
Ritor1
parents:
diff changeset
1405 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1406 if ( am_Players[i].cards_at_hand[j] > -1 )
0
Ritor1
parents:
diff changeset
1407 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1408 for (m = 0; m<DECK_SIZE; ++m)
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1409 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1410 if (deckMaster.cards_IDs[m] == am_Players[i].cards_at_hand[j] && deckMaster.cardsInUse[m] == 0)
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1411 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1412 deckMaster.cardsInUse[m] = 1;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1413 break;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1414 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1415 }
0
Ritor1
parents:
diff changeset
1416 }
Ritor1
parents:
diff changeset
1417 }
Ritor1
parents:
diff changeset
1418 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1419
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1420 for (i=0; i<DECK_SIZE; ++i)
0
Ritor1
parents:
diff changeset
1421 {
Ritor1
parents:
diff changeset
1422 do
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1423 rand_deck_pos = rand() % DECK_SIZE;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1424 while (card_taken_flags[rand_deck_pos] == 1 );
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1425
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1426 card_taken_flags[rand_deck_pos]=1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1427 playDeck.cards_IDs[i] = deckMaster.cards_IDs[rand_deck_pos];
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1428 playDeck.cardsInUse[i] = deckMaster.cardsInUse[rand_deck_pos];
0
Ritor1
parents:
diff changeset
1429 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1430
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1431 deck_walk_index = 0;
0
Ritor1
parents:
diff changeset
1432 amuint_4FABC4 = -1;
Ritor1
parents:
diff changeset
1433 pArcomageGame->field_F6 = 1;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1434
0
Ritor1
parents:
diff changeset
1435 }
Ritor1
parents:
diff changeset
1436
Ritor1
parents:
diff changeset
1437 //----- (0040A255) --------------------------------------------------------
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1438 void InitalHandsFill()
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1439 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1440 for (int i = 0; i < minimum_cards_at_hand; ++i )
0
Ritor1
parents:
diff changeset
1441 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1442 GetNextCardFromDeck(0);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1443 GetNextCardFromDeck(1);
0
Ritor1
parents:
diff changeset
1444 }
Ritor1
parents:
diff changeset
1445 pArcomageGame->field_F6 = 1;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1446
0
Ritor1
parents:
diff changeset
1447 }
Ritor1
parents:
diff changeset
1448 // 4E1874: using guessed type int dword_4E1874;
Ritor1
parents:
diff changeset
1449
Ritor1
parents:
diff changeset
1450 //----- (0040A283) --------------------------------------------------------
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1451 void GetNextCardFromDeck( int player_num )
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1452 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1453 signed int deck_index; // eax@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1454 int new_card_id; // edi@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1455 signed int card_slot_indx; // eax@7
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1456
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1457 deck_index = deck_walk_index;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1458 for(;;)
0
Ritor1
parents:
diff changeset
1459 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1460 if ( deck_index >= DECK_SIZE )
0
Ritor1
parents:
diff changeset
1461 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1462 FillPlayerDeck();
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1463 deck_index = deck_walk_index;
0
Ritor1
parents:
diff changeset
1464 }
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1465 if ( !playDeck.cardsInUse[deck_index] )
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
1466 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1467 new_card_id = playDeck.cards_IDs[deck_index];
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1468 ++deck_index;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1469 deck_walk_index = deck_index;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1470 break;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
1471 }
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1472 ++deck_index;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1473 deck_walk_index = deck_index;
0
Ritor1
parents:
diff changeset
1474 }
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1475
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1476 ArcomageGame::PlaySound(21);
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1477 card_slot_indx = GetEmptyCardSlotIndex(player_num);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1478 if ( card_slot_indx != -1 )
0
Ritor1
parents:
diff changeset
1479 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1480 amuint_4FAA4C = card_slot_indx;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1481 am_Players[player_num].cards_at_hand[card_slot_indx] = new_card_id;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1482 am_Players[player_num].card_shift[card_slot_indx].x = rand_interval(-4, 4);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1483 am_Players[player_num].card_shift[card_slot_indx].y = rand_interval(-4, 4);
0
Ritor1
parents:
diff changeset
1484 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1485 byte_4FAA2D = 1;
Ritor1
parents:
diff changeset
1486 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1487
0
Ritor1
parents:
diff changeset
1488 }
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
1489
0
Ritor1
parents:
diff changeset
1490
Ritor1
parents:
diff changeset
1491 //----- (0040A324) --------------------------------------------------------
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1492 int GetEmptyCardSlotIndex( int player_num )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1493 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1494 int i;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1495 for (i=0; i<10; ++i )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1496 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1497 if (am_Players[player_num].cards_at_hand[i]==-1)
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1498 break;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1499 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1500 if ( i >= 10 )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1501 return -1;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1502 else
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1503 return i;
0
Ritor1
parents:
diff changeset
1504 }
Ritor1
parents:
diff changeset
1505
Ritor1
parents:
diff changeset
1506 //----- (0040A346) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1507 void IncreaseResourcesInTurn( int player_num )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1508 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1509 am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1510 am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1511 am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level;
0
Ritor1
parents:
diff changeset
1512 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1513
0
Ritor1
parents:
diff changeset
1514
Ritor1
parents:
diff changeset
1515 //----- (0040A383) --------------------------------------------------------
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1516 void TurnChange()
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1517 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1518
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1519 char player_name[64]; // [sp+4h] [bp-64h]@4
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1520 // RECT v6; // [sp+44h] [bp-24h]@6
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1521
0
Ritor1
parents:
diff changeset
1522 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1523 POINT v11; // [sp+60h] [bp-8h]@4
0
Ritor1
parents:
diff changeset
1524
Ritor1
parents:
diff changeset
1525 if ( !pArcomageGame->field_F4 )
Ritor1
parents:
diff changeset
1526 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1527 if ( am_Players[0].IsHisTurn != 1 || am_Players[1].IsHisTurn != 1 )
0
Ritor1
parents:
diff changeset
1528 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1529 ++current_player_num;
0
Ritor1
parents:
diff changeset
1530 am_byte_4FAA75 = 1;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1531 if ( current_player_num >= 2 )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1532 current_player_num = 0;
0
Ritor1
parents:
diff changeset
1533 }
Ritor1
parents:
diff changeset
1534 else
Ritor1
parents:
diff changeset
1535 {
Ritor1
parents:
diff changeset
1536 //nullsub_1();
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1537 // v11.x = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1538 // v11.y = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1539 strcpy(player_name,"The Next Player is: ");//"Ñëåä"
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1540 // v0 = 0;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1541 v11.y = 200;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1542 v11.x = 320; // - 12 * v0 / 2;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1543 pPrimaryWindow_draws_text(-1, player_name, &v11);
0
Ritor1
parents:
diff changeset
1544 am_byte_4FAA75 = 1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1545 ++current_player_num;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1546 if ( current_player_num >= 2 )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1547 current_player_num = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1548 strcpy(player_name, am_Players[current_player_num].pPlayerName);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1549 // v4 = 0;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1550 v11.y = 260;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1551 v11.x = 320;// - 12 * v4 / 2;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1552 pPrimaryWindow_draws_text(-1, player_name, &v11);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1553 /* v6.left = 0;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1554 v6.right = 640;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1555 v6.top = 0;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1556 v6.bottom = 480;*/
0
Ritor1
parents:
diff changeset
1557 //nullsub_1();
Ritor1
parents:
diff changeset
1558 CallRenderPresent();
Ritor1
parents:
diff changeset
1559 //nullsub_1();
Ritor1
parents:
diff changeset
1560 while ( 1 )
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1561 {
0
Ritor1
parents:
diff changeset
1562 while ( !ArcomageGame::MsgLoop(20, &v10) )
Ritor1
parents:
diff changeset
1563 ;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1564 if ( v10.field_0 == 1 )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1565 {
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1566 if ( v10.field_4 )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1567 break;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1568 //nullsub_1();
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1569 continue;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1570 }
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1571 if (( v10.field_0 > 4 )&& ( v10.field_0 <= 8 ))
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1572 break;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1573 if ( v10.field_0 == 10 )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1574 {
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1575 pArcomageGame->field_F4 = 1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1576 byte_4FAA74 = 1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1577 break;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1578 }
0
Ritor1
parents:
diff changeset
1579 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1580 /* v11.x = 0;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1581 v11.y = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1582 v6.left = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1583 v6.right = 640;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1584 v6.top = 0;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1585 v6.bottom = 480;*/
0
Ritor1
parents:
diff changeset
1586 //nullsub_1();
Ritor1
parents:
diff changeset
1587 CallRenderPresent();
Ritor1
parents:
diff changeset
1588 }
Ritor1
parents:
diff changeset
1589 }
Ritor1
parents:
diff changeset
1590 }
Ritor1
parents:
diff changeset
1591
Ritor1
parents:
diff changeset
1592
Ritor1
parents:
diff changeset
1593 //----- (0040A514) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1594 bool IsGameOver()
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1595 {
0
Ritor1
parents:
diff changeset
1596 bool result; // eax@1
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1597
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1598 result = false;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1599 for(int i=0; i<2; ++i)
0
Ritor1
parents:
diff changeset
1600 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1601 if ( am_Players[i].tower_height <= 0 )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1602 result = true;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1603 if ( am_Players[i].tower_height >= max_tower_height )
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1604 result = true;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1605 if ( am_Players[i].resource_bricks >= max_resources_amount
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1606 || am_Players[i].resource_gems >= max_resources_amount
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1607 || am_Players[i].resource_beasts >= max_resources_amount )
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1608 result = true;
0
Ritor1
parents:
diff changeset
1609 }
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1610
0
Ritor1
parents:
diff changeset
1611 if ( result )
Ritor1
parents:
diff changeset
1612 byte_4FAA2C = 1;
Ritor1
parents:
diff changeset
1613 return result;
Ritor1
parents:
diff changeset
1614 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1615
0
Ritor1
parents:
diff changeset
1616
Ritor1
parents:
diff changeset
1617 //----- (0040A560) --------------------------------------------------------
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1618 char PlayerTurn( int player_num )
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1619 {
0
Ritor1
parents:
diff changeset
1620 int v1; // ebp@0
Ritor1
parents:
diff changeset
1621 unsigned __int64 v2; // qax@3
Ritor1
parents:
diff changeset
1622 unsigned __int64 v3; // kr00_8@3
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1623
0
Ritor1
parents:
diff changeset
1624 int v5; // esi@67
Ritor1
parents:
diff changeset
1625 char Dest[100]; // [sp+8h] [bp-A8h]@67
Ritor1
parents:
diff changeset
1626 int v8; // [sp+6Ch] [bp-44h]@3
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1627 RECT pSrcXYZW; // [sp+70h] [bp-40h]@75
0
Ritor1
parents:
diff changeset
1628 int v10[4]; // [sp+80h] [bp-30h]@69
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1629 POINT pTargetXY; // [sp+90h] [bp-20h]@75
0
Ritor1
parents:
diff changeset
1630 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1631 int animation_stage; // [sp+A4h] [bp-Ch]@1
0
Ritor1
parents:
diff changeset
1632 char v15; // [sp+AEh] [bp-2h]@63
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1633 bool break_loop; // [sp+AFh] [bp-1h]@1
0
Ritor1
parents:
diff changeset
1634
Ritor1
parents:
diff changeset
1635 uCardID = -1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1636 break_loop = false;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1637 animation_stage = 20;
0
Ritor1
parents:
diff changeset
1638 byte_4FAA00 = 0;
Ritor1
parents:
diff changeset
1639 dword_4FAA68 = 0;
Ritor1
parents:
diff changeset
1640 amuint_4FAA38 = 10;
Ritor1
parents:
diff changeset
1641 amuint_4FAA34 = 5;
Ritor1
parents:
diff changeset
1642 if ( amuint_4FAA4C != -1 )
Ritor1
parents:
diff changeset
1643 byte_4FAA2D = 1;
Ritor1
parents:
diff changeset
1644 do
Ritor1
parents:
diff changeset
1645 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1646
0
Ritor1
parents:
diff changeset
1647 do
Ritor1
parents:
diff changeset
1648 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1649 v3 = pEventTimer->Time() - pArcomageGame->event_timer_time;
0
Ritor1
parents:
diff changeset
1650 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1651 while (v3 < 6);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1652
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
1653 pArcomageGame->event_timer_time = (unsigned int )pEventTimer->Time();
0
Ritor1
parents:
diff changeset
1654 if ( pArcomageGame->field_F4 )
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1655 break_loop = 1;
0
Ritor1
parents:
diff changeset
1656 ArcomageGame::MsgLoop(0, &a2);
Ritor1
parents:
diff changeset
1657 switch ( a2.field_0 )
Ritor1
parents:
diff changeset
1658 {
Ritor1
parents:
diff changeset
1659 case 2:
Ritor1
parents:
diff changeset
1660 if ( a2.field_4 == 129 && a2.field_8 == 1 )
Ritor1
parents:
diff changeset
1661 {
Ritor1
parents:
diff changeset
1662 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
1663 dword_4FAA68 = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1664 break_loop = true;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1665 pArcomageGame->field_F4 = 1;
0
Ritor1
parents:
diff changeset
1666 }
Ritor1
parents:
diff changeset
1667 break;
Ritor1
parents:
diff changeset
1668 case 9:
Ritor1
parents:
diff changeset
1669 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1670 break;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1671 case 10:
0
Ritor1
parents:
diff changeset
1672 pAudioPlayer->StopChannels(-1, -1);
Ritor1
parents:
diff changeset
1673 byte_4FAA74 = 1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1674 break_loop = true;
0
Ritor1
parents:
diff changeset
1675 pArcomageGame->field_F4 = 1;
Ritor1
parents:
diff changeset
1676 break;
Ritor1
parents:
diff changeset
1677 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1678
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1679 if (am_Players[current_player_num].IsHisTurn != 1 &&
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1680 !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D )
0
Ritor1
parents:
diff changeset
1681 {
Ritor1
parents:
diff changeset
1682 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1683 am_byte_4FAA76 = 1;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1684 OpponentsAITurn(current_player_num);
0
Ritor1
parents:
diff changeset
1685 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1686 }
Ritor1
parents:
diff changeset
1687 if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 )
Ritor1
parents:
diff changeset
1688 amuint_4FAA38 = 10;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1689 if ( byte_4FAA2E || byte_4FAA2D ||am_Players[current_player_num].IsHisTurn != 1 )
0
Ritor1
parents:
diff changeset
1690 {
Ritor1
parents:
diff changeset
1691 pArcomageGame->field_F6 = 1;
Ritor1
parents:
diff changeset
1692 if ( byte_4FAA2D )
Ritor1
parents:
diff changeset
1693 {
Ritor1
parents:
diff changeset
1694 --amuint_4FAA38;
Ritor1
parents:
diff changeset
1695 if ( amuint_4FAA38 < 0 )
Ritor1
parents:
diff changeset
1696 {
Ritor1
parents:
diff changeset
1697 byte_4FAA2D = 0;
Ritor1
parents:
diff changeset
1698 amuint_4FAA38 = 10;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1699 break_loop = false;
0
Ritor1
parents:
diff changeset
1700 }
Ritor1
parents:
diff changeset
1701 }
Ritor1
parents:
diff changeset
1702 if ( byte_4FAA2E )
Ritor1
parents:
diff changeset
1703 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1704 --animation_stage;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1705 if ( animation_stage < 0 )
0
Ritor1
parents:
diff changeset
1706 {
Ritor1
parents:
diff changeset
1707 if ( dword_4FAA68 > 1 )
Ritor1
parents:
diff changeset
1708 {
Ritor1
parents:
diff changeset
1709 --dword_4FAA68;
Ritor1
parents:
diff changeset
1710 byte_4FAA00 = 0;
Ritor1
parents:
diff changeset
1711 }
Ritor1
parents:
diff changeset
1712 else
Ritor1
parents:
diff changeset
1713 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1714 break_loop = true;
0
Ritor1
parents:
diff changeset
1715 }
Ritor1
parents:
diff changeset
1716 byte_4FAA2E = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1717 animation_stage = 20;
0
Ritor1
parents:
diff changeset
1718 }
Ritor1
parents:
diff changeset
1719 }
Ritor1
parents:
diff changeset
1720 }
Ritor1
parents:
diff changeset
1721 else
Ritor1
parents:
diff changeset
1722 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1723 if ( need_to_discard_card )
0
Ritor1
parents:
diff changeset
1724 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1725 if ( a2.field_0 == 7 && DiscardCard(player_num, current_card_slot_index) )
0
Ritor1
parents:
diff changeset
1726 {
Ritor1
parents:
diff changeset
1727 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1728 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1729 if ( dword_4FAA64 > 0 )
Ritor1
parents:
diff changeset
1730 {
Ritor1
parents:
diff changeset
1731 --dword_4FAA64;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1732 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
0
Ritor1
parents:
diff changeset
1733 }
Ritor1
parents:
diff changeset
1734 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1735 }
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1736 if ( a2.field_0 == 8 && DiscardCard(player_num, current_card_slot_index) )
0
Ritor1
parents:
diff changeset
1737 {
Ritor1
parents:
diff changeset
1738 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1739 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1740 if ( dword_4FAA64 > 0 )
Ritor1
parents:
diff changeset
1741 {
Ritor1
parents:
diff changeset
1742 --dword_4FAA64;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1743 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
0
Ritor1
parents:
diff changeset
1744 }
Ritor1
parents:
diff changeset
1745 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1746 }
Ritor1
parents:
diff changeset
1747 }
Ritor1
parents:
diff changeset
1748 else
Ritor1
parents:
diff changeset
1749 {
Ritor1
parents:
diff changeset
1750 if ( a2.field_0 == 7 )
Ritor1
parents:
diff changeset
1751 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1752 if ( PlayCard(player_num, current_card_slot_index) )
0
Ritor1
parents:
diff changeset
1753 {
Ritor1
parents:
diff changeset
1754 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1755 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1756 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1757 }
Ritor1
parents:
diff changeset
1758 }
Ritor1
parents:
diff changeset
1759 if ( a2.field_0 == 8 )
Ritor1
parents:
diff changeset
1760 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
1761 if ( DiscardCard(player_num, current_card_slot_index) )
0
Ritor1
parents:
diff changeset
1762 {
Ritor1
parents:
diff changeset
1763 byte_4FAA2E = 1;
Ritor1
parents:
diff changeset
1764 if ( am_byte_4FAA75 )
Ritor1
parents:
diff changeset
1765 am_byte_4FAA76 = 1;
Ritor1
parents:
diff changeset
1766 }
Ritor1
parents:
diff changeset
1767 }
Ritor1
parents:
diff changeset
1768 }
Ritor1
parents:
diff changeset
1769 }
Ritor1
parents:
diff changeset
1770 //nullsub_1();
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1771 //if ( false )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1772 //{
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1773 // if ( !v15 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1774 // {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1775 // //nullsub_1();
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1776 // v15 = 1;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1777 // }
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1778 //}
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1779 //else
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1780 //{
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1781 // v15 = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1782 // }
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1783 //if ( false )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1784 //{
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1785 // //nullsub_1();
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1786 // //nullsub_1();
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1787 // // assert(false && "Invalid strcpy params");
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1788 // // inv_strcpy(nullptr, Dest);
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1789 // v5 = 0;//unk::const_0(&unk_4E19FC, 0);
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1790 // //nullsub_1();
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1791 // if ( v5 == 1 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1792 // {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1793 // pAudioPlayer->StopChannels(-1, -1);
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1794 // v16 = 1;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1795 // pArcomageGame->field_F4 = 1;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1796 // dword_4FAA68 = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1797 // }
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1798 // /*v10[0] = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1799 // v10[2] = 640;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1800 // v10[1] = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1801 // v10[3] = 480;*/
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1802 // //nullsub_1();
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
1803 //}
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1804 if ( dword_4FABB8 != DrawCardsRectangles(player_num) )
0
Ritor1
parents:
diff changeset
1805 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1806 dword_4FABB8 = DrawCardsRectangles(player_num);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1807 pArcomageGame->field_F6 = 1;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1808 }
0
Ritor1
parents:
diff changeset
1809 if ( pArcomageGame->field_F6 )
Ritor1
parents:
diff changeset
1810 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1811 DrawGameUI(animation_stage);
0
Ritor1
parents:
diff changeset
1812 DoBlt_Copy(pArcomageGame->pBackgroundPixels);
Ritor1
parents:
diff changeset
1813 pArcomageGame->field_F6 = 0;
Ritor1
parents:
diff changeset
1814 }
Ritor1
parents:
diff changeset
1815 if ( pArcomageGame->field_F9 )
Ritor1
parents:
diff changeset
1816 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1817 pTargetXY.x = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1818 pTargetXY.y = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1819 pSrcXYZW.left = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1820 pSrcXYZW.right = 640;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1821 pSrcXYZW.top = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1822 pSrcXYZW.bottom = 480;
0
Ritor1
parents:
diff changeset
1823 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1824 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
0
Ritor1
parents:
diff changeset
1825 am_EndScene();
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1826 DrawGameUI(animation_stage);
0
Ritor1
parents:
diff changeset
1827 pRenderer->Present();
Ritor1
parents:
diff changeset
1828 pArcomageGame->field_F9 = 0;
Ritor1
parents:
diff changeset
1829 }
Ritor1
parents:
diff changeset
1830 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1831 while ( !break_loop );
0
Ritor1
parents:
diff changeset
1832 return dword_4FAA68 > 0;
Ritor1
parents:
diff changeset
1833 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
1834
0
Ritor1
parents:
diff changeset
1835
Ritor1
parents:
diff changeset
1836 //----- (0040A9AF) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1837 void DrawGameUI( int animation_stage )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1838 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1839
0
Ritor1
parents:
diff changeset
1840 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1841 DrawRectanglesForText();
0
Ritor1
parents:
diff changeset
1842 am_EndScene();
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1843
0
Ritor1
parents:
diff changeset
1844 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1845 DrawCards();
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1846 DrawPlayersTowers();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1847 DrawPlayersWall();
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1848 DrawPlayersText();
0
Ritor1
parents:
diff changeset
1849 am_EndScene();
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1850
0
Ritor1
parents:
diff changeset
1851 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1852 DrawCardAnimation(animation_stage);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1853
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1854 for( int i=0; i<10; ++i)
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1855 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1856 if (array_4FABD0[i].have_effect)
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1857 array_4FABD0[i].field_40->DrawEffect();
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1858 }
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
1859 current_card_slot_index = DrawCardsRectangles(current_player_num);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1860 DrawSparks();
0
Ritor1
parents:
diff changeset
1861 am_EndScene();
Ritor1
parents:
diff changeset
1862 }
Ritor1
parents:
diff changeset
1863
Ritor1
parents:
diff changeset
1864 //----- (0040AA4E) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1865 void DrawSparks()
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1866 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1867 int rgb_pixel_color; // [sp-4h] [bp-2Ch]@4
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1868 unsigned int pixel_color;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1869
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1870 for (int i=0; i<10; ++i)
0
Ritor1
parents:
diff changeset
1871 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1872 if(array_4FABD0[i].have_effect && (array_4FABD0[i].field_40->_40E2A7()==2))
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1873 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1874 rgb_pixel_color = 0x0000FF00;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1875 if ( !array_4FABD0[i].effect_sign )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1876 rgb_pixel_color = 0x000000FF;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1877
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1878 pixel_color = R8G8B8_to_TargetFormat(rgb_pixel_color);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1879 for(int j=0; j<150; ++j )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1880 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1881 if (array_4FABD0[i].effect_sparks[j].have_spark > 0)
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1882 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1883 if (j%2)
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1884 SetPixel(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1885 else
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1886 SetPixel2sq(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color);
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1887 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1888 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1889 }
0
Ritor1
parents:
diff changeset
1890 }
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
1891
0
Ritor1
parents:
diff changeset
1892 }
Ritor1
parents:
diff changeset
1893
Ritor1
parents:
diff changeset
1894 //----- (0040AB0A) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1895 void DrawRectanglesForText()
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1896 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1897
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1898 RECT pSrcRect; // [sp+Ch] [bp-18h]@1
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1899 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1900 //resources rectangles
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1901 pSrcRect.left = 765;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1902 pSrcRect.top = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1903 pSrcRect.right = 843;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1904 pSrcRect.bottom = 216;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1905
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1906 pTargetXY.x = 8;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1907 pTargetXY.y = 56;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1908 Blt_Copy(&pSrcRect, &pTargetXY, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1909
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1910 pTargetXY.x = 555;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1911 pTargetXY.y = 56;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1912 Blt_Copy(&pSrcRect, &pTargetXY, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1913
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1914 //players name rectangle
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1915 pSrcRect.left = 283;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1916 pSrcRect.top = 166;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1917 pSrcRect.right = 361;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1918 pSrcRect.bottom = 190;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1919 pTargetXY.x = 8;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1920 pTargetXY.y = 13;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1921 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1922
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1923 pTargetXY.x = 555;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1924 pTargetXY.y = 13;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1925 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1926
1241
ae812777b1d4 fix in arcomagecards
Gloval
parents: 1219
diff changeset
1927 //tower height rectangle
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1928 pSrcRect.left = 234;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1929 pSrcRect.top = 166;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1930 pSrcRect.right = 283;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1931 pSrcRect.bottom = 190;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1932 pTargetXY.x = 100;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1933 pTargetXY.y = 296;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1934 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1935
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1936 pTargetXY.x = 492;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1937 pTargetXY.y = 296;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1938 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1939
1241
ae812777b1d4 fix in arcomagecards
Gloval
parents: 1219
diff changeset
1940 //wall height rectangle
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1941 pSrcRect.left = 192;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1942 pSrcRect.top = 166;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1943 pSrcRect.right = 234;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1944 pSrcRect.bottom = 190;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1945 pTargetXY.x = 168;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1946 pTargetXY.y = 296;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1947 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1948
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1949 pTargetXY.x = 430;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1950 pTargetXY.y = 296;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
1951 Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2);
0
Ritor1
parents:
diff changeset
1952 }
Ritor1
parents:
diff changeset
1953
Ritor1
parents:
diff changeset
1954 //----- (0040AC5F) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1955 void DrawPlayersText()
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1956 {
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1957
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1958 int res_value; // ecx@18
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1959 char text_buff[32]; // [sp+Ch] [bp-28h]@2
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1960 POINT text_position; // [sp+2Ch] [bp-8h]@2
0
Ritor1
parents:
diff changeset
1961
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
1962 if ( need_to_discard_card )
0
Ritor1
parents:
diff changeset
1963 {
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1964 strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1965 text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1966 text_position.y = 306;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1967 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
0
Ritor1
parents:
diff changeset
1968 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1969 strcpy( text_buff, am_Players[0].pPlayerName);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1970 if ( !current_player_num )
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1971 strcat(text_buff, "***");
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1972 text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1973 text_position.y = 21;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1974 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1975
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1976 strcpy(text_buff, am_Players[1].pPlayerName);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1977 if ( current_player_num == 1 )
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
1978 strcat(text_buff, "***" );
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1979 text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1980 text_position.y = 21;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1981 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1982
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1983 intToString(am_Players[0].tower_height, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1984 text_position.x = 123 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1985 text_position.y = 305;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1986 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1987
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1988 intToString(am_Players[1].tower_height, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1989 text_position.x = 515 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1990 text_position.y = 305;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1991 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1992
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1993 intToString(am_Players[0].wall_height, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1994 text_position.x = 188 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1995 text_position.y = 305;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1996 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1997
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1998 intToString(am_Players[1].wall_height, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
1999 text_position.x = 451 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2000 text_position.y = 305;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2001 pPrimaryWindow_draws_text(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2002
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2003 res_value = am_Players[0].quarry_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2004 if ( use_start_bonus )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2005 res_value =am_Players[0].quarry_level + quarry_bonus;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2006 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2007 text_position.x = 14;// - 6 * 0 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2008 text_position.y = 92;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2009 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2010
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2011 res_value = am_Players[1].quarry_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2012 if ( use_start_bonus )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2013 res_value = am_Players[1].quarry_level + quarry_bonus;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2014 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2015 // v2 = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2016 text_position.y = 92;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2017 text_position.x = 561; //- 6 * v2 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2018 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2019
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2020 res_value = am_Players[0].magic_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2021 if ( use_start_bonus )
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2022 res_value = am_Players[0].magic_level + magic_bonus;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2023 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2024 // v4 = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2025 text_position.y = 164;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2026 text_position.x = 14; //- 6 * v4 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2027 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2028
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2029 res_value = am_Players[1].magic_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2030 if ( use_start_bonus )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2031 res_value = am_Players[1].magic_level + magic_bonus;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2032 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2033 // v6 = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2034 text_position.y = 164;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2035 text_position.x = 561; //- 6 * v6 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2036 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2037
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2038 res_value = am_Players[0].zoo_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2039 if ( use_start_bonus )
1201
Gloval
parents: 1200
diff changeset
2040 res_value = am_Players[0].zoo_level + zoo_bonus;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2041 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2042 // v8 = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2043 text_position.y = 236;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2044 text_position.x = 14;// - 6 * v8 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2045 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2046
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2047 res_value = am_Players[1].zoo_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2048 if ( use_start_bonus )
1201
Gloval
parents: 1200
diff changeset
2049 res_value = am_Players[1].zoo_level + zoo_bonus;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2050 intToString(res_value, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2051 // v10 = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2052 text_position.y = 236;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2053 text_position.x = 561;// - 6 * v10 / 2;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2054 DrawPlayerLevels(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2055
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2056 intToString(am_Players[0].resource_bricks, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2057 text_position.y = 114;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2058 text_position.x = 10;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2059 DrawBricksCount(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2060
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2061 intToString(am_Players[1].resource_bricks, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2062 text_position.x = 557;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2063 text_position.y = 114;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2064 DrawBricksCount(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2065
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2066 intToString(am_Players[0].resource_gems, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2067 text_position.x = 10;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2068 text_position.y = 186;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2069 DrawGemsCount(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2070
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2071 intToString(am_Players[1].resource_gems, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2072 text_position.x = 557;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2073 text_position.y = 186;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2074 DrawGemsCount(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2075
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2076 intToString(am_Players[0].resource_beasts, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2077 text_position.x = 10;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2078 text_position.y = 258;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2079 DrawBeastsCount(-1, text_buff, &text_position);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2080
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2081 intToString(am_Players[1].resource_beasts, text_buff);
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2082 text_position.x = 557;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2083 text_position.y = 258;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2084 DrawBeastsCount(-1, text_buff, &text_position);
0
Ritor1
parents:
diff changeset
2085 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2086
0
Ritor1
parents:
diff changeset
2087
Ritor1
parents:
diff changeset
2088 //----- (0040B102) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2089 void DrawPlayerLevels( int a1, char *text, POINT *pXY )
0
Ritor1
parents:
diff changeset
2090 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2091 char *v3; // esi@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2092 unsigned char test_char; // bl@2
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2093 int v7; // eax@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2094 RECT pSrcRect;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2095 POINT pTargetPoint;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2096
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2097 v3 = text;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2098 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2099 pTargetPoint.x = pXY->x;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2100 pTargetPoint.y = pXY->y;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2101 do
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2102 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2103 test_char = *v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2104 ++v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2105 if ( test_char )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2106 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2107 v7 = 22 * test_char;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2108 pSrcRect.right = v7 - 842;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2109 pSrcRect.left = v7 - 864;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2110 pSrcRect.top = 190;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2111 pSrcRect.bottom = 207;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2112 Blt_Chroma(&pSrcRect, &pTargetPoint, pArcomageGame->field_54, 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2113 pTargetPoint.x += 22;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2114 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2115 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2116 while ( test_char!= 0 );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2117 am_EndScene();
0
Ritor1
parents:
diff changeset
2118 }
Ritor1
parents:
diff changeset
2119
Ritor1
parents:
diff changeset
2120 //----- (0040B17E) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2121 void DrawBricksCount( int a1, char* text, POINT *pXY )
0
Ritor1
parents:
diff changeset
2122 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2123
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2124 char *v3; // esi@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2125 unsigned char test_char; // bl@2
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2126 int v7; // eax@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2127 RECT pSrcRect;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2128 POINT pTargetPoint;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2129
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2130 v3 = text;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2131 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2132 pTargetPoint.x = pXY->x;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2133 pTargetPoint.y = pXY->y;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2134 do
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2135 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2136 test_char = *v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2137 ++v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2138 if ( test_char )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2139 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2140 v7 = 13 * test_char;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2141 pSrcRect.left = v7 - 370;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2142 pSrcRect.right = v7 - 357;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2143 pSrcRect.top = 128;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2144 pSrcRect.bottom = 138;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2145 Blt_Copy(&pSrcRect, &pTargetPoint, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2146 pTargetPoint.x += 13;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2147 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2148 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2149 while ( test_char!= 0 );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2150 am_EndScene();
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2151
0
Ritor1
parents:
diff changeset
2152 }
Ritor1
parents:
diff changeset
2153
Ritor1
parents:
diff changeset
2154 //----- (0040B1F3) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2155 void DrawGemsCount( int a1, char* text, POINT* pXY )
0
Ritor1
parents:
diff changeset
2156 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2157
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2158 char *v3; // esi@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2159 unsigned char test_char; // bl@2
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2160 int v7; // eax@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2161 RECT pSrcRect;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2162 POINT pTargetPoint;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2163
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2164 v3 = text;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2165 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2166 pTargetPoint.x = pXY->x;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2167 pTargetPoint.y = pXY->y;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2168 do
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2169 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2170 test_char = *v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2171 ++v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2172 if ( test_char )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2173 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2174 v7 = 13 * test_char;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2175 pSrcRect.left = v7 - 370;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2176 pSrcRect.right = v7 - 357;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2177 pSrcRect.top = 138;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2178 pSrcRect.bottom = 148;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2179 Blt_Copy(&pSrcRect, &pTargetPoint, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2180 pTargetPoint.x += 13;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2181 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2182 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2183 while ( test_char!= 0 );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2184 am_EndScene();
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2185
0
Ritor1
parents:
diff changeset
2186 }
Ritor1
parents:
diff changeset
2187
Ritor1
parents:
diff changeset
2188 //----- (0040B268) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2189 void DrawBeastsCount( int a1, char *text, POINT *pXY )
0
Ritor1
parents:
diff changeset
2190 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2191
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2192 char *v3; // esi@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2193 unsigned char test_char; // bl@2
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2194 int v7; // eax@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2195 RECT pSrcRect;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2196 POINT pTargetPoint;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2197
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2198 v3 = text;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2199 am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2200 pTargetPoint.x = pXY->x;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2201 pTargetPoint.y = pXY->y;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2202 do
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2203 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2204 test_char = *v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2205 ++v3;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2206 if ( test_char )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2207 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2208 v7 = 13 * test_char;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2209 pSrcRect.left = v7 - 370;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2210 pSrcRect.right = v7 - 357;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2211 pSrcRect.top = 148;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2212 pSrcRect.bottom = 158;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2213 Blt_Copy(&pSrcRect, &pTargetPoint, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2214 pTargetPoint.x += 13;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2215 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2216 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2217 while ( test_char!= 0 );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2218 am_EndScene();
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2219
0
Ritor1
parents:
diff changeset
2220 }
Ritor1
parents:
diff changeset
2221
Ritor1
parents:
diff changeset
2222 //----- (0040B2DD) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2223 void DrawPlayersTowers()
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2224 {
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2225 int tower_height; // eax@1
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2226 int tower_top; // esi@3
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2227 RECT pSrcXYZW; // [sp+0h] [bp-18h]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2228 POINT pTargetXY; // [sp+10h] [bp-8h]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2229
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2230 tower_height= am_Players[0].tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2231 if ( am_Players[0].tower_height > max_tower_height )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2232 tower_height = max_tower_height;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2233 pSrcXYZW.top = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2234 pSrcXYZW.left = 892;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2235 pSrcXYZW.right = 937;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2236 tower_top = 200 * tower_height / max_tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2237 pSrcXYZW.bottom = tower_top;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2238 pTargetXY.x = 102;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2239 pTargetXY.y = 297 - tower_top;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2240 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2241
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2242 pSrcXYZW.top = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2243 pSrcXYZW.left = 384;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2244 pSrcXYZW.right = 452;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2245 pSrcXYZW.bottom = 94;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2246 pTargetXY.y = 203 - tower_top;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2247 pTargetXY.x = 91;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2248 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2249
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2250
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2251 tower_height = am_Players[1].tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2252 if (am_Players[1].tower_height > max_tower_height )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2253 tower_height = max_tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2254 tower_top = 200 * tower_height / max_tower_height;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2255 pSrcXYZW.top = 0;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2256 pSrcXYZW.left = 892;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2257 pSrcXYZW.right = 937;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2258 pSrcXYZW.bottom = tower_top;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2259
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2260 pTargetXY.x = 494;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2261 pTargetXY.y = 297 - tower_top;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2262 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2263 //draw tower up cone
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2264 pSrcXYZW.left = 384;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2265 pSrcXYZW.right = 452;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2266 pSrcXYZW.top = 94;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2267 pSrcXYZW.bottom = 188;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2268
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2269 pTargetXY.x = 483;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2270 pTargetXY.y = 203 - tower_top;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2271 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2272
0
Ritor1
parents:
diff changeset
2273 }
Ritor1
parents:
diff changeset
2274 // 4E1884: using guessed type int dword_4E1884;
Ritor1
parents:
diff changeset
2275
Ritor1
parents:
diff changeset
2276 //----- (0040B400) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2277 void DrawPlayersWall()
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2278 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2279 int v0; // eax@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2280 int v1; // eax@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2281 LONG v2; // ecx@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2282 int v3; // eax@5
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2283 int v4; // eax@8
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2284 LONG v5; // esi@8
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2285 RECT pSrcXYZW; // [sp+4h] [bp-18h]@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2286 POINT pTargetXY; // [sp+14h] [bp-8h]@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2287
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2288 v0 = am_Players[0].wall_height;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2289
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2290 if ( am_Players[0].wall_height > 100 )
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2291 v0 = 100;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2292
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2293 if ( am_Players[0].wall_height > 0 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2294 {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2295
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2296 pSrcXYZW.top = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2297 pSrcXYZW.left = 843;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2298 v1 = 200 * v0 / 100;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2299 pSrcXYZW.right = 867;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2300 pSrcXYZW.bottom = v1;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2301 pTargetXY.x = 177;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2302 pTargetXY.y = 297 - v1;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2303 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2304 }
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2305
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2306 v3 = am_Players[1].wall_height;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2307 if ( am_Players[1].wall_height > 100 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2308 v3 = 100;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2309
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2310
1247
Gloval
parents: 1246
diff changeset
2311 if ( am_Players[1].wall_height > 0 )
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2312 {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2313
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2314 pSrcXYZW.top = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2315 pSrcXYZW.left = 843;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2316 v4 = 200 * v3 / 100;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2317 pSrcXYZW.right = 867;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2318 pSrcXYZW.bottom = v4;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2319 pTargetXY.x = 439;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2320 pTargetXY.y = 297 - v4;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2321 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2322 }
0
Ritor1
parents:
diff changeset
2323 }
Ritor1
parents:
diff changeset
2324
Ritor1
parents:
diff changeset
2325 //----- (0040B4B9) --------------------------------------------------------
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2326 void DrawCards()
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2327 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2328
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2329 int v0; // esi@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2330 char v1; // bl@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2331 int v2; // edi@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2332 int v3; // edx@2
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2333 int v4; // eax@3
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2334 int v5; // ecx@3
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2335 int v6; // eax@3
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2336 unsigned int v7; // ecx@4
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2337 int v8; // eax@16
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2338 int v9; // ecx@16
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2339 int v10; // eax@16
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2340 signed int v11; // edi@18
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2341 signed int v12; // esi@20
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2342 int v13; // ecx@20
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2343 int v14; // eax@23
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2344 signed int v15; // eax@25
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2345 int v16; // ecx@25
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2346 POINT *v17; // esi@26
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2347 signed int v18; // eax@29
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2348 Acromage_st1 *v19; // ecx@29
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2349 int v20; // ecx@31
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2350 int v21; // [sp-4h] [bp-2Ch]@8
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2351 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@8
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2352 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2353 int v24; // [sp+24h] [bp-4h]@1
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2354
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2355 v0 = GetPlayerHandCardCount(current_player_num);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2356 v2 = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2357 pTargetXY.y = 327;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2358 v24 = (640 - 96 * v0) / (v0 + 1);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2359 pTargetXY.x = (640 - 96 * v0) / (v0 + 1);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2360 while ( v2 < v0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2361 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2362 v3 = current_player_num;
1241
ae812777b1d4 fix in arcomagecards
Gloval
parents: 1219
diff changeset
2363 if ( am_byte_4E185D)
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2364 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2365
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2366 pTargetXY.x += am_Players[current_player_num].card_shift[v2].x ;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2367 pTargetXY.y += am_Players[current_player_num].card_shift[v2].y;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2368 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2369 v7 = am_Players[current_player_num].cards_at_hand[v2];
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2370 if ( v7 == -1 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2371 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2372 ++v0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2373 goto LABEL_15;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2374 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2375 if ( v2 != amuint_4FAA4C )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2376 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2377 if ( am_Players[current_player_num].IsHisTurn == 0 && byte_505881 == 0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2378 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2379 pSrcXYZW.left = 192;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2380 pSrcXYZW.right = 288;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2381 pSrcXYZW.top = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2382 pSrcXYZW.bottom = 128;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2383 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2384 goto LABEL_13;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2385 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2386 pArcomageGame->GetCardRect(v7, &pSrcXYZW);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2387 if ( !CanCardBePlayed(current_player_num, v2) )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2388 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2389 Blt_Copy(&pSrcXYZW, &pTargetXY, 0);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2390 goto LABEL_13;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2391 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2392 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2393
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2394 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2395 LABEL_13:
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2396 v3 = current_player_num;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2397 pTargetXY.x += v24 + 96;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2398 LABEL_15:
1241
ae812777b1d4 fix in arcomagecards
Gloval
parents: 1219
diff changeset
2399 if ( am_byte_4E185D )
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2400 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2401 pTargetXY.x -= am_Players[current_player_num].card_shift[v2].x ;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2402 pTargetXY.y -= am_Players[current_player_num].card_shift[v2].y ;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2403 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2404 ++v2;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2405 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2406
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2407 for (v11=0; v11<10; ++v11)
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2408 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2409 if ( am_byte_4FAA76 == 0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2410 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2411 if ( shown_cards[v11].uCardId != -1 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2412 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2413 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2414 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2415 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2416 if ( shown_cards[v11].field_4 != 0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2417 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2418 pTargetXY.x = shown_cards[v11].field_18_point.x + 12;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2419 pTargetXY.y = shown_cards[v11].field_18_point.y + 40;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2420 pSrcXYZW.left = 843;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2421 pSrcXYZW.right = 916;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2422 pSrcXYZW.top = 200;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2423 pSrcXYZW.bottom = 216;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2424 Blt_Chroma(&pSrcXYZW, &pTargetXY, pArcomageGame->field_54, 2);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2425 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2426 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2427 else if ( amuint_4FAA34 <= 0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2428 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2429 if ( v11 == 9 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2430 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2431 am_byte_4FAA76 = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2432 am_byte_4FAA75 = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2433 amuint_4FAA34 = 5;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2434 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2435 if ( shown_cards[v11].uCardId != -1 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2436 amuint_4FABC4 = shown_cards[v11].uCardId;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2437 shown_cards[v11].uCardId = -1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2438 shown_cards[v11].field_18_point.x = shown_cards[v11].field_8.x;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2439 shown_cards[v11].field_18_point.y = shown_cards[v11].field_8.y;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2440 shown_cards[v11].field_4 = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2441 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2442 else
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2443 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2444 if ( shown_cards[v11].uCardId != -1 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2445 {
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2446 shown_cards[v11].field_18_point.x += shown_cards[v11].field_10_xplus;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2447 shown_cards[v11].field_18_point.y += shown_cards[v11].field_14_y_plus;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2448 pArcomageGame->GetCardRect(shown_cards[v11].uCardId, &pSrcXYZW);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2449 Blt_Copy(&pSrcXYZW, &shown_cards[v11].field_18_point, 0);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2450 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2451 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2452 }
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2453 if ( am_byte_4FAA76 != 0 )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2454 --amuint_4FAA34;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2455
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2456 pSrcXYZW.left = 192;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2457 pSrcXYZW.right = 288;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2458 pSrcXYZW.top = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2459 pSrcXYZW.bottom = 128;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2460 pTargetXY.x = 120;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2461 pTargetXY.y = 18;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2462 Blt_Copy(&pSrcXYZW, &pTargetXY, 0);
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2463
0
Ritor1
parents:
diff changeset
2464 }
Ritor1
parents:
diff changeset
2465
Ritor1
parents:
diff changeset
2466
Ritor1
parents:
diff changeset
2467 //----- (0040B76F) --------------------------------------------------------
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2468 void DrawCardAnimation( int animation_stage )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2469 {
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2470
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2471 int v1; // eax@3
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2472 int v2; // eax@3
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2473 int v3; // esi@4
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2474 int v4; // eax@4
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2475 POINT *v5; // edx@6
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2476 RECT *v6; // ecx@6
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2477
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2478 int v8; // eax@15
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2479 Acromage_st1 *v9; // ecx@15
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2480 int v10; // ecx@19
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2481 int v11; // eax@20
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2482 int v12; // ecx@20
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2483 int v13; // eax@20
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2484 unsigned int v14; // ecx@21
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2485 double v15; // st7@22
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2486 POINT *v16; // edx@23
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2487 int v17; // eax@32
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2488 char v18; // zf@37
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2489 int v19; // eax@41
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2490 int v20; // eax@46
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2491 int v21; // ecx@46
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2492 int v22; // eax@46
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2493 int v23; // [sp-4h] [bp-2Ch]@28
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2494 RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2495 POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2496 int v26; // [sp+24h] [bp-4h]@1
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2497
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2498 v26 = animation_stage;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2499 if ( amuint_4FAA4C != -1 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2500 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2501 if ( amuint_4FAA38 >= 9 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2502 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2503 am_uint_4FAA44_blt_xy.y = 18;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2504 am_uint_4FAA44_blt_xy.x = 120;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2505 v1 = GetPlayerHandCardCount(current_player_num);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2506 v2 = (640 - 96 * v1) / v1 + 96;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2507 if ( am_byte_4E185D )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2508 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2509 // v3 = 188 * current_player_num + 8 * amuint_4FAA4C;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2510 // amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 + *(am_Players[0].arr_6C[0] + v3) - 120) / 10;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2511 amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].card_shift[amuint_4FAA4C].x-120)/10;
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2512 v4 = (am_Players[current_player_num].card_shift[amuint_4FAA4C].y+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2513 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2514 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2515 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2516 amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 - 120) / 10;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2517 v4 = 30;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2518 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2519 am_uint_4FAA44_blt_xy.y += v4;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2520 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2521
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2522 amuint_4FAA3C_blt_xy.y = v4;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2523
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2524 pSrcXYZW.left = 192;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2525 pSrcXYZW.top = 0;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2526 pSrcXYZW.right = 288;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2527 pSrcXYZW.bottom = 128;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2528 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2529 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2530 else
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2531 {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2532
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2533
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2534 pSrcXYZW.left = 192;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2535 pSrcXYZW.top = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2536 pSrcXYZW.right = 288;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2537 pSrcXYZW.bottom = 128;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2538 am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2539 am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2540 Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2541 if ( !amuint_4FAA38 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2542 {
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2543
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2544 amuint_4FAA4C = -1;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2545 }
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2546 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2547 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2548 LABEL_11:
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2549
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2550 if ( uCardID != -1 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2551 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2552 if ( v26 <= 10 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2553 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2554 if ( v26 == 10 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2555 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2556 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2557 // v8 = 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2558 for (v8=0; v8<10; ++v8)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2559 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2560 if (shown_cards[v8].uCardId==-1)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2561 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2562 shown_cards[v8].uCardId = uCardID;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2563 shown_cards[v8].field_4 = 1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2564 break;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2565 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2566 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2567 /* v9 = shown_cards;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2568 while ( v9->uCardId != -1 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2569 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2570 ++v9;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2571 ++v8;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2572 if ( v9 >= &dword_4FABB8 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2573 goto LABEL_20;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2574 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2575
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2576 v10 = v8;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2577 shown_cards[v10].uCardId = uCardID;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2578 shown_cards[v10].field_4 = 1;*/
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2579 //LABEL_20:
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2580 pTargetXY.x = shown_cards[v8].field_8.x;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2581 pTargetXY.y = shown_cards[v8].field_8.y;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2582 Blt_Copy(&pSrcXYZW, &pTargetXY, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2583 uCardID = -1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2584 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2585 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2586 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2587 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2588 pArcomageGame->GetCardRect(uCardID, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2589 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2590 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2591 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2592 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2593 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2594
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2595 if ( played_card_id != -1 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2596 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2597 v15 = v26;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2598 if ( v15 > 15.0 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2599 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2600 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2601 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2602 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2603 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 2);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2604 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2605 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2606 if ( v15 == 15.0 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2607 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2608 ApplyCardToPlayer(current_player_num, played_card_id);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2609 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2610 pTargetXY.x = 272;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2611 pTargetXY.y = 173;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2612 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2613 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2614 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2615 if ( v15 == 5.0 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2616 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2617 amuint_4FAA5C_blt_xy.x = 272;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2618 amuint_4FAA5C_blt_xy.y = 173;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2619 for (v17=0; v17<10; ++v17)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2620 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2621 if (shown_cards[v17].uCardId==-1)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2622 break;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2623 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2624
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2625 amuint_4FAA54_blt_xy.x = (shown_cards[v17].field_8.x - 272) / 5;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2626 amuint_4FAA54_blt_xy.y = (shown_cards[v17].field_8.y - 173) / 5;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2627 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2628 pTargetXY.x = 272;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2629 pTargetXY.y = 173;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2630 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2631 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2632 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2633 if ( v15 >= 5.0 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2634 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2635 v18 = v26 == 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2636 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2637 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2638 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2639 v18 = v26 == 0;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2640 if ( v26 > 0 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2641 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2642 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2643 amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2644 amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2645 Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2646 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2647 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2648 }
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2649 if ( !v18 )
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2650 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2651
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2652 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2653 pTargetXY.x = 272;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2654 pTargetXY.y = 173;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2655 Blt_Copy(&pSrcXYZW, &pTargetXY, 2);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2656 return;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2657 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2658
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2659 pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2660 for (v19=0; v19<10; ++v19)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2661 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2662 if (shown_cards[v19].uCardId==-1)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2663 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2664 shown_cards[v19].uCardId = played_card_id;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2665 break;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2666 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2667 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2668 pTargetXY.x = shown_cards[v19].field_8.x;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2669 pTargetXY.y = shown_cards[v19].field_8.y;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2670 Blt_Copy(&pSrcXYZW, &pTargetXY, 0);
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2671 played_card_id = -1;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2672 }
0
Ritor1
parents:
diff changeset
2673 }
Ritor1
parents:
diff changeset
2674
Ritor1
parents:
diff changeset
2675 //----- (0040BB12) --------------------------------------------------------
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2676 void ArcomageGame::GetCardRect(unsigned int uCardID, RECT *pCardRect)
0
Ritor1
parents:
diff changeset
2677 {
Ritor1
parents:
diff changeset
2678 int v3; // edx@1
Ritor1
parents:
diff changeset
2679 int v4; // ecx@1
Ritor1
parents:
diff changeset
2680
Ritor1
parents:
diff changeset
2681 v3 = pCards[uCardID].slot % 10;
Ritor1
parents:
diff changeset
2682 v4 = (pCards[uCardID].slot / 10 << 7) + 220;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2683 pCardRect->top = v4;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2684 pCardRect->left = 96 * v3;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2685 pCardRect->bottom = v4 + 128;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2686 pCardRect->right = 96 * v3 + 96;
0
Ritor1
parents:
diff changeset
2687 }
Ritor1
parents:
diff changeset
2688
Ritor1
parents:
diff changeset
2689 //----- (0040BB49) --------------------------------------------------------
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2690 int GetPlayerHandCardCount( int player_num )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2691 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2692 int card_count; // eax@1
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2693
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2694 card_count = 0;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2695 for(int i=0; i<10; ++i)
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2696 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2697 if (am_Players[player_num].cards_at_hand[i]!=-1)
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2698 ++card_count;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2699 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2700 return card_count;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2701
0
Ritor1
parents:
diff changeset
2702 }
Ritor1
parents:
diff changeset
2703
Ritor1
parents:
diff changeset
2704 //----- (0040BB67) --------------------------------------------------------
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2705 signed int DrawCardsRectangles( int player_num )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2706 {
1241
ae812777b1d4 fix in arcomagecards
Gloval
parents: 1219
diff changeset
2707 //need do fix rectangle not fit to card
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2708
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2709 //int v1; // esi@1
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2710 signed int result; // eax@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2711 int v3; // ebx@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2712 char v4; // zf@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2713 int v5; // eax@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2714 int v6; // eax@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2715 int v7; // ecx@6
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2716 char *v8; // eax@6
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2717 int v9; // eax@10
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2718 int v10; // ecx@10
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2719 int v11; // eax@10
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2720 char v12; // ch@2@11
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2721 int v13; // ST00_4@12
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2722 unsigned __int16 v14; // ax@12
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2723 int v15; // eax@13
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2724 int v16; // ecx@13
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2725 int v17; // eax@13
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2726 char v18; // al@16
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2727 char v19; // ch@2@16
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2728 int v20; // ST00_4@19
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2729 unsigned __int16 v21; // ax@19
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2730 RECT pXYZW; // [sp+Ch] [bp-3Ch]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2731 stru273 v26; // [sp+1Ch] [bp-2Ch]@2
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2732 int v25; // [sp+2Ch] [bp-1Ch]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2733 __int32 var18; // [sp+30h] [bp-18h]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2734 int i; // [sp+34h] [bp-14h]@4
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2735 int v28; // [sp+38h] [bp-10h]@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2736 int hand_index; // [sp+3Ch] [bp-Ch]@3
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2737 int v30; // [sp+40h] [bp-8h]@1
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2738 char v31; // [sp+44h] [bp-4h]@12
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2739 char v32; // [sp+45h] [bp-3h]@12
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2740 char v33; // [sp+46h] [bp-2h]@12
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2741
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2742
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2743 v30 = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2744 result = -1;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2745 //v3 = 188 * a1;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2746
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2747 //v4 = LOBYTE(am_Players[a1].field_20) == 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2748 v28 = -1;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2749 if ( am_Players[player_num].IsHisTurn )
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2750 {
0
Ritor1
parents:
diff changeset
2751 if ( v26._40DD2F() )
Ritor1
parents:
diff changeset
2752 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2753 v5 = GetPlayerHandCardCount(player_num);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2754 hand_index = 0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2755 v25 = v5;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2756 pXYZW.top = 327;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2757 pXYZW.bottom = 455;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2758 pXYZW.left = (640 - 96 * v5) / (v5 + 1);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2759 var18 = pXYZW.left + 96;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2760 pXYZW.right = pXYZW.left + 96;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2761 if ( v5 > 0 )
0
Ritor1
parents:
diff changeset
2762 {
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2763 // v6 = 47 * v1;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2764 // for ( i = player_num; ; v6 = i )
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2765 for(;;)
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2766 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2767 v7 = v30;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2768 // v8 = &am_Players[0].cards_at_hand[v30 + v6];
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2769
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2770 for (v7=0; v7<10; ++v7)
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2771 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2772 if (am_Players[player_num].cards_at_hand[v7]!= -1 )
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2773 break;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2774 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2775 //if ( *v8 )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2776 // {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2777 // do
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2778 // {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2779 // //v8 += 4;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2780 // ++v7;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2781 // }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2782 // while ( *v8 == -1 );
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2783 v30 = v7;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2784 // }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2785 if ( am_byte_4E185D )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2786 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2787 // v9 = v3 + 8 * v7;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2788 v10 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v9);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2789 v11 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v9);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2790 pXYZW.left += v10;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2791 pXYZW.right += v10;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2792 pXYZW.top += v11;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2793 pXYZW.bottom += v11;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2794 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2795 if (v26.Inside(&pXYZW) )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2796 break;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2797
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2798 v13=0;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2799 v14 = R8G8B8_to_TargetFormat(v13);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2800 DrawRect(&pXYZW, v14, 0);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2801 pXYZW.left += var18;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2802 pXYZW.right += var18;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2803 if ( am_byte_4E185D )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2804 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2805 v16 = am_Players[player_num].card_shift[v30].x;//*(am_player[0].arr_6C[0] + v15);
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2806 v17 = am_Players[player_num].card_shift[v30].y;//*(&am_player[0].arr_6C[0][1] + v15);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2807 pXYZW.left -= v16;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2808 pXYZW.right -= v16;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2809 pXYZW.top -= v17;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2810 pXYZW.bottom -= v17;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2811 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2812 ++v30;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2813 ++hand_index;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2814 if ( hand_index >= v25 )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2815 return v28;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2816 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2817 v28 = hand_index;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2818 v18 = CanCardBePlayed(player_num, hand_index);
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2819 if ( v18 )
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2820 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2821 v20=0x00FFFFFF;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2822 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2823 else
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2824 {
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2825 v20=0x000000FF;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2826 }
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2827
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2828 v21 = R8G8B8_to_TargetFormat(v20);
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2829 DrawRect(&pXYZW, v21, 0);
0
Ritor1
parents:
diff changeset
2830 }
Ritor1
parents:
diff changeset
2831 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2832 result = v28;
0
Ritor1
parents:
diff changeset
2833 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2834 return result;
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2835
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2836
0
Ritor1
parents:
diff changeset
2837 }
Ritor1
parents:
diff changeset
2838 // 4E185D: using guessed type char am_byte_4E185D;
Ritor1
parents:
diff changeset
2839
Ritor1
parents:
diff changeset
2840 //----- (0040BCFB) --------------------------------------------------------
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2841 bool DiscardCard( int player_num, signed int card_slot_index )
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2842 {
0
Ritor1
parents:
diff changeset
2843 int v2; // esi@2
Ritor1
parents:
diff changeset
2844 signed int v3; // edi@2
Ritor1
parents:
diff changeset
2845 char *v4; // eax@2
Ritor1
parents:
diff changeset
2846 int v5; // ecx@7
Ritor1
parents:
diff changeset
2847 int v6; // ebx@7
Ritor1
parents:
diff changeset
2848 int v7; // esi@8
Ritor1
parents:
diff changeset
2849 int v8; // eax@8
Ritor1
parents:
diff changeset
2850 int v9; // esi@8
Ritor1
parents:
diff changeset
2851 int v10; // ecx@8
Ritor1
parents:
diff changeset
2852 int v11; // eax@8
Ritor1
parents:
diff changeset
2853 int v12; // eax@8
Ritor1
parents:
diff changeset
2854 signed int v13; // edx@9
Ritor1
parents:
diff changeset
2855 unsigned int v14; // eax@12
Ritor1
parents:
diff changeset
2856 char result; // al@12
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2857 int i;
0
Ritor1
parents:
diff changeset
2858
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2859 if ( card_slot_index <= -1 )
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2860 return false;
0
Ritor1
parents:
diff changeset
2861 v2 = 0;
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2862
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2863 for(i=0; i<10; ++i)
0
Ritor1
parents:
diff changeset
2864 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2865 if ( am_Players[player_num].cards_at_hand[i] != -1 )
0
Ritor1
parents:
diff changeset
2866 {
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2867 if ( card_slot_index == v2 )
0
Ritor1
parents:
diff changeset
2868 break;
Ritor1
parents:
diff changeset
2869 ++v2;
Ritor1
parents:
diff changeset
2870 }
Ritor1
parents:
diff changeset
2871 }
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
2872
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2873 if ( pCards[am_Players[player_num].cards_at_hand[i]].can_be_discarded)
0
Ritor1
parents:
diff changeset
2874 {
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2875 ArcomageGame::PlaySound(22);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2876 v8 = GetPlayerHandCardCount(current_player_num);
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2877 v10=am_Players[player_num].card_shift[i].x + (640 - 96 * v8) / (v8 + 1);
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2878 amuint_4FAA5C_blt_xy.x = v10;
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
2879 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[i].y + 327;//v11;
0
Ritor1
parents:
diff changeset
2880 v12 = 0;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2881
0
Ritor1
parents:
diff changeset
2882 if ( !am_byte_4FAA75 )
Ritor1
parents:
diff changeset
2883 {
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2884 for (v12=0; v12<10; ++v12)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2885 {
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2886 if (shown_cards[v12].uCardId== -1)
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2887 break;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2888 }
0
Ritor1
parents:
diff changeset
2889 }
Ritor1
parents:
diff changeset
2890 pArcomageGame->field_F6 = 1;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2891 amuint_4FAA54_blt_xy.x = (shown_cards[v12].field_8.x - v10) / 10;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2892 amuint_4FAA54_blt_xy.y = (shown_cards[v12].field_8.y - 327) / 10;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2893 uCardID = am_Players[player_num].cards_at_hand[i];
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2894 am_Players[player_num].cards_at_hand[i] = -1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2895 need_to_discard_card = 0;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2896 return true;
0
Ritor1
parents:
diff changeset
2897 }
Ritor1
parents:
diff changeset
2898 else
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2899 return false;
0
Ritor1
parents:
diff changeset
2900 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2901
0
Ritor1
parents:
diff changeset
2902
Ritor1
parents:
diff changeset
2903 //----- (0040BE0E) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2904 bool PlayCard( int player_num, signed int card_slot_num )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2905 {
1247
Gloval
parents: 1246
diff changeset
2906
0
Ritor1
parents:
diff changeset
2907 int v3; // ebp@1
Ritor1
parents:
diff changeset
2908 int v4; // ecx@2
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
2909 ArcomagePlayer *v5; // esi@2
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2910 int card_index; // edi@2
0
Ritor1
parents:
diff changeset
2911 int v7; // eax@2
Ritor1
parents:
diff changeset
2912 int v8; // ebx@8
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2913 int cards_at_hand; // eax@8
0
Ritor1
parents:
diff changeset
2914 int v10; // ebx@8
Ritor1
parents:
diff changeset
2915 int v11; // ebp@8
Ritor1
parents:
diff changeset
2916 int v12; // ecx@8
Ritor1
parents:
diff changeset
2917 int v13; // eax@8
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2918 ArcomageCard *pCard; // eax@8
0
Ritor1
parents:
diff changeset
2919 int v15; // ecx@8
Ritor1
parents:
diff changeset
2920 int v16; // ecx@8
Ritor1
parents:
diff changeset
2921
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2922 if ( card_slot_num <= -1 )
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2923 return false;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2924
0
Ritor1
parents:
diff changeset
2925 v4 = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2926 for (card_index=0; card_index<10; ++card_index)
0
Ritor1
parents:
diff changeset
2927 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2928 if ( am_Players[player_num].cards_at_hand[card_index] != -1 )
0
Ritor1
parents:
diff changeset
2929 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2930 if ( card_slot_num == v4 )
0
Ritor1
parents:
diff changeset
2931 break;
Ritor1
parents:
diff changeset
2932 ++v4;
Ritor1
parents:
diff changeset
2933 }
Ritor1
parents:
diff changeset
2934 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2935
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2936 if (CanCardBePlayed(player_num, card_index) )
0
Ritor1
parents:
diff changeset
2937 {
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2938 ArcomageGame::PlaySound(23);
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2939 cards_at_hand = GetPlayerHandCardCount(current_player_num);
0
Ritor1
parents:
diff changeset
2940 pArcomageGame->field_F6 = 1;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2941 v12 = am_Players[player_num].card_shift[card_index].x +
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2942 (640 - 96 * cards_at_hand) / (cards_at_hand + 1)+
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2943 96 * card_index ;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2944
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2945 // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2946 amuint_4FAA5C_blt_xy.x = v12;//v12;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2947 amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[card_index].y + 327;//v13;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2948
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2949 amuint_4FAA54_blt_xy.x = (272 - v12) / 5;
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
2950 amuint_4FAA54_blt_xy.y = -30;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2951
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2952 pCard = &pCards[am_Players[player_num].cards_at_hand[card_index]];
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2953 am_Players[player_num].resource_bricks -= pCard->needed_bricks;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2954 am_Players[player_num].resource_beasts -= pCard->needed_beasts;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2955 am_Players[player_num].resource_gems -= pCard->needed_gems;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2956 played_card_id = am_Players[player_num].cards_at_hand[card_index];
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2957 am_Players[player_num].cards_at_hand[card_index] = -1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
2958 return true;
0
Ritor1
parents:
diff changeset
2959 }
Ritor1
parents:
diff changeset
2960 else
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2961 return false;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2962
0
Ritor1
parents:
diff changeset
2963 }
Ritor1
parents:
diff changeset
2964
Ritor1
parents:
diff changeset
2965 //----- (0040BF15) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2966 bool CanCardBePlayed( int player_num, int hand_card_indx )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2967 {
0
Ritor1
parents:
diff changeset
2968 bool result; // eax@1
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2969 ArcomageCard *test_card; // ecx@1
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2970 ArcomagePlayer *pPlayer; // esi@1
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2971
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2972 pPlayer = &am_Players[player_num];
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2973 result = true;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2974 test_card = &pCards[am_Players[player_num].cards_at_hand[hand_card_indx]];
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2975 if ( test_card->needed_quarry_level > pPlayer->quarry_level )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2976 result = false;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2977 if ( test_card->needed_magic_level > pPlayer->magic_level )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2978 result = false;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
2979 if ( test_card->needed_might_level > pPlayer->zoo_level )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2980 result = false;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2981 if ( test_card->needed_bricks > pPlayer->resource_bricks )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2982 result = false;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2983 if ( test_card->needed_gems > pPlayer->resource_gems )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2984 result = false;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
2985 if ( test_card->needed_beasts > pPlayer->resource_beasts )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
2986 result = false;
0
Ritor1
parents:
diff changeset
2987 return result;
Ritor1
parents:
diff changeset
2988 }
Ritor1
parents:
diff changeset
2989
Ritor1
parents:
diff changeset
2990
Ritor1
parents:
diff changeset
2991
Ritor1
parents:
diff changeset
2992
Ritor1
parents:
diff changeset
2993 //----- (0040BF77) --------------------------------------------------------
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2994 void ApplyCardToPlayer( int player_num, unsigned int uCardID )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
2995 {
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
2996
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
2997
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
2998 #define APPLY_TO_PLAYER( PLAYER, ENEMY,FIELD, VAL, RES )\
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
2999 if (VAL != 0) {\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3000 if (VAL == 99) {\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3001 if ( PLAYER->##FIELD < ENEMY->##FIELD ) {\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3002 PLAYER->##FIELD = ENEMY->##FIELD;\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3003 RES = ENEMY->##FIELD - PLAYER->##FIELD;\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3004 }\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3005 } else {\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3006 PLAYER->##FIELD += (signed int)(VAL);\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3007 if ( PLAYER->##FIELD<0 ) PLAYER->##FIELD= 0;\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3008 RES = (signed int)(VAL);\
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3009 }\
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3010 }
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3011
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3012 #define APPLY_TO_ENEMY( PLAYER, ENEMY,FIELD, VAL, RES ) APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES)
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3013
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3014 #define APPLY_TO_BOTH( PLAYER, ENEMY, FIELD, VAL, RES_P, RES_E ) \
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3015 if ( VAL != 0) {\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3016 if ( VAL == 99 ) { \
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3017 if ( PLAYER->##FIELD != ENEMY->##FIELD ) { \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3018 if ( PLAYER->##FIELD <= ENEMY->##FIELD ) { \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3019 PLAYER->##FIELD = ENEMY->##FIELD; \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3020 RES_P = ENEMY->##FIELD - PLAYER->##FIELD; \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3021 } else { \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3022 ENEMY->##FIELD = PLAYER->##FIELD; \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3023 RES_E = PLAYER->##FIELD - ENEMY->##FIELD; \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3024 } \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3025 }\
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3026 } else { \
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3027 PLAYER->##FIELD += (signed int)(VAL);\
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3028 ENEMY->##FIELD += (signed int)(VAL); if (PLAYER->##FIELD < 0 ) {PLAYER->##FIELD = 0;} \
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3029 if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3030 RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3031 }\
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3032 }
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3033 ArcomagePlayer *player; // esi@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3034 int v3; // eax@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3035 ArcomagePlayer *enemy; // edi@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3036 int v5; // eax@2
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3037 char v6; // sf@2
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3038 unsigned __int8 v7; // of@2
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3039 int v8; // eax@3
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3040 int v9; // eax@4
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3041 char v10; // zf@5
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3042 int v11; // eax@8
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3043 unsigned __int8 v12; // zf@8
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3044 char v13; // sf@8
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3045 unsigned __int8 v14; // of@8
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3046 int v15; // eax@9
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3047 int v16; // eax@10
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3048 char v17; // zf@12
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3049 char v18; // al@15
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3050 int v19; // eax@16
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3051 int v20; // eax@17
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3052 int v21; // eax@22
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3053 int v22; // eax@23
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3054 int v23; // eax@26
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3055 signed int v24; // ebx@26
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3056 int v103;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3057 int v104;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3058
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3059 POINT v184; // [sp+Ch] [bp-64h]@488
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3060 int enemy_num; // [sp+14h] [bp-5Ch]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3061 ArcomageCard *pCard; // [sp+18h] [bp-58h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3062 int buildings_e; // [sp+1Ch] [bp-54h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3063 int buildings_p; // [sp+20h] [bp-50h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3064 int quarry_p; // [sp+28h] [bp-48h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3065 int dmg_e; // [sp+2Ch] [bp-44h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3066 int dmg_p; // [sp+30h] [bp-40h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3067 int bricks_p; // [sp+34h] [bp-3Ch]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3068 int tower_e; // [sp+38h] [bp-38h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3069 int tower_p; // [sp+3Ch] [bp-34h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3070 int wall_e; // [sp+40h] [bp-30h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3071 int wall_p; // [sp+44h] [bp-2Ch]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3072 int beasts_e; // [sp+48h] [bp-28h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3073 int beasts_p; // [sp+4Ch] [bp-24h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3074 int gems_e; // [sp+50h] [bp-20h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3075 int gems_p; // [sp+54h] [bp-1Ch]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3076 int bricks_e; // [sp+58h] [bp-18h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3077 int zoo_e; // [sp+5Ch] [bp-14h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3078 int zoo_p; // [sp+60h] [bp-10h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3079 int magic_e; // [sp+64h] [bp-Ch]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3080 int magic_p; // [sp+68h] [bp-8h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3081 int quarry_e; // [sp+6Ch] [bp-4h]@1
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3082
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3083 quarry_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3084 magic_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3085 zoo_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3086 bricks_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3087 gems_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3088 beasts_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3089 wall_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3090 tower_p = 0;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3091 buildings_p = 0;
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3092 dmg_p = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3093 quarry_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3094 magic_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3095 zoo_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3096 bricks_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3097 gems_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3098 beasts_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3099 wall_e = 0;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3100 tower_e = 0;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3101 buildings_e = 0;
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3102 dmg_e = 0;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3103
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3104 player = &am_Players[player_num];
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3105 pCard = &pCards[uCardID];
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3106 enemy_num = (player_num + 1) % 2;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3107 enemy = &am_Players[enemy_num];
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3108 switch ( pCard->compare_param )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3109 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3110 case 2:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3111 v5 = player->quarry_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3112 v7 = __OFSUB__(v5, enemy->quarry_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3113 v6 = v5 - enemy->quarry_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3114 v18 = v6 ^ v7;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3115 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3116 case 3:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3117 v8 = player->magic_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3118 v7 = __OFSUB__(v8, enemy->magic_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3119 v6 = v8 - enemy->magic_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3120 v18 = v6 ^ v7;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3121 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3122 case 4:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3123 v9 = player->zoo_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3124 v7 = __OFSUB__(v9, enemy->zoo_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3125 v6 = v9 - enemy->zoo_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3126 v18 = v6 ^ v7;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3127 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3128 case 5:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3129 v10 = player->quarry_level == enemy->quarry_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3130 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3131 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3132 case 6:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3133 v10 = player->magic_level == enemy->magic_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3134 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3135 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3136 case 7:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3137 v10 = player->zoo_level == enemy->zoo_level;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3138 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3139 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3140 case 8:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3141 v11 = player->quarry_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3142 v14 = __OFSUB__(v11, enemy->quarry_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3143 v12 = v11 == enemy->quarry_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3144 v13 = v11 - enemy->quarry_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3145 v18 = !((v13 ^ v14) | v12);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3146 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3147 case 9:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3148 v15 = player->magic_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3149 v14 = __OFSUB__(v15, enemy->magic_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3150 v12 = v15 == enemy->magic_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3151 v13 = v15 - enemy->magic_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3152 v18 = !((v13 ^ v14) | v12);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3153 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3154 case 10:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3155 v16 = player->zoo_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3156 v14 = __OFSUB__(v16, enemy->zoo_level);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3157 v12 = v16 == enemy->zoo_level;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3158 v13 = v16 - enemy->zoo_level < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3159 v18 = !((v13 ^ v14) | v12);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3160 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3161 case 11:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3162 v10 = player->wall_height == 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3163 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3164 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3165 case 12:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3166 v17 = player->wall_height == 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3167 v18 = !v17;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3168 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3169 case 13:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3170 v10 = enemy->wall_height == 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3171 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3172 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3173 case 14:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3174 v17 = enemy->wall_height == 0;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3175 v18 = !v17;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3176 goto LABEL_25;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3177 case 15:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3178 v19 = player->wall_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3179 v7 = __OFSUB__(v19, enemy->wall_height);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3180 v6 = v19 - enemy->wall_height < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3181 v18 = v6 ^ v7;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3182 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3183 case 16:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3184 v20 = player->tower_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3185 v7 = __OFSUB__(v20, enemy->tower_height);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3186 v6 = v20 - enemy->tower_height < 0;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3187 v18 = v6 ^ v7;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3188 goto LABEL_25;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3189 case 17:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3190 v10 = player->wall_height == enemy->wall_height;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3191 v18 = v10;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3192 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3193 case 18:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3194 v10 = player->tower_height == enemy->tower_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3195 v18 = v10;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3196 goto LABEL_25;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3197 case 19:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3198 v21 = player->wall_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3199 v14 = __OFSUB__(v21, enemy->wall_height);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3200 v12 = v21 == enemy->wall_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3201 v13 = v21 - enemy->wall_height < 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3202 v18 = !((v13 ^ v14) | v12);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3203 goto LABEL_25;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3204 case 20:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3205 v22 = player->tower_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3206 v14 = __OFSUB__(v22, enemy->tower_height);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3207 v12 = v22 == enemy->tower_height;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3208 v13 = v22 - enemy->tower_height < 0;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3209 v18 = !((v13 ^ v14) | v12);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3210 LABEL_25:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3211 if ( v18 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3212 goto LABEL_26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3213 goto LABEL_231;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3214 default:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3215 LABEL_26:
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3216 v23 = pCard->draw_extra_card_count;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3217 v24 = 0;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3218 dword_4FAA68 = v23 + (pCard->field_30 == 1);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3219 dword_4FAA64 = v23;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3220 if ( v23 > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3221 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3222 do
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3223 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3224 GetNextCardFromDeck(player_num);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3225 ++v24;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3226 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3227 while ( v24 < pCard->draw_extra_card_count );
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3228 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3229
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3230 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3231
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3232
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3233 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3234 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3235 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl, zoo_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3236 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks, bricks_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3237 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems, gems_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3238 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts, beasts_p);
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3239 if ( pCard->to_player_buildings )
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3240 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3241 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3242 buildings_p = (signed int)pCard->to_player_buildings - dmg_p;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3243 }
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3244 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall, wall_p);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3245 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower, tower_p);
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3246
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3247 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3248 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3249 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3250 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3251 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3252 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3253 if ( pCard->to_enemy_buildings )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3254 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3255 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3256 buildings_e = (signed int)pCard->to_enemy_buildings - dmg_e;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3257 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3258 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3259 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3260
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3261 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl, quarry_p, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3262 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl, magic_p, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3263 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl, zoo_p, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3264 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks, bricks_p, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3265 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems, gems_p, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3266 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts, beasts_p, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3267 if ( pCard->to_pl_enm_buildings )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3268 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3269 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3270 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3271 buildings_p = (signed int)pCard->to_pl_enm_buildings - dmg_p;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3272 buildings_e = (signed int)pCard->to_pl_enm_buildings - dmg_e;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3273 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3274 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3275 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3276 break;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3277 case 0:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3278 LABEL_231:
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3279 v103 = pCard->can_draw_extra_card2;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3280 v104 = 0;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3281 dword_4FAA68 = v103 + (pCard->field_4D == 1);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3282 dword_4FAA64 = v103;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3283 if ( v103 > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3284 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3285 do
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3286 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3287 GetNextCardFromDeck(player_num);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3288 ++v104;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3289 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3290 while ( v104 < pCard->can_draw_extra_card2 );
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3291 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3292
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3293 need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3294
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3295 APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3296 APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3297 APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl2, zoo_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3298 APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks2, bricks_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3299 APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems2, gems_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3300 APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts2, beasts_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3301 if ( pCard->to_player_buildings2 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3302 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3303 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings2);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3304 buildings_p = (signed int)pCard->to_player_buildings2 - dmg_p;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3305 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3306 APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall2, wall_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3307 APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower2, tower_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3308
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3309 APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl2, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3310 APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl2, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3311 APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl2, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3312 APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks2, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3313 APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems2, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3314 APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts2, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3315 if ( pCard->to_enemy_buildings2 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3316 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3317 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings2);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3318 buildings_e = (signed int)pCard->to_enemy_buildings2 - dmg_e;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3319 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3320 APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall2, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3321 APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower2, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3322
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3323 APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl2, quarry_p, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3324 APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl2, magic_p, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3325 APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl2, zoo_p, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3326 APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks2, bricks_p, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3327 APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems2, gems_p, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3328 APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts2, beasts_p, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3329
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3330 if ( pCard->to_pl_enm_buildings2 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3331 {
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3332 dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings2);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3333 dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings2);
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3334 buildings_p = (signed int)pCard->to_pl_enm_buildings2 - dmg_p;
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3335 buildings_e = (signed int)pCard->to_pl_enm_buildings2 - dmg_e;
1245
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3336 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3337 APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall2, wall_p, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3338 APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower2, tower_p, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3339 break;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3340 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3341 // }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3342 if ( quarry_p > 0 || quarry_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3343 pArcomageGame->PlaySound(30);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3344 if ( quarry_p < 0 || quarry_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3345 pArcomageGame->PlaySound(31);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3346 if ( magic_p > 0 || magic_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3347 pArcomageGame->PlaySound(33);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3348 if ( magic_p < 0 || magic_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3349 pArcomageGame->PlaySound(34);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3350 if ( zoo_p > 0 || zoo_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3351 pArcomageGame->PlaySound(36);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3352 if ( zoo_p < 0 || zoo_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3353 pArcomageGame->PlaySound(37);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3354 if ( bricks_p > 0 || bricks_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3355 pArcomageGame->PlaySound(39);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3356 if ( bricks_p < 0 || bricks_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3357 pArcomageGame->PlaySound(40);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3358 if ( gems_p > 0 || gems_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3359 pArcomageGame->PlaySound(42);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3360 if ( gems_p < 0 || gems_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3361 pArcomageGame->PlaySound(43);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3362 if ( beasts_p > 0 || beasts_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3363 pArcomageGame->PlaySound(45u);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3364 if ( beasts_p < 0 || beasts_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3365 pArcomageGame->PlaySound(46);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3366 if ( buildings_p || buildings_e || dmg_p || dmg_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3367 pArcomageGame->PlaySound(48);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3368 if ( wall_p > 0 || wall_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3369 pArcomageGame->PlaySound(49);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3370 if ( wall_p < 0 || wall_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3371 pArcomageGame->PlaySound(50);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3372 if ( tower_p > 0 || tower_e > 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3373 pArcomageGame->PlaySound(52);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3374 if ( tower_p < 0 || tower_e < 0 )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3375 pArcomageGame->PlaySound(53);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3376 if ( player_num )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3377 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3378 if ( quarry_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3379 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3380 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3381 v184.y = 92;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3382 am_40D2B4(&v184, quarry_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3383 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3384 if ( quarry_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3385 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3386 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3387 v184.y = 92;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3388 am_40D2B4(&v184, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3389 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3390 if ( magic_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3391 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3392 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3393 v184.y = 164;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3394 am_40D2B4(&v184, magic_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3395 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3396 if ( magic_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3397 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3398 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3399 v184.y = 164;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3400 am_40D2B4(&v184, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3401 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3402 if ( zoo_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3403 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3404 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3405 v184.y = 236;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3406 am_40D2B4(&v184, zoo_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3407 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3408 if ( zoo_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3409 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3410 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3411 v184.y = 236;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3412 am_40D2B4(&v184, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3413 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3414 if ( bricks_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3415 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3416 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3417 v184.y = 114;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3418 am_40D2B4(&v184, bricks_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3419 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3420 if ( bricks_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3421 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3422 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3423 v184.y = 114;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3424 am_40D2B4(&v184, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3425 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3426 if ( gems_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3427 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3428 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3429 v184.y = 186;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3430 am_40D2B4(&v184, gems_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3431 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3432 if ( gems_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3433 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3434 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3435 v184.y = 186;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3436 am_40D2B4(&v184, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3437 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3438 if ( beasts_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3439 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3440 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3441 v184.y = 258;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3442 am_40D2B4(&v184, beasts_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3443 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3444 if ( beasts_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3445 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3446 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3447 v184.y = 258;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3448 am_40D2B4(&v184, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3449 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3450 if ( wall_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3451 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3452 v184.x = 442;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3453 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3454 am_40D2B4(&v184, wall_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3455 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3456 if ( wall_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3457 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3458 v184.x = 180;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3459 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3460 am_40D2B4(&v184, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3461 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3462 if ( tower_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3463 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3464 v184.x = 514;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3465 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3466 am_40D2B4(&v184, tower_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3467 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3468 if ( tower_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3469 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3470 v184.x = 122;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3471 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3472 am_40D2B4(&v184, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3473 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3474 if ( dmg_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3475 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3476 v184.x = 442;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3477 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3478 am_40D2B4(&v184, dmg_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3479 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3480 if ( buildings_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3481 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3482 v184.x = 514;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3483 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3484 am_40D2B4(&v184, buildings_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3485 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3486 if ( dmg_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3487 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3488 v184.x = 180;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3489 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3490 am_40D2B4(&v184, dmg_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3491 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3492 if ( buildings_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3493 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3494 v184.x = 122;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3495 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3496 am_40D2B4(&v184, buildings_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3497 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3498 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3499 else
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3500 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3501 if ( quarry_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3502 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3503 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3504 v184.y = 92;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3505 am_40D2B4(&v184, quarry_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3506 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3507 if ( quarry_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3508 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3509 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3510 v184.y = 92;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3511 am_40D2B4(&v184, quarry_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3512 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3513 if ( magic_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3514 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3515 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3516 v184.y = 164;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3517 am_40D2B4(&v184, magic_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3518 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3519 if ( magic_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3520 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3521 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3522 v184.y = 164;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3523 am_40D2B4(&v184, magic_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3524 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3525 if ( zoo_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3526 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3527 v184.x = 26;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3528 v184.y = 236;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3529 am_40D2B4(&v184, zoo_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3530 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3531 if ( zoo_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3532 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3533 v184.x = 573;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3534 v184.y = 236;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3535 am_40D2B4(&v184, zoo_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3536 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3537 if ( bricks_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3538 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3539 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3540 v184.y = 114;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3541 am_40D2B4(&v184, bricks_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3542 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3543 if ( bricks_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3544 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3545 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3546 v184.y = 114;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3547 am_40D2B4(&v184, bricks_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3548 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3549 if ( gems_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3550 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3551 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3552 v184.y = 186;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3553 am_40D2B4(&v184, gems_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3554 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3555 if ( gems_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3556 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3557 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3558 v184.y = 186;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3559 am_40D2B4(&v184, gems_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3560 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3561 if ( beasts_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3562 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3563 v184.x = 16;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3564 v184.y = 258;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3565 am_40D2B4(&v184, beasts_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3566 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3567 if ( beasts_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3568 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3569 v184.x = 563;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3570 v184.y = 258;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3571 am_40D2B4(&v184, beasts_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3572 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3573 if ( wall_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3574 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3575 v184.x = 180;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3576 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3577 am_40D2B4(&v184, wall_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3578 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3579 if ( wall_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3580 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3581 v184.x = 442;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3582 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3583 am_40D2B4(&v184, wall_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3584 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3585 if ( tower_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3586 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3587 v184.x = 122;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3588 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3589 am_40D2B4(&v184, tower_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3590 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3591 if ( tower_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3592 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3593 v184.x = 514;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3594 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3595 am_40D2B4(&v184, tower_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3596 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3597 if ( dmg_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3598 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3599 v184.x = 180;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3600 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3601 am_40D2B4(&v184, dmg_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3602 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3603 if ( buildings_p )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3604 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3605 v184.x = 122;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3606 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3607 am_40D2B4(&v184, buildings_p);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3608 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3609 if ( dmg_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3610 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3611 v184.x = 442;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3612 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3613 am_40D2B4(&v184, dmg_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3614 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3615 if ( buildings_e )
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3616 {
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3617 v184.x = 514;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3618 v184.y = 296;
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3619 am_40D2B4(&v184, buildings_e);
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3620 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3621 }
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3622 #undef APPLY_TO_BOTH
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3623 #undef APPLY_TO_ENEMY
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3624 #undef APPLY_TO_PLAYER
e161d8a5a529 acromage - apply card
Gloval
parents: 1241
diff changeset
3625
0
Ritor1
parents:
diff changeset
3626 }
Ritor1
parents:
diff changeset
3627
Ritor1
parents:
diff changeset
3628
Ritor1
parents:
diff changeset
3629
Ritor1
parents:
diff changeset
3630
Ritor1
parents:
diff changeset
3631 //----- (0040D2B4) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3632 int am_40D2B4( POINT* startXY, int effect_value )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3633 {
0
Ritor1
parents:
diff changeset
3634 int v2; // ebp@1
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3635 POINT *v3; // edi@1
0
Ritor1
parents:
diff changeset
3636 int result; // eax@3
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
3637 int v6;
0
Ritor1
parents:
diff changeset
3638 stru272_stru0 *v8; // ecx@12
Ritor1
parents:
diff changeset
3639 signed int v11; // [sp+10h] [bp-8h]@1
1194
9baf16113199 arcomage ui partialy drawn
Gloval
parents: 1191
diff changeset
3640
0
Ritor1
parents:
diff changeset
3641
Ritor1
parents:
diff changeset
3642 v11 = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3643 v2 = effect_value;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3644
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3645 while ( array_4FABD0[v11].have_effect )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3646 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3647 result = array_4FABD0[v11].field_40->_40E2A7();
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3648 if ( !result )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3649 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3650 array_4FABD0[v11].have_effect = 0;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3651 --v11;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3652 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3653 ++v11;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3654 if ( v11 >= 10 )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3655 return result;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3656 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3657 v6 = v11;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3658 array_4FABD0[v11].have_effect = 1;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3659 if ( effect_value <= 0 )
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3660 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3661 array_4FABD0[v6].effect_sign = 0;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3662 effect_value = -effect_value;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3663 }
0
Ritor1
parents:
diff changeset
3664 else
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3665 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3666 array_4FABD0[v6].effect_sign = 1;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3667 }
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3668 array_4FABD0[v6].field_4.effect_area.left = startXY->x - 20;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3669 array_4FABD0[v6].field_4.effect_area.right = startXY->x + 20;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3670 array_4FABD0[v6].field_4.effect_area.top = startXY->y - 20;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3671 array_4FABD0[v6].field_4.effect_area.bottom = startXY->y + 20;
1186
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3672 array_4FABD0[v6].field_4.field_10 = -60;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3673 array_4FABD0[v6].field_4.field_14 = 60;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3674 array_4FABD0[v6].field_4.field_18 = 180;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3675 array_4FABD0[v6].field_4.field_1Cf = 0.5;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3676 array_4FABD0[v6].field_4.field_20 = 150;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3677 array_4FABD0[v6].field_4.field_24f= 50.0;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3678 array_4FABD0[v6].field_4.field_28f = 3.0;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3679 array_4FABD0[v6].field_4.field_2Cf = 8.0;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3680 array_4FABD0[v6].field_4.field_30 = 5;
569216b4f54d more on arcomage 2
Gloval
parents: 1185
diff changeset
3681 array_4FABD0[v6].field_4.field_34 = 15;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3682 array_4FABD0[v6].field_4.sparks_array = &array_4FABD0[v6].effect_sparks[0];
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3683 v8 = array_4FABD0[v6].field_40;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3684 v8->StartFill(&array_4FABD0[v6].field_4);
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3685 if ( 10 * effect_value > 150 )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3686 effect_value = 15;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3687
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
3688 if ( v8->signature != SIG_trpg )
0
Ritor1
parents:
diff changeset
3689 return 2;
Ritor1
parents:
diff changeset
3690 if ( !v8->field_59 )
Ritor1
parents:
diff changeset
3691 return 3;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3692 v8->position_in_sparks_arr = 10 * effect_value;
0
Ritor1
parents:
diff changeset
3693 v8->field_30 = 0.0;
Ritor1
parents:
diff changeset
3694 v8->field_58 = 0;
Ritor1
parents:
diff changeset
3695 v8->field_44 = 0;
Ritor1
parents:
diff changeset
3696 v8->field_4C = 0;
Ritor1
parents:
diff changeset
3697 v8->field_48 = 0;
Ritor1
parents:
diff changeset
3698 v8->field_50 = 0;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3699 for (int i=0; i<v8->field_4; ++i)
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
3700 v8->field_54[i].have_spark=0;
0
Ritor1
parents:
diff changeset
3701 return 0;
Ritor1
parents:
diff changeset
3702 }
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
3703
0
Ritor1
parents:
diff changeset
3704
Ritor1
parents:
diff changeset
3705 //----- (0040D402) --------------------------------------------------------
1246
975480e1ce38 spelling fix and macros optimise
Gloval
parents: 1245
diff changeset
3706 int ApplyDamageToBuildings( int player_num, int damage )
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3707 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3708 ArcomagePlayer *v2; // ecx@1
0
Ritor1
parents:
diff changeset
3709 int v3; // esi@1
Ritor1
parents:
diff changeset
3710 int result; // eax@3
Ritor1
parents:
diff changeset
3711
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3712
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3713 v3 = am_Players[player_num].wall_height;
0
Ritor1
parents:
diff changeset
3714 if ( v3 <= 0 )
Ritor1
parents:
diff changeset
3715 {
Ritor1
parents:
diff changeset
3716 result = 0;
Ritor1
parents:
diff changeset
3717 }
Ritor1
parents:
diff changeset
3718 else
Ritor1
parents:
diff changeset
3719 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3720 if ( v3 >= -damage )
0
Ritor1
parents:
diff changeset
3721 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3722 result = damage;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3723 am_Players[player_num].wall_height += damage;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
3724
0
Ritor1
parents:
diff changeset
3725 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
3726 else
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
3727 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3728 damage += v3;
0
Ritor1
parents:
diff changeset
3729 result = -v3;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3730 am_Players[player_num].wall_height = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3731 am_Players[player_num].tower_height += damage;
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
3732 }
0
Ritor1
parents:
diff changeset
3733 }
1209
decc0dd6e4ba more on arcomage
Gloval
parents: 1208
diff changeset
3734
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3735 if ( am_Players[player_num].tower_height < 0 )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3736 am_Players[player_num].tower_height = 0;
0
Ritor1
parents:
diff changeset
3737 return result;
Ritor1
parents:
diff changeset
3738 }
Ritor1
parents:
diff changeset
3739 // 40D402: using guessed type int __fastcall am_40D402(uint, uint);
Ritor1
parents:
diff changeset
3740
Ritor1
parents:
diff changeset
3741 //----- (0040D444) --------------------------------------------------------
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3742 void GameResultsApply()
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3743 {
0
Ritor1
parents:
diff changeset
3744 int v0; // esi@1
Ritor1
parents:
diff changeset
3745 int v1; // edi@1
Ritor1
parents:
diff changeset
3746 int v2; // eax@1
Ritor1
parents:
diff changeset
3747 int v3; // eax@23
Ritor1
parents:
diff changeset
3748 int v4; // edx@25
Ritor1
parents:
diff changeset
3749 int v5; // ecx@28
Ritor1
parents:
diff changeset
3750 int v6; // eax@28
Ritor1
parents:
diff changeset
3751 GUIWindow *v7; // ecx@50
Ritor1
parents:
diff changeset
3752 signed int v8; // eax@50
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3753 char v9; // eax@52
0
Ritor1
parents:
diff changeset
3754 signed int v10; // eax@54
Ritor1
parents:
diff changeset
3755 char *v11; // esi@59
Ritor1
parents:
diff changeset
3756 char *v12; // esi@65
Ritor1
parents:
diff changeset
3757 signed int v14; // [sp-4h] [bp-58h]@46
Ritor1
parents:
diff changeset
3758 char pText[64]; // [sp+Ch] [bp-48h]@1
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3759 POINT xy; // [sp+4Ch] [bp-8h]@1
0
Ritor1
parents:
diff changeset
3760
Ritor1
parents:
diff changeset
3761 v0 = -1;
Ritor1
parents:
diff changeset
3762 v1 = -1;
Ritor1
parents:
diff changeset
3763 //nullsub_1();
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3764 xy.x = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3765 xy.y = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3766 strcpy(pText, "The Winner is: ");//"Ïîáåäè"
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3767 // v2 = 0;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3768 xy.y = 160;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3769 xy.x = 320; //- 12 * v2 / 2;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3770 // pPrimaryWindow_draws_text(-1, pText, xy);
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3771 if ( am_Players[0].tower_height < max_tower_height )
0
Ritor1
parents:
diff changeset
3772 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3773 if ( am_Players[1].tower_height < max_tower_height )
0
Ritor1
parents:
diff changeset
3774 goto LABEL_10;
Ritor1
parents:
diff changeset
3775 v0 = 2;
Ritor1
parents:
diff changeset
3776 }
Ritor1
parents:
diff changeset
3777 else
Ritor1
parents:
diff changeset
3778 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3779 if ( am_Players[1].tower_height < max_tower_height )
0
Ritor1
parents:
diff changeset
3780 {
Ritor1
parents:
diff changeset
3781 v0 = 1;
Ritor1
parents:
diff changeset
3782 }
Ritor1
parents:
diff changeset
3783 else
Ritor1
parents:
diff changeset
3784 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3785 if ( am_Players[0].tower_height == am_Players[1].tower_height )
0
Ritor1
parents:
diff changeset
3786 {
Ritor1
parents:
diff changeset
3787 v0 = 0;
Ritor1
parents:
diff changeset
3788 v1 = 4;
Ritor1
parents:
diff changeset
3789 goto LABEL_10;
Ritor1
parents:
diff changeset
3790 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3791 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1;
0
Ritor1
parents:
diff changeset
3792 }
Ritor1
parents:
diff changeset
3793 }
Ritor1
parents:
diff changeset
3794 v1 = 0;
Ritor1
parents:
diff changeset
3795 LABEL_10:
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3796 if ( am_Players[0].tower_height <= 0 )
0
Ritor1
parents:
diff changeset
3797 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3798 if ( am_Players[1].tower_height > 0 )
0
Ritor1
parents:
diff changeset
3799 {
Ritor1
parents:
diff changeset
3800 v0 = 2;
Ritor1
parents:
diff changeset
3801 }
Ritor1
parents:
diff changeset
3802 else
Ritor1
parents:
diff changeset
3803 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3804 if ( am_Players[0].tower_height == am_Players[1].tower_height )
0
Ritor1
parents:
diff changeset
3805 {
Ritor1
parents:
diff changeset
3806 LABEL_20:
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3807 if ( am_Players[0].wall_height == am_Players[1].wall_height )
0
Ritor1
parents:
diff changeset
3808 {
Ritor1
parents:
diff changeset
3809 v0 = 0;
Ritor1
parents:
diff changeset
3810 v1 = 4;
Ritor1
parents:
diff changeset
3811 }
Ritor1
parents:
diff changeset
3812 else
Ritor1
parents:
diff changeset
3813 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3814 v0 = (am_Players[0].wall_height <= am_Players[1].wall_height) + 1;
0
Ritor1
parents:
diff changeset
3815 v1 = 1;
Ritor1
parents:
diff changeset
3816 }
Ritor1
parents:
diff changeset
3817 goto LABEL_23;
Ritor1
parents:
diff changeset
3818 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3819 v0 = (am_Players[0].tower_height <= am_Players[1].tower_height) + 1;
0
Ritor1
parents:
diff changeset
3820 }
Ritor1
parents:
diff changeset
3821 goto LABEL_17;
Ritor1
parents:
diff changeset
3822 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3823 if ( am_Players[1].tower_height <= 0 )
0
Ritor1
parents:
diff changeset
3824 {
Ritor1
parents:
diff changeset
3825 v0 = 1;
Ritor1
parents:
diff changeset
3826 LABEL_17:
Ritor1
parents:
diff changeset
3827 v1 = 2;
Ritor1
parents:
diff changeset
3828 }
Ritor1
parents:
diff changeset
3829 if ( !v0 && v1 == 4 )
Ritor1
parents:
diff changeset
3830 goto LABEL_20;
Ritor1
parents:
diff changeset
3831 LABEL_23:
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3832 v3 = am_Players[0].resource_bricks;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3833 if ( am_Players[0].resource_bricks <= am_Players[0].resource_gems )
0
Ritor1
parents:
diff changeset
3834 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3835 v3 = am_Players[0].resource_beasts;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3836 v4 = am_Players[0].resource_gems;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3837 if ( am_Players[0].resource_gems > am_Players[0].resource_beasts )
0
Ritor1
parents:
diff changeset
3838 goto LABEL_28;
Ritor1
parents:
diff changeset
3839 }
Ritor1
parents:
diff changeset
3840 else
Ritor1
parents:
diff changeset
3841 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3842 if ( am_Players[0].resource_bricks <= am_Players[0].resource_beasts )
0
Ritor1
parents:
diff changeset
3843 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3844 v4 = am_Players[0].resource_beasts;
0
Ritor1
parents:
diff changeset
3845 goto LABEL_28;
Ritor1
parents:
diff changeset
3846 }
Ritor1
parents:
diff changeset
3847 }
Ritor1
parents:
diff changeset
3848 v4 = v3;
Ritor1
parents:
diff changeset
3849 LABEL_28:
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3850 v5 = am_Players[1].resource_bricks;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3851 v6 = am_Players[1].resource_gems;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3852 if ( am_Players[1].resource_bricks <= am_Players[1].resource_gems )
0
Ritor1
parents:
diff changeset
3853 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3854 v5 = am_Players[1].resource_beasts;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3855 if ( am_Players[1].resource_gems > am_Players[1].resource_beasts )
0
Ritor1
parents:
diff changeset
3856 goto LABEL_33;
Ritor1
parents:
diff changeset
3857 goto LABEL_32;
Ritor1
parents:
diff changeset
3858 }
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3859 v6 = am_Players[1].resource_beasts;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3860 if ( am_Players[1].resource_bricks > am_Players[1].resource_beasts )
0
Ritor1
parents:
diff changeset
3861 LABEL_32:
Ritor1
parents:
diff changeset
3862 v6 = v5;
Ritor1
parents:
diff changeset
3863 LABEL_33:
Ritor1
parents:
diff changeset
3864 if ( v0 == -1 )
Ritor1
parents:
diff changeset
3865 {
Ritor1
parents:
diff changeset
3866 if ( v1 != -1 )
Ritor1
parents:
diff changeset
3867 goto LABEL_49;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3868 if ( v4 < max_resources_amount )
0
Ritor1
parents:
diff changeset
3869 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3870 if ( v6 < max_resources_amount )
0
Ritor1
parents:
diff changeset
3871 goto LABEL_49;
Ritor1
parents:
diff changeset
3872 v0 = 2;
Ritor1
parents:
diff changeset
3873 }
Ritor1
parents:
diff changeset
3874 else
Ritor1
parents:
diff changeset
3875 {
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3876 if ( v6 < max_resources_amount )
0
Ritor1
parents:
diff changeset
3877 {
Ritor1
parents:
diff changeset
3878 v0 = 1;
Ritor1
parents:
diff changeset
3879 }
Ritor1
parents:
diff changeset
3880 else
Ritor1
parents:
diff changeset
3881 {
Ritor1
parents:
diff changeset
3882 if ( v4 == v6 )
Ritor1
parents:
diff changeset
3883 goto LABEL_46;
Ritor1
parents:
diff changeset
3884 v0 = (v4 <= v6) + 1;
Ritor1
parents:
diff changeset
3885 }
Ritor1
parents:
diff changeset
3886 }
Ritor1
parents:
diff changeset
3887 v1 = 3;
Ritor1
parents:
diff changeset
3888 }
Ritor1
parents:
diff changeset
3889 if ( !v0 && v1 == 4 )
Ritor1
parents:
diff changeset
3890 {
Ritor1
parents:
diff changeset
3891 if ( v4 != v6 )
Ritor1
parents:
diff changeset
3892 {
Ritor1
parents:
diff changeset
3893 v14 = 5;
Ritor1
parents:
diff changeset
3894 v0 = (v4 <= v6) + 1;
Ritor1
parents:
diff changeset
3895 goto LABEL_48;
Ritor1
parents:
diff changeset
3896 }
Ritor1
parents:
diff changeset
3897 LABEL_46:
Ritor1
parents:
diff changeset
3898 v0 = 0;
Ritor1
parents:
diff changeset
3899 v14 = 4;
Ritor1
parents:
diff changeset
3900 LABEL_48:
Ritor1
parents:
diff changeset
3901 v1 = v14;
Ritor1
parents:
diff changeset
3902 }
Ritor1
parents:
diff changeset
3903 LABEL_49:
Ritor1
parents:
diff changeset
3904 pArcomageGame->field_B0 = v1;
Ritor1
parents:
diff changeset
3905 pArcomageGame->uGameResult = v0;
Ritor1
parents:
diff changeset
3906 if ( v0 == 1 )
Ritor1
parents:
diff changeset
3907 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3908
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3909 v8 = (signed int)window_SpeakInHouse->par1C;
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3910 if (( v8 >= 108 )&&( v8 <= 120 ))
0
Ritor1
parents:
diff changeset
3911 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3912 if ( !pParty->pArcomageWins[v8-108] )
0
Ritor1
parents:
diff changeset
3913 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3914 pParty->pArcomageWins[v8-108] = 1;
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3915 auto _a = (signed int)(p2DEvents[ window_SpeakInHouse->par1C - 1].fPriceMultiplier * 100.0);
0
Ritor1
parents:
diff changeset
3916 party_finds_gold(_a, 0);
Ritor1
parents:
diff changeset
3917 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3918
0
Ritor1
parents:
diff changeset
3919 }
Ritor1
parents:
diff changeset
3920 v10 = 108;
Ritor1
parents:
diff changeset
3921 do
Ritor1
parents:
diff changeset
3922 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3923 if ( !pParty->pArcomageWins[v10-108] )
0
Ritor1
parents:
diff changeset
3924 break;
Ritor1
parents:
diff changeset
3925 ++v10;
Ritor1
parents:
diff changeset
3926 }
Ritor1
parents:
diff changeset
3927 while ( v10 <= 120 );
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3928
0
Ritor1
parents:
diff changeset
3929 if ( v10 == 121 )
484
4bd56919f075 avard quest guild bits
Gloval
parents: 463
diff changeset
3930 _449B7E_toggle_bit(pParty->_quest_bits, 238, 1u);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3931
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3932
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3933 for (int i=0; i<4; ++i )
0
Ritor1
parents:
diff changeset
3934 {
1460
ff2118028c71 renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents: 1393
diff changeset
3935 v11 = (char *)&pParty->pPlayers[i]._achieved_awards_bits;
0
Ritor1
parents:
diff changeset
3936 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v11, 1) )
949
Nomad
parents: 938
diff changeset
3937 _449B7E_toggle_bit((unsigned char *)v11, PLAYER_GUILD_BITS__ARCOMAGE_WIN, 1);
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3938
0
Ritor1
parents:
diff changeset
3939 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3940
949
Nomad
parents: 938
diff changeset
3941 ++pParty->uNumArcomageWins;
Nomad
parents: 938
diff changeset
3942 if ( pParty->uNumArcomageWins > 1000000 )
Nomad
parents: 938
diff changeset
3943 pParty->uNumArcomageWins = 1000000;
0
Ritor1
parents:
diff changeset
3944 }
Ritor1
parents:
diff changeset
3945 else
Ritor1
parents:
diff changeset
3946 {
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3947 for (int i=0; i<4; ++i )
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3948 {
1460
ff2118028c71 renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents: 1393
diff changeset
3949 v12 = (char *)&pParty->pPlayers[i]._achieved_awards_bits;
0
Ritor1
parents:
diff changeset
3950 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v12, 1) )
949
Nomad
parents: 938
diff changeset
3951 _449B7E_toggle_bit((unsigned char *)v12, PLAYER_GUILD_BITS__ARCOMAGE_LOSE, 1);
0
Ritor1
parents:
diff changeset
3952 }
1218
eb687c8529ee arcomage card animation working
Gloval
parents: 1209
diff changeset
3953
949
Nomad
parents: 938
diff changeset
3954 ++pParty->uNumArcomageLoses;
Nomad
parents: 938
diff changeset
3955 if ( pParty->uNumArcomageLoses > 1000000 )
Nomad
parents: 938
diff changeset
3956 pParty->uNumArcomageLoses = 1000000;
0
Ritor1
parents:
diff changeset
3957 }
Ritor1
parents:
diff changeset
3958 }
Ritor1
parents:
diff changeset
3959
Ritor1
parents:
diff changeset
3960
Ritor1
parents:
diff changeset
3961
Ritor1
parents:
diff changeset
3962 //----- (00409C8B) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3963 void PrepareArcomage()
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
3964 {
0
Ritor1
parents:
diff changeset
3965 signed __int64 v1; // qax@4
Ritor1
parents:
diff changeset
3966 int v2; // esi@4
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3967 int v3; // esi@5
0
Ritor1
parents:
diff changeset
3968 signed int v4; // edi@5
Ritor1
parents:
diff changeset
3969 int v6; // edx@9
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3970 RECT pXYZW; // [sp+8h] [bp-1Ch]@5
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3971 POINT pXY; // [sp+18h] [bp-Ch]@5
0
Ritor1
parents:
diff changeset
3972
Ritor1
parents:
diff changeset
3973 pAudioPlayer->StopChannels(-1, -1);
1201
Gloval
parents: 1200
diff changeset
3974 strcpy(pArcomageGame->pPlayer1Name, Player1Name);
Gloval
parents: 1200
diff changeset
3975 strcpy(pArcomageGame->pPlayer2Name, Player2Name);
0
Ritor1
parents:
diff changeset
3976 am_byte_4FAA76 = 0;
Ritor1
parents:
diff changeset
3977 am_byte_4FAA75 = 0;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3978
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3979 for (int i=0; i<10; ++i)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3980 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3981 v2 = (i+1) % 4;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3982 v3 = (i+1) / 4;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3983 shown_cards[i].uCardId = -1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3984 shown_cards[i].field_4 = 0;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3985 shown_cards[i].field_8.x = 100 * v2 + 120;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3986 shown_cards[i].field_8.y = 138 * v3 + 18;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3987 shown_cards[i].field_10_xplus = -100 * v2 / 5;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3988 shown_cards[i].field_14_y_plus = -138 * v3 / 5;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3989 shown_cards[i].field_18_point.x = shown_cards[i].field_8.x;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
3990 shown_cards[i].field_18_point.y = shown_cards[i].field_8.y;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3991 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3992
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3993 pXY.x = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3994 pXY.y = 0;
0
Ritor1
parents:
diff changeset
3995 ArcomageGame::LoadBackground();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3996 pXYZW.left = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3997 pXYZW.right = 640;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3998 pXYZW.top = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
3999 pXYZW.bottom = 480;
0
Ritor1
parents:
diff changeset
4000 am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4001 Blt_Copy(&pXYZW, &pXY, 2);
0
Ritor1
parents:
diff changeset
4002 am_EndScene();
Ritor1
parents:
diff changeset
4003 pRenderer->Present();
Ritor1
parents:
diff changeset
4004 ArcomageGame::LoadSprites();
Ritor1
parents:
diff changeset
4005 CallRenderPresent();
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4006
0
Ritor1
parents:
diff changeset
4007 v4 = 120;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4008 for (int i=0; i<12; ++i)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4009 am_sounds[i] = pSoundList->LoadSound(v4++, 0);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4010
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
4011 for (int i=0; i<10; ++i)
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4012 stru272_stru0::Ctor(&array_4FABD0[i].field_40);
1184
a90dc4aee8f4 arcomage refactoring continued
Gloval
parents: 1183
diff changeset
4013
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4014 current_card_slot_index = -1;
0
Ritor1
parents:
diff changeset
4015 amuint_4FAA4C = -1;
Ritor1
parents:
diff changeset
4016 byte_4FAA74 = 0;
Ritor1
parents:
diff changeset
4017 pArcomageGame->field_F4 = 0;
Ritor1
parents:
diff changeset
4018 byte_4FAA2C = 0;
Ritor1
parents:
diff changeset
4019 byte_505880 = 0;
Ritor1
parents:
diff changeset
4020 dword_4FAA70 = 0;
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4021 need_to_discard_card = 0;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
4022 SetStartGameData();
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4023 InitalHandsFill();
0
Ritor1
parents:
diff changeset
4024 //nullsub_1();
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
4025 pArcomageGame->GameOver = 0;
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4026 pArcomageGame->pfntComic = pFontComic;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4027 pArcomageGame->pfntArrus = pFontArrus;
0
Ritor1
parents:
diff changeset
4028 }
Ritor1
parents:
diff changeset
4029
Ritor1
parents:
diff changeset
4030
Ritor1
parents:
diff changeset
4031 //----- (0040D711) --------------------------------------------------------
Ritor1
parents:
diff changeset
4032 ArcomageGame::ArcomageGame()
Ritor1
parents:
diff changeset
4033 {
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4034 field_4 = 0;
0
Ritor1
parents:
diff changeset
4035 //RGBTexture::RGBTexture(&this->pGameBackground);
Ritor1
parents:
diff changeset
4036 //RGBTexture::RGBTexture(&v1->pSprites);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4037 bGameInProgress = 0;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4038 field_F9 = 0;
0
Ritor1
parents:
diff changeset
4039 }
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
4040
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
4041
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
4042 //----- (00409BE8) --------------------------------------------------------
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
4043 void SetStartConditions()
938
016e3577865c stru289 removed, some data movements
Nomad
parents: 935
diff changeset
4044 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
4045 const ArcomageStartConditions *st_cond; // eax@1
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4046
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4047 st_cond = &start_conditions[window_SpeakInHouse->par1C - 108];
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4048 start_tower_height = st_cond->tower_height;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4049 start_wall_height = st_cond->wall_height;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4050 start_quarry_level = st_cond->quarry_level - 1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4051 start_magic_level = st_cond->magic_level - 1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4052 start_zoo_level = st_cond->zoo_level - 1;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4053 minimum_cards_at_hand = 5;
1197
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
4054 quarry_bonus = 1;
2b950844f2d6 mostly arcomage structs renaming.
Gloval
parents: 1194
diff changeset
4055 magic_bonus = 1;
1201
Gloval
parents: 1200
diff changeset
4056 zoo_bonus = 1;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4057 max_tower_height = st_cond->max_tower;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4058 max_resources_amount = st_cond->max_resources;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4059
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
4060 opponent_mastery = st_cond->mastery_lvl;
1200
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4061
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4062 start_bricks_amount = st_cond->bricks_amount;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4063 start_gems_amount = st_cond->gems_amount;
c42f255ce1dc Cards drawn
Gloval
parents: 1199
diff changeset
4064 start_beasts_amount = st_cond->beasts_amount;
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4065
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4066 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4067
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4068
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4069 //----- (0040D75D) --------------------------------------------------------
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4070 void pPrimaryWindow_draws_text( int a1, const char *pText, POINT *pXY )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4071 {
1256
236d39ae8f6e arcomage playable
Gloval
parents: 1247
diff changeset
4072 pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - ((pFontComic->uFontHeight - 3) >> 1) + 3, 0, pText, 0, 0, 0);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4073 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4074
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4075
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4076 //----- (0040DB27) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4077 void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill )
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4078 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4079 RECT *v3; // esi@1
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4080
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4081 v3 = pXYZW;
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4082 pRenderer->BeginScene();
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4083 pRenderer->SetRasterClipRect(0, 0, 639u, 479u);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4084 if ( bSolidFill )
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4085 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4086 for ( int i = v3->top; i <= v3->bottom; ++i )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4087 pRenderer->RasterLine2D(v3->left, i, v3->right, i, uColor);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4088 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4089 else
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4090 {
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4091 pRenderer->RasterLine2D(v3->left, v3->top, v3->right, v3->top, uColor);
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4092 pRenderer->RasterLine2D(v3->right, v3->top, v3->right, v3->bottom, uColor);
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4093 pRenderer->RasterLine2D(v3->right, v3->bottom, v3->left, v3->bottom, uColor);
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4094 pRenderer->RasterLine2D(v3->left, v3->bottom, v3->left, v3->top, uColor);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4095 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4096 pRenderer->EndScene();
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4097 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4098
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4099 void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4100 {
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4101 pRenderer->BeginScene();
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4102 if ( pRenderer->uNumSceneBegins )
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4103 {
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4104 int xVal = pTargetXY->x;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4105 int yVal = pTargetXY->y;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4106 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479)
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4107 {
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4108 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4109 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * yVal] = uColor;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4110 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4111 pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor;
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4112 }
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4113 pRenderer->EndScene();
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4114 }
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4115 }
1185
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4116
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4117 //----- (0040DBD3) --------------------------------------------------------
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4118 void SetPixel( POINT *pTargetXY, unsigned __int16 uColor )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4119 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4120 pRenderer->BeginScene();
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4121 if ( pRenderer->uNumSceneBegins )
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4122 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4123 int xVal = pTargetXY->x;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4124 int yVal = pTargetXY->y;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4125 if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479)
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4126 {
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4127 pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor;
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4128 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4129 pRenderer->EndScene();
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4130 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4131 }
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4132
24454b5c9268 more on acromage
Gloval
parents: 1184
diff changeset
4133
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4134 //----- (0040DDB1) --------------------------------------------------------
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4135 int rand_interval( int min, int max )
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4136 {
1263
73269755dd89 arcomage renaming&cleaning
Gloval
parents: 1257
diff changeset
4137 return min + rand() % (max - min + 1);
1183
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4138 }
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4139
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4140
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4141 //----- (0040DEC8) --------------------------------------------------------
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4142 void __fastcall intToString(int val, char *pOut)
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4143 {
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4144 sprintf(pOut, "%d", val);
fa30ea497e94 arcomage refactoring started
Gloval
parents: 1165
diff changeset
4145 }
1303
Ritor1
parents: 1264
diff changeset
4146
Ritor1
parents: 1264
diff changeset
4147 void set_stru1_field_8_InArcomage(int inValue)
Ritor1
parents: 1264
diff changeset
4148 {
Ritor1
parents: 1264
diff changeset
4149 switch(inValue)
Ritor1
parents: 1264
diff changeset
4150 {
Ritor1
parents: 1264
diff changeset
4151 case 91:LOBYTE(pArcomageGame->stru1.field_8) = 123;break;
Ritor1
parents: 1264
diff changeset
4152 case 92:LOBYTE(pArcomageGame->stru1.field_8) = 124;break;
Ritor1
parents: 1264
diff changeset
4153 case 93:LOBYTE(pArcomageGame->stru1.field_8) = 125;break;
Ritor1
parents: 1264
diff changeset
4154 case 96:LOBYTE(pArcomageGame->stru1.field_8) = 126;break;
Ritor1
parents: 1264
diff changeset
4155 case 61:LOBYTE(pArcomageGame->stru1.field_8) = 43;break;
Ritor1
parents: 1264
diff changeset
4156 case 55:LOBYTE(pArcomageGame->stru1.field_8) = 38;break;
Ritor1
parents: 1264
diff changeset
4157 case 56:LOBYTE(pArcomageGame->stru1.field_8) = 42;break;
Ritor1
parents: 1264
diff changeset
4158 case 57:LOBYTE(pArcomageGame->stru1.field_8) = 40;break;
Ritor1
parents: 1264
diff changeset
4159 case 59:LOBYTE(pArcomageGame->stru1.field_8) = 58;break;
Ritor1
parents: 1264
diff changeset
4160 case 54:LOBYTE(pArcomageGame->stru1.field_8) = 94;break;
Ritor1
parents: 1264
diff changeset
4161 case 50:LOBYTE(pArcomageGame->stru1.field_8) = 64;break;
Ritor1
parents: 1264
diff changeset
4162 case 51:LOBYTE(pArcomageGame->stru1.field_8) = 35;break;
Ritor1
parents: 1264
diff changeset
4163 case 52:LOBYTE(pArcomageGame->stru1.field_8) = 36;break;
Ritor1
parents: 1264
diff changeset
4164 case 53:LOBYTE(pArcomageGame->stru1.field_8) = 37;break;
Ritor1
parents: 1264
diff changeset
4165 case 49:LOBYTE(pArcomageGame->stru1.field_8) = 33;break;
Ritor1
parents: 1264
diff changeset
4166 case 39:LOBYTE(pArcomageGame->stru1.field_8) = 34;break;
Ritor1
parents: 1264
diff changeset
4167 case 44:LOBYTE(pArcomageGame->stru1.field_8) = 60;break;
Ritor1
parents: 1264
diff changeset
4168 case 46:LOBYTE(pArcomageGame->stru1.field_8) = 62;break;
Ritor1
parents: 1264
diff changeset
4169 case 47:LOBYTE(pArcomageGame->stru1.field_8) = 63;break;
Ritor1
parents: 1264
diff changeset
4170 case 48:LOBYTE(pArcomageGame->stru1.field_8) = 41;break;
Ritor1
parents: 1264
diff changeset
4171 default:LOBYTE(pArcomageGame->stru1.field_8) = inValue;break;
Ritor1
parents: 1264
diff changeset
4172 }
Ritor1
parents: 1264
diff changeset
4173 }