annotate Arcomage.cpp @ 2459:e5c88c2b02ab

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