Mercurial > mm7
annotate Player.cpp @ 1553:b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
author | Grumpy7 |
---|---|
date | Sat, 07 Sep 2013 21:00:02 +0200 |
parents | d253172de469 |
children | e303d8a9bcdc |
rev | line source |
---|---|
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1116
diff
changeset
|
1 #ifdef _MSC_VER |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1116
diff
changeset
|
2 #define _CRT_SECURE_NO_WARNINGS |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1116
diff
changeset
|
3 #endif |
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1116
diff
changeset
|
4 |
187 | 5 #include <assert.h> |
6 | |
1016 | 7 #include "stru6.h" |
8 | |
9 | |
0 | 10 #include "Player.h" |
11 #include "PlayerFrameTable.h" | |
12 #include "AudioPlayer.h" | |
13 #include "Party.h" | |
816 | 14 #include "Log.h" |
0 | 15 #include "LOD.h" |
16 #include "GUIWindow.h" | |
17 #include "Viewport.h" | |
18 #include "Actor.h" | |
19 #include "Game.h" | |
20 #include "Mouse.h" | |
21 #include "TurnEngine.h" | |
22 #include "Events.h" | |
23 #include "Events2D.h" | |
24 #include "Outdoor.h" | |
25 #include "StorylineTextTable.h" | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
26 #include "Autonotes.h" |
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
27 #include "Awards.h" |
189 | 28 #include "texts.h" |
816 | 29 |
0 | 30 #include "mm7_data.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
821
diff
changeset
|
31 #include "MM7.h" |
1297 | 32 #include "SpriteObject.h" |
33 #include "DecalBuilder.h" | |
0 | 34 |
35 | |
36 | |
37 | |
38 | |
39 /* 381 */ | |
40 #pragma pack(push, 1) | |
290 | 41 struct PlayerCreation_AttributeProps |
0 | 42 { |
43 unsigned __int8 uBaseValue; | |
44 char uMaxValue; | |
45 char uDroppedStep; | |
46 char uBaseStep; | |
47 }; | |
48 #pragma pack(pop) | |
49 | |
50 | |
51 #pragma pack(push, 1) | |
290 | 52 |
53 | |
54 | |
0 | 55 #pragma pack(pop) |
290 | 56 PlayerCreation_AttributeProps StatTable[4][7] = //0x4ED7B0 |
57 { | |
58 {{11, 25, 1, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, { 9, 25, 1, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, {9, 25, 1, 1},}, | |
59 {{ 7, 15, 2, 1}, {14, 30, 1, 2}, {11, 25, 1, 1}, { 7, 15, 2, 1}, {14, 30, 1, 2}, {11, 25, 1, 1}, {9, 20, 1, 1},}, | |
60 {{14, 30, 1, 2}, { 7, 15, 2, 1}, { 7, 15, 2, 1}, {11, 25, 1, 1}, {11, 25, 1, 1}, {14, 30, 1, 2}, {9, 20, 1, 1},}, | |
61 {{14, 30, 1, 2}, {11, 25, 1, 1}, {11, 25, 1, 1}, {14, 30, 1, 2}, { 7, 15, 2, 1}, { 7, 15, 2, 1}, {9, 20, 1, 1}} | |
0 | 62 }; |
63 | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 // available skills per class ( 9 classes X 37 skills ) | |
70 // 0 - not available | |
71 // 1 - available | |
72 // 2 - primary skill | |
73 unsigned char pSkillAvailabilityPerClass[9][37] = // byte[] @ MM7.exe::004ED820 | |
74 { | |
75 {0, 2, 0, 1, 1, 1, 1, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, | |
76 {0, 1, 2, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 2, 1, 0}, | |
77 {1, 1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 2, 1, 1, 0, 0, 0}, | |
78 {0, 1, 1, 1, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0}, | |
79 {0, 1, 0, 1, 1, 2, 0, 0, 0, 1, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1}, | |
80 {0, 1, 1, 2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0}, | |
81 {0, 0, 0, 0, 0, 0, 2, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 2, 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, | |
82 {0, 0, 2, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 2, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1}, | |
83 {2, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0} // some of these are started at 4ED94C, but needs to be here | |
84 }; | |
85 | |
86 | |
1374 | 87 unsigned char pEquipTypeToBodyAnchor[21] = // 4E8398 |
88 { | |
89 1, // EQUIP_OFF_HAND | |
90 1, // EQUIP_MAIN_HAND | |
91 2, // EQUIP_BOW | |
92 3, // EQUIP_ARMOUR | |
93 0, // EQUIP_SHIELD | |
94 4, // EQUIP_HELMET | |
95 5, // EQUIP_BELT | |
96 6, // EQUIP_CLOAK | |
97 7, // EQUIP_GAUNTLETS | |
98 8, // EQUIP_BOOTS | |
99 10, // EQUIP_RING | |
100 9, // EQUIP_AMULET | |
101 1, // EQUIP_WAND | |
102 0, // EQUIP_REAGENT | |
103 0, // EQUIP_POTION | |
104 0, // EQUIP_SPELL_SCROLL | |
105 0, // EQUIP_BOOK | |
106 0, // EQUIP_MESSAGE_SCROLL | |
107 0, // EQUIP_GOLD | |
108 0, // EQUIP_GEM | |
109 0 // EQUIP_NONE | |
110 }; | |
0 | 111 |
112 | |
113 unsigned char pBaseHealthByClass[12] = {40, 35, 35, 30, 30, 30, 25, 20, 20, 0, 0, 0}; | |
114 unsigned char pBaseManaByClass[12] = { 0, 0, 0, 5, 5, 0, 10, 10, 15, 0, 0, 0}; | |
115 unsigned char pBaseHealthPerLevelByClass[36] = {5, 7, 9, 9, 4, 6, 8, 8, 5, 6, 8, 8, 4, 5, 6, 6, 3, 4, 6, 6, 4, 5, 6, 6, 2, 3, 4, 4, 2, 3, 4, 4, 2, 3, 3, 3}; | |
116 unsigned char pBaseManaPerLevelByClass[36] = {0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 2, 3, 3, 1, 2, 3, 3, 0, 2, 3, 3, 3, 4, 5, 5, 3, 4, 5, 5, 3, 4, 6, 6}; | |
117 | |
1325 | 118 unsigned char pConditionAttributeModifier[7][19] = |
119 {{100, 100, 100, 120, 50, 200, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}, //Might | |
120 {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}, //Intelligence | |
121 {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}, //Willpower | |
122 {100, 100, 100, 100, 50, 150, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}, //Endurance | |
123 {100, 100, 100, 50, 10, 100, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}, //Accuracy | |
124 {100, 100, 100, 120, 20, 120, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}, //Speed | |
125 {100, 100, 100, 100, 200, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}}; //Luck | |
126 | |
127 unsigned char pAgingAttributeModifier[7][4] = | |
128 {{100, 75, 40, 10}, //Might | |
129 {100, 150, 100, 10}, //Intelligence | |
130 {100, 150, 100, 10}, //Willpower | |
131 {100, 75, 40, 10}, //Endurance | |
132 {100, 100, 40, 10}, //Accuracy | |
133 {100, 100, 40, 10}, //Speed | |
134 {100, 100, 100, 100}}; //Luck | |
0 | 135 |
1036 | 136 signed int pAgeingTable[4] = {50, 100, 150, 0xFFFF}; |
0 | 137 |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1205
diff
changeset
|
138 std::array<unsigned int, 18> pConditionImportancyTable = {{16, 15, 14, 17, 13, 2, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 1, 0}}; |
0 | 139 |
1036 | 140 short param_to_bonus_table[29] = {500, 400, 350, 300, 275, 250, 225, 200, 175, |
0 | 141 150, 125, 100, 75, 50, 40, 35, 30, 25, 21, |
1036 | 142 19, 17, 15, 13, 11, 9, 7, 5, 3, 0}; |
143 signed int parameter_to_bonus_value[29] = {30, 25, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6}; | |
0 | 144 |
145 | |
816 | 146 unsigned short base_recovery_times_per_weapon_type[12] = |
147 { | |
148 100, // PLAYER_SKILL_STAFF && Unarmed withoud skill | |
149 90, // PLAYER_SKILL_SWORD && Unarmed with skill | |
150 60, // PLAYER_SKILL_DAGGER | |
151 100, // PLAYER_SKILL_AXE | |
152 80, // PLAYER_SKILL_SPEAR | |
153 100, // PLAYER_SKILL_BOW | |
154 80, // PLAYER_SKILL_MACE | |
155 30, // PLAYER_SKILL_BLASTER | |
156 10, // PLAYER_SKILL_SHIELD | |
157 10, // PLAYER_SKILL_LEATHER | |
158 20, // PLAYER_SKILL_CHAIN | |
159 30 // PLAYER_SKILL_PLATE | |
160 }; | |
161 | |
162 | |
0 | 163 |
164 //----- (00490913) -------------------------------------------------------- | |
1459 | 165 int PlayerCreation_GetUnspentAttributePointCount() |
0 | 166 { |
167 signed int v0; // edi@1 | |
1273 | 168 int raceId; // ebx@2 |
0 | 169 signed int v4; // eax@17 |
170 int v5; // edx@18 | |
171 signed int v6; // ecx@18 | |
1273 | 172 signed int remainingStatPoints; // [sp+Ch] [bp-8h]@1 |
173 | |
174 remainingStatPoints = 50; | |
0 | 175 v0 = 50; |
1273 | 176 for (int playerNum = 0; playerNum < 4; playerNum++) |
177 { | |
178 raceId = pParty->pPlayers[playerNum].GetRace(); | |
179 for (int statNum = 0; statNum <= 6; statNum++) | |
180 { | |
181 switch ( statNum ) | |
0 | 182 { |
1273 | 183 case 0: |
184 v0 = pParty->pPlayers[playerNum].uMight; | |
185 break; | |
186 case 1: | |
187 v0 = pParty->pPlayers[playerNum].uIntelligence; | |
188 break; | |
189 case 2: | |
190 v0 = pParty->pPlayers[playerNum].uWillpower; | |
191 break; | |
192 case 3: | |
193 v0 = pParty->pPlayers[playerNum].uEndurance; | |
194 break; | |
195 case 4: | |
196 v0 = pParty->pPlayers[playerNum].uAccuracy; | |
197 break; | |
198 case 5: | |
199 v0 = pParty->pPlayers[playerNum].uSpeed; | |
200 break; | |
201 case 6: | |
202 v0 = pParty->pPlayers[playerNum].uLuck; | |
203 break; | |
204 } | |
205 v4 = StatTable[raceId][statNum].uBaseValue; | |
206 if ( v0 >= v4 ) | |
207 { | |
208 v5 = StatTable[raceId][statNum].uDroppedStep; | |
209 v6 = StatTable[raceId][statNum].uBaseStep; | |
0 | 210 } |
211 else | |
212 { | |
1273 | 213 v5 = StatTable[raceId][statNum].uBaseStep; |
214 v6 = StatTable[raceId][statNum].uDroppedStep; | |
0 | 215 } |
1273 | 216 remainingStatPoints += v5 * (v4 - v0) / v6; |
217 } | |
218 } | |
219 return remainingStatPoints; | |
0 | 220 } |
221 | |
222 | |
223 | |
224 //----- (00427730) -------------------------------------------------------- | |
225 bool Player::CanCastSpell(unsigned int uRequiredMana) | |
226 { | |
1275 | 227 if (sMana >= (signed int)uRequiredMana) |
228 { | |
229 sMana -= (signed int)uRequiredMana; | |
488 | 230 return true; |
231 } | |
232 | |
233 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
234 return false; | |
0 | 235 } |
236 | |
237 | |
238 //----- (004BE2DD) -------------------------------------------------------- | |
1014 | 239 void Player::SalesProcess( unsigned int inventory_idnx, int item_index, int _2devent_idx ) |
240 { | |
0 | 241 float v6; // ST04_4@1 |
1014 | 242 signed int item_value; // eax@1 |
243 signed int sell_price; // ebx@1 | |
244 | |
245 item_value =pOwnItems[item_index].GetValue(); | |
246 v6 = p2DEvents[ _2devent_idx - 1].fPriceMultiplier; | |
247 sell_price = GetPriceSell(item_value, v6); | |
248 if ( pOwnItems[item_index].Broken() ) | |
249 sell_price = 1; | |
250 if ( sell_price < 1 ) | |
251 sell_price = 1; | |
252 RemoveItemAtInventoryIndex(inventory_idnx); | |
253 Party::SetGold(pParty->uNumGold + sell_price); | |
0 | 254 } |
255 | |
256 | |
257 | |
258 //----- (0043EEF3) -------------------------------------------------------- | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
259 bool Player::NothingOrJustBlastersEquipped() |
0 | 260 { |
1014 | 261 signed int item_idx; // esi@1 |
262 signed int item_id; // esi@1 | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
263 for (int i = 0; i < 16; ++i) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
264 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
265 item_idx = pEquipment.pIndices[i]; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
266 if (item_idx) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
267 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
268 item_id = pOwnItems[item_idx - 1].uItemID; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
269 if ( item_id != ITEM_BLASTER && item_id != ITEM_LASER_RIFLE ) //blaster& blaster rifle |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
270 return false; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
271 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
272 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
273 return true; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
274 } |
1014 | 275 |
0 | 276 |
277 | |
278 | |
279 //----- (004B8040) -------------------------------------------------------- | |
1036 | 280 int Player::GetConditionDayOfWeek( unsigned int uCondition ) |
281 { | |
282 return (unsigned int)(((signed __int64)((double)this->pConditions[uCondition] * 0.234375) / 60 / 60) / 24) % 7 + 1; | |
0 | 283 } |
284 | |
285 //----- (004B807C) -------------------------------------------------------- | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
286 int Player::GetTempleHealCostModifier(float a2) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
287 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
288 unsigned int conditionIdx; // eax@1 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
289 int conditionTimeMultiplier; // esi@1 |
0 | 290 int v6; // eax@8 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
291 signed int result; // qax@13 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
292 signed int baseConditionMultiplier; // [sp+8h] [bp-8h]@4 |
1275 | 293 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
294 conditionIdx = GetMajorConditionIdx(); |
1275 | 295 if ( conditionIdx >= 14 && conditionIdx <= 16) |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
296 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
297 if ( conditionIdx <= 15 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
298 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
299 baseConditionMultiplier = 5; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
300 } |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
301 if ( conditionIdx == 16 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
302 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
303 baseConditionMultiplier = 10; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
304 } |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
305 conditionTimeMultiplier = GetConditionDayOfWeek(conditionIdx); |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
306 } |
1350 | 307 else |
308 { | |
1275 | 309 conditionTimeMultiplier = 1; |
310 baseConditionMultiplier = 1; | |
1350 | 311 if (conditionIdx < 14) |
312 { | |
313 for (int i = 0; i <= 13; i++) | |
314 { | |
315 v6 = GetConditionDayOfWeek(i); | |
316 if ( v6 > conditionTimeMultiplier ) | |
317 conditionTimeMultiplier = v6; | |
318 } | |
319 } | |
1275 | 320 } |
321 result = (int)((double)conditionTimeMultiplier * (double)baseConditionMultiplier * a2); | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
322 if ( result < 1 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
323 result = 1; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
324 return result; |
0 | 325 } |
326 | |
327 //----- (004B8102) -------------------------------------------------------- | |
917 | 328 int Player::GetPriceSell(int uRealValue, float price_multiplier) |
0 | 329 { |
330 signed int v3; // esi@1 | |
331 signed int result; // eax@3 | |
332 | |
1275 | 333 v3 = (signed int)((signed __int64)((double)uRealValue / (price_multiplier + 2.0)) + uRealValue * GetMerchant() / 100); |
917 | 334 if ( v3 > uRealValue ) |
335 v3 = uRealValue; | |
0 | 336 result = 1; |
337 if ( v3 >= 1 ) | |
338 result = v3; | |
339 return result; | |
340 } | |
341 | |
342 //----- (004B8142) -------------------------------------------------------- | |
749 | 343 int Player::GetBuyingPrice(unsigned int uRealValue, float price_multiplier) |
344 { | |
1275 | 345 uint price = (uint)(((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100); |
749 | 346 assert (price > 0); |
347 | |
348 if (price < uRealValue) | |
349 price = uRealValue; | |
350 return price; | |
0 | 351 } |
352 | |
353 //----- (004B8179) -------------------------------------------------------- | |
916 | 354 int Player::GetPriceIdentification(float a2) |
0 | 355 { |
356 signed int v2; // esi@1 | |
357 int v3; // ecx@1 | |
358 signed int result; // eax@3 | |
359 | |
1275 | 360 v2 = (signed int)(a2 * 50.0); |
0 | 361 v3 = v2 * (100 - GetMerchant()) / 100; |
362 if ( v3 < v2 / 3 ) | |
363 v3 = v2 / 3; | |
364 result = 1; | |
365 if ( v3 >= 1 ) | |
366 result = v3; | |
367 return result; | |
368 } | |
369 | |
370 //----- (004B81C3) -------------------------------------------------------- | |
916 | 371 int Player::GetPriceRepair(int a2, float a3) |
0 | 372 { |
373 signed int v3; // esi@1 | |
374 int v4; // ecx@1 | |
375 signed int result; // eax@3 | |
376 | |
1275 | 377 v3 = (signed int)((double)a2 / (6.0 - a3)); |
0 | 378 v4 = v3 * (100 - GetMerchant()) / 100; |
379 if ( v4 < v3 / 3 ) | |
380 v4 = v3 / 3; | |
381 result = 1; | |
382 if ( v4 >= 1 ) | |
383 result = v4; | |
384 return result; | |
385 } | |
386 | |
387 //----- (004B8213) -------------------------------------------------------- | |
1275 | 388 int Player::GetBaseSellingPrice(int a2, float a3) |
389 { | |
390 signed int v3; // qax@1 | |
391 | |
392 v3 = (signed int)((double)a2 / (a3 + 2.0)); | |
393 if ( v3 < 1 ) | |
394 v3 = 1; | |
0 | 395 return v3; |
396 } | |
397 | |
398 //----- (004B8233) -------------------------------------------------------- | |
1275 | 399 int Player::GetBaseBuyingPrice(int a2, float a3) |
400 { | |
401 signed int v3; // qax@1 | |
402 | |
403 v3 = (signed int)((double)a2 * a3); | |
404 if ( v3 < 1 ) | |
405 v3 = 1; | |
0 | 406 return v3; |
407 } | |
408 | |
409 //----- (004B824B) -------------------------------------------------------- | |
1275 | 410 int Player::GetBaseIdentifyPrice(float a2) |
411 { | |
412 signed int v2; // qax@1 | |
413 | |
414 v2 = (signed int)(a2 * 50.0); | |
415 if ( v2 < 1 ) | |
416 v2 = 1; | |
0 | 417 return v2; |
418 } | |
419 | |
420 //----- (004B8265) -------------------------------------------------------- | |
1275 | 421 int Player::GetBaseRepairPrice(int a2, float a3) |
422 { | |
423 signed int v3; // qax@1 | |
424 | |
425 v3 = (signed int)((double)a2 / (6.0 - a3)); | |
426 if ( v3 < 1 ) | |
427 v3 = 1; | |
0 | 428 return v3; |
429 } | |
430 | |
431 | |
432 | |
433 | |
434 | |
435 //----- (004B6FF9) -------------------------------------------------------- | |
1348 | 436 bool Player::IsPlayerHealableByTemple() |
1278
ce8ea73e7678
changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
Grumpy7
parents:
1276
diff
changeset
|
437 { |
0 | 438 signed int v2; // eax@1 |
336 | 439 v2 = (signed int)window_SpeakInHouse->ptr_1C; |
1348 | 440 if (this->sHealth >= GetMaxHealth() && this->sMana >= GetMaxMana() && GetMajorConditionIdx() == Condition_Good) |
441 { | |
442 return false; | |
443 } | |
444 else | |
445 { | |
446 if (GetMajorConditionIdx() == Condition_Zombie) | |
447 { | |
448 if ((v2 == 78 || v2 == 81 || v2 == 82)) | |
449 { | |
450 return false; | |
451 } | |
452 else | |
453 { | |
454 return true; | |
455 } | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
456 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
457 else |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
458 { |
1348 | 459 return true; |
460 } | |
1278
ce8ea73e7678
changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
Grumpy7
parents:
1276
diff
changeset
|
461 } |
0 | 462 } |
463 | |
464 | |
465 | |
466 //----- (00421E75) -------------------------------------------------------- | |
1012 | 467 unsigned int Player::GetItemIDAtInventoryIndex(int *pitem_index) |
468 { | |
469 int item_idx; // eax@1 | |
470 int inv_index; // eax@3 | |
471 | |
1351 | 472 |
1012 | 473 item_idx = *pitem_index; |
474 if ( item_idx >125 || item_idx < 0 ) | |
475 { | |
476 return 0; | |
477 } | |
478 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
479 inv_index = this->pInventoryMatrix[item_idx]; |
1012 | 480 if ( inv_index < 0 ) |
481 { | |
482 *pitem_index = -1 - inv_index; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
483 inv_index = this->pInventoryMatrix[-1 - inv_index]; |
1012 | 484 } |
485 | |
486 return inv_index; | |
0 | 487 } |
488 | |
489 | |
490 | |
491 //----- (004160CA) -------------------------------------------------------- | |
1012 | 492 void Player::ItemsEnchant( int enchant_count ) |
493 { | |
494 int avalible_items; // ebx@1 | |
495 int i; // edx@8 | |
496 __int16 item_index_tabl[138]; // [sp+Ch] [bp-118h]@1 | |
497 | |
498 avalible_items = 0; | |
499 memset (item_index_tabl,0,sizeof(item_index_tabl)); | |
500 | |
1349 | 501 for (i = 0; i < 138; ++i) |
502 { | |
503 if (( pOwnItems[i].uItemID>0)&&(pOwnItems[i].uItemID <= 134)) | |
504 item_index_tabl[avalible_items++] = i; | |
505 } | |
1012 | 506 |
507 if ( avalible_items ) | |
508 { | |
509 if ( enchant_count ) | |
510 { | |
1349 | 511 for ( i = 0; i < enchant_count; ++i ) |
512 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
513 if (!(pInventoryItemList[item_index_tabl[i]].uAttributes&ITEM_ENCHANTED)) |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
514 pInventoryItemList[item_index_tabl[rand() % avalible_items]].uAttributes |= ITEM_ENCHANTED; |
1349 | 515 } |
0 | 516 } |
517 else | |
518 { | |
1012 | 519 for ( i = 0; i < avalible_items; ++i ) |
520 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
521 pInventoryItemList[item_index_tabl[i]].uAttributes |= ITEM_ENCHANTED; |
1349 | 522 } |
523 } | |
524 } | |
0 | 525 } |
526 | |
527 //----- (004948B1) -------------------------------------------------------- | |
187 | 528 void Player::PlaySound(PlayerSpeech speech, int a3) |
529 { | |
1351 | 530 signed int speechCount = 0; // esi@4 |
531 signed int expressionCount = 0; // esi@4 | |
532 int pickedVariant; // esi@10 | |
248 | 533 CHARACTER_EXPRESSION_ID expression; // ebx@17 |
1406 | 534 signed int pSoundID; // ecx@19 |
1351 | 535 int speechVariantArray[5]; // [sp+Ch] [bp-1Ch]@7 |
536 int expressionVariantArray[5]; | |
537 unsigned int pickedSoundID; // [sp+30h] [bp+8h]@4 | |
538 unsigned int expressionDuration = 0; | |
187 | 539 |
1351 | 540 pickedSoundID = 0; |
203 | 541 if (uVoicesVolumeMultiplier) |
0 | 542 { |
1351 | 543 for (int i = 0; i < 2; i++) |
544 { | |
1406 | 545 if ( SoundSetAction[speech][i] ) |
546 { | |
547 speechVariantArray[speechCount] = SoundSetAction[speech][i]; | |
1351 | 548 speechCount++; |
549 } | |
550 } | |
551 if ( speechCount ) | |
552 { | |
553 pickedVariant = speechVariantArray[rand() % speechCount]; | |
554 int numberOfSubvariants = byte_4ECF08[pickedVariant - 1][uVoiceID]; | |
555 if (numberOfSubvariants > 0) | |
556 { | |
557 pickedSoundID = rand() % numberOfSubvariants + 2 * (pickedVariant + 50 * uVoiceID) + 4998; | |
1406 | 558 pAudioPlayer->PlaySound((SoundID)pickedSoundID, PID(OBJECT_Player, uActiveCharacter + 39), 0, -1, 0, 0, (int)(pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f), 0); |
1351 | 559 } |
560 } | |
561 } | |
562 | |
563 for (int i = 0; i < 5; i++) | |
564 { | |
1406 | 565 if ( SoundSetAction[speech][i + 3] ) |
566 { | |
567 expressionVariantArray[expressionCount] = SoundSetAction[speech][i + 3]; | |
1351 | 568 expressionCount++; |
569 } | |
570 } | |
571 if ( expressionCount ) | |
572 { | |
573 expression = (CHARACTER_EXPRESSION_ID)expressionVariantArray[rand() % expressionCount]; | |
574 if (expression == CHARACTER_EXPRESSION_21 && pickedSoundID ) | |
575 { | |
1406 | 576 pSoundID = 0; |
577 if ( pSoundList->sNumSounds ) | |
578 { | |
1351 | 579 for (int i = 0; i < pSoundList->sNumSounds; i++) |
0 | 580 { |
1406 | 581 if (pSoundList->pSounds[i].uSoundID == pickedSoundID) |
582 pSoundID = i; | |
0 | 583 } |
584 } | |
1406 | 585 if ( pSoundList->pSounds[pSoundID].pSoundData[0] ) |
1351 | 586 expressionDuration = (sLastTrackLengthMS << 7) / 1000; |
587 } | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
588 PlayEmotion(expression, expressionDuration); |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
589 } |
0 | 590 } |
591 // 4948B1: using guessed type int var_1C[5]; | |
592 | |
593 //----- (00494A25) -------------------------------------------------------- | |
187 | 594 void Player::PlayEmotion(CHARACTER_EXPRESSION_ID new_expression, int a3) |
595 { | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
596 unsigned int v3 = expression; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
597 if (expression == CHARACTER_EXPRESSION_DEAD || expression == CHARACTER_EXPRESSION_ERADICATED) |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
598 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
599 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
600 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
601 else if (expression == CHARACTER_EXPRESSION_PERTIFIED && new_expression != CHARACTER_EXPRESSION_FALLING) |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
602 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
603 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
604 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
605 else |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
606 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
607 if (expression != CHARACTER_EXPRESSION_SLEEP || new_expression != CHARACTER_EXPRESSION_FALLING) |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
608 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
609 if (v3 >= 2 && v3 <= 11 && v3 != 8 && !(new_expression == CHARACTER_EXPRESSION_DMGRECVD_MINOR || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MODERATE || new_expression == CHARACTER_EXPRESSION_DMGRECVD_MAJOR)) |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
610 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
611 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
612 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
613 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
614 } |
0 | 615 this->uExpressionTimePassed = 0; |
616 if ( !a3 ) | |
617 { | |
187 | 618 this->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[a3].uAnimLength; |
619 } | |
1353
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
620 else |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
621 { |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
622 this->uExpressionTimeLength = 0; |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
623 } |
187 | 624 expression = new_expression; |
0 | 625 viewparams->bRedrawGameUI = 1; |
626 } | |
627 | |
628 //----- (0049327B) -------------------------------------------------------- | |
1355 | 629 bool Player::ProfessionOrGuildFlagsCorrect( unsigned int uClass, int a3 ) |
1354
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
630 { |
135 | 631 if ( this->classType == uClass ) |
0 | 632 { |
1354
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
633 return true; |
0 | 634 } |
635 else | |
636 { | |
1354
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
637 if (!a3) |
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
638 { |
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
639 return false; |
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
640 } |
0 | 641 switch ( uClass ) |
642 { | |
643 case 0x1Au: | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
644 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 65)); |
0 | 645 case 0x1Bu: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
646 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 67)); |
0 | 647 case 0x22u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
648 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 77)); |
0 | 649 case 0x23u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
650 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 79)); |
0 | 651 break; |
652 default: | |
1354
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
653 assert("Should not be able to get here" && false); |
0 | 654 break; |
655 } | |
1354
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
656 return false; |
05becb008006
Player::_49327B to Player::ProfessionOrGuildFlagsCorrect, removed a huge section of the function that's never used (only 4 inputs used)
Grumpy7
parents:
1353
diff
changeset
|
657 } |
0 | 658 } |
659 | |
660 | |
661 //----- (00492C0B) -------------------------------------------------------- | |
662 bool Player::CanAct() | |
663 { | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
664 if ( this->IsAsleep() || this->IsParalyzed() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
665 this->IsUnconcious() || this->IsDead() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
666 this->IsPertified() || this->IsEradicated() ) |
1355 | 667 return false; |
0 | 668 else |
1355 | 669 return true; |
0 | 670 } |
671 | |
672 //----- (00492C40) -------------------------------------------------------- | |
673 bool Player::CanSteal() | |
674 { | |
1355 | 675 return GetActualSkillLevel(PLAYER_SKILL_STEALING) != 0; |
0 | 676 } |
677 | |
678 //----- (00492C4E) -------------------------------------------------------- | |
679 bool Player::CanEquip_RaceAndAlignmentCheck(unsigned int uItemID) | |
680 { | |
1357
06926081358f
Player::CanEquip_RaceAndAlignmentCheck fixed 3 missing return values, started using new race and gender functions, moved everything to a switch
Grumpy7
parents:
1356
diff
changeset
|
681 switch (uItemID) |
06926081358f
Player::CanEquip_RaceAndAlignmentCheck fixed 3 missing return values, started using new race and gender functions, moved everything to a switch
Grumpy7
parents:
1356
diff
changeset
|
682 { |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
683 case ITEM_RELIC_ETHRICS_STAFF: |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
684 case ITEM_RELIC_OLD_NICK: |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1358
diff
changeset
|
685 case ITEM_RELIC_TWILIGHT: return pParty->IsPartyEvil(); break; |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
686 case ITEM_RELIC_TALEDONS_HELM: |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1358
diff
changeset
|
687 case ITEM_RELIC_JUSTICE: return pParty->IsPartyGood(); break; |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
688 case ITEM_ARTIFACT_ELFBANE: return IsRaceGoblin(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
689 case ITEM_ARTIFACT_MINDS_EYE: return IsRaceHuman(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
690 case ITEM_ELVEN_CHAINMAIL: return IsRaceElf(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
691 case ITEM_FORGE_GAUNTLETS: return IsRaceDwarf(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
692 case ITEM_ARTIFACT_HEROS_BELT: return IsMale(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
693 case ITEM_ARTIFACT_LADYS_ESCORT: return IsFemale(); break; |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
694 case ITEM_WETSUIT: return NothingOrJustBlastersEquipped(); break; |
1357
06926081358f
Player::CanEquip_RaceAndAlignmentCheck fixed 3 missing return values, started using new race and gender functions, moved everything to a switch
Grumpy7
parents:
1356
diff
changeset
|
695 default: return 1; break; |
1356
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
696 } |
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
697 } |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
698 |
0 | 699 //----- (00492D65) -------------------------------------------------------- |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
700 void Player::SetCondition( unsigned int uConditionIdx, int a3 ) |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
701 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
702 signed int player_sex; // ecx@77 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
703 signed int remainig_player; // ebx@82 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
704 int players_before; // [sp+10h] [bp-4h]@2 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
705 int players_after; // [sp+20h] [bp+Ch]@82 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
706 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
707 if ( pConditions[uConditionIdx] ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
708 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
709 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
710 if (!ConditionProcessor::IsPlayerAffected(this, uConditionIdx, a3)) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
711 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
712 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
713 } |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
714 |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
715 switch ( uConditionIdx ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
716 { |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
717 case Condition_Cursed: PlaySound(SPEECH_30, 0); break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
718 case Condition_Weak: PlaySound(SPEECH_25, 0); break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
719 case Condition_Sleep: break; //nosound |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
720 case Condition_Fear: PlaySound(SPEECH_26, 0); break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
721 case Condition_Drunk: PlaySound(SPEECH_31, 0); break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
722 case Condition_Insane: PlaySound(SPEECH_29, 0); break; |
1014 | 723 case Condition_Poison1: |
724 case Condition_Poison2: | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
725 case Condition_Poison3: PlaySound(SPEECH_27, 0); break; |
1014 | 726 case Condition_Disease1: |
727 case Condition_Disease2: | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
728 case Condition_Disease3: PlaySound(SPEECH_28, 0);break; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
729 case Condition_Paralyzed: break; //nosound |
1014 | 730 case Condition_Unconcious: |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
731 PlaySound(SPEECH_32, 0); |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
732 if ( sHealth > 0 ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
733 sHealth = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
734 break; |
1014 | 735 case Condition_Dead: |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
736 PlaySound(SPEECH_33, 0); |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
737 if ( sHealth > 0 ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
738 sHealth = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
739 if ( sMana > 0 ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
740 sMana = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
741 break; |
1014 | 742 case Condition_Pertified: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
743 PlaySound(SPEECH_34, 0); |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
744 break; |
1014 | 745 case Condition_Eradicated: |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
746 PlaySound(SPEECH_35, 0); |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
747 if (sHealth > 0 ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
748 sHealth = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
749 if ( sMana > 0 ) |
1014 | 750 sMana = 0; |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
751 break; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
752 case Condition_Zombie: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
753 if ( classType == PLAYER_CLASS_LICH || IsEradicated() || IsZombie() || !IsDead()) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
754 return; |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
755 memset(&pConditions[0], 0, sizeof(pConditions)); |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
756 sHealth = GetMaxHealth(); |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
757 sMana = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
758 player_sex = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
759 uPrevFace = uCurrentFace; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
760 uPrevVoiceID = uVoiceID; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
761 if (IsMale()) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
762 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
763 uCurrentFace = 23; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
764 uVoiceID = 23; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
765 } |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
766 else |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
767 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
768 uCurrentFace = 24; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
769 uVoiceID = 24; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
770 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
771 PlaySound(SPEECH_99, 0); |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
772 break; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
773 } |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
774 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
775 players_before = 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
776 for (int i = 1; i < 5; ++i) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
777 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
778 if ( pPlayers[i]->CanAct() ) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
779 ++players_before; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
780 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
781 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
782 pConditions[uConditionIdx] = 1; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
783 |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
784 remainig_player = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
785 players_after = 0; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
786 for (int i = 1; i < 5; ++i) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
787 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
788 if ( pPlayers[i]->CanAct() ) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
789 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
790 remainig_player = i; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
791 ++players_after; |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
792 } |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
793 } |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
794 if (( players_before == 2 ) && ( players_after == 1 )) |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
795 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
796 pPlayers[remainig_player]->PlaySound(SPEECH_107, 0); |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
797 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
798 return; |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
799 } |
0 | 800 |
801 //----- (00492528) -------------------------------------------------------- | |
802 bool Player::CanFitItem(unsigned int uSlot, unsigned int uItemID) | |
803 { | |
1363 | 804 Texture *texture; // esi@1 |
805 unsigned int slotWidth; // ebx@1 | |
806 unsigned int slotHeight; // [sp+1Ch] [bp+Ch]@1 | |
807 | |
808 texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
809 slotWidth = GetSizeInInventorySlots(texture->uTextureWidth); | |
810 slotHeight = GetSizeInInventorySlots(texture->uTextureHeight); | |
0 | 811 if ( !areWeLoadingTexture ) |
812 { | |
1363 | 813 texture->Release(); |
1006 | 814 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 815 } |
1363 | 816 if ( slotHeight == 0 || slotWidth == 0) |
817 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
818 assert("Items should have nonzero dimensions" && false); |
1363 | 819 return 1; |
820 } | |
821 if ( (slotWidth + uSlot % INVETORYSLOTSWIDTH) <= INVETORYSLOTSWIDTH && (slotHeight + uSlot / INVETORYSLOTSWIDTH) <= INVETORYSLOTSHEIGHT ) | |
822 { | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
823 for (unsigned int x = 0; x < slotWidth; x++) |
1363 | 824 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
825 for (unsigned int y = 0; y < slotHeight; y++) |
1363 | 826 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
827 if (pInventoryMatrix[y * INVETORYSLOTSWIDTH + x + uSlot] != 0) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
828 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
829 return false; |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
830 } |
1363 | 831 } |
832 } | |
833 return true; | |
834 } | |
835 return false; | |
0 | 836 } |
837 // 506128: using guessed type int areWeLoadingTexture; | |
838 | |
839 //----- (004925E6) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
840 int Player::FindFreeInventoryListSlot() |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
841 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
842 for (int i = 0; i < 126; i++ ) |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
843 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
844 if (pInventoryItemList[i].uItemID == 0) |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
845 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
846 return i; |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
847 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
848 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
849 return -1; |
0 | 850 } |
851 | |
852 //----- (00492600) -------------------------------------------------------- | |
853 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) | |
854 { | |
855 int result; // eax@8 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
856 signed int freeSlot; // [sp+8h] [bp-4h]@4 |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
857 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
858 freeSlot = FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
859 if ( freeSlot == -1 ) |
0 | 860 { |
861 if ( uActiveCharacter ) | |
201 | 862 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
1366
8f339c3bbdaf
Player::CreateItemInInventory small bugfix from previous change
Grumpy7
parents:
1365
diff
changeset
|
863 return 0; |
0 | 864 } |
865 else | |
866 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
867 PutItemArInventoryIndex(uItemID, freeSlot, uSlot); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
868 result = freeSlot + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
869 this->pInventoryItemList[freeSlot].uItemID = uItemID; |
0 | 870 } |
871 return result; | |
872 } | |
873 // 506128: using guessed type int areWeLoadingTexture; | |
874 | |
875 //----- (00492700) -------------------------------------------------------- | |
876 int Player::HasSkill(unsigned int uSkillType) | |
877 { | |
1374 | 878 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) |
879 { | |
880 return 1; | |
0 | 881 } |
882 else | |
883 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
884 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
885 ShowStatusBarString(pTmpBuf.data(), 2u); |
1374 | 886 return 0; |
887 } | |
0 | 888 } |
889 | |
890 //----- (00492745) -------------------------------------------------------- | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
891 void Player::WearItem( unsigned int uItemID ) |
0 | 892 { |
1010 | 893 int item_body_anch; // edi@6 |
894 int item_indx; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
895 item_indx = FindFreeInventoryListSlot(); |
1010 | 896 |
897 if ( item_indx != -1 ) | |
898 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
899 pInventoryItemList[item_indx].uItemID = uItemID; |
1374 | 900 item_body_anch = pEquipTypeToBodyAnchor[pItemsTable->pItems[uItemID].uEquipType]; |
901 pEquipment.pIndices[item_body_anch] = item_indx + 1; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
902 pInventoryItemList[item_indx].uBodyAnchor = item_body_anch + 1; |
0 | 903 } |
904 } | |
905 | |
906 //----- (004927A8) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
907 int Player::AddItem(int index, unsigned int uItemID) |
0 | 908 { |
1374 | 909 int xStartValue = 0; |
910 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
911 if ( index == -1 ) |
0 | 912 { |
1385 | 913 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) |
914 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
915 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) |
0 | 916 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
917 if ( CanFitItem(ycoord * INVETORYSLOTSWIDTH + xcoord, uItemID) ) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
918 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
919 return CreateItemInInventory(ycoord * INVETORYSLOTSWIDTH + xcoord, uItemID); |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
920 } |
0 | 921 } |
1385 | 922 } |
0 | 923 return 0; |
924 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
925 if ( !CanFitItem(index, uItemID) ) |
0 | 926 { |
927 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
928 return 0; | |
929 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
930 return CreateItemInInventory(index, uItemID); |
0 | 931 } |
932 | |
933 //----- (00492826) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
934 int Player::AddItem2(int index, ItemGen *Src) |
0 | 935 { |
936 pItemsTable->SetSpecialBonus(Src); | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
937 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
938 if ( index == -1 ) |
0 | 939 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
940 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
941 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
942 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) //TODO: change pInventoryMatrix to 2 dimensional array. |
1385 | 943 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
944 if ( CanFitItem(ycoord * INVETORYSLOTSWIDTH + xcoord, Src->uItemID) ) |
0 | 945 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
946 return CreateItemInInventory2(ycoord * INVETORYSLOTSWIDTH + xcoord, Src); |
0 | 947 } |
1385 | 948 } |
0 | 949 } |
950 return 0; | |
951 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
952 if ( !CanFitItem(index, Src->uItemID) ) |
0 | 953 return 0; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
954 return CreateItemInInventory2(index, Src); |
0 | 955 } |
956 | |
957 //----- (0049289C) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
958 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src ) |
0 | 959 { |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
960 signed int freeSlot; // ebx@1 |
0 | 961 int result; // eax@6 |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
962 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
963 freeSlot = FindFreeInventoryListSlot(); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
964 if ( freeSlot == -1 ) |
0 | 965 { |
966 result = 0; | |
967 } | |
968 else | |
969 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
970 PutItemArInventoryIndex(Src->uItemID, freeSlot, index); |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
971 memcpy(&pInventoryItemList[freeSlot], Src, sizeof(ItemGen)); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
972 result = freeSlot + 1; |
0 | 973 } |
974 return result; | |
975 } | |
976 // 506128: using guessed type int areWeLoadingTexture; | |
977 | |
978 //----- (0049298B) -------------------------------------------------------- | |
1385 | 979 void Player::PutItemArInventoryIndex( int uItemID, int itemListPos, int index ) //originally accepted ItemGen* but needed only its uItemID |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
980 { |
1014 | 981 Texture *item_texture; // esi@1 |
982 int *pInvPos; // esi@4 | |
983 unsigned int slot_width; // [sp+Ch] [bp-4h]@1 | |
984 unsigned int slot_height; // [sp+18h] [bp+8h]@1 | |
985 | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
986 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1014 | 987 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); |
988 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 989 if ( !areWeLoadingTexture ) |
990 { | |
1014 | 991 item_texture->Release(); |
1006 | 992 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 993 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
994 if ( slot_width > 0 ) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
995 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
996 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
997 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
998 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
999 memset32(pInvPos, -1 - index, slot_width);//TODO: try to come up with a better solution. negative values are used when drawing the inventory - nothing is drawn |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1000 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1001 } |
1014 | 1002 } |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1003 pInventoryMatrix[index] = itemListPos + 1; |
0 | 1004 } |
278 | 1005 |
0 | 1006 // 506128: using guessed type int areWeLoadingTexture; |
1007 | |
1008 //----- (00492A36) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1009 void Player::RemoveItemAtInventoryIndex( unsigned int index ) |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1010 { |
1014 | 1011 ItemGen *item_in_slot; // ecx@1 |
1012 Texture *item_texture; // esi@1 | |
1013 unsigned int slot_height; // ebp@1 | |
1014 int *pInvPos; // edx@4 | |
1015 unsigned int slot_width; // [sp+14h] [bp+4h]@1 | |
1016 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1017 item_in_slot = &this->pInventoryItemList[pInventoryMatrix[index]-1]; |
1014 | 1018 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item_in_slot->uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1019 item_in_slot->Reset(); | |
1020 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); | |
1021 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 1022 if ( !areWeLoadingTexture ) |
1023 { | |
1014 | 1024 item_texture->Release(); |
1006 | 1025 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1026 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1027 if ( slot_width > 0 ) |
1014 | 1028 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1029 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1030 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1031 { |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1032 memset32(pInvPos, 0, slot_width); |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1033 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1034 } |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1035 } |
0 | 1036 } |
1037 // 506128: using guessed type int areWeLoadingTexture; | |
1038 | |
1039 //----- (00490EEE) -------------------------------------------------------- | |
1386 | 1040 int Player::SelectPhrasesTransaction(ItemGen *pItem, int building_type, int BuildID_2Events, int ShopMenuType) //TODO: probably move this somewhere else, not really Player:: stuff |
1041 { | |
1042 unsigned int idemId; // edx@1 | |
1043 signed int equipType; // esi@1 | |
1044 float multiplier; // ST04_4@26 | |
1045 int price; // edi@26 | |
1046 int merchantLevel; // [sp+10h] [bp-8h]@1 | |
1047 int itemValue; | |
1048 | |
1049 merchantLevel = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); | |
1050 idemId = pItem->uItemID; | |
1051 equipType = pItemsTable->pItems[idemId].uEquipType; | |
1052 itemValue = pItem->GetValue(); | |
1053 | |
1054 switch (building_type) | |
1055 { | |
1411 | 1056 case BuildingType_WeaponShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1057 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1058 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1059 if (equipType > EQUIP_BOW) |
1386 | 1060 return 4; |
1061 break; | |
1411 | 1062 case BuildingType_ArmorShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1063 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1064 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1065 if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS) |
1386 | 1066 return 4; |
1067 break; | |
1411 | 1068 case BuildingType_MagicShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1069 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1070 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1071 if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC ) |
1386 | 1072 return 4; |
1073 break; | |
1411 | 1074 case BuildingType_AlchemistShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1075 if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE) |
1386 | 1076 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1077 if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL)) |
1386 | 1078 return 4; |
1079 break; | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1080 default: |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1081 assert(false); |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1082 break; |
1386 | 1083 } |
1084 if (pItem->Stolen()) | |
1085 return 6; | |
1086 | |
1087 multiplier = p2DEvents[BuildID_2Events - 1].fPriceMultiplier; | |
1088 switch (ShopMenuType) | |
1089 { | |
1090 case 2: | |
1091 price = GetBuyingPrice(itemValue, multiplier); | |
1092 break; | |
1093 case 3: | |
917 | 1094 if (pItem->Broken()) |
1386 | 1095 price = 1; |
917 | 1096 else |
1386 | 1097 price = this->GetPriceSell(itemValue, multiplier); |
1098 break; | |
1099 case 4: | |
1100 price = this->GetPriceIdentification(multiplier); | |
1101 break; | |
1102 case 5: | |
1103 price = this->GetPriceRepair(itemValue, multiplier); | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1104 break; |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1105 default: |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1106 assert(false); |
1386 | 1107 break; |
1108 } | |
1109 if ( merchantLevel ) | |
1110 { | |
1111 if (price == itemValue) | |
1112 { | |
1113 return 3; | |
1114 } | |
917 | 1115 else |
1386 | 1116 { |
1117 return 2; | |
1118 } | |
1119 } | |
0 | 1120 else |
1386 | 1121 { |
1122 return 1; | |
1123 } | |
0 | 1124 } |
1125 | |
1126 //----- (0049107D) -------------------------------------------------------- | |
1127 int Player::GetBodybuilding() | |
1128 { | |
1010 | 1129 int v1; // al@1 |
0 | 1130 |
1131 v1 = GetActualSkillLevel(PLAYER_SKILL_BODYBUILDING); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1132 int multiplier = GetMultiplierForSkillLevel(v1, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1133 return multiplier * (v1 & 0x3F); |
0 | 1134 } |
1135 | |
1136 //----- (004910A8) -------------------------------------------------------- | |
607 | 1137 int Player::GetMeditation() |
0 | 1138 { |
1010 | 1139 int v1; // al@1 |
0 | 1140 |
1141 v1 = GetActualSkillLevel(PLAYER_SKILL_MEDITATION); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1142 int multiplier = GetMultiplierForSkillLevel(v1, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1143 return multiplier * (v1 & 0x3F); |
0 | 1144 } |
1145 | |
1146 //----- (004910D3) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1147 bool Player::CanIdentify( ItemGen *pItem ) |
0 | 1148 { |
1149 unsigned __int16 v2; // ax@1 | |
1150 int v5; // edi@7 | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
1151 |
652 | 1152 if (CheckHiredNPCSpeciality(Scholar)) |
1153 return true; | |
0 | 1154 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1155 v2 = GetActualSkillLevel(PLAYER_SKILL_ITEM_ID); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1156 if ( (signed int)SkillToMastery(v2) >= 4 ) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1157 return true; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1158 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1159 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1160 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1161 return v5 >= pItemsTable->pItems[pItem->uItemID].uItemID_Rep_St; |
0 | 1162 } |
1163 | |
1164 //----- (00491151) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1165 bool Player::CanRepair( ItemGen *pItem ) |
0 | 1166 { |
1167 unsigned __int16 v2; // ax@1 | |
1168 int v5; // edi@7 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1169 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1170 ItemDesc* v7 = &pItemsTable->pItems[pItem->uItemID]; |
652 | 1171 if (CheckHiredNPCSpeciality(Smith) && v7->uEquipType <= 2 || |
1172 CheckHiredNPCSpeciality(Armorer) && v7->uEquipType >= 3 && v7->uEquipType <= 9 || | |
1173 CheckHiredNPCSpeciality(Alchemist) && v7->uEquipType >= 9 ) | |
1174 return true; | |
1175 | |
1010 | 1176 v2 = GetActualSkillLevel(PLAYER_SKILL_REPAIR); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1177 if ( (signed int)SkillToMastery(v2) >= 4 ) |
0 | 1178 return true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1179 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1180 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1181 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1182 return v5 >= v7->uItemID_Rep_St; |
0 | 1183 } |
1184 | |
1185 //----- (004911F3) -------------------------------------------------------- | |
1186 int Player::GetMerchant() | |
1187 { | |
1188 unsigned __int16 v2; // ax@1 | |
1189 int v5; // edi@1 | |
1190 int v7; // eax@3 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1191 |
607 | 1192 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1193 if ( SkillToMastery(v2) >= 4 ) |
0 | 1194 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1195 |
0 | 1196 v7 = GetPartyReputation(); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1197 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1198 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1199 if (v5 == 0) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1200 { |
0 | 1201 return -v7; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1202 } |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1203 return v5 - v7 + 7; |
0 | 1204 } |
1205 | |
1206 //----- (0049125A) -------------------------------------------------------- | |
1207 int Player::GetPerception() | |
1208 { | |
1209 unsigned __int16 v2; // ax@1 | |
1210 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1211 |
1010 | 1212 v2 = GetActualSkillLevel(PLAYER_SKILL_PERCEPTION); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1213 if ( SkillToMastery(v2) >= 4 ) |
0 | 1214 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1215 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1216 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1217 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1218 return v5; |
0 | 1219 } |
1220 | |
1221 //----- (004912B0) -------------------------------------------------------- | |
1222 int Player::GetDisarmTrap() | |
1223 { | |
1224 unsigned __int16 v2; // ax@1 | |
1225 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1226 |
1010 | 1227 v2 = GetActualSkillLevel(PLAYER_SKILL_TRAP_DISARM); |
0 | 1228 if ( (signed int)SkillToMastery(v2) >= 4 ) |
1229 return 10000; | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1230 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1231 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1232 if ( HasEnchantedItemEquipped(35) ) //only the real skill level is supposed to be added again, not the multiplied value |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1233 multiplier++; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1234 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1235 return v5; |
0 | 1236 } |
1237 | |
1238 //----- (00491317) -------------------------------------------------------- | |
1239 char Player::GetLearningPercent() | |
1240 { | |
1241 int v2; // eax@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1242 |
1010 | 1243 v2 = GetActualSkillLevel(PLAYER_SKILL_LEARNING); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1244 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1245 return multiplier * v2 + 9; |
0 | 1246 } |
1247 | |
1248 //----- (0048C6AF) -------------------------------------------------------- | |
1249 Player::Player() | |
1250 { | |
1251 memset(&pEquipment, 0, sizeof(PlayerEquipment)); | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1252 memset(pInventoryMatrix, 0, 126 * sizeof(int)); |
0 | 1253 for (uint i = 0; i < 126; ++i) |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1254 pInventoryItemList[i].Reset(); |
0 | 1255 for (uint i = 0; i < 12; ++i) |
1256 pEquippedItems[i].Reset(); | |
1257 | |
1258 | |
1259 for (uint i = 0; i < 24; ++i) | |
1260 { | |
1261 pPlayerBuffs[i].uSkill = 0; | |
1262 pPlayerBuffs[i].uSkill = 0; | |
1263 pPlayerBuffs[i].uPower = 0; | |
1264 pPlayerBuffs[i].uExpireTime = 0; | |
1265 pPlayerBuffs[i].uCaster = 0; | |
1266 pPlayerBuffs[i].uFlags = 0; | |
1267 } | |
1268 | |
1269 pName[0] = 0; | |
1014 | 1270 uCurrentFace = 0; |
0 | 1271 uVoiceID = 0; |
1272 memset(pConditions, 0, 20 * sizeof(__int64)); | |
1273 | |
1274 field_BB = 0; | |
1275 | |
1276 uMight = uMightBonus = 0; | |
1277 uIntelligence = uIntelligenceBonus = 0; | |
1278 uWillpower = uWillpowerBonus = 0; | |
1279 uEndurance = uEnduranceBonus = 0; | |
1280 uSpeed = uSpeedBonus = 0; | |
1281 uAccuracy = uAccuracyBonus = 0; | |
1282 uLuck = uLuckBonus = 0; | |
1283 uLevel = sLevelModifier = 0; | |
1284 sAgeModifier = 0; | |
1388
60d4885eb107
sACModifier zeroed in player constructor so AC is not always 0(or -some value) ingame
Grumpy7
parents:
1387
diff
changeset
|
1285 sACModifier = 0; |
0 | 1286 |
1019 | 1287 // memset(field_1F5, 0, 30); |
1288 pure_luck_used=0; | |
1289 pure_speed_used=0; | |
1290 pure_intellect_used=0; | |
1291 pure_endurance_used=0; | |
1292 pure_willpower_used=0; | |
1293 pure_accuracy_used=0; | |
1294 pure_might_used=0; | |
0 | 1295 |
1296 sResFireBase = sResFireBonus = 0; | |
1297 sResAirBase = sResAirBonus = 0; | |
1298 sResWaterBase = sResWaterBonus = 0; | |
1299 sResEarthBase = sResEarthBonus = 0; | |
1300 sResMagicBase = sResMagicBonus = 0; | |
1301 sResSpiritBase = sResSpiritBonus = 0; | |
1302 sResMindBase = sResMindBonus = 0; | |
1303 sResBodyBase = sResBodyBonus = 0; | |
1304 sResLightBase = sResLightBonus = 0; | |
1305 sResDarkBase = sResDarkBonus = 0; | |
1306 | |
1307 uTimeToRecovery = 0; | |
1308 | |
1309 uSkillPoints = 0; | |
1310 | |
1311 sHealth = 0; | |
1312 uFullHealthBonus = 0; | |
1313 _health_related = 0; | |
1314 | |
1315 sMana = 0; | |
1316 uFullManaBonus = 0; | |
1317 _mana_related = 0; | |
1318 | |
1319 uQuickSpell = 0; | |
1320 memset(pInstalledBeacons, 0, 5 * sizeof(LloydBeacon)); | |
1321 | |
1322 _some_attack_bonus = 0; | |
1323 field_1A91 = 0; | |
1324 _melee_dmg_bonus = 0; | |
1325 field_1A93 = 0; | |
1326 _ranged_atk_bonus = 0; | |
1327 field_1A95 = 0; | |
1328 _ranged_dmg_bonus = 0; | |
1329 field_1A97 = 0; | |
1330 | |
130 | 1331 expression = CHARACTER_EXPRESSION_INVALID; |
0 | 1332 uExpressionTimePassed = 0; |
1333 uExpressionTimeLength = 0; | |
1334 | |
1335 uNumDivineInterventionCastsThisDay = 0; | |
1336 uNumArmageddonCasts = 0; | |
1337 uNumFireSpikeCasts = 0; | |
1338 | |
1339 memset(field_1988, 0, 49 * sizeof(int)); | |
1340 memset(field_1A50, 0, 64 * sizeof(char)); | |
1341 | |
1342 field_E0 = 0; | |
1343 field_E4 = 0; | |
1344 field_E8 = 0; | |
1345 field_EC = 0; | |
1346 field_F0 = 0; | |
1347 field_F4 = 0; | |
1348 field_F8 = 0; | |
1349 field_FC = 0; | |
1350 field_100 = 0; | |
1351 field_104 = 0; | |
198 | 1352 |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1353 _expression21_animtime = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1354 _expression21_frameset = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1355 |
198 | 1356 lastOpenedSpellbookPage = 0; |
0 | 1357 } |
1358 | |
1359 //----- (0048C6F6) -------------------------------------------------------- | |
1360 bool Party::AddItem(ItemGen *pItem) | |
1361 { | |
1362 unsigned int v2; // eax@1 | |
1363 unsigned int v3; // ecx@4 | |
1364 signed int v4; // edx@4 | |
1365 char *v5; // eax@8 | |
973 | 1366 //unsigned int v6; // eax@10 |
0 | 1367 Texture *v7; // ebx@10 |
1368 signed int v8; // esi@10 | |
1369 Player *v9; // edi@11 | |
1370 int v10; // eax@11 | |
1371 bool result; // eax@15 | |
1372 std::string v12; // [sp-18h] [bp-40h]@9 | |
1010 | 1373 |
1374 | |
188 | 1375 int v15[4] = {0, 1, 2, 3}; // [sp+Ch] [bp-1Ch]@3 |
1376 //int v16; // [sp+10h] [bp-18h]@3 | |
1377 //int v17; // [sp+14h] [bp-14h]@3 | |
1378 //int v18; // [sp+18h] [bp-10h]@3 | |
0 | 1379 Player *v19; // [sp+1Ch] [bp-Ch]@9 |
1380 Party *v20; // [sp+20h] [bp-8h]@1 | |
1381 int v21; // [sp+24h] [bp-4h]@10 | |
1382 | |
1383 auto thos = this; | |
1384 | |
1385 v20 = thos; | |
1386 v2 = pItem->uItemID; | |
222 | 1387 if ( !pItemsTable->pItems[v2].uItemID_Rep_St ) |
315 | 1388 pItem->SetIdentified(); |
188 | 1389 ///v15 = 0; |
1390 //v16 = 1; | |
1391 //v18 = 3; | |
1392 //v17 = 2; | |
0 | 1393 if ( uActiveCharacter ) |
1394 { | |
1395 v3 = uActiveCharacter - 1; | |
1396 v4 = 0; | |
1397 do | |
1398 { | |
188 | 1399 v15[v4++] = v3++; |
0 | 1400 if ( (signed int)v3 >= 4 ) |
1401 v3 = 0; | |
1402 } | |
1403 while ( v4 < 4 ); | |
1404 } | |
1405 v5 = pItemsTable->pItems[v2].pIconName; | |
1406 if ( v5 ) | |
1407 { | |
973 | 1408 v7 = pIcons_LOD->LoadTexturePtr(v5, TEXTURE_16BIT_PALETTE); |
0 | 1409 v21 = areWeLoadingTexture; |
1410 v8 = 0; | |
1411 while ( 1 ) | |
1412 { | |
188 | 1413 v9 = &v20->pPlayers[v15[v8]]; |
1414 v19 = &v20->pPlayers[v15[v8]]; | |
1014 | 1415 v10 = v19->AddItem(-1, pItem->uItemID); |
0 | 1416 if ( v10 ) |
1417 break; | |
1418 ++v8; | |
1419 if ( v8 >= 4 ) | |
1420 { | |
1421 if ( !v21 ) | |
1422 { | |
1423 v7->Release(); | |
1006 | 1424 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1425 } |
1426 goto LABEL_15; | |
1427 } | |
1428 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1429 memcpy(&v9->pInventoryItemList[v10-1], pItem, 0x24u); |
0 | 1430 pItem->Reset(); |
1431 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); | |
187 | 1432 v19->PlaySound(SPEECH_60, 0); |
0 | 1433 if ( !v21 ) |
1434 { | |
1435 v7->Release(); | |
1006 | 1436 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1437 } |
1438 result = 1; | |
1439 } | |
1440 else | |
1441 { | |
1442 MessageBoxW(nullptr, L"Invalid picture_name detected ::addItem()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Party.cpp:795", 0); | |
1443 LABEL_15: | |
1444 result = 0; | |
1445 } | |
1446 return result; | |
1447 } | |
1448 // 506128: using guessed type int areWeLoadingTexture; | |
1449 | |
1450 //----- (0048C855) -------------------------------------------------------- | |
1451 int Player::GetBaseStrength() | |
1452 { | |
1453 return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH, 0); | |
1454 } | |
1455 | |
1456 //----- (0048C86C) -------------------------------------------------------- | |
1457 int Player::GetBaseIntelligence() | |
1458 { | |
1459 return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE, 0); | |
1460 } | |
1461 | |
1462 //----- (0048C883) -------------------------------------------------------- | |
1463 int Player::GetBaseWillpower() | |
1464 { | |
1465 return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER, 0); | |
1466 } | |
1467 | |
1468 //----- (0048C89A) -------------------------------------------------------- | |
1469 int Player::GetBaseEndurance() | |
1470 { | |
1471 return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0); | |
1472 } | |
1473 | |
1474 //----- (0048C8B1) -------------------------------------------------------- | |
1475 int Player::GetBaseAccuracy() | |
1476 { | |
1477 return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY, 0); | |
1478 } | |
1479 | |
1480 //----- (0048C8C8) -------------------------------------------------------- | |
1481 int Player::GetBaseSpeed() | |
1482 { | |
1483 return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED, 0); | |
1484 } | |
1485 | |
1486 //----- (0048C8DF) -------------------------------------------------------- | |
1487 int Player::GetBaseLuck() | |
1488 { | |
1489 return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK, 0); | |
1490 } | |
1491 | |
1492 //----- (0048C8F6) -------------------------------------------------------- | |
1493 int Player::GetBaseLevel() | |
1494 { | |
1495 return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0); | |
1496 } | |
1497 | |
1498 //----- (0048C90D) -------------------------------------------------------- | |
1499 int Player::GetActualLevel() | |
1500 { | |
1501 return uLevel + sLevelModifier + | |
1502 GetMagicalBonus(CHARACTER_ATTRIBUTE_LEVEL) + | |
1503 GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0); | |
1504 } | |
1505 | |
1506 //----- (0048C93C) -------------------------------------------------------- | |
1507 int Player::GetActualMight() | |
1508 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1509 return GetActualAttribute(CHARACTER_ATTRIBUTE_STRENGTH, &Player::uMight, &Player::uMightBonus); |
0 | 1510 } |
1511 | |
1512 //----- (0048C9C2) -------------------------------------------------------- | |
1513 int Player::GetActualIntelligence() | |
1514 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1515 return GetActualAttribute(CHARACTER_ATTRIBUTE_INTELLIGENCE, &Player::uIntelligence, &Player::uIntelligenceBonus); |
0 | 1516 } |
1517 | |
1518 //----- (0048CA3F) -------------------------------------------------------- | |
1519 int Player::GetActualWillpower() | |
1520 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1521 return GetActualAttribute(CHARACTER_ATTRIBUTE_WILLPOWER, &Player::uWillpower, &Player::uWillpowerBonus); |
0 | 1522 } |
1523 | |
1524 //----- (0048CABC) -------------------------------------------------------- | |
1525 int Player::GetActualEndurance() | |
1526 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1527 return GetActualAttribute(CHARACTER_ATTRIBUTE_ENDURANCE, &Player::uEndurance, &Player::uEnduranceBonus); |
0 | 1528 } |
1529 | |
1530 //----- (0048CB39) -------------------------------------------------------- | |
1531 int Player::GetActualAccuracy() | |
1532 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1533 return GetActualAttribute(CHARACTER_ATTRIBUTE_ACCURACY, &Player::uAccuracy, &Player::uAccuracyBonus); |
0 | 1534 } |
1535 | |
1536 //----- (0048CBB6) -------------------------------------------------------- | |
1537 int Player::GetActualSpeed() | |
1538 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1539 return GetActualAttribute(CHARACTER_ATTRIBUTE_SPEED, &Player::uSpeed, &Player::uSpeedBonus); |
0 | 1540 } |
1541 | |
1542 //----- (0048CC33) -------------------------------------------------------- | |
1543 int Player::GetActualLuck() | |
1544 { | |
1036 | 1545 signed int npc_luck_bonus; // [sp+10h] [bp-4h]@1 |
1546 | |
1547 npc_luck_bonus = 0; | |
652 | 1548 if ( CheckHiredNPCSpeciality(Fool) ) |
1036 | 1549 npc_luck_bonus = 5; |
652 | 1550 if ( CheckHiredNPCSpeciality(ChimneySweep) ) |
1036 | 1551 npc_luck_bonus += 20; |
652 | 1552 if ( CheckHiredNPCSpeciality(Psychic) ) |
1036 | 1553 npc_luck_bonus += 10; |
1324 | 1554 |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1555 return GetActualAttribute(CHARACTER_ATTRIBUTE_LUCK, &Player::uLuck, &Player::uLuckBonus) |
1325 | 1556 + npc_luck_bonus; |
1557 } | |
1558 | |
1559 //----- (new function) -------------------------------------------------------- | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1560 int Player::GetActualAttribute( CHARACTER_ATTRIBUTE_TYPE attrId, unsigned short Player::* attrValue, unsigned short Player::* attrBonus ) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1561 { |
1324 | 1562 uint uActualAge = this->sAgeModifier + GetBaseAge(); |
1563 uint uAgeingMultiplier = 100; | |
1564 for (uint i = 0; i < 4; ++i) | |
1325 | 1565 { |
1324 | 1566 if (uActualAge >= pAgeingTable[i]) |
1325 | 1567 uAgeingMultiplier = pAgingAttributeModifier[attrId][i]; |
1568 else | |
1569 break; | |
1570 } | |
1571 | |
1572 auto uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()]; | |
1573 int magicBonus = GetMagicalBonus(attrId); | |
1574 int itemBonus = GetItemsBonus(attrId, 0); | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1575 return uConditionMult * uAgeingMultiplier * this->*attrValue / 100 / 100 |
1325 | 1576 + magicBonus |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1577 + itemBonus |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1578 + this->*attrBonus; |
0 | 1579 } |
1580 | |
1581 //----- (0048CCF5) -------------------------------------------------------- | |
1582 int Player::GetActualAttack(int a2) | |
1583 { | |
1584 Player *v2; // esi@1 | |
1585 int v3; // eax@1 | |
1586 int v4; // edi@1 | |
1587 int v5; // ebx@1 | |
1588 int v6; // ebp@1 | |
1589 | |
1590 v2 = this; | |
1591 v3 = GetActualAccuracy(); | |
1036 | 1592 v4 = GetParameterBonus(v3); |
0 | 1593 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_ATTACK); |
1594 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_ATTACK, a2); | |
1595 return v4 + v5 + v6 + GetMagicalBonus(CHARACTER_ATTRIBUTE_ATTACK) + v2->_some_attack_bonus; | |
1596 } | |
1597 | |
1598 //----- (0048CD45) -------------------------------------------------------- | |
1599 int Player::GetMeleeDamageMinimal() | |
1600 { | |
1601 Player *v1; // edi@1 | |
1602 int v2; // eax@1 | |
1603 int v3; // esi@1 | |
1604 int v4; // esi@1 | |
1605 int v5; // esi@1 | |
1606 int v6; // esi@1 | |
1607 signed int result; // eax@1 | |
1608 | |
1036 | 1609 |
0 | 1610 v2 = GetActualMight(); |
1036 | 1611 v3 = GetParameterBonus(v2); |
0 | 1612 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 0) + v3; |
1613 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; | |
1036 | 1614 result = _melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
1615 if ( result < 1 ) | |
1616 result = 1; | |
0 | 1617 return result; |
1618 } | |
1619 | |
1620 //----- (0048CD90) -------------------------------------------------------- | |
1621 int Player::GetMeleeDamageMaximal() | |
1622 { | |
1623 Player *v1; // edi@1 | |
1624 int v2; // eax@1 | |
1625 int v3; // esi@1 | |
1626 int v4; // esi@1 | |
1627 int v5; // esi@1 | |
1628 int v6; // esi@1 | |
1629 signed int result; // eax@1 | |
1630 | |
1631 v1 = this; | |
1632 v2 = GetActualMight(); | |
1036 | 1633 v3 = GetParameterBonus(v2); |
0 | 1634 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 0) + v3; |
1635 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; | |
1636 v6 = v1->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; | |
1637 result = 1; | |
1638 if ( v6 >= 1 ) | |
1639 result = v6; | |
1640 return result; | |
1641 } | |
1642 | |
1643 //----- (0048CDDB) -------------------------------------------------------- | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1644 int Player::CalculateMeleeDamageTo( bool ignoreSkillBonus, bool ignoreOffhand, unsigned int uTargetActorID ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1645 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1646 int dmgSum; // esi@62 |
0 | 1647 signed int result; // eax@64 |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1648 int mainWpnDmg; // [sp+18h] [bp-8h]@1 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1649 int offHndWpnDmg; // [sp+1Ch] [bp-4h]@1 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1650 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1651 offHndWpnDmg = 0; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1652 mainWpnDmg = 0; |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1653 if ( IsUnarmed() ) |
0 | 1654 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1655 mainWpnDmg = rand() % 3 + 1; |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1656 } |
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1657 else |
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1658 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1659 if ( HasItemEquipped(EQUIP_MAIN_HAND) ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1660 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1661 ItemGen *mainHandItemGen = &this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1662 int itemId = mainHandItemGen->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1663 bool addOneDice = false; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1664 if ( pItemsTable->pItems[itemId].uSkillType == PLAYER_SKILL_SPEAR && !this->pEquipment.uShield ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1665 addOneDice = true; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1666 mainWpnDmg = CalculateMeleeDmgToEnemyWithWeapon(mainHandItemGen, uTargetActorID, addOneDice); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1667 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1668 if ( !ignoreOffhand ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1669 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1670 if ( this->HasItemEquipped(EQUIP_OFF_HAND) ) |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1671 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1672 ItemGen *offHandItemGen = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uShield - 1]; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1673 int itemId = offHandItemGen->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1674 if ( pItemsTable->pItems[itemId].uEquipType != EQUIP_SHIELD ) |
0 | 1675 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1676 offHndWpnDmg = CalculateMeleeDmgToEnemyWithWeapon(offHandItemGen, uTargetActorID, false); |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1677 } |
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1678 } |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1679 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1680 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1681 dmgSum = mainWpnDmg + offHndWpnDmg; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1682 if ( !ignoreSkillBonus ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1683 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1684 int might = GetActualMight(); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1685 int mightBonus = GetParameterBonus(might); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1686 int mightAndSkillbonus = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + mightBonus; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1687 dmgSum += this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + mightAndSkillbonus; |
0 | 1688 } |
1689 result = 1; | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1690 if ( dmgSum >= 1 ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1691 result = dmgSum; |
0 | 1692 return result; |
1693 } | |
1694 | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1695 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1696 int Player::CalculateMeleeDmgToEnemyWithWeapon( ItemGen * weapon, unsigned int uTargetActorID , bool addOneDice ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1697 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1698 int itemId = weapon->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1699 int diceCount = pItemsTable->pItems[itemId].uDamageDice; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1700 if (addOneDice) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1701 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1702 diceCount++; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1703 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1704 int diceSides = pItemsTable->pItems[itemId].uDamageRoll; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1705 int diceResult = 0; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1706 for (int i = 0; i < diceCount; i++) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1707 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1708 diceResult += rand() % diceSides + 1; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1709 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1710 int totalDmg = pItemsTable->pItems[itemId].uDamageMod + diceResult; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1711 if ( uTargetActorID > 0) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1712 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1713 int enchType = weapon->uSpecEnchantmentType; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1714 if ( MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_UNDEAD) && (enchType == 64 || itemId == ITEM_ARTIFACT_GHOULSBANE || itemId == ITEM_ARTIFACT_GIBBET || itemId == ITEM_RELIC_JUSTICE) ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1715 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1716 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1717 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1718 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_KREEGAN) && ( enchType == 39 || itemId == ITEM_ARTIFACT_GIBBET)) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1719 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1720 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1721 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1722 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_DRAGON) && ( enchType == 40 || itemId == ITEM_ARTIFACT_GIBBET)) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1723 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1724 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1725 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1726 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_TITAN) && ( enchType == 65 )) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1727 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1728 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1729 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1730 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1731 if ( (signed int)SkillToMastery(this->pActiveSkills[2]) >= 3 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1732 && pItemsTable->pItems[itemId].uSkillType == 2 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1733 && rand() % 100 < 10 ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1734 totalDmg *= 3; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1735 return totalDmg; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1736 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1737 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1738 |
0 | 1739 //----- (0048D0B9) -------------------------------------------------------- |
1740 int Player::GetRangedAttack() | |
1741 { | |
1742 Player *v1; // esi@1 | |
1743 int v2; // eax@1 | |
1744 int v3; // edi@3 | |
1745 int v4; // eax@4 | |
1746 int v5; // edi@4 | |
1747 int v6; // edi@4 | |
1748 int v7; // edi@4 | |
1749 | |
1750 v1 = this; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1751 v2 = *(int *)&this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1752 if ( v2 < ITEM_BLASTER || v2 > ITEM_LASER_RIFLE ) |
0 | 1753 { |
1754 v4 = GetActualAccuracy(); | |
1036 | 1755 v5 = GetParameterBonus(v4); |
0 | 1756 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK, 0) + v5; |
1757 v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6; | |
1758 v3 = v1->_ranged_atk_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v7; | |
1759 } | |
1760 else | |
1761 { | |
1762 v3 = GetActualAttack(1); | |
1763 } | |
1764 return v3; | |
1765 } | |
1766 | |
1767 //----- (0048D124) -------------------------------------------------------- | |
1768 int Player::GetRangedDamageMin() | |
1769 { | |
1770 Player *v1; // esi@1 | |
1771 int v2; // edi@1 | |
1772 int v3; // edi@1 | |
1773 int v4; // edi@1 | |
1774 unsigned __int16 v5; // ax@1 | |
1775 int result; // eax@6 | |
1776 | |
1777 v1 = this; | |
1040 | 1778 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN, 0); |
1779 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; | |
1780 v4 = v1->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; | |
0 | 1781 if ( v4 >= 1 ) |
1782 result = v4; | |
1783 else | |
1784 result = 0; | |
1785 return result; | |
1786 } | |
1787 | |
1788 //----- (0048D191) -------------------------------------------------------- | |
1789 int Player::GetRangedDamageMax() | |
1790 { | |
1791 Player *v1; // esi@1 | |
1792 int v2; // edi@1 | |
1793 int v3; // edi@1 | |
1794 int v4; // edi@1 | |
1795 unsigned __int16 v5; // ax@1 | |
1796 int result; // eax@6 | |
1797 | |
1798 v1 = this; | |
1040 | 1799 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX, 0); |
1800 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; | |
1801 v4 = v1->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; | |
0 | 1802 if ( v4 >= 1 ) |
1803 result = v4; | |
1804 else | |
1805 result = 0; | |
1806 return result; | |
1807 } | |
1808 | |
1809 //----- (0048D1FE) -------------------------------------------------------- | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1810 int Player::CalculateRangedDamageTo( int a2 ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1811 { |
0 | 1812 bool result; // eax@1 |
1813 ItemGen *v4; // ebx@2 | |
1814 unsigned int v5; // edi@2 | |
1815 int v7; // edx@4 | |
1816 char v8; // zf@4 | |
1817 int v9; // esi@5 | |
1818 int v10; // ebx@6 | |
1819 signed int v15; // [sp+8h] [bp-Ch]@2 | |
1820 int v17; // [sp+10h] [bp-4h]@1 | |
1821 | |
1822 v17 = 0; | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1823 if ( !HasItemEquipped(EQUIP_BOW) ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1824 return 0; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1825 v4 = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uBow-1]; |
0 | 1826 v5 = v4->uItemID; |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1827 v15 = pItemsTable->pItems[v5].uDamageRoll; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1828 for( int i = 0; i < pItemsTable->pItems[v5].uDamageDice; i++ ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1829 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1830 int v7 = rand() % v15; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1831 v17 += v7 + 1; |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1832 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1833 v9 = pItemsTable->pItems[v5].uDamageMod + v17; |
0 | 1834 if ( a2 ) |
1835 { | |
377 | 1836 v10 = v4->uSpecEnchantmentType; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1837 if ( v10 == 64 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_UNDEAD)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1838 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1839 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1840 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1841 else if ( v10 == 39 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_KREEGAN)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1842 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1843 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1844 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1845 else if ( v10 == 40 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_DRAGON)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1846 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1847 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1848 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1849 else if ( v10 == 63 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_ELF)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1850 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1851 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1852 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1853 } |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1854 return v9 + this->GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS); |
0 | 1855 } |
1856 | |
1857 //----- (0048D2EA) -------------------------------------------------------- | |
1858 char *Player::GetMeleeDamageString() | |
1859 { | |
1036 | 1860 signed int itemid; // eax@1 |
1861 int min_damage; // edi@3 | |
1862 int max_damage; // eax@3 | |
0 | 1863 |
1864 static char player__getmeleedamagestring_static_buff[40]; // idb | |
1865 | |
1036 | 1866 if ( pEquipment.uMainHand) |
1867 { | |
1868 itemid= pOwnItems[this->pEquipment.uMainHand-1].uItemID; | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1869 if ( itemid < ITEM_BLASTER || itemid > ITEM_LASER_RIFLE ) //blasters |
1036 | 1870 { |
1871 min_damage = GetMeleeDamageMinimal(); | |
1872 max_damage = GetMeleeDamageMaximal(); | |
1873 } | |
1874 else | |
1875 { //for blasters | |
1876 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 0); | |
1877 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 0); | |
1878 } | |
1879 if ( max_damage ) | |
1880 { | |
1881 if ( min_damage == max_damage ) | |
1882 { | |
1883 sprintf(player__getmeleedamagestring_static_buff, "%d", min_damage); | |
1884 } | |
1885 else | |
1886 { | |
1887 sprintf(player__getmeleedamagestring_static_buff, "%d - %d", min_damage, max_damage); | |
1888 } | |
1889 } | |
1890 else | |
1891 { | |
1892 strcpy(player__getmeleedamagestring_static_buff, "N/A"); | |
1893 } | |
1894 | |
1895 if (( itemid >= 135 )&&( itemid <= 159 )) //wands | |
1896 { | |
1897 strcpy(player__getmeleedamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" | |
1898 } | |
1899 } | |
0 | 1900 else |
1036 | 1901 strcpy(player__getmeleedamagestring_static_buff, "N/A"); |
1902 return player__getmeleedamagestring_static_buff; | |
0 | 1903 } |
1904 | |
1905 //----- (0048D396) -------------------------------------------------------- | |
1906 char *Player::GetRangedDamageString() | |
1036 | 1907 { |
1908 signed int itemid; // eax@1 | |
1909 int min_damage; // edi@3 | |
1910 int max_damage; // eax@3 | |
1911 | |
1912 static char player__getrangeddamagestring_static_buff[40]; // idb | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1913 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1914 if (pEquipment.uMainHand >= 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1915 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1916 itemid = pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1917 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1918 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1919 if (pEquipment.uMainHand >= 0 && ( itemid >= 135 ) && ( itemid <= 159 )) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1920 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1921 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1922 return player__getrangeddamagestring_static_buff; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1923 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1924 else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE)) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1925 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1926 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1927 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1928 } |
0 | 1929 else |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1930 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1931 min_damage = GetRangedDamageMin(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1932 max_damage = GetRangedDamageMax(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1933 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1934 if ( max_damage > 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1935 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1936 if ( min_damage == max_damage ) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1937 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1938 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1939 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1940 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1941 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1942 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1943 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1944 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1945 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1946 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1947 strcpy(player__getrangeddamagestring_static_buff, "N/A"); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1948 } |
1036 | 1949 return player__getrangeddamagestring_static_buff; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1950 } |
0 | 1951 |
1952 //----- (0048D45A) -------------------------------------------------------- | |
1953 bool Player::CanTrainToNextLevel() | |
1954 { | |
1955 int v1; // edx@1 | |
1956 int v2; // eax@1 | |
1957 int i; // esi@1 | |
1958 | |
1959 v1 = this->uLevel; | |
1960 v2 = 0; | |
1961 for ( i = 0; i < v1; ++i ) | |
1962 v2 += i + 1; | |
1963 return (signed __int64)this->uExperience >= 1000 * v2; | |
1964 } | |
1965 | |
1966 //----- (0048D498) -------------------------------------------------------- | |
1967 unsigned int Player::GetExperienceDisplayColor() | |
1968 { | |
1969 unsigned int result; // eax@2 | |
1970 | |
1971 if ( CanTrainToNextLevel() ) | |
995 | 1972 result = ui_character_bonus_text_color; |
0 | 1973 else |
995 | 1974 result = ui_character_default_text_color; |
0 | 1975 return result; |
1976 } | |
1977 | |
1978 //----- (0048D4B3) -------------------------------------------------------- | |
1036 | 1979 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int amount ) |
1980 { | |
1981 | |
1982 int resist_value; // edi@8 | |
1983 int player_luck; // eax@21 | |
1984 signed int res_rand_divider; // ebx@2 | |
1985 int armor_skill; // eax@29 | |
1986 enum CHARACTER_ATTRIBUTE_TYPE player_resist; // [sp-4h] [bp-10h]@9 | |
1987 signed int result_amount_dmg; // [sp+8h] [bp-4h]@17 | |
1988 | |
1989 player_resist=CHARACTER_ATTRIBUTE_STRENGTH; | |
1990 switch(dmg_type) | |
1991 { | |
1992 case DMGT_FIRE: player_resist=CHARACTER_ATTRIBUTE_RESIST_FIRE; break; | |
1993 case DMGT_ELECTR: player_resist=CHARACTER_ATTRIBUTE_RESIST_AIR; break; | |
1994 case DMGT_COLD: player_resist=CHARACTER_ATTRIBUTE_RESIST_WATER; break; | |
1995 case DMGT_3: player_resist=CHARACTER_ATTRIBUTE_RESIST_EARTH; break; | |
1996 | |
1997 case DMGT_SPIRIT: player_resist=CHARACTER_ATTRIBUTE_RESIST_SPIRIT;break; | |
1998 case DMGT_MIND: player_resist=CHARACTER_ATTRIBUTE_RESIST_MIND; break; | |
1999 case DMGT_BODY: player_resist=CHARACTER_ATTRIBUTE_RESIST_BODY; break; | |
2000 } | |
2001 if (player_resist) | |
2002 resist_value = GetActualResistance(player_resist); | |
2003 else | |
2004 resist_value = 0; | |
2005 | |
2006 result_amount_dmg = amount; | |
2007 if ( classType == PLAYER_CLASS_LICH && resist_value >= 200 ) | |
0 | 2008 return 0; |
1036 | 2009 player_luck = GetActualLuck(); |
2010 res_rand_divider = GetParameterBonus(player_luck) + resist_value + 30; | |
2011 | |
2012 if ( resist_value ) | |
2013 { | |
2014 if ( rand() % res_rand_divider >= 30 ) | |
2015 { | |
2016 result_amount_dmg = amount >> 1; | |
2017 if ( rand() % res_rand_divider >= 30 ) | |
0 | 2018 { |
1036 | 2019 result_amount_dmg = amount >> 2; |
2020 if ( rand() % res_rand_divider >= 30 ) | |
0 | 2021 { |
1036 | 2022 result_amount_dmg = amount >> 3; |
2023 if ( rand() % res_rand_divider >= 30 ) | |
2024 result_amount_dmg = amount >> 4; | |
0 | 2025 } |
2026 } | |
2027 } | |
2028 } | |
1036 | 2029 if (( dmg_type == DMGT_PHISYCAL )&&( pEquipment.uArmor )) |
2030 { | |
2031 if (!pOwnItems[pEquipment.uArmor-1].Broken()) | |
0 | 2032 { |
1036 | 2033 armor_skill = GetEquippedItemSkillType(EQUIP_ARMOUR); |
2034 if ( armor_skill==PLAYER_SKILL_PLATE ) | |
0 | 2035 { |
1036 | 2036 if ( SkillToMastery(pActiveSkills[PLAYER_SKILL_PLATE]) >= 3 ) |
2037 return (int)(double)result_amount_dmg * 0.5; | |
0 | 2038 } |
1036 | 2039 if (armor_skill==PLAYER_SKILL_CHAIN ) |
0 | 2040 { |
1036 | 2041 if (SkillToMastery(pActiveSkills[PLAYER_SKILL_CHAIN]) == 4) |
2042 return (int)(double)result_amount_dmg * 0.66670001; | |
0 | 2043 } |
2044 } | |
1036 | 2045 } |
2046 return result_amount_dmg; | |
0 | 2047 } |
2048 | |
2049 //----- (0048D62C) -------------------------------------------------------- | |
816 | 2050 ITEM_EQUIP_TYPE Player::GetEquippedItemEquipType(ITEM_EQUIP_TYPE uEquipSlot) |
2051 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2052 return pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uEquipType; |
0 | 2053 } |
2054 | |
2055 //----- (0048D651) -------------------------------------------------------- | |
816 | 2056 PLAYER_SKILL_TYPE Player::GetEquippedItemSkillType(ITEM_EQUIP_TYPE uEquipSlot) |
2057 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2058 return (PLAYER_SKILL_TYPE)pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uSkillType; |
0 | 2059 } |
2060 | |
2061 //----- (0048D676) -------------------------------------------------------- | |
2062 bool Player::IsUnarmed() | |
2063 { | |
1091 | 2064 return HasItemEquipped(EQUIP_MAIN_HAND) != 0 && |
2065 !(HasItemEquipped(EQUIP_OFF_HAND) == 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD); | |
0 | 2066 } |
2067 | |
2068 //----- (0048D6AA) -------------------------------------------------------- | |
2069 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex) | |
2070 { | |
2071 auto i = pEquipment.pIndices[uEquipIndex]; | |
2072 if (i) | |
1080 | 2073 return ~(pOwnItems[i - 1].uAttributes & ITEM_BROKEN); |
1036 | 2074 else |
2075 return false; | |
0 | 2076 } |
2077 | |
2078 //----- (0048D6D0) -------------------------------------------------------- | |
2079 bool Player::HasEnchantedItemEquipped(int uEnchantment) | |
2080 { | |
2081 for (uint i = 0; i < 16; ++i) | |
2082 { | |
2083 if (HasItemEquipped((ITEM_EQUIP_TYPE)i) && | |
1080 | 2084 pOwnItems[pEquipment.pIndices[i]-1].uSpecEnchantmentType == uEnchantment) |
0 | 2085 // *(int *)&this->field_1F6[36 * pEquipment[i] + 6] != uEnchantment) |
2086 return true; | |
2087 } | |
2088 return false; | |
2089 } | |
2090 | |
2091 //----- (0048D709) -------------------------------------------------------- | |
1080 | 2092 bool Player::WearsItem( int item_id, ITEM_EQUIP_TYPE equip_type ) |
2093 { | |
1010 | 2094 |
0 | 2095 int v6; // esi@5 |
2096 | |
1080 | 2097 if ( equip_type >= 16 ) |
0 | 2098 { |
2099 v6 = 0; | |
2100 while ( !HasItemEquipped((ITEM_EQUIP_TYPE)v6) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2101 || pInventoryItemList[pEquipment.pIndices[v6] - 1].uItemID != item_id ) |
0 | 2102 { |
2103 ++v6; | |
2104 if ( (signed int)v6 >= 16 ) | |
2105 return 0; | |
2106 } | |
2107 return 1; | |
2108 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2109 if ( HasItemEquipped(equip_type) && pInventoryItemList[pEquipment.pIndices[equip_type - 1]].uItemID == item_id ) |
0 | 2110 return 1; |
2111 return 0; | |
2112 } | |
2113 | |
2114 //----- (0048D76C) -------------------------------------------------------- | |
2115 bool Player::StealFromShop(ItemGen *a2, int a3, int a4, int a5, int *a6) | |
2116 { | |
2117 unsigned __int16 v6; // cx@8 | |
2118 int v7; // edi@8 | |
2119 unsigned int v8; // ebx@8 | |
2120 unsigned int v9; // esi@8 | |
2121 int v10; // eax@8 | |
2122 int v11; // edi@12 | |
2123 bool result; // eax@13 | |
2124 | |
2125 if ( !a2 | |
2126 || this->pConditions[16] | |
2127 || this->pConditions[14] | |
2128 || this->pConditions[15] | |
2129 || this->pConditions[4] | |
2130 || this->pConditions[13] | |
2131 || this->pConditions[2] ) | |
2132 { | |
2133 result = 0; | |
2134 } | |
2135 else | |
2136 { | |
2137 v6 = this->pActiveSkills[34]; | |
2138 v7 = v6 & 0x3F; | |
2139 v8 = SkillToMastery(v6); | |
2140 v9 = a2->GetValue(); | |
2141 v10 = pItemsTable->pItems[a2->uItemID].uEquipType; | |
2142 if ( !pItemsTable->pItems[a2->uItemID].uEquipType || v10 == 1 || v10 == 2 ) | |
2143 v9 *= 3; | |
2144 v11 = dword_4EDEB4[rand() % 100 / 20] + v7 * dword_4EDEA0[v8]; | |
2145 *a6 = 100 * (a4 + a3) + v9 + (a5 != 0 ? 0x1F4 : 0); | |
2146 if ( rand() % 100 >= 5 ) | |
2147 { | |
2148 if ( *a6 > v11 ) | |
2149 result = *a6 - v11 < 500; | |
2150 else | |
2151 result = 2; | |
2152 } | |
2153 else | |
2154 { | |
2155 result = 0; | |
2156 } | |
2157 } | |
2158 return result; | |
2159 } | |
2160 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2161 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2162 | |
2163 //----- (0048D88B) -------------------------------------------------------- | |
2164 int Player::StealFromActor(unsigned int uActorID, int _steal_perm, int reputation) | |
2165 { | |
2166 Player *v4; // esi@1 | |
2167 Actor *v5; // edi@1 | |
2168 unsigned __int16 v6; // cx@10 | |
2169 int v7; // ebx@10 | |
2170 unsigned int v8; // esi@10 | |
2171 int v9; // eax@10 | |
2172 int v10; // esi@10 | |
2173 int v11; // eax@13 | |
2174 signed int v12; // ebx@15 | |
2175 signed int v13; // edx@15 | |
2176 int v14; // ecx@15 | |
2177 unsigned __int16 v15; // si@21 | |
2178 unsigned int v16; // ebx@24 | |
2179 int v17; // esi@24 | |
2180 const void *v18; // eax@29 | |
2181 unsigned int v19; // esi@31 | |
2182 int v20; // eax@34 | |
2183 char v21; // zf@36 | |
2184 unsigned int v22; // ST0C_4@39 | |
2185 char *v23; // esi@39 | |
2186 const char *v25; // [sp-Ch] [bp-48h]@40 | |
2187 int v26; // [sp-8h] [bp-44h]@40 | |
2188 ItemGen v27; // [sp+8h] [bp-34h]@15 | |
2189 unsigned int v28; // [sp+2Ch] [bp-10h]@10 | |
2190 int v29; // [sp+30h] [bp-Ch]@10 | |
2191 int v30; // [sp+34h] [bp-8h]@10 | |
2192 Player *v31; // [sp+38h] [bp-4h]@1 | |
2193 signed int _steal_perma; // [sp+48h] [bp+Ch]@12 | |
2194 | |
2195 v4 = this; | |
2196 v5 = &pActors[uActorID]; | |
2197 v31 = this; | |
2198 if ( &pActors[uActorID] | |
2199 && !this->pConditions[16] | |
2200 && !this->pConditions[14] | |
2201 && !this->pConditions[15] | |
2202 && !this->pConditions[4] | |
2203 && !this->pConditions[13] | |
2204 && !this->pConditions[2] ) | |
2205 { | |
2206 if ( !(BYTE2(v5->uAttributes) & 0x80) ) | |
2207 pActors[uActorID].SetRandomGoldIfTheresNoItem(); | |
2208 v6 = v4->pActiveSkills[34]; | |
2209 v7 = v6 & 0x3F; | |
2210 v8 = SkillToMastery(v6); | |
2211 v9 = rand(); | |
2212 v28 = 4 * v8; | |
2213 v30 = dword_4EDEA0[v8]; | |
2214 v29 = dword_4EDEB4[v9 % 100 / 20]; | |
2215 v10 = v5->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); | |
2216 if ( rand() % 100 < 5 || v10 > v29 + v7 * v30 || (_steal_perma = 2, BYTE2(v5->uAttributes) & 8) ) | |
2217 { | |
322 | 2218 Actor::AggroSurroundingPeasants(uActorID, 1); |
0 | 2219 _steal_perma = 0; |
2220 v26 = (int)v31->pName; | |
2221 v25 = pGlobalTXT_LocalizationStrings[376]; | |
2222 } | |
2223 else | |
2224 { | |
2225 v11 = rand(); | |
2226 if ( v11 % 100 >= 40 ) | |
2227 { | |
2228 if ( v11 % 100 >= 70 ) | |
2229 { | |
2230 v19 = 0; | |
2231 if ( v7 > 0 ) | |
2232 { | |
2233 do | |
2234 { | |
2235 --v7; | |
2236 v19 += rand() % dword_4EDEC4[v28 / 4] + 1; | |
2237 } | |
2238 while ( v7 ); | |
2239 } | |
2240 if ( pItemsTable->pItems[v5->array_000234[3].uItemID].uEquipType != 18 ) | |
2241 return _steal_perma; | |
377 | 2242 v20 = (int)&v5->array_000234[3].uSpecEnchantmentType; |
2243 if ( (signed int)v19 > v5->array_000234[3].uSpecEnchantmentType ) | |
2244 v19 = v5->array_000234[3].uSpecEnchantmentType; | |
0 | 2245 v21 = *(int *)v20 == v19; |
2246 *(int *)v20 -= v19; | |
2247 if ( v21 ) | |
2248 v5->array_000234[3].uItemID = 0; | |
2249 if ( v19 ) | |
2250 { | |
2251 party_finds_gold(v19, 2); | |
2252 v22 = v19; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2253 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2254 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], v31->pName, v22); |
0 | 2255 LABEL_43: |
2256 ShowStatusBarString(v23, 2u); | |
2257 return _steal_perma; | |
2258 } | |
2259 } | |
2260 else | |
2261 { | |
2262 v27.Reset(); | |
2263 v12 = 0; | |
2264 v13 = 0; | |
2265 v14 = (int)v5->array_000234; | |
2266 while ( !*(int *)v14 || pItemsTable->pItems[*(int *)v14].uEquipType == 18 ) | |
2267 { | |
2268 ++v13; | |
2269 v14 += 36; | |
2270 if ( v13 >= 4 ) | |
2271 goto LABEL_21; | |
2272 } | |
2273 v12 = 1; | |
2274 LABEL_21: | |
2275 v15 = v5->uCarriedItemID; | |
2276 if ( v15 || v12 ) | |
2277 { | |
2278 v27.Reset(); | |
2279 if ( v15 ) | |
2280 { | |
2281 v16 = (signed __int16)v15; | |
2282 v5->uCarriedItemID = 0; | |
2283 v27.uItemID = (signed __int16)v15; | |
2284 v17 = (signed __int16)v15; | |
2285 if ( pItemsTable->pItems[v17].uEquipType == 12 ) | |
2286 v27.uNumCharges = rand() % 6 + pItemsTable->pItems[v17].uDamageMod + 1; | |
2287 if ( pItemsTable->pItems[v17].uEquipType == 14 ) | |
2288 { | |
2289 if ( v16 != 220 ) | |
570 | 2290 v27.uEnchantmentType = 2 * rand() % 4 + 2; |
0 | 2291 } |
2292 } | |
2293 else | |
2294 { | |
2295 v18 = &v5->array_000234[rand() % 4]; | |
2296 memcpy(&v27, v18, sizeof(v27)); | |
2297 ((ItemGen *)v18)->Reset(); | |
2298 v16 = v27.uItemID; | |
2299 } | |
2300 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2301 sprintf( | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2302 pTmpBuf2.data(), |
0 | 2303 pGlobalTXT_LocalizationStrings[304], |
2304 v31->pName, | |
2305 pItemsTable->pItems[v16].pUnidentifiedName); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2306 ShowStatusBarString(pTmpBuf2.data(), 2u); |
0 | 2307 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2308 memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem)); | |
2309 pMouse->SetCursorBitmapFromItemID(v16); | |
2310 return _steal_perma; | |
2311 } | |
2312 } | |
2313 } | |
2314 v26 = (int)v31->pName; | |
2315 v25 = pGlobalTXT_LocalizationStrings[377]; | |
2316 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2317 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2318 sprintfex(pTmpBuf2.data(), v25, v26); |
0 | 2319 goto LABEL_43; |
2320 } | |
2321 return 0; | |
2322 } | |
2323 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2324 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2325 // 4EDEC4: using guessed type int dword_4EDEC4[]; | |
2326 | |
2327 //----- (0048DBB9) -------------------------------------------------------- | |
2328 void Player::Heal(int amount) | |
2329 { | |
1010 | 2330 signed int max_health; // eax@3 |
2331 | |
2332 if ( !pConditions[Condition_Eradicated] && !pConditions[Condition_Dead] ) | |
2333 { | |
2334 max_health = GetMaxHealth(); | |
2335 if ( pConditions[Condition_Zombie] ) | |
2336 max_health /= 2; | |
2337 sHealth += amount; | |
2338 if ( sHealth > max_health ) | |
2339 sHealth = max_health; | |
2340 if ( pConditions[Condition_Unconcious] ) | |
2341 { | |
2342 if ( sHealth > 0 ) | |
2343 { | |
2344 pConditions[Condition_Unconcious] = 0i64; | |
0 | 2345 } |
2346 } | |
2347 } | |
2348 } | |
2349 | |
2350 //----- (0048DC1E) -------------------------------------------------------- | |
1036 | 2351 int Player::ReceiveDamage( signed int amount, DAMAGE_TYPE dmg_type ) |
2352 { | |
2353 signed int recieved_dmg; // eax@1 | |
2354 unsigned int armor_indx; // eax@8 | |
2355 bool broke_armor; | |
2356 | |
2357 pConditions[Condition_Sleep] = 0i64; | |
2358 recieved_dmg = CalculateIncommingDamage(dmg_type, amount); | |
2359 sHealth -= recieved_dmg; | |
2360 broke_armor = sHealth <= -10; | |
2361 if ( sHealth < 1 ) // | |
2362 { | |
2363 if ( (sHealth + uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1) | |
2364 || pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0i64 ) | |
0 | 2365 { |
1019 | 2366 SetCondition(Condition_Unconcious, 0); |
0 | 2367 } |
2368 else | |
2369 { | |
1019 | 2370 SetCondition(Condition_Dead, 0); |
1036 | 2371 //v6 = LODWORD(pParty->uTimePlayed); ???? if equals 0 do not broke armor? |
2372 if ( sHealth > 0 ) | |
2373 sHealth = 0; | |
2374 } | |
2375 if (broke_armor ) | |
2376 { | |
2377 armor_indx = pEquipment.uArmor; | |
2378 if ( armor_indx ) | |
0 | 2379 { |
1036 | 2380 if ( !pOwnItems[armor_indx-1].uAttributes & ITEM_ENCHANTED) |
0 | 2381 { |
1036 | 2382 pOwnItems[armor_indx-1].uAttributes|=ITEM_BROKEN; |
0 | 2383 } |
2384 } | |
2385 } | |
2386 } | |
1036 | 2387 if ( recieved_dmg && CanAct() ) |
187 | 2388 PlaySound(SPEECH_24, 0); |
1036 | 2389 return recieved_dmg; |
0 | 2390 } |
2391 | |
2392 //----- (0048DCF6) -------------------------------------------------------- | |
2393 int Player::_48DCF6(int a2, Actor *pActor) | |
2394 { | |
2395 signed int v3; // edi@1 | |
2396 signed int v4; // ebx@1 | |
2397 Player *v5; // esi@1 | |
2398 int v6; // eax@2 | |
2399 int v7; // eax@5 | |
2400 int v8; // eax@8 | |
2401 int v9; // ebx@8 | |
2402 int v10; // eax@8 | |
2403 int v11; // ebx@8 | |
2404 signed int v12; // edx@9 | |
2405 ItemGen *v13; // eax@9 | |
2406 int v14; // edx@16 | |
2407 unsigned int v15; // edx@17 | |
2408 int v16; // edx@26 | |
2409 unsigned int v17; // edx@27 | |
2410 signed int v19; // edx@38 | |
2411 int *v20; // ecx@38 | |
2412 signed int v21; // eax@40 | |
2413 int v22; // eax@49 | |
2414 signed int v23; // ebx@49 | |
2415 unsigned int v24; // eax@60 | |
2416 int v25; // ecx@61 | |
2417 int v26; // ebx@74 | |
2418 void *v27; // ecx@76 | |
2419 unsigned int v28; // ebx@78 | |
2420 signed int result; // eax@86 | |
2421 SoundID v30; // [sp-20h] [bp-C0h]@56 | |
2422 signed int v31; // [sp-1Ch] [bp-BCh]@56 | |
2423 unsigned int v32; // [sp-18h] [bp-B8h]@56 | |
2424 signed int v33; // [sp-14h] [bp-B4h]@56 | |
2425 signed int v34; // [sp-10h] [bp-B0h]@56 | |
2426 int v35; // [sp-Ch] [bp-ACh]@56 | |
2427 unsigned int v36; // [sp-8h] [bp-A8h]@51 | |
2428 unsigned int v37; // [sp-8h] [bp-A8h]@56 | |
2429 unsigned int v38; // [sp-8h] [bp-A8h]@57 | |
2430 unsigned int v39; // [sp-8h] [bp-A8h]@68 | |
2431 enum CHARACTER_ATTRIBUTE_TYPE v40; // [sp-4h] [bp-A4h]@4 | |
2432 int v41; // [sp-4h] [bp-A4h]@51 | |
2433 int v42; // [sp-4h] [bp-A4h]@56 | |
2434 int v43; // [sp-4h] [bp-A4h]@57 | |
2435 signed int v44; // [sp-4h] [bp-A4h]@59 | |
2436 int v45; // [sp-4h] [bp-A4h]@68 | |
2437 char v46[140]; // [sp+Ch] [bp-94h]@13 | |
2438 unsigned int v47; // [sp+98h] [bp-8h]@1 | |
2439 int v48; // [sp+9Ch] [bp-4h]@1 | |
2440 | |
2441 v3 = 0; | |
2442 v4 = 0; | |
2443 v5 = this; | |
2444 v47 = 0; | |
2445 v48 = 0; | |
2446 switch ( a2 ) | |
2447 { | |
2448 case 1: | |
2449 v6 = GetActualWillpower(); | |
2450 goto LABEL_46; | |
2451 case 2: | |
2452 case 3: | |
2453 case 4: | |
2454 case 9: | |
2455 case 10: | |
2456 case 11: | |
2457 case 13: | |
2458 case 21: | |
2459 v6 = GetActualEndurance(); | |
2460 goto LABEL_46; | |
2461 case 5: | |
2462 case 12: | |
2463 case 23: | |
2464 v40 = (CHARACTER_ATTRIBUTE_TYPE)14; | |
2465 goto LABEL_5; | |
2466 case 15: | |
2467 v40 = (CHARACTER_ATTRIBUTE_TYPE)13; | |
2468 goto LABEL_5; | |
2469 case 6: | |
2470 case 7: | |
2471 case 8: | |
2472 case 14: | |
2473 case 16: | |
2474 v40 = (CHARACTER_ATTRIBUTE_TYPE)15; | |
2475 LABEL_5: | |
2476 v7 = GetActualResistance(v40); | |
2477 goto LABEL_47; | |
2478 case 22: | |
2479 v8 = GetActualWillpower(); | |
1036 | 2480 v9 = GetParameterBonus(v8); |
0 | 2481 v10 = GetActualIntelligence(); |
1036 | 2482 v11 = (GetParameterBonus(v10) + v9) >> 1; |
0 | 2483 break; |
2484 case 17: | |
2485 v12 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2486 v13 = this->pInventoryItemList; |
0 | 2487 do |
2488 { | |
315 | 2489 if ( (signed int)v13->uItemID > 0 && (signed int)v13->uItemID <= 134 && !v13->Broken()) |
0 | 2490 v46[v4++] = v12; |
2491 ++v12; | |
2492 ++v13; | |
2493 } | |
2494 while ( v12 < 138 ); | |
2495 goto LABEL_36; | |
2496 case 18: | |
2497 v14 = 0; | |
2498 do | |
2499 { | |
2500 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) | |
2501 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2502 __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used |
816 | 2503 if ( v15 == EQUIP_ARMOUR ) |
898 | 2504 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; |
816 | 2505 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) |
898 | 2506 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1; |
0 | 2507 } |
2508 v14 = v15 + 1; | |
2509 } | |
2510 while ( v14 < 16 ); | |
2511 goto LABEL_36; | |
2512 case 19: | |
2513 v16 = 0; | |
2514 do | |
2515 { | |
2516 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) | |
2517 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2518 __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used |
0 | 2519 if ( v17 == 2 ) |
2520 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; | |
2521 if ( (!v17 || v17 == 1) | |
816 | 2522 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) |
898 | 2523 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1; |
0 | 2524 } |
2525 v16 = v17 + 1; | |
2526 } | |
2527 while ( v16 < 16 ); | |
2528 LABEL_36: | |
2529 if ( !v4 ) | |
2530 goto LABEL_87; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2531 v48 = (int)&v5->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; |
0 | 2532 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); |
2533 break; | |
2534 case 20: | |
2535 v19 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2536 v20 = this->pInventoryMatrix; |
0 | 2537 do |
2538 { | |
2539 if ( *v20 > 0 ) | |
2540 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2541 v21 = *(int *)&v5->pInventoryItemList[*v20-1]; |
0 | 2542 if ( v21 > 0 ) |
2543 { | |
2544 if ( v21 <= 134 ) | |
2545 v46[v4++] = v19; | |
2546 } | |
2547 } | |
2548 ++v19; | |
2549 ++v20; | |
2550 } | |
2551 while ( v19 < 126 ); | |
2552 if ( !v4 ) | |
2553 goto LABEL_87; | |
2554 v47 = (unsigned __int8)v46[rand() % v4]; | |
2555 v6 = GetActualAccuracy(); | |
2556 LABEL_46: | |
1036 | 2557 v7 = GetParameterBonus(v6); |
0 | 2558 LABEL_47: |
2559 v11 = v7; | |
2560 break; | |
2561 default: | |
2562 v11 = 0; | |
2563 break; | |
2564 } | |
2565 v22 = GetActualLuck(); | |
1036 | 2566 v23 = GetParameterBonus(v22) + v11 + 30; |
0 | 2567 if ( rand() % v23 >= 30 ) |
2568 { | |
2569 LABEL_87: | |
2570 result = 0; | |
2571 } | |
2572 else | |
2573 { | |
2574 switch ( a2 ) | |
2575 { | |
2576 case 1: | |
2577 v41 = 1; | |
2578 v36 = 0; | |
2579 goto LABEL_56; | |
2580 case 2: | |
2581 v41 = 1; | |
2582 v36 = 1; | |
2583 goto LABEL_56; | |
2584 case 3: | |
2585 v41 = 1; | |
2586 v36 = 2; | |
2587 goto LABEL_56; | |
2588 case 23: | |
2589 v41 = 1; | |
2590 v36 = 3; | |
2591 goto LABEL_56; | |
2592 case 4: | |
2593 v41 = 1; | |
2594 v36 = 4; | |
2595 LABEL_56: | |
2596 SetCondition(v36, v41); | |
2597 v42 = 0; | |
2598 v37 = 0; | |
2599 v35 = 0; | |
2600 v34 = 0; | |
2601 v33 = -1; | |
2602 v32 = 0; | |
2603 v31 = 0; | |
2604 v30 = (SoundID)221; | |
2605 goto LABEL_83; | |
2606 case 5: | |
2607 v43 = 1; | |
2608 v38 = 5; | |
2609 goto LABEL_70; | |
2610 case 6: | |
2611 case 7: | |
2612 case 8: | |
2613 if ( a2 == 6 ) | |
2614 { | |
2615 v44 = 6; | |
2616 goto LABEL_60; | |
2617 } | |
2618 v25 = 2 * (a2 != 8) + 8; | |
2619 goto LABEL_65; | |
2620 case 9: | |
2621 if ( a2 == 6 ) | |
2622 { | |
2623 v44 = 7; | |
2624 LABEL_60: | |
2625 v24 = v44; | |
2626 } | |
2627 else | |
2628 { | |
2629 v25 = 2 * (a2 != 8) + 9; | |
2630 LABEL_65: | |
2631 v24 = v25; | |
2632 } | |
2633 SetCondition(v24, 1); | |
2634 v42 = 0; | |
2635 v37 = 0; | |
2636 v35 = 0; | |
2637 v34 = 0; | |
2638 v33 = -1; | |
2639 v32 = 0; | |
2640 v31 = 0; | |
2641 v30 = (SoundID)222; | |
2642 LABEL_83: | |
2643 pAudioPlayer->PlaySound(v30, v31, v32, v33, v34, v35, v37, v42); | |
2644 do | |
2645 { | |
2646 LABEL_84: | |
2647 if ( v5 == pPlayers[v3 + 1] ) | |
2648 break; | |
2649 ++v3; | |
2650 } | |
2651 while ( v3 < 4 ); | |
2652 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); | |
2653 result = 1; | |
2654 break; | |
2655 case 12: | |
2656 v43 = 1; | |
2657 v38 = 12; | |
2658 goto LABEL_70; | |
2659 case 15: | |
2660 v45 = 1; | |
2661 v39 = 15; | |
2662 goto LABEL_73; | |
2663 case 13: | |
2664 v43 = 1; | |
2665 v38 = 13; | |
2666 LABEL_70: | |
2667 SetCondition(v38, v43); | |
2668 v42 = 0; | |
2669 v37 = 0; | |
2670 v35 = 0; | |
2671 v34 = 0; | |
2672 v33 = -1; | |
2673 v32 = 0; | |
2674 v31 = 0; | |
2675 v30 = (SoundID)224; | |
2676 goto LABEL_83; | |
2677 case 14: | |
2678 v45 = 1; | |
2679 v39 = 14; | |
2680 goto LABEL_73; | |
2681 case 16: | |
2682 v45 = 1; | |
2683 v39 = 16; | |
2684 LABEL_73: | |
2685 SetCondition(v39, v45); | |
2686 v42 = 0; | |
2687 v37 = 0; | |
2688 v35 = 0; | |
2689 v34 = 0; | |
2690 v33 = -1; | |
2691 v32 = 0; | |
2692 v31 = 0; | |
2693 v30 = (SoundID)225; | |
2694 goto LABEL_83; | |
2695 case 17: | |
2696 case 18: | |
2697 case 19: | |
2698 v26 = v48; | |
2699 if ( *(char *)(v48 + 21) & 2 ) | |
2700 goto LABEL_84; | |
187 | 2701 PlaySound(SPEECH_40, 0); |
0 | 2702 *(int *)(v26 + 20) |= 2u; |
2703 goto LABEL_79; | |
2704 case 20: | |
187 | 2705 PlaySound(SPEECH_40, 0); |
0 | 2706 v27 = pActor->array_000234; |
2707 if ( pActor->array_000234[0].uItemID ) | |
2708 { | |
2709 v27 = &pActor->array_000234[1]; | |
2710 if ( pActor->array_000234[1].uItemID ) | |
2711 goto LABEL_84; | |
2712 } | |
2713 v28 = v47; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2714 memcpy(v27, &v5->pInventoryItemList[v5->pInventoryMatrix[v47]-1], 0x24u); |
0 | 2715 RemoveItemAtInventoryIndex(v28); |
2716 LABEL_79: | |
2717 v42 = 0; | |
2718 v37 = 0; | |
2719 v35 = 0; | |
2720 v34 = 0; | |
2721 v33 = -1; | |
2722 v32 = 0; | |
2723 v31 = 0; | |
2724 v30 = (SoundID)47; | |
2725 goto LABEL_83; | |
2726 case 21: | |
187 | 2727 PlaySound(SPEECH_42, 0); |
0 | 2728 ++v5->sAgeModifier; |
2729 goto LABEL_82; | |
2730 case 22: | |
187 | 2731 PlaySound(SPEECH_41, 0); |
0 | 2732 v5->sMana = 0; |
2733 LABEL_82: | |
2734 v42 = 0; | |
2735 v37 = 0; | |
2736 v35 = 0; | |
2737 v34 = 0; | |
2738 v33 = -1; | |
2739 v32 = 0; | |
2740 v31 = 0; | |
2741 v30 = (SoundID)226; | |
2742 goto LABEL_83; | |
2743 default: | |
2744 goto LABEL_87; | |
2745 } | |
2746 } | |
2747 return result; | |
2748 } | |
324 | 2749 |
0 | 2750 // 48DCF6: using guessed type char var_94[140]; |
2751 | |
2752 //----- (0048E1A3) -------------------------------------------------------- | |
2753 unsigned int Player::GetSpellSchool(unsigned int uSpellID) | |
2754 { | |
1091 | 2755 return pSpellStats->pInfos[uSpellID].uSchool; |
0 | 2756 } |
2757 | |
2758 //----- (0048E1B5) -------------------------------------------------------- | |
816 | 2759 int Player::GetAttackRecoveryTime(bool bRangedAttack) |
2760 { | |
2761 ItemGen *weapon = nullptr; | |
2762 ItemDesc *weapon_desc = nullptr; | |
2763 uint weapon_recovery = base_recovery_times_per_weapon_type[0]; | |
2764 if (bRangedAttack) | |
0 | 2765 { |
2766 if ( !HasItemEquipped(EQUIP_BOW) ) | |
2767 goto LABEL_17; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2768 weapon = &pInventoryItemList[pEquipment.uBow - 1]; |
816 | 2769 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
2770 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; | |
2771 goto LABEL_17; | |
2772 } | |
2773 else if ( IsUnarmed() == 1 ) | |
2774 { | |
2775 if (GetActualSkillLevel(PLAYER_SKILL_UNARMED)) | |
2776 { | |
2777 weapon_recovery = base_recovery_times_per_weapon_type[1]; | |
0 | 2778 goto LABEL_17; |
2779 } | |
2780 } | |
816 | 2781 |
2782 if ( HasItemEquipped(EQUIP_MAIN_HAND) ) | |
2783 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2784 weapon = &pInventoryItemList[pEquipment.uMainHand - 1]; |
816 | 2785 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
2786 if (weapon_desc->uEquipType == EQUIP_WAND) | |
2787 { | |
2788 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2789 __debugbreak(); // looks like wands were two-handed weapons once, or supposed to be. should not get here now | |
2790 weapon_recovery = pSpellDatas[wand_spell_ids[weapon->uItemID - ITEM_WAND_FIRE]].uExpertLevelRecovery; | |
2791 } | |
0 | 2792 else |
816 | 2793 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; |
2794 } | |
1010 | 2795 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD) |
2796 // ADD: shield check because shield recovery is added later and can be accidentally doubled | |
816 | 2797 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2798 auto v12 = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2799 auto v12_desc = &pItemsTable->pItems[v12->uItemID]; |
2800 if (base_recovery_times_per_weapon_type[v12_desc->uSkillType] > weapon_recovery) | |
2801 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2802 weapon = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2803 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
2804 weapon_recovery = base_recovery_times_per_weapon_type[pItemsTable->pItems[weapon->uItemID].uSkillType]; | |
2805 } | |
2806 } | |
2807 | |
0 | 2808 LABEL_17: |
816 | 2809 uint armour_recovery = 0; |
0 | 2810 if ( HasItemEquipped(EQUIP_ARMOUR) ) |
2811 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2812 auto armour_skill_type = pItemsTable->pItems[pInventoryItemList[pEquipment.uArmor - 1].uItemID].uSkillType; |
816 | 2813 uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type]; |
2814 | |
2815 float armour_recovery_multipliers[4]; | |
2816 if (armour_skill_type == PLAYER_SKILL_LEATHER) | |
2817 { | |
2818 armour_recovery_multipliers[0] = 1.0f; | |
2819 armour_recovery_multipliers[1] = 0; | |
2820 armour_recovery_multipliers[2] = 0; | |
2821 armour_recovery_multipliers[3] = 0; | |
2822 } | |
2823 else if (armour_skill_type == PLAYER_SKILL_CHAIN) | |
2824 { | |
2825 armour_recovery_multipliers[0] = 1.0f; | |
2826 armour_recovery_multipliers[1] = 0.5f; | |
2827 armour_recovery_multipliers[2] = 0; | |
2828 armour_recovery_multipliers[3] = 0; | |
2829 } | |
2830 else if (armour_skill_type == PLAYER_SKILL_PLATE) | |
2831 { | |
2832 armour_recovery_multipliers[0] = 1.0f; | |
2833 armour_recovery_multipliers[1] = 0.5f; | |
2834 armour_recovery_multipliers[2] = 0.5f; | |
2835 armour_recovery_multipliers[3] = 0; | |
0 | 2836 } |
2837 else | |
2838 { | |
816 | 2839 assert(false && "Unknown armour type"); // what kind of armour is that? |
2840 armour_recovery_multipliers[0] = 1.0f; | |
2841 armour_recovery_multipliers[1] = 1.0f; | |
2842 armour_recovery_multipliers[2] = 1.0f; | |
2843 armour_recovery_multipliers[3] = 1.0f; | |
2844 } | |
2845 | |
2846 uint skill_mastery = SkillToMastery(pActiveSkills[armour_skill_type]); | |
2847 armour_recovery = base_armour_recovery * armour_recovery_multipliers[skill_mastery - 1]; | |
2848 } | |
2849 | |
2850 uint shield_recovery = 0; | |
2851 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD) | |
2852 { | |
2853 float shield_recovery_multipliers[4] = {1, 0, 0, 0}; | |
2854 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2855 auto shield = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2856 auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType; |
2857 | |
2858 uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type]; | |
2859 shield_recovery = shield_base_recovery * SkillToMastery(pActiveSkills[skill_type]); | |
2860 } | |
2861 | |
1036 | 2862 uint player_speed_recovery_reduction = GetParameterBonus(GetActualSpeed()), |
816 | 2863 sword_axe_bow_recovery_reduction = 0; |
2864 bool shooting_laser = false; | |
2865 if (weapon_desc) | |
2866 { | |
2867 if (GetActualSkillLevel((PLAYER_SKILL_TYPE)weapon_desc->uSkillType) && | |
2868 (weapon_desc->uSkillType == PLAYER_SKILL_SWORD || weapon_desc->uSkillType == PLAYER_SKILL_AXE || weapon_desc->uSkillType == PLAYER_SKILL_BOW) ) | |
2869 { | |
2870 if (SkillToMastery(pActiveSkills[weapon_desc->uSkillType]) >= 2 ) // Expert Sword, Axe & Bow reduce recovery | |
2871 sword_axe_bow_recovery_reduction = pActiveSkills[weapon_desc->uSkillType] & 0x3F; | |
2872 } | |
2873 if (weapon_desc->uSkillType == PLAYER_SKILL_BLASTER) | |
2874 shooting_laser = true; | |
2875 } | |
2876 | |
2877 uint armsmaster_recovery_reduction = 0; | |
2878 if (!bRangedAttack && !shooting_laser) | |
2879 { | |
2880 if (uint armsmaster_level = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER)) | |
2881 { | |
2882 armsmaster_recovery_reduction = armsmaster_level & 0x3F; | |
2883 if (SkillToMastery(armsmaster_level) >= 4) | |
2884 armsmaster_recovery_reduction *= 2; | |
2885 } | |
2886 } | |
2887 | |
2888 uint v41 = 0; | |
2889 if (pPlayerBuffs[PLAYER_BUFF_7].uExpireTime > 0) | |
0 | 2890 v41 = 25; |
816 | 2891 |
2892 uint weapon_enchantment_recovery_reduction = 0; | |
2893 if ( weapon ) | |
2894 { | |
2895 if (weapon->uSpecEnchantmentType == 59 || | |
2896 weapon->uSpecEnchantmentType == 41 || | |
2897 weapon->uSpecEnchantmentType == 500) | |
2898 weapon_enchantment_recovery_reduction = 20; | |
2899 } | |
2900 | |
2901 | |
2902 int recovery = weapon_recovery + | |
2903 armour_recovery + | |
2904 shield_recovery | |
2905 - armsmaster_recovery_reduction | |
2906 - weapon_enchantment_recovery_reduction | |
2907 - v41 | |
2908 - sword_axe_bow_recovery_reduction | |
2909 - player_speed_recovery_reduction; | |
2910 | |
2911 if (recovery < 0) | |
2912 recovery = 0; | |
2913 return recovery; | |
0 | 2914 } |
2915 | |
2916 //----- (0048E4F8) -------------------------------------------------------- | |
2917 int Player::GetMaxHealth() | |
2918 { | |
2919 int v3; // esi@1 | |
2920 int v4; // esi@1 | |
2921 int v6; // esi@1 | |
2922 | |
1036 | 2923 v3 = GetParameterBonus(GetActualEndurance()); |
135 | 2924 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); |
0 | 2925 v6 = uFullHealthBonus |
135 | 2926 + pBaseHealthByClass[classType / 4] |
0 | 2927 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) |
2928 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4; | |
2929 if (v6 <= 0) | |
2930 return 1; | |
2931 return v6; | |
2932 } | |
2933 | |
2934 //----- (0048E565) -------------------------------------------------------- | |
2935 int Player::GetMaxMana() | |
2936 { | |
2937 int v2; // eax@2 | |
2938 int v3; // esi@4 | |
2939 int v4; // eax@5 | |
2940 int v5; // esi@5 | |
2941 int v6; // eax@5 | |
2942 int v7; // esi@6 | |
2943 int v8; // esi@6 | |
2944 int v9; // esi@6 | |
2945 int result; // eax@7 | |
1116 | 2946 |
135 | 2947 switch (classType) |
0 | 2948 { |
1116 | 2949 case PLAYER_CLASS_ROGUE: |
2950 case PLAYER_CLASS_SPY: | |
2951 case PLAYER_CLASS_ASSASSIN: | |
2952 case PLAYER_CLASS_ARCHER: | |
2953 case PLAYER_CLASS_WARRIOR_MAGE: | |
2954 case PLAYER_CLASS_MASTER_ARCHER: | |
2955 case PLAYER_CLASS_SNIPER: | |
2956 case PLAYER_CLASS_SORCERER: | |
2957 case PLAYER_CLASS_WIZARD: | |
2958 case PLAYER_CLASS_ARCHMAGE: | |
2959 case PLAYER_CLASS_LICH: | |
0 | 2960 v2 = GetActualIntelligence(); |
1036 | 2961 v3 = GetParameterBonus(v2); |
1116 | 2962 break; |
2963 case PLAYER_CLASS_INITIATE: | |
2964 case PLAYER_CLASS_MASTER: | |
2965 case PLAYER_CLASS_NINJA: | |
2966 case PLAYER_CLASS_PALADIN: | |
2967 case PLAYER_CLASS_CRUSADER: | |
2968 case PLAYER_CLASS_HERO: | |
2969 case PLAYER_CLASS_VILLIAN: | |
2970 case PLAYER_CLASS_CLERIC: | |
2971 case PLAYER_CLASS_PRIEST: | |
2972 case PLAYER_CLASS_PRIEST_OF_SUN: | |
2973 case PLAYER_CLASS_PRIEST_OF_MOON: | |
0 | 2974 v2 = GetActualWillpower(); |
1036 | 2975 v3 = GetParameterBonus(v2); |
1116 | 2976 break; |
2977 case PLAYER_CLASS_HUNTER: | |
2978 case PLAYER_CLASS_RANGER_LORD: | |
2979 case PLAYER_CLASS_BOUNTY_HUNTER: | |
2980 case PLAYER_CLASS_DRUID: | |
2981 case PLAYER_CLASS_GREAT_DRUID: | |
2982 case PLAYER_CLASS_ARCH_DRUID: | |
2983 case PLAYER_CLASS_WARLOCK: | |
0 | 2984 v4 = GetActualWillpower(); |
1036 | 2985 v5 = GetParameterBonus(v4); |
0 | 2986 v6 = GetActualIntelligence(); |
1036 | 2987 v3 = GetParameterBonus(v6) + v5; |
0 | 2988 break; |
2989 default: | |
1116 | 2990 return 0; |
0 | 2991 break; |
2992 } | |
1116 | 2993 v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3); |
2994 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7; | |
2995 v9 = uFullManaBonus | |
2996 + pBaseManaByClass[classType / 4] | |
2997 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) | |
2998 + v8; | |
2999 return max(0,v9); | |
0 | 3000 } |
3001 | |
3002 //----- (0048E656) -------------------------------------------------------- | |
3003 int Player::GetBaseAC() | |
3004 { | |
3005 Player *v1; // edi@1 | |
3006 int v2; // eax@1 | |
3007 int v3; // esi@1 | |
3008 int v4; // esi@1 | |
3009 int v5; // esi@1 | |
3010 int result; // eax@2 | |
3011 | |
3012 v1 = this; | |
3013 v2 = GetActualSpeed(); | |
1036 | 3014 v3 = GetParameterBonus(v2); |
0 | 3015 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; |
3016 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; | |
3017 if ( v5 >= 1 ) | |
3018 result = v5; | |
3019 else | |
3020 result = 0; | |
3021 return result; | |
3022 } | |
3023 | |
3024 //----- (0048E68F) -------------------------------------------------------- | |
3025 int Player::GetActualAC() | |
3026 { | |
3027 Player *v1; // edi@1 | |
3028 int v2; // eax@1 | |
3029 int v3; // esi@1 | |
3030 int v4; // esi@1 | |
3031 int v5; // esi@1 | |
3032 int v6; // esi@1 | |
3033 int result; // eax@2 | |
3034 | |
3035 v1 = this; | |
3036 v2 = GetActualSpeed(); | |
1036 | 3037 v3 = GetParameterBonus(v2); |
0 | 3038 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; |
3039 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; | |
3040 v6 = v1->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5; | |
3041 if ( v6 >= 1 ) | |
3042 result = v6; | |
3043 else | |
3044 result = 0; | |
3045 return result; | |
3046 } | |
3047 | |
3048 //----- (0048E6DC) -------------------------------------------------------- | |
3049 unsigned int Player::GetBaseAge() | |
3050 { | |
352 | 3051 return ((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year; |
0 | 3052 } |
3053 | |
3054 //----- (0048E72C) -------------------------------------------------------- | |
3055 unsigned int Player::GetActualAge() | |
3056 { | |
3057 return this->sAgeModifier + GetBaseAge(); | |
3058 } | |
3059 | |
3060 //----- (0048E73F) -------------------------------------------------------- | |
3061 int Player::GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3062 { | |
3063 Player *v2; // ebx@1 | |
3064 signed int v3; // esi@1 | |
3065 enum CHARACTER_RACE v4; // eax@1 | |
3066 signed int v5; // edi@8 | |
3067 char v6; // zf@9 | |
3068 int v7; // esi@20 | |
3069 int result; // eax@21 | |
3070 signed int v9; // [sp-4h] [bp-10h]@11 | |
3071 | |
3072 v2 = this; | |
3073 v3 = 0; | |
3074 v4 = GetRace(); | |
3075 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE ) | |
3076 { | |
3077 v5 = 0; | |
3078 goto LABEL_16; | |
3079 } | |
3080 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR ) | |
3081 { | |
3082 v5 = 1; | |
3083 LABEL_16: | |
3084 v6 = v4 == 2; | |
3085 goto LABEL_17; | |
3086 } | |
3087 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER ) | |
3088 { | |
3089 v6 = v4 == 3; | |
3090 v5 = 2; | |
3091 goto LABEL_17; | |
3092 } | |
3093 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH ) | |
3094 { | |
3095 v5 = 3; | |
3096 v6 = v4 == 3; | |
3097 goto LABEL_17; | |
3098 } | |
3099 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_MIND ) | |
3100 { | |
3101 v5 = 7; | |
3102 if ( v4 != 1 ) | |
3103 goto LABEL_20; | |
3104 v9 = 10; | |
3105 LABEL_19: | |
3106 v3 = v9; | |
3107 goto LABEL_20; | |
3108 } | |
3109 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_BODY || a2 == 33 ) | |
3110 { | |
3111 v5 = 8; | |
3112 v6 = v4 == 0; | |
3113 LABEL_17: | |
3114 if ( !v6 ) | |
3115 goto LABEL_20; | |
3116 v9 = 5; | |
3117 goto LABEL_19; | |
3118 } | |
3119 v5 = 0; | |
3120 LABEL_20: | |
3121 v7 = GetItemsBonus(a2, 0) + v3; | |
135 | 3122 if ( v2->classType != PLAYER_CLASS_LICH || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) ) |
0 | 3123 result = v7 + *(&v2->sResFireBase + v5); |
3124 return result; | |
3125 } | |
3126 | |
3127 //----- (0048E7D0) -------------------------------------------------------- | |
3128 int Player::GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3129 { | |
3130 signed int v2; // edi@1 | |
3131 Player *v3; // esi@1 | |
3132 enum CHARACTER_RACE v4; // ebx@1 | |
3133 char v6; // zf@18 | |
3134 int v7; // ebx@28 | |
3135 int result; // eax@28 | |
3136 signed int v9; // [sp+10h] [bp-8h]@1 | |
3137 signed int v10; // [sp+14h] [bp-4h]@1 | |
3138 | |
3139 v2 = 0; | |
3140 v3 = this; | |
3141 v10 = 0; | |
3142 v9 = 0; | |
3143 v4 = GetRace(); | |
652 | 3144 if ( CheckHiredNPCSpeciality(Enchanter) ) |
0 | 3145 v10 = 20; |
3146 if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE | |
3147 || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR | |
3148 || a2 == CHARACTER_ATTRIBUTE_RESIST_WATER | |
3149 || a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH) | |
3150 && SkillToMastery(v3->pActiveSkills[9]) == 4 | |
3151 && HasItemEquipped(EQUIP_ARMOUR) | |
3152 && GetEquippedItemSkillType(EQUIP_ARMOUR) == PLAYER_SKILL_LEATHER ) | |
3153 v10 += v3->pActiveSkills[9] & 0x3F; | |
3154 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE ) | |
3155 goto LABEL_25; | |
3156 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR ) | |
3157 { | |
3158 v2 = 1; | |
3159 LABEL_25: | |
3160 v6 = v4 == 2; | |
3161 LABEL_26: | |
3162 if ( v6 ) | |
3163 v9 = 5; | |
3164 goto LABEL_28; | |
3165 } | |
3166 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER ) | |
3167 { | |
3168 v6 = v4 == 3; | |
3169 v2 = 2; | |
3170 goto LABEL_26; | |
3171 } | |
3172 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH ) | |
3173 { | |
3174 v2 = 3; | |
3175 if ( v4 == 3 ) | |
3176 v10 += 5; | |
3177 } | |
3178 else | |
3179 { | |
3180 if ( a2 != CHARACTER_ATTRIBUTE_RESIST_MIND ) | |
3181 { | |
3182 if ( a2 != CHARACTER_ATTRIBUTE_RESIST_BODY && a2 != 33 ) | |
3183 goto LABEL_28; | |
3184 v2 = 8; | |
3185 v6 = v4 == 0; | |
3186 goto LABEL_26; | |
3187 } | |
3188 v2 = 7; | |
3189 if ( v4 == 1 ) | |
3190 v9 = 10; | |
3191 } | |
3192 LABEL_28: | |
3193 v7 = GetItemsBonus(a2, 0); | |
3194 result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2); | |
135 | 3195 if ( v3->classType == PLAYER_CLASS_LICH ) |
0 | 3196 { |
3197 if ( result > 200 ) | |
3198 result = 200; | |
3199 } | |
3200 return result; | |
3201 } | |
3202 | |
3203 //----- (0048E8F5) -------------------------------------------------------- | |
816 | 3204 bool Player::Recover(int dt) |
3205 { | |
3206 //Player *v2; // esi@1 | |
0 | 3207 signed __int64 v3; // qax@1 |
816 | 3208 //bool result; // eax@4 |
3209 | |
3210 //v2 = this; | |
3211 v3 = (signed __int64)((double)(dt * _48EA46_calc_special_bonus_by_items(17)) * 0.01 + (double)dt); | |
3212 | |
3213 Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery); | |
3214 | |
3215 if (uTimeToRecovery > v3) | |
3216 { | |
3217 uTimeToRecovery -= v3; | |
3218 return true; | |
0 | 3219 } |
3220 else | |
3221 { | |
816 | 3222 uTimeToRecovery = 0; |
3223 viewparams->bRedrawGameUI = true; | |
3224 if (!uActiveCharacter) | |
0 | 3225 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3226 return false; |
3227 } | |
0 | 3228 } |
3229 | |
3230 //----- (0048E96A) -------------------------------------------------------- | |
816 | 3231 void Player::SetRecoveryTime(signed int rec) |
3232 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
821
diff
changeset
|
3233 assert(rec >= 0); |
816 | 3234 |
3235 if (rec > uTimeToRecovery) | |
3236 uTimeToRecovery = rec; | |
3237 | |
3238 if (pPlayers[uActiveCharacter] == this && !some_active_character) | |
0 | 3239 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3240 |
3241 viewparams->bRedrawGameUI = true; | |
0 | 3242 } |
3243 // 50C0C4: using guessed type int some_active_character; | |
3244 | |
3245 //----- (0048E9B7) -------------------------------------------------------- | |
3246 void Player::RandomizeName() | |
3247 { | |
3248 if (!uExpressionTimePassed) | |
3249 strcpy(pName, pNPCStats->pNPCNames[rand() % pNPCStats->uNumNPCNames[uSex]][uSex]); | |
3250 } | |
3251 | |
3252 //----- (0048E9F4) -------------------------------------------------------- | |
3253 unsigned int Player::GetMajorConditionIdx() | |
3254 { | |
3255 for (uint i = 0; i < 18; ++i) | |
3256 if (pConditions[pConditionImportancyTable[i]] != 0) | |
3257 return pConditionImportancyTable[i]; | |
3258 | |
3259 return 18; | |
3260 } | |
3261 | |
3262 //----- (0048EA1B) -------------------------------------------------------- | |
1036 | 3263 int Player::GetParameterBonus( int player_parameter ) |
3264 { | |
3265 int i; // eax@1 | |
3266 i = 0; | |
3267 while (param_to_bonus_table[i]) | |
3268 { | |
3269 if (player_parameter >= param_to_bonus_table[i]) | |
3270 break; | |
3271 ++i; | |
3272 } | |
3273 return parameter_to_bonus_value[i]; | |
0 | 3274 } |
3275 | |
3276 //----- (0048EA46) -------------------------------------------------------- | |
3277 int Player::_48EA46_calc_special_bonus_by_items(int a2) | |
3278 { | |
1032 | 3279 int inv_indx; // eax@3 |
3280 | |
3281 for (int i=EQUIP_OFF_HAND; i<EQUIP_BOOK; ++i ) | |
3282 { | |
3283 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3284 continue; | |
3285 inv_indx = pEquipment.pIndices[i] - 1; | |
3286 if (a2==17) | |
3287 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3288 if ((pInventoryItemList[inv_indx].uSpecEnchantmentType==17)||(pInventoryItemList[inv_indx].uItemID==533)) //Elven Chainmail+Increases rate of Recovery |
1032 | 3289 return 50; |
3290 } | |
3291 if (a2==24) | |
3292 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3293 if (pInventoryItemList[inv_indx].uSpecEnchantmentType==24) //Increased Knockback. |
1032 | 3294 return 5; |
3295 } | |
3296 } | |
3297 return 0; | |
0 | 3298 } |
3299 | |
3300 //----- (0048EAAE) -------------------------------------------------------- | |
3301 int Player::GetItemsBonus(CHARACTER_ATTRIBUTE_TYPE attr, int a3) | |
3302 { | |
3303 CHARACTER_ATTRIBUTE_TYPE v3; // esi@1 | |
1040 | 3304 // signed int v4; // eax@1 |
0 | 3305 int v5; // edi@1 |
3306 Player *v6; // ebx@1 | |
3307 Player *v8; // ecx@48 | |
3308 int v9; // eax@49 | |
3309 int v10; // edx@49 | |
3310 Player *v11; // ecx@55 | |
3311 int v12; // eax@56 | |
3312 int v13; // edx@56 | |
3313 int v14; // ecx@58 | |
3314 int v15; // eax@58 | |
3315 Player *v16; // ecx@61 | |
3316 int v17; // eax@62 | |
3317 Player *v18; // ecx@66 | |
3318 int v19; // eax@67 | |
3319 int v20; // eax@69 | |
3320 Player *v21; // ecx@75 | |
3321 int v22; // eax@76 | |
3322 int v23; // edx@76 | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
3323 //int v24; // eax@79 |
0 | 3324 int v25; // ecx@80 |
3325 int v26; // edi@80 | |
3326 Player *v27; // ecx@84 | |
3327 int v28; // eax@85 | |
3328 int v29; // edx@85 | |
3329 Player *v30; // ecx@96 | |
3330 int v31; // ebp@97 | |
3331 int v32; // eax@98 | |
3332 unsigned int v33; // eax@100 | |
3333 int v34; // eax@103 | |
3334 char v35; // zf@104 | |
3335 char v36; // zf@107 | |
3336 unsigned __int8 v37; // zf@119 | |
3337 char v38; // sf@119 | |
3338 unsigned __int8 v39; // of@119 | |
3339 char v40; // zf@122 | |
3340 char v41; // zf@145 | |
3341 char v42; // zf@164 | |
3342 char v43; // zf@173 | |
3343 char v44; // zf@189 | |
3344 char v45; // zf@198 | |
3345 char v46; // zf@239 | |
3346 int v47; // eax@268 | |
3347 int v48; // eax@269 | |
3348 int v49; // eax@291 | |
3349 char v50; // zf@295 | |
3350 int v51; // eax@306 | |
3351 int v52; // eax@307 | |
3352 char v53; // zf@312 | |
3353 char v54; // zf@336 | |
3354 char v55; // zf@348 | |
3355 int v56; // eax@365 | |
3356 int v57; // ebx@368 | |
3357 signed int v58; // [sp-4h] [bp-20h]@10 | |
3358 signed int v59; // [sp-4h] [bp-20h]@71 | |
3359 signed int v60; // [sp-4h] [bp-20h]@347 | |
3360 int v61; // [sp+10h] [bp-Ch]@1 | |
3361 int v62; // [sp+14h] [bp-8h]@1 | |
3362 int v63; // [sp+18h] [bp-4h]@101 | |
3363 ItemGen *attra; // [sp+20h] [bp+4h]@101 | |
3364 unsigned int v65; // [sp+24h] [bp+8h]@95 | |
1040 | 3365 bool no_skills; |
0 | 3366 |
3367 v3 = attr; | |
3368 v5 = 0; | |
3369 v6 = this; | |
3370 v62 = 0; | |
3371 v61 = 0; | |
3372 | |
1040 | 3373 |
3374 no_skills=false; | |
0 | 3375 switch (attr) |
3376 { | |
1040 | 3377 case CHARACTER_ATTRIBUTE_SKILL_ALCHEMY: v58 = PLAYER_SKILL_ALCHEMY; break; |
3378 case CHARACTER_ATTRIBUTE_SKILL_STEALING: v58 = PLAYER_SKILL_STEALING; break; | |
3379 case CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM: v58 = PLAYER_SKILL_TRAP_DISARM; break; | |
3380 case CHARACTER_ATTRIBUTE_SKILL_ITEM_ID: v58 = PLAYER_SKILL_ITEM_ID; break; | |
3381 case CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID: v58 = PLAYER_SKILL_MONSTER_ID; break; | |
3382 case CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER: v58 = PLAYER_SKILL_ARMSMASTER; break; | |
3383 case CHARACTER_ATTRIBUTE_SKILL_DODGE: v58 = PLAYER_SKILL_DODGE; break; | |
3384 case CHARACTER_ATTRIBUTE_SKILL_UNARMED: v58 = PLAYER_SKILL_UNARMED; break; | |
3385 case CHARACTER_ATTRIBUTE_SKILL_FIRE: v58 = PLAYER_SKILL_FIRE; break; | |
3386 case CHARACTER_ATTRIBUTE_SKILL_AIR: v58 = PLAYER_SKILL_AIR; break; | |
3387 case CHARACTER_ATTRIBUTE_SKILL_WATER: v58 = PLAYER_SKILL_WATER; break; | |
3388 case CHARACTER_ATTRIBUTE_SKILL_EARTH: v58 = PLAYER_SKILL_EARTH; break; | |
3389 case CHARACTER_ATTRIBUTE_SKILL_SPIRIT: v58 = PLAYER_SKILL_SPIRIT; break; | |
3390 case CHARACTER_ATTRIBUTE_SKILL_MIND: v58 = PLAYER_SKILL_MIND; break; | |
3391 case CHARACTER_ATTRIBUTE_SKILL_BODY: v58 = PLAYER_SKILL_BODY; break; | |
3392 case CHARACTER_ATTRIBUTE_SKILL_LIGHT: v58 = PLAYER_SKILL_LIGHT; break; | |
3393 case CHARACTER_ATTRIBUTE_SKILL_DARK: v58 = PLAYER_SKILL_DARK; break; | |
3394 case CHARACTER_ATTRIBUTE_SKILL_MEDITATION: v58 = PLAYER_SKILL_MEDITATION; break; | |
3395 case CHARACTER_ATTRIBUTE_SKILL_BOW: v58 = PLAYER_SKILL_BOW; break; | |
3396 case CHARACTER_ATTRIBUTE_SKILL_SHIELD: v58 = PLAYER_SKILL_SHIELD; break; | |
3397 case CHARACTER_ATTRIBUTE_SKILL_LEARNING: v58 = PLAYER_SKILL_LEARNING; break; | |
3398 default: | |
3399 no_skills=true; | |
0 | 3400 } |
1040 | 3401 if (!no_skills) |
0 | 3402 { |
1040 | 3403 if ( !this->pActiveSkills[v58] ) |
3404 return 0; | |
0 | 3405 } |
1040 | 3406 |
0 | 3407 if ( (signed int)attr > 28 ) |
3408 { | |
3409 if ( (signed int)attr < 29 ) | |
3410 return v5 + v62 + v61; | |
1040 | 3411 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS ) |
0 | 3412 { |
3413 if ( HasItemEquipped(EQUIP_BOW) ) | |
1040 | 3414 v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uBow-1].uItemID].uDamageMod; |
0 | 3415 return v5 + v62 + v61; |
3416 } | |
1040 | 3417 if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MIN ) |
0 | 3418 { |
3419 if ( !HasItemEquipped(EQUIP_BOW) ) | |
3420 return v5 + v62 + v61; | |
1040 | 3421 v57 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID; |
0 | 3422 v5 = pItemsTable->pItems[v57].uDamageMod; |
3423 v56 = pItemsTable->pItems[v57].uDamageDice; | |
1040 | 3424 v5 += v56; |
3425 return v5 + v62 + v61; | |
3426 } | |
3427 if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MAX ) | |
0 | 3428 { |
3429 if ( !HasItemEquipped(EQUIP_BOW) ) | |
3430 return v5 + v62 + v61; | |
1040 | 3431 v20 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID; |
0 | 3432 v5 = pItemsTable->pItems[v20].uDamageDice * pItemsTable->pItems[v20].uDamageRoll; |
3433 LABEL_365: | |
3434 v56 = pItemsTable->pItems[v20].uDamageMod; | |
3435 LABEL_366: | |
3436 v5 += v56; | |
3437 return v5 + v62 + v61; | |
3438 } | |
3439 if ( (signed int)attr <= 33 || (signed int)attr > 46 ) | |
3440 return v5 + v62 + v61; | |
3441 LABEL_95: | |
3442 v65 = 0; | |
3443 while ( 1 ) | |
3444 { | |
3445 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) ) | |
3446 goto LABEL_361; | |
898 | 3447 v31 = *(&v6->pEquipment.uShield + v65) - 1; |
0 | 3448 if ( v3 == 9 ) |
3449 { | |
816 | 3450 v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65); |
0 | 3451 if ( v32 >= 3 ) |
3452 { | |
3453 if ( v32 <= 11 ) | |
3454 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3455 v33 = v6->pInventoryItemList[v31].uItemID; |
0 | 3456 v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; |
3457 } | |
3458 } | |
3459 } | |
3460 v63 = (int)((char *)v6 + 36 * v31); | |
3461 attra = (ItemGen *)(v63 + 532); | |
377 | 3462 if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1 |
3463 && !pItemsTable->IsMaterialSpecial(attra) ) | |
0 | 3464 { |
3465 v34 = attra->uItemID; | |
3466 switch ( attra->uItemID ) | |
3467 { | |
3468 case 0x1F4u: | |
3469 v35 = v3 == 5; | |
3470 goto LABEL_105; | |
3471 case 0x1F5u: | |
3472 v36 = v3 == 0; | |
3473 goto LABEL_108; | |
3474 case 0x1F6u: | |
3475 if ( v3 == 21 ) | |
3476 v61 += 10; | |
3477 v36 = v3 == 2; | |
3478 goto LABEL_108; | |
3479 case 0x1F7u: | |
3480 if ( v3 == 17 ) | |
3481 v61 += 5; | |
3482 if ( v3 == 18 ) | |
3483 v61 += 5; | |
3484 v36 = v3 == 6; | |
3485 goto LABEL_108; | |
3486 case 0x1F8u: | |
3487 goto LABEL_118; | |
3488 case 0x1F9u: | |
3489 v40 = v3 == 3; | |
3490 goto LABEL_123; | |
3491 case 0x1FAu: | |
3492 v35 = v3 == 10; | |
3493 goto LABEL_105; | |
3494 case 0x1FEu: | |
3495 v35 = v3 == 4; | |
3496 goto LABEL_105; | |
3497 case 0x1FFu: | |
3498 if ( v3 == 23 ) | |
3499 v61 += 10; | |
3500 if ( v3 == 22 ) | |
3501 v61 += 10; | |
3502 goto LABEL_361; | |
3503 case 0x200u: | |
3504 if ( v3 == 36 ) | |
3505 { | |
3506 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]); | |
3507 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3508 } | |
3509 v36 = v3 == 5; | |
3510 LABEL_108: | |
3511 if ( v36 ) | |
3512 v5 += 40; | |
3513 goto LABEL_361; | |
3514 case 0x201u: | |
3515 if ( v3 == 39 ) | |
3516 { | |
3517 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
3518 v34 = ((unsigned int)v34 >> 1) & 0x1F; | |
3519 v62 = v34; | |
3520 } | |
3521 goto LABEL_136; | |
3522 case 0x202u: | |
3523 if ( !v3 ) | |
3524 v5 += 150; | |
3525 if ( v3 == 1 ) | |
3526 v5 -= 40; | |
3527 if ( v3 == 2 ) | |
3528 v5 -= 40; | |
3529 goto LABEL_145; | |
3530 case 0x203u: | |
3531 if ( v3 == 42 ) | |
3532 { | |
3533 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); | |
3534 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3535 } | |
3536 if ( v3 == 43 ) | |
3537 v61 += 15; | |
3538 goto LABEL_361; | |
3539 case 0x204u: | |
3540 if ( v3 == 17 ) | |
3541 v61 += 5; | |
3542 if ( v3 == 18 ) | |
3543 v61 += 5; | |
3544 if ( v3 == 6 ) | |
3545 v5 += 50; | |
3546 if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 ) | |
3547 goto LABEL_166; | |
3548 v42 = v3 == 15; | |
3549 goto LABEL_165; | |
3550 case 0x205u: | |
3551 if ( v3 == 18 ) | |
3552 v61 += 5; | |
3553 goto LABEL_361; | |
3554 case 0x206u: | |
3555 if ( !v3 ) | |
3556 v5 += 100; | |
3557 if ( v3 == 3 ) | |
3558 v5 += 100; | |
3559 v43 = v3 == 9; | |
3560 goto LABEL_174; | |
3561 case 0x207u: | |
3562 if ( v3 == 45 ) | |
3563 v61 += 5; | |
3564 if ( v3 == 15 ) | |
3565 v5 -= 10; | |
3566 v42 = v3 == 14; | |
3567 LABEL_165: | |
3568 if ( v42 ) | |
3569 LABEL_166: | |
3570 v5 -= 10; | |
3571 goto LABEL_361; | |
3572 case 0x208u: | |
3573 v35 = v3 == 3; | |
3574 goto LABEL_105; | |
3575 case 0x209u: | |
3576 if ( v3 == 2 ) | |
3577 v5 += 15; | |
3578 if ( !v3 ) | |
3579 v5 += 15; | |
3580 v41 = v3 == 6; | |
3581 goto LABEL_146; | |
3582 case 0x20Au: | |
3583 if ( v3 == 46 ) | |
3584 v61 += 15; | |
3585 v44 = v3 == 3; | |
3586 goto LABEL_190; | |
3587 case 0x20Bu: | |
3588 if ( v3 == 34 ) | |
3589 { | |
3590 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); | |
3591 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3592 } | |
3593 if ( v3 == 12 ) | |
3594 v5 += 50; | |
3595 if ( v3 == 2 ) | |
3596 v5 += 30; | |
3597 v45 = v3 == 9; | |
3598 goto LABEL_199; | |
3599 case 0x20Cu: | |
3600 if ( !v3 ) | |
3601 v5 += 75; | |
3602 goto LABEL_145; | |
3603 case 0x20Du: | |
3604 if ( v3 == 5 ) | |
3605 v5 += 50; | |
3606 if ( v3 == 6 ) | |
3607 v5 += 50; | |
3608 if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 ) | |
3609 goto LABEL_374; | |
3610 v43 = v3 == 15; | |
3611 LABEL_174: | |
3612 if ( v43 ) | |
3613 LABEL_374: | |
3614 v5 -= 15; | |
3615 goto LABEL_361; | |
3616 case 0x20Eu: | |
3617 if ( v3 == 4 ) | |
3618 v5 += 150; | |
3619 if ( v3 == 44 ) | |
3620 v61 += 5; | |
3621 if ( v3 == 9 ) | |
3622 v5 -= 25; | |
3623 goto LABEL_361; | |
3624 case 0x20Fu: | |
3625 if ( v3 == 39 ) | |
3626 { | |
3627 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
3628 v34 = ((unsigned int)v34 >> 1) & 0x1F; | |
3629 v62 = v34; | |
3630 } | |
3631 if ( v3 == 40 ) | |
3632 { | |
3633 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); | |
3634 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3635 } | |
3636 LABEL_145: | |
3637 v41 = v3 == 5; | |
3638 LABEL_146: | |
3639 if ( v41 ) | |
3640 v5 -= 40; | |
3641 goto LABEL_361; | |
3642 case 0x210u: | |
3643 if ( v3 == 38 ) | |
3644 { | |
3645 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); | |
3646 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3647 } | |
3648 if ( !v3 ) | |
3649 v5 += 75; | |
3650 v44 = v3 == 11; | |
3651 LABEL_190: | |
3652 if ( v44 ) | |
3653 v5 -= 50; | |
3654 goto LABEL_361; | |
3655 case 0x211u: | |
3656 if ( v3 == 5 ) | |
3657 v5 += 100; | |
3658 if ( v3 == 4 ) | |
3659 v5 += 50; | |
3660 v35 = v3 == 11; | |
3661 LABEL_105: | |
3662 if ( v35 ) | |
3663 v5 += 50; | |
3664 goto LABEL_361; | |
3665 case 0x212u: | |
3666 if ( v3 == 1 ) | |
3667 v5 -= 20; | |
3668 v45 = v3 == 2; | |
3669 LABEL_199: | |
3670 if ( v45 ) | |
3671 v5 -= 20; | |
3672 goto LABEL_361; | |
3673 case 0x214u: | |
3674 if ( v3 == 1 ) | |
3675 v5 += 15; | |
3676 v46 = v3 == 2; | |
3677 goto LABEL_240; | |
3678 case 0x215u: | |
3679 if ( v3 == 5 ) | |
3680 v5 += 15; | |
3681 v46 = v3 == 4; | |
3682 goto LABEL_240; | |
3683 case 0x216u: | |
3684 if ( v3 == 10 ) | |
3685 v5 += 30; | |
3686 if ( !v3 ) | |
3687 v5 += 15; | |
3688 goto LABEL_315; | |
3689 case 0x217u: | |
3690 if ( v3 == 21 ) | |
3691 v61 += 5; | |
3692 if ( !v3 ) | |
3693 v5 += 15; | |
3694 goto LABEL_253; | |
3695 case 0x218u: | |
3696 goto LABEL_253; | |
3697 default: | |
3698 goto LABEL_361; | |
3699 } | |
3700 goto LABEL_361; | |
3701 } | |
3702 if ( *(int *)(v63 + 536) == v3 + 1 ) | |
3703 { | |
3704 if ( (signed int)v3 >= 0 ) | |
3705 { | |
3706 if ( (signed int)v3 <= 15 ) | |
3707 { | |
3708 v5 += *((int *)v6->pConditions + 9 * v31 + 135); | |
3709 } | |
3710 else | |
3711 { | |
3712 if ( (signed int)v3 <= 23 && v5 < *((int *)v6->pConditions + 9 * v31 + 135) ) | |
3713 v5 = *((int *)v6->pConditions + 9 * v31 + 135); | |
3714 } | |
3715 } | |
3716 goto LABEL_361; | |
3717 } | |
3718 v34 = *(int *)(v63 + 544); | |
3719 if ( v34 > 48 ) | |
3720 { | |
3721 switch ( v34 ) | |
3722 { | |
3723 case 54: | |
3724 goto LABEL_315; | |
3725 case 49: | |
3726 if ( v3 == 6 ) | |
3727 goto LABEL_121; | |
3728 v50 = v3 == 1; | |
3729 goto LABEL_296; | |
3730 case 51: | |
3731 if ( v3 != 5 && v3 != 1 ) | |
3732 goto LABEL_309; | |
3733 goto LABEL_121; | |
3734 case 52: | |
3735 if ( v3 == 3 ) | |
3736 goto LABEL_121; | |
3737 v50 = v3 == 4; | |
3738 goto LABEL_296; | |
3739 case 53: | |
3740 if ( !v3 ) | |
3741 goto LABEL_121; | |
3742 v50 = v3 == 2; | |
3743 goto LABEL_296; | |
3744 case 55: | |
3745 v46 = v3 == 6; | |
3746 goto LABEL_240; | |
3747 case 56: | |
3748 if ( !v3 ) | |
3749 goto LABEL_351; | |
3750 v53 = v3 == 3; | |
3751 goto LABEL_350; | |
3752 case 57: | |
3753 if ( v3 == 1 ) | |
3754 goto LABEL_351; | |
3755 v53 = v3 == 2; | |
3756 goto LABEL_350; | |
3757 case 50: | |
3758 if ( v3 == 10 ) | |
3759 v5 += 30; | |
3760 goto LABEL_361; | |
3761 case 60: | |
3762 if ( v3 != 23 ) | |
3763 goto LABEL_336; | |
3764 if ( v5 >= 3 ) | |
3765 goto LABEL_361; | |
3766 v5 = 3; | |
3767 LABEL_336: | |
3768 v54 = v3 == 22; | |
3769 goto LABEL_345; | |
3770 case 61: | |
3771 if ( v3 != 17 ) | |
3772 goto LABEL_340; | |
3773 if ( v5 >= 3 ) | |
3774 goto LABEL_361; | |
3775 v5 = 3; | |
3776 LABEL_340: | |
3777 v54 = v3 == 18; | |
3778 goto LABEL_345; | |
3779 case 62: | |
3780 if ( v3 != 19 ) | |
3781 goto LABEL_344; | |
3782 if ( v5 >= 3 ) | |
3783 goto LABEL_361; | |
3784 v5 = 3; | |
3785 LABEL_344: | |
3786 v54 = v3 == 20; | |
3787 LABEL_345: | |
3788 if ( !v54 ) | |
3789 goto LABEL_361; | |
3790 if ( v5 >= 3 ) | |
3791 goto LABEL_361; | |
3792 v60 = 3; | |
3793 goto LABEL_360; | |
3794 case 67: | |
3795 v55 = v3 == 18; | |
3796 goto LABEL_357; | |
3797 case 68: | |
3798 v53 = v3 == 9; | |
3799 goto LABEL_350; | |
3800 case 69: | |
3801 if ( v3 == 11 ) | |
3802 v5 += 20; | |
3803 break; | |
3804 case 70: | |
3805 if ( v3 == 12 ) | |
3806 v5 += 10; | |
3807 v55 = v3 == 16; | |
3808 LABEL_357: | |
3809 if ( v55 && v5 < 2 ) | |
3810 { | |
3811 v60 = 2; | |
3812 LABEL_360: | |
3813 v5 = v60; | |
3814 } | |
3815 break; | |
3816 default: | |
3817 goto LABEL_361; | |
3818 } | |
3819 goto LABEL_361; | |
3820 } | |
3821 if ( v34 == 48 ) | |
3822 { | |
3823 if ( v3 == 9 ) | |
3824 v5 += 5; | |
3825 LABEL_315: | |
3826 v46 = v3 == 3; | |
3827 LABEL_240: | |
3828 if ( v46 ) | |
3829 v5 += 15; | |
3830 goto LABEL_361; | |
3831 } | |
3832 if ( v34 > 32 ) | |
3833 { | |
3834 if ( v34 > 44 ) | |
3835 { | |
3836 v51 = v34 - 45; | |
3837 if ( !v51 ) | |
3838 { | |
3839 if ( v3 == 5 ) | |
3840 goto LABEL_351; | |
3841 v53 = v3 == 4; | |
3842 LABEL_350: | |
3843 if ( v53 ) | |
3844 LABEL_351: | |
3845 v5 += 5; | |
3846 goto LABEL_361; | |
3847 } | |
3848 v52 = v51 - 1; | |
3849 if ( !v52 ) | |
3850 { | |
3851 v40 = v3 == 0; | |
3852 LABEL_123: | |
3853 if ( v40 ) | |
3854 v5 += 25; | |
3855 goto LABEL_361; | |
3856 } | |
3857 if ( v52 == 1 ) | |
3858 { | |
3859 LABEL_309: | |
3860 v50 = v3 == 8; | |
3861 goto LABEL_296; | |
3862 } | |
3863 } | |
3864 else | |
3865 { | |
3866 if ( v34 == 44 ) | |
3867 { | |
3868 v50 = v3 == 7; | |
3869 goto LABEL_296; | |
3870 } | |
3871 v34 -= 33; | |
3872 if ( !v34 ) | |
3873 { | |
3874 if ( v3 != 38 ) | |
3875 goto LABEL_361; | |
3876 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); | |
3877 goto LABEL_138; | |
3878 } | |
3879 --v34; | |
3880 if ( !v34 ) | |
3881 { | |
3882 if ( v3 != 36 ) | |
3883 goto LABEL_361; | |
3884 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]); | |
3885 goto LABEL_138; | |
3886 } | |
3887 v49 = v34 - 8; | |
3888 if ( !v49 ) | |
3889 { | |
3890 if ( (signed int)v3 >= 0 && (signed int)v3 <= 15 ) | |
3891 ++v5; | |
3892 goto LABEL_361; | |
3893 } | |
3894 if ( v49 == 1 ) | |
3895 { | |
3896 if ( v3 != 3 && v3 != 7 ) | |
3897 { | |
3898 v50 = v3 == 9; | |
3899 LABEL_296: | |
3900 if ( !v50 ) | |
3901 goto LABEL_361; | |
3902 } | |
3903 LABEL_121: | |
3904 v5 += 10; | |
3905 goto LABEL_361; | |
3906 } | |
3907 } | |
3908 } | |
3909 else | |
3910 { | |
3911 if ( v34 == 32 ) | |
3912 { | |
3913 if ( v3 != 39 ) | |
3914 goto LABEL_361; | |
3915 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
3916 goto LABEL_138; | |
3917 } | |
3918 if ( v34 > 28 ) | |
3919 { | |
3920 v34 -= 29; | |
3921 if ( v34 ) | |
3922 { | |
3923 --v34; | |
3924 if ( v34 ) | |
3925 { | |
3926 --v34; | |
3927 if ( v34 || v3 != 41 ) | |
3928 goto LABEL_361; | |
3929 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[19]); | |
3930 } | |
3931 else | |
3932 { | |
3933 if ( v3 != 34 ) | |
3934 goto LABEL_361; | |
3935 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); | |
3936 } | |
3937 } | |
3938 else | |
3939 { | |
3940 if ( v3 != 37 ) | |
3941 goto LABEL_361; | |
3942 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[15]); | |
3943 } | |
3944 goto LABEL_138; | |
3945 } | |
3946 if ( v34 == 28 ) | |
3947 { | |
3948 LABEL_136: | |
3949 if ( v3 == 42 ) | |
3950 { | |
3951 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); | |
3952 LABEL_138: | |
3953 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3954 goto LABEL_361; | |
3955 } | |
3956 } | |
3957 else | |
3958 { | |
3959 v47 = v34 - 1; | |
3960 if ( v47 ) | |
3961 { | |
3962 v48 = v47 - 1; | |
3963 if ( v48 ) | |
3964 { | |
3965 v34 = v48 - 24; | |
3966 if ( v34 ) | |
3967 { | |
3968 --v34; | |
3969 if ( v34 || v3 != 40 ) | |
3970 goto LABEL_361; | |
3971 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); | |
3972 } | |
3973 else | |
3974 { | |
3975 if ( v3 != 35 ) | |
3976 goto LABEL_361; | |
3977 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[13]); | |
3978 } | |
3979 goto LABEL_138; | |
3980 } | |
3981 LABEL_118: | |
3982 if ( (signed int)v3 < 0 ) | |
3983 goto LABEL_361; | |
3984 v39 = __OFSUB__((int)v3, 6); | |
3985 v37 = v3 == 6; | |
3986 v38 = v3 - 6 < 0; | |
3987 } | |
3988 else | |
3989 { | |
3990 LABEL_253: | |
3991 if ( (signed int)v3 < 10 ) | |
3992 goto LABEL_361; | |
3993 v39 = __OFSUB__((int)v3, 15); | |
3994 v37 = v3 == 15; | |
3995 v38 = v3 - 15 < 0; | |
3996 } | |
3997 if ( (unsigned __int8)(v38 ^ v39) | v37 ) | |
3998 goto LABEL_121; | |
3999 } | |
4000 } | |
4001 LABEL_361: | |
4002 ++v65; | |
4003 if ( (signed int)v65 >= 16 ) | |
4004 return v5 + v62 + v61; | |
4005 } | |
4006 } | |
1040 | 4007 if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MAX ) |
0 | 4008 { |
4009 if ( IsUnarmed() != 1 ) | |
4010 { | |
816 | 4011 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4012 { | |
4013 v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4014 if ( v22 >= 0 ) |
4015 { | |
4016 if ( v22 <= 2 ) | |
4017 { | |
1040 | 4018 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; |
898 | 4019 if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) |
0 | 4020 { |
4021 v26 = pItemsTable->pItems[v23].uDamageRoll; | |
4022 v25 = pItemsTable->pItems[v23].uDamageDice; | |
4023 } | |
4024 else | |
4025 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4026 v25 = pItemsTable->pItems[v23].uDamageRoll; |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4027 v26 = pItemsTable->pItems[v23].uDamageDice + 1; |
0 | 4028 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4029 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26; |
0 | 4030 } |
4031 } | |
4032 } | |
1040 | 4033 |
4034 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) ) | |
4035 { | |
4036 | |
4037 v28 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); | |
4038 if ((v28 < 0) || v28 > 2 ) | |
4039 return v5 + v62 + v61; | |
4040 } | |
1062 | 4041 v15 = pItemsTable->pItems[v23].uDamageMod; |
4042 v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll; | |
1040 | 4043 v5 += v15 + v14; |
1049 | 4044 return v5 + v62 + v61; |
0 | 4045 } |
4046 v59 = 3; | |
4047 LABEL_74: | |
4048 v5 = v59; | |
4049 return v5 + v62 + v61; | |
4050 } | |
4051 if ( (signed int)attr < 0 ) | |
4052 return v5 + v62 + v61; | |
1040 | 4053 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED ) |
0 | 4054 goto LABEL_95; |
1040 | 4055 if ( attr == CHARACTER_ATTRIBUTE_LEVEL ) |
4056 { | |
4057 if ( !Player::HasEnchantedItemEquipped(25) ) | |
4058 return v5 + v62 + v61; | |
4059 v5 = 5; | |
4060 return v5 + v62 + v61; | |
4061 } | |
4062 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_LEVEL ) | |
0 | 4063 return v5 + v62 + v61; |
1040 | 4064 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) |
0 | 4065 { |
4066 if ( IsUnarmed() == 1 ) | |
4067 { | |
4068 v5 = 0; | |
4069 return v5 + v62 + v61; | |
4070 } | |
816 | 4071 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4072 { | |
4073 v17 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4074 if ( v17 >= 0 ) |
4075 { | |
4076 if ( v17 <= 2 ) | |
1040 | 4077 v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uMainHand-1].uItemID].uDamageMod; |
0 | 4078 } |
4079 } | |
865 | 4080 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 ) |
0 | 4081 return v5 + v62 + v61; |
1040 | 4082 v20 = v6->pOwnItems[v6->pEquipment.uShield - 1].uItemID; |
4083 v56 = pItemsTable->pItems[v20].uDamageMod; | |
4084 v5 += v56; | |
4085 return v5 + v62 + v61; | |
4086 } | |
4087 if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MIN ) | |
0 | 4088 { |
4089 if ( IsUnarmed() == 1 ) | |
4090 { | |
4091 v5 = 1; | |
4092 return v5 + v62 + v61; | |
4093 } | |
816 | 4094 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4095 { | |
4096 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4097 if ( v9 >= 0 ) |
4098 { | |
4099 if ( v9 <= 2 ) | |
4100 { | |
1040 | 4101 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice + |
4102 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod; | |
898 | 4103 if ( !v6->pEquipment.uShield ) |
0 | 4104 { |
1040 | 4105 if ( pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) |
0 | 4106 ++v5; |
4107 } | |
4108 } | |
4109 } | |
4110 } | |
1040 | 4111 |
4112 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND)) | |
4113 { | |
4114 v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); | |
4115 if ((v12 < 0) || v12 > 2 ) | |
4116 return v5 + v62 + v61; | |
4117 } | |
4118 v14 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageMod; | |
4119 v15 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageDice; | |
0 | 4120 LABEL_88: |
4121 v5 += v15 + v14; | |
4122 } | |
4123 return v5 + v62 + v61; | |
4124 } | |
4125 | |
4126 //----- (0048F73C) -------------------------------------------------------- | |
4127 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
4128 { | |
4129 int result; // eax@1 | |
4130 int v3; // eax@4 | |
4131 int v4; // ecx@5 | |
4132 | |
4133 switch (a2) | |
4134 { | |
4135 case CHARACTER_ATTRIBUTE_LEVEL: return 0; | |
4136 } | |
4137 | |
4138 result = 0; | |
4139 if ( (signed int)a2 > 10 ) | |
4140 { | |
4141 if ( (signed int)a2 <= 15 ) | |
4142 { | |
4143 switch ( a2 ) | |
4144 { | |
4145 case CHARACTER_ATTRIBUTE_RESIST_BODY: | |
4146 v3 = this->pPlayerBuffs[2].uPower; | |
1167 | 4147 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower; |
0 | 4148 break; |
4149 case CHARACTER_ATTRIBUTE_RESIST_AIR: | |
4150 v3 = this->pPlayerBuffs[0].uPower; | |
1167 | 4151 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower; |
0 | 4152 break; |
4153 case CHARACTER_ATTRIBUTE_RESIST_WATER: | |
4154 v3 = this->pPlayerBuffs[22].uPower; | |
1167 | 4155 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower; |
0 | 4156 break; |
4157 case CHARACTER_ATTRIBUTE_RESIST_EARTH: | |
4158 v3 = this->pPlayerBuffs[3].uPower; | |
1167 | 4159 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower; |
0 | 4160 break; |
4161 default: | |
4162 if ( a2 != 14 ) | |
4163 return result; | |
4164 v3 = this->pPlayerBuffs[9].uPower; | |
1167 | 4165 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower; |
0 | 4166 break; |
4167 } | |
4168 return v4 + v3; | |
4169 } | |
4170 if ( a2 != CHARACTER_ATTRIBUTE_ATTACK ) | |
4171 { | |
4172 if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) | |
4173 { | |
4174 v3 = this->pPlayerBuffs[8].uPower; | |
1167 | 4175 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower; |
0 | 4176 return v4 + v3; |
4177 } | |
4178 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK ) | |
4179 return result; | |
4180 } | |
4181 return this->pPlayerBuffs[1].uPower; | |
4182 } | |
4183 if ( a2 == 10 ) | |
4184 { | |
4185 v3 = this->pPlayerBuffs[5].uPower; | |
1167 | 4186 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower; |
0 | 4187 return v4 + v3; |
4188 } | |
4189 switch ( a2 ) | |
4190 { | |
4191 case CHARACTER_ATTRIBUTE_STRENGTH: | |
4192 v3 = pPlayerBuffs[19].uPower; | |
4193 goto LABEL_5; | |
4194 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
4195 v3 = pPlayerBuffs[17].uPower; | |
4196 goto LABEL_5; | |
4197 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
4198 v3 = pPlayerBuffs[20].uPower; | |
4199 goto LABEL_5; | |
4200 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
4201 v3 = pPlayerBuffs[16].uPower; | |
4202 goto LABEL_5; | |
4203 case CHARACTER_ATTRIBUTE_ACCURACY: | |
4204 v3 = pPlayerBuffs[15].uPower; | |
4205 goto LABEL_5; | |
4206 case CHARACTER_ATTRIBUTE_SPEED: | |
4207 v3 = pPlayerBuffs[21].uPower; | |
4208 goto LABEL_5; | |
4209 case CHARACTER_ATTRIBUTE_LUCK: | |
4210 v3 = pPlayerBuffs[18].uPower; | |
4211 LABEL_5: | |
1167 | 4212 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
0 | 4213 return v4 + v3; |
4214 case CHARACTER_ATTRIBUTE_AC_BONUS: | |
4215 v3 = this->pPlayerBuffs[14].uPower; | |
1167 | 4216 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower; |
0 | 4217 return v4 + v3; |
4218 default: | |
4219 return result; | |
4220 } | |
4221 return result; | |
4222 } | |
4223 | |
4224 //----- (0048F882) -------------------------------------------------------- | |
1008 | 4225 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) |
4226 { | |
1064 | 4227 signed int bonus_value; // esi@1 |
4228 unsigned __int16 skill_value; // ax@126 | |
4229 int result; // al@127 | |
353 | 4230 |
1064 | 4231 bonus_value = 0; |
353 | 4232 switch (uSkillType) |
4233 { | |
4234 case PLAYER_SKILL_MONSTER_ID: | |
4235 { | |
652 | 4236 if ( CheckHiredNPCSpeciality(Hunter) ) |
1064 | 4237 bonus_value = 6; |
652 | 4238 if ( CheckHiredNPCSpeciality(Sage) ) |
1064 | 4239 bonus_value += 6; |
4240 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID, 0); | |
353 | 4241 } |
4242 break; | |
4243 | |
4244 case PLAYER_SKILL_ARMSMASTER: | |
4245 { | |
652 | 4246 if ( CheckHiredNPCSpeciality(Armsmaster) ) |
1064 | 4247 bonus_value = 2; |
652 | 4248 if ( CheckHiredNPCSpeciality(Weaponsmaster) ) |
1064 | 4249 bonus_value += 3; |
4250 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER, 0); | |
353 | 4251 } |
4252 break; | |
4253 | |
4254 case PLAYER_SKILL_STEALING: | |
4255 { | |
652 | 4256 if (CheckHiredNPCSpeciality(Burglar)) |
1064 | 4257 bonus_value = 8; |
4258 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING, 0); | |
353 | 4259 } |
4260 break; | |
4261 | |
4262 | |
4263 case PLAYER_SKILL_ALCHEMY: | |
4264 { | |
652 | 4265 if ( CheckHiredNPCSpeciality(Herbalist) ) |
1064 | 4266 bonus_value = 4; |
652 | 4267 if ( CheckHiredNPCSpeciality(Apothecary) ) |
1064 | 4268 bonus_value += 8; |
4269 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY, 0); | |
353 | 4270 } |
4271 break; | |
4272 | |
4273 case PLAYER_SKILL_LEARNING: | |
4274 { | |
652 | 4275 if ( CheckHiredNPCSpeciality(Teacher) ) |
1064 | 4276 bonus_value = 10; |
652 | 4277 if ( CheckHiredNPCSpeciality(Instructor) ) |
1064 | 4278 bonus_value += 15; |
652 | 4279 if ( CheckHiredNPCSpeciality(Scholar) ) |
1064 | 4280 bonus_value += 5; |
4281 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING, 0); | |
353 | 4282 } |
4283 break; | |
4284 | |
4285 case PLAYER_SKILL_UNARMED: | |
4286 { | |
652 | 4287 if (CheckHiredNPCSpeciality(Monk) ) |
1064 | 4288 bonus_value = 2; |
4289 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 0); | |
353 | 4290 } |
4291 break; | |
4292 | |
4293 case PLAYER_SKILL_DODGE: | |
4294 { | |
652 | 4295 if ( CheckHiredNPCSpeciality(Monk) ) |
1064 | 4296 bonus_value = 2; |
4297 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE, 0); | |
353 | 4298 } |
4299 break; | |
4300 | |
4301 case PLAYER_SKILL_BOW: | |
1064 | 4302 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW, 0); |
353 | 4303 break; |
4304 case PLAYER_SKILL_SHIELD: | |
1064 | 4305 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD, 0); |
353 | 4306 break; |
4307 | |
4308 case PLAYER_SKILL_EARTH: | |
652 | 4309 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4310 bonus_value = 2; |
652 | 4311 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4312 bonus_value += 3; |
652 | 4313 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4314 bonus_value += 4; |
353 | 4315 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4316 bonus_value += 3; |
4317 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH, 0); | |
353 | 4318 break; |
4319 case PLAYER_SKILL_FIRE: | |
652 | 4320 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4321 bonus_value = 2; |
652 | 4322 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4323 bonus_value += 3; |
652 | 4324 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4325 bonus_value += 4; |
353 | 4326 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4327 bonus_value += 3; |
4328 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE, 0); | |
353 | 4329 break; |
4330 case PLAYER_SKILL_AIR: | |
652 | 4331 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4332 bonus_value = 2; |
652 | 4333 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4334 bonus_value += 3; |
652 | 4335 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4336 bonus_value += 4; |
353 | 4337 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4338 bonus_value += 3; |
4339 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR, 0); | |
353 | 4340 break; |
4341 case PLAYER_SKILL_WATER: | |
652 | 4342 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4343 bonus_value = 2; |
652 | 4344 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4345 bonus_value += 3; |
652 | 4346 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4347 bonus_value += 4; |
353 | 4348 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4349 bonus_value += 3; |
4350 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER, 0); | |
353 | 4351 break; |
4352 case PLAYER_SKILL_SPIRIT: | |
652 | 4353 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4354 bonus_value = 2; |
652 | 4355 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4356 bonus_value += 3; |
652 | 4357 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4358 bonus_value += 4; |
4359 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT, 0); | |
353 | 4360 break; |
4361 case PLAYER_SKILL_MIND: | |
652 | 4362 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4363 bonus_value = 2; |
652 | 4364 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4365 bonus_value += 3; |
652 | 4366 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4367 bonus_value += 4; |
4368 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND, 0); | |
353 | 4369 break; |
4370 case PLAYER_SKILL_BODY: | |
652 | 4371 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4372 bonus_value = 2; |
652 | 4373 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4374 bonus_value += 3; |
652 | 4375 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4376 bonus_value += 4; |
4377 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY, 0); | |
353 | 4378 break; |
4379 case PLAYER_SKILL_LIGHT: | |
1064 | 4380 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT, 0); |
353 | 4381 break; |
4382 case PLAYER_SKILL_DARK: | |
4383 { | |
1064 | 4384 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK, 0); |
353 | 4385 } |
4386 break; | |
4387 | |
4388 case PLAYER_SKILL_MERCHANT: | |
4389 { | |
652 | 4390 if ( CheckHiredNPCSpeciality(Trader) ) |
1064 | 4391 bonus_value = 4; |
652 | 4392 if ( CheckHiredNPCSpeciality(Merchant) ) |
1064 | 4393 bonus_value += 6; |
652 | 4394 if ( CheckHiredNPCSpeciality(Gypsy) ) |
1064 | 4395 bonus_value += 3; |
652 | 4396 if ( CheckHiredNPCSpeciality(Duper) ) |
1064 | 4397 bonus_value += 8; |
353 | 4398 } |
4399 break; | |
4400 | |
4401 case PLAYER_SKILL_PERCEPTION: | |
4402 { | |
652 | 4403 if ( CheckHiredNPCSpeciality(Scout) ) |
1064 | 4404 bonus_value = 6; |
652 | 4405 if ( CheckHiredNPCSpeciality(Psychic) ) |
1064 | 4406 bonus_value += 5; |
353 | 4407 } |
4408 break; | |
4409 | |
0 | 4410 case PLAYER_SKILL_ITEM_ID: |
1064 | 4411 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID, 0); |
0 | 4412 break; |
4413 case PLAYER_SKILL_MEDITATION: | |
1064 | 4414 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION, 0); |
353 | 4415 break; |
0 | 4416 case PLAYER_SKILL_TRAP_DISARM: |
353 | 4417 { |
652 | 4418 if ( CheckHiredNPCSpeciality(Tinker) ) |
1064 | 4419 bonus_value = 4; |
652 | 4420 if ( CheckHiredNPCSpeciality(Locksmith) ) |
1064 | 4421 bonus_value += 6; |
652 | 4422 if ( CheckHiredNPCSpeciality(Burglar) ) |
1064 | 4423 bonus_value += 8; |
4424 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 0); | |
353 | 4425 } |
4426 break; | |
4427 } | |
4428 | |
1064 | 4429 skill_value = pActiveSkills[uSkillType]; |
4430 if ( bonus_value + (skill_value & 0x3F) < 60 ) | |
4431 result = bonus_value + skill_value; | |
0 | 4432 else |
1064 | 4433 result = skill_value & 0xFFFC | 0x3C; //al |
0 | 4434 return result; |
4435 } | |
4436 | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4437 |
0 | 4438 //----- (0048FC00) -------------------------------------------------------- |
1538 | 4439 int Player::GetSkillBonus(enum CHARACTER_ATTRIBUTE_TYPE inSkill) //TODO: move the individual implementations to attribute classes once possible |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4440 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4441 int armsMasterBonus; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4442 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4443 armsMasterBonus = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4444 int armmaster_skill = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4445 if ( armmaster_skill > 0 ) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4446 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4447 int multiplier = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4448 if ( inSkill == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4449 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4450 multiplier = GetMultiplierForSkillLevel(armmaster_skill, 0, 0, 1, 2); |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4451 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4452 else if ( inSkill == CHARACTER_ATTRIBUTE_ATTACK ) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4453 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4454 multiplier = GetMultiplierForSkillLevel(armmaster_skill, 0, 1, 1, 2); |
1064 | 4455 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4456 armsMasterBonus = multiplier * (armmaster_skill & 0x3F); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4457 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4458 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4459 switch(inSkill) |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4460 { |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4461 case CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4462 if (HasItemEquipped(EQUIP_BOW)) |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4463 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4464 int bowSkillLevel = GetActualSkillLevel(PLAYER_SKILL_DODGE); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4465 int multiplier = GetMultiplierForSkillLevel(bowSkillLevel, 0, 0, 0, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4466 return multiplier * (bowSkillLevel & 0x3F); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4467 } |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4468 return 0; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4469 break; |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4470 case CHARACTER_ATTRIBUTE_HEALTH: |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4471 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4472 int base_value = pBaseHealthPerLevelByClass[classType]; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4473 int attrib_modif = GetBodybuilding(); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4474 return base_value * attrib_modif; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4475 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4476 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4477 case CHARACTER_ATTRIBUTE_MANA: |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4478 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4479 int base_value = pBaseManaPerLevelByClass[classType]; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4480 int attrib_modif = GetMeditation(); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4481 return base_value * attrib_modif; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4482 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4483 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4484 case CHARACTER_ATTRIBUTE_AC_BONUS: |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4485 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4486 bool wearingArmor = false; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4487 bool wearingLeather = false; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4488 unsigned int ACSum = 0; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4489 |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4490 for (int j = 0; j < 16; ++j) |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4491 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4492 if (pEquipment.pIndices[j] && (!pOwnItems[pEquipment.pIndices[j]].Broken())) |
1538 | 4493 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4494 int curr_item = pOwnItems[pEquipment.pIndices[j] - 1].uItemID; |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4495 PLAYER_SKILL_TYPE itemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[curr_item].uSkillType; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4496 int currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4497 int multiplier = 0; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4498 switch (itemSkillType) |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4499 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4500 case PLAYER_SKILL_STAFF: |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4501 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4502 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4503 case PLAYER_SKILL_SWORD: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4504 case PLAYER_SKILL_SPEAR: |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4505 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 0, 0, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4506 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4507 case PLAYER_SKILL_SHIELD: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4508 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4509 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4510 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4511 case PLAYER_SKILL_LEATHER: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4512 wearingLeather = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4513 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4514 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4515 case PLAYER_SKILL_CHAIN: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4516 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4517 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4518 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4519 case PLAYER_SKILL_PLATE: |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4520 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4521 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4522 break; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4523 } |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4524 ACSum += multiplier * (currArmorSkillLevel & 0x3F); |
1538 | 4525 } |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4526 } |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4527 |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4528 int dodgeSkillLevel = GetActualSkillLevel(PLAYER_SKILL_DODGE); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4529 int dodgeMastery = SkillToMastery(dodgeSkillLevel); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4530 int multiplier = GetMultiplierForSkillLevel(dodgeSkillLevel, 1, 2, 3, 3); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4531 if ( !wearingArmor && (!wearingLeather || dodgeMastery == 4) ) |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4532 { |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4533 ACSum += multiplier * (dodgeSkillLevel & 0x3F); |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4534 } |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4535 return ACSum; |
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
4536 } |
1538 | 4537 break; |
4538 case CHARACTER_ATTRIBUTE_ATTACK: | |
4539 if ( this->IsUnarmed() ) | |
4540 { | |
4541 int unarmedSkill = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
4542 if (!unarmedSkill) | |
4543 { | |
4544 return 0; | |
4545 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4546 int multiplier = GetMultiplierForSkillLevel(unarmedSkill, 0, 1, 2, 2); |
1538 | 4547 return armsMasterBonus + multiplier * (unarmedSkill & 0x3F); |
4548 } | |
4549 for (int i = 0; i < 16; ++i) | |
4550 { | |
4551 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4552 { | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4553 ItemDesc currItem = pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID]; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4554 if ( currItem.uEquipType <= EQUIP_MAIN_HAND) |
1533 | 4555 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4556 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItem.uSkillType; |
1538 | 4557 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
4558 if (currItemSkillType == PLAYER_SKILL_BLASTER) | |
4559 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4560 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); |
1538 | 4561 return multiplier * (currentItemSkillLevel & 0x3F); |
4562 } | |
4563 else if (currItemSkillType == PLAYER_SKILL_STAFF && this->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) | |
4564 { | |
4565 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4566 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 2, 2); |
1538 | 4567 return multiplier * (unarmedSkillLevel & 0x3F) + armsMasterBonus + (currentItemSkillLevel & 0x3F); |
4568 } | |
4569 else | |
4570 { | |
4571 return armsMasterBonus + (currentItemSkillLevel & 0x3F); | |
4572 } | |
4573 } | |
4574 } | |
4575 } | |
4576 return 0; | |
4577 break; | |
4578 | |
4579 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: | |
4580 for (int i = 0; i < 16; i++) | |
4581 { | |
4582 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4583 { | |
4584 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID].uSkillType; | |
4585 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); | |
4586 if ( currentItemSkillType == PLAYER_SKILL_BOW ) | |
4587 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4588 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 1, 1); |
1538 | 4589 return multiplier * (currentItemSkillLevel & 0x3F); |
4590 } | |
4591 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) | |
4592 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4593 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); |
1538 | 4594 return multiplier * (currentItemSkillLevel & 0x3F); |
4595 } | |
4596 } | |
4597 } | |
4598 return 0; | |
4599 break; | |
4600 | |
4601 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: | |
4602 if ( this->IsUnarmed() ) | |
4603 { | |
4604 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
4605 if ( !unarmedSkillLevel ) | |
4606 { | |
4607 return 0; | |
4608 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4609 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 4610 return multiplier * (unarmedSkillLevel & 0x3F); |
4611 } | |
4612 for (int i = 0; i < 16; i++) | |
4613 { | |
4614 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4615 { | |
4616 int currItemId = this->pInventoryItemList[this->pEquipment.pIndices[i]].uItemID; | |
4617 if ( pItemsTable->pItems[currItemId].uEquipType == EQUIP_MAIN_HAND || pItemsTable->pItems[currItemId].uEquipType == EQUIP_OFF_HAND ) | |
4618 { | |
4619 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemId].uSkillType; | |
4620 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); | |
4621 int baseSkillBonus; | |
4622 int multiplier; | |
4623 switch (currItemSkillType) | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4624 { |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4625 case PLAYER_SKILL_STAFF: |
1538 | 4626 if ( SkillToMastery(currItemSkillLevel) >= 4 && this->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4627 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4628 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4629 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 4630 return multiplier * (unarmedSkillLevel & 0x3F); |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4631 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4632 else |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4633 { |
1538 | 4634 return armsMasterBonus; |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4635 } |
1538 | 4636 break; |
4637 | |
4638 case PLAYER_SKILL_DAGGER: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4639 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 1); |
1538 | 4640 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
4641 return armsMasterBonus + baseSkillBonus; | |
4642 break; | |
4643 case PLAYER_SKILL_SWORD: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4644 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 0); |
1538 | 4645 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
4646 return armsMasterBonus + baseSkillBonus; | |
4647 break; | |
4648 case PLAYER_SKILL_MACE: | |
4649 case PLAYER_SKILL_SPEAR: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4650 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 1, 1, 1); |
1538 | 4651 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
4652 return armsMasterBonus + baseSkillBonus; | |
4653 break; | |
4654 case PLAYER_SKILL_AXE: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4655 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 1, 1); |
1538 | 4656 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
4657 return armsMasterBonus + baseSkillBonus; | |
4658 break; | |
1535 | 4659 } |
1533 | 4660 } |
1535 | 4661 } |
1538 | 4662 } |
4663 return 0; | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4664 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4665 default: |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4666 return 0; |
1533 | 4667 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4668 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4669 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
4670 unsigned int Player::GetMultiplierForSkillLevel(unsigned int skillValue, int mult1, int mult2, int mult3, int mult4) |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4671 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4672 int masteryLvl = SkillToMastery(skillValue); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4673 switch (masteryLvl) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4674 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4675 case 1: return mult1; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4676 case 2: return mult2; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4677 case 3: return mult3; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4678 case 4: return mult4; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4679 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4680 assert(false); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4681 return 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4682 } |
0 | 4683 //----- (00490109) -------------------------------------------------------- |
4684 // faces are: 0 1 2 3 human males | |
4685 // 4 5 6 7 human females | |
4686 // 8 9 elf males | |
4687 // 10 11 elf females | |
4688 // 12 13 dwarf males | |
4689 // 14 15 dwarf females | |
4690 // 16 17 goblin males | |
4691 // 18 19 goblin females | |
4692 // 20 lich male | |
4693 // 21 lich female | |
4694 // 22 underwater suits (unused) | |
4695 // 23 zombie male | |
4696 // 24 zombie female | |
4697 enum CHARACTER_RACE Player::GetRace() | |
4698 { | |
1014 | 4699 if ( uCurrentFace > 15 ) |
4700 { | |
4701 if ( uCurrentFace >= 16 && uCurrentFace <= 19 ) | |
0 | 4702 return CHARACTER_RACE_GOBLIN; |
4703 } | |
4704 else | |
4705 { | |
1014 | 4706 if ( uCurrentFace >= 12 ) |
0 | 4707 { |
4708 return CHARACTER_RACE_DWARF; | |
4709 } | |
4710 else | |
4711 { | |
1014 | 4712 |
4713 if ( uCurrentFace <= 7 ) | |
0 | 4714 { |
4715 return CHARACTER_RACE_HUMAN; | |
4716 } | |
4717 else | |
4718 { | |
1014 | 4719 if ( uCurrentFace <= 11 ) |
0 | 4720 return CHARACTER_RACE_ELF; |
4721 } | |
4722 } | |
4723 } | |
4724 return CHARACTER_RACE_HUMAN; | |
4725 } | |
4726 | |
4727 //----- (00490141) -------------------------------------------------------- | |
187 | 4728 PLAYER_SEX Player::GetSexByVoice() |
0 | 4729 { |
4730 signed int result; // eax@1 | |
4731 | |
4732 result = 0; | |
4733 switch ( this->uVoiceID ) | |
4734 { | |
4735 case 0u: | |
4736 case 1u: | |
4737 case 2u: | |
4738 case 3u: | |
4739 case 8u: | |
4740 case 9u: | |
4741 case 0xCu: | |
4742 case 0xDu: | |
4743 case 0x10u: | |
4744 case 0x11u: | |
4745 case 0x14u: | |
4746 case 0x17u: | |
187 | 4747 return SEX_MALE; |
4748 | |
0 | 4749 case 4u: |
4750 case 5u: | |
4751 case 6u: | |
4752 case 7u: | |
4753 case 0xAu: | |
4754 case 0xBu: | |
4755 case 0xEu: | |
4756 case 0xFu: | |
4757 case 0x12u: | |
4758 case 0x13u: | |
4759 case 0x15u: | |
4760 case 0x18u: | |
187 | 4761 return SEX_FEMALE; |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4762 } |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4763 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4764 return SEX_MALE; |
0 | 4765 } |
4766 | |
4767 //----- (00490188) -------------------------------------------------------- | |
4768 void Player::SetInitialStats() | |
4769 { | |
4770 auto v1 = GetRace(); | |
290 | 4771 uMight = StatTable[v1][0].uBaseValue; |
4772 uIntelligence = StatTable[v1][1].uBaseValue; | |
4773 uWillpower = StatTable[v1][2].uBaseValue; | |
4774 uEndurance = StatTable[v1][3].uBaseValue; | |
4775 uAccuracy = StatTable[v1][4].uBaseValue; | |
4776 uSpeed = StatTable[v1][5].uBaseValue; | |
4777 uLuck = StatTable[v1][6].uBaseValue; | |
0 | 4778 } |
4779 | |
4780 //----- (004901FC) -------------------------------------------------------- | |
1021 | 4781 void Player::SetSexByVoice() |
4782 { | |
4783 switch ( this->uVoiceID) | |
0 | 4784 { |
4785 case 0: | |
4786 case 1: | |
4787 case 2: | |
4788 case 3: | |
4789 case 8: | |
4790 case 9: | |
4791 case 0xC: | |
4792 case 0xD: | |
4793 case 0x10: | |
4794 case 0x11: | |
4795 case 0x14: | |
4796 case 0x17: | |
1021 | 4797 this->uSex = SEX_MALE; |
0 | 4798 break; |
4799 case 4: | |
4800 case 5: | |
4801 case 6: | |
4802 case 7: | |
4803 case 0xA: | |
4804 case 0xB: | |
4805 case 0xE: | |
4806 case 0xF: | |
4807 case 0x12: | |
4808 case 0x13: | |
4809 case 0x15: | |
4810 case 0x18: | |
1021 | 4811 this->uSex = SEX_FEMALE; |
0 | 4812 break; |
4813 default: | |
4814 break; | |
4815 } | |
1021 | 4816 |
0 | 4817 } |
4818 | |
4819 //----- (0049024A) -------------------------------------------------------- | |
135 | 4820 void Player::Reset(PLAYER_CLASS_TYPE cls) |
0 | 4821 { |
4822 sLevelModifier = 0; | |
4823 sAgeModifier = 0; | |
4824 | |
135 | 4825 classType = cls; |
0 | 4826 uLuckBonus = 0; |
4827 uSpeedBonus = 0; | |
4828 uAccuracyBonus = 0; | |
4829 uEnduranceBonus = 0; | |
4830 uWillpowerBonus = 0; | |
4831 uIntelligenceBonus = 0; | |
4832 uMightBonus = 0; | |
4833 uLevel = 1; | |
4834 uExperience = 251 + rand() % 100; | |
4835 uBirthYear = 1147 - rand() % 6; | |
4836 memset(pActiveSkills, 0, sizeof(pActiveSkills)); | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
4837 memset(_achieved_awards_bits, 0, 64); |
0 | 4838 memset(&spellbook, 0, sizeof(PlayerSpells)); |
4839 | |
4840 for (uint i = 0; i < 37; ++i) | |
4841 { | |
135 | 4842 if (pSkillAvailabilityPerClass[classType / 4][i] != 2) |
0 | 4843 continue; |
4844 | |
4845 pActiveSkills[i] = 1; | |
4846 | |
4847 switch (i) | |
4848 { | |
886 | 4849 case PLAYER_SKILL_FIRE: |
4850 spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;//its temporary, for test spells | |
894 | 4851 |
4852 extern bool all_magic; | |
4853 if ( all_magic == true ) | |
4854 { | |
4855 pActiveSkills[PLAYER_SKILL_AIR] = 1; | |
4856 pActiveSkills[PLAYER_SKILL_WATER] = 1; | |
4857 pActiveSkills[PLAYER_SKILL_EARTH] = 1; | |
4858 spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; | |
4859 spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; | |
4860 spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; | |
4861 spellbook.pFireSpellbook.bIsSpellAvailable[4] = true; | |
4862 spellbook.pFireSpellbook.bIsSpellAvailable[5] = true; | |
4863 spellbook.pFireSpellbook.bIsSpellAvailable[6] = true; | |
4864 spellbook.pFireSpellbook.bIsSpellAvailable[7] = true; | |
4865 spellbook.pFireSpellbook.bIsSpellAvailable[8] = true; | |
4866 spellbook.pFireSpellbook.bIsSpellAvailable[9] = true; | |
4867 spellbook.pFireSpellbook.bIsSpellAvailable[10] = true; | |
886 | 4868 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; |
569 | 4869 spellbook.pAirSpellbook.bIsSpellAvailable[1] = true; |
4870 spellbook.pAirSpellbook.bIsSpellAvailable[2] = true; | |
4871 spellbook.pAirSpellbook.bIsSpellAvailable[3] = true; | |
4872 spellbook.pAirSpellbook.bIsSpellAvailable[4] = true; | |
4873 spellbook.pAirSpellbook.bIsSpellAvailable[5] = true; | |
4874 spellbook.pAirSpellbook.bIsSpellAvailable[6] = true; | |
4875 spellbook.pAirSpellbook.bIsSpellAvailable[7] = true; | |
4876 spellbook.pAirSpellbook.bIsSpellAvailable[8] = true; | |
4877 spellbook.pAirSpellbook.bIsSpellAvailable[9] = true; | |
4878 spellbook.pAirSpellbook.bIsSpellAvailable[10] = true; | |
4879 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
4880 spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true; | |
4881 spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true; | |
4882 spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true; | |
4883 spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true; | |
4884 spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true; | |
710 | 4885 spellbook.pWaterSpellbook.bIsSpellAvailable[6] = true; |
4886 spellbook.pWaterSpellbook.bIsSpellAvailable[7] = true; | |
4887 spellbook.pWaterSpellbook.bIsSpellAvailable[8] = true; | |
886 | 4888 spellbook.pWaterSpellbook.bIsSpellAvailable[9] = true; |
4889 spellbook.pWaterSpellbook.bIsSpellAvailable[10] = true; | |
894 | 4890 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; |
4891 spellbook.pEarthSpellbook.bIsSpellAvailable[1] = true; | |
4892 spellbook.pEarthSpellbook.bIsSpellAvailable[2] = true; | |
4893 spellbook.pEarthSpellbook.bIsSpellAvailable[3] = true; | |
4894 spellbook.pEarthSpellbook.bIsSpellAvailable[4] = true; | |
4895 spellbook.pEarthSpellbook.bIsSpellAvailable[5] = true; | |
4896 spellbook.pEarthSpellbook.bIsSpellAvailable[6] = true; | |
4897 spellbook.pEarthSpellbook.bIsSpellAvailable[7] = true; | |
4898 spellbook.pEarthSpellbook.bIsSpellAvailable[8] = true; | |
4899 spellbook.pEarthSpellbook.bIsSpellAvailable[9] = true; | |
4900 spellbook.pEarthSpellbook.bIsSpellAvailable[10] = true; | |
4901 } | |
486 | 4902 break; |
886 | 4903 case PLAYER_SKILL_AIR: |
4904 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; | |
4905 break; | |
4906 case PLAYER_SKILL_WATER: | |
4907 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
4908 break; | |
4909 case PLAYER_SKILL_EARTH: | |
4910 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; | |
4911 break; | |
4912 case PLAYER_SKILL_SPIRIT: | |
4913 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; | |
4914 break; | |
4915 case PLAYER_SKILL_MIND: | |
4916 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; | |
4917 break; | |
4918 case PLAYER_SKILL_BODY: | |
4919 spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; | |
894 | 4920 |
4921 if ( all_magic == true ) | |
4922 { | |
4923 pActiveSkills[PLAYER_SKILL_MIND] = 1; | |
4924 pActiveSkills[PLAYER_SKILL_SPIRIT] = 1; | |
4925 spellbook.pBodySpellbook.bIsSpellAvailable[1] = true; | |
4926 spellbook.pBodySpellbook.bIsSpellAvailable[2] = true; | |
4927 spellbook.pBodySpellbook.bIsSpellAvailable[3] = true; | |
4928 spellbook.pBodySpellbook.bIsSpellAvailable[4] = true; | |
4929 spellbook.pBodySpellbook.bIsSpellAvailable[5] = true; | |
4930 spellbook.pBodySpellbook.bIsSpellAvailable[6] = true; | |
4931 spellbook.pBodySpellbook.bIsSpellAvailable[7] = true; | |
4932 spellbook.pBodySpellbook.bIsSpellAvailable[8] = true; | |
4933 spellbook.pBodySpellbook.bIsSpellAvailable[9] = true; | |
4934 spellbook.pBodySpellbook.bIsSpellAvailable[10] = true; | |
924 | 4935 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; |
894 | 4936 spellbook.pMindSpellbook.bIsSpellAvailable[1] = true; |
4937 spellbook.pMindSpellbook.bIsSpellAvailable[2] = true; | |
4938 spellbook.pMindSpellbook.bIsSpellAvailable[3] = true; | |
4939 spellbook.pMindSpellbook.bIsSpellAvailable[4] = true; | |
4940 spellbook.pMindSpellbook.bIsSpellAvailable[5] = true; | |
4941 spellbook.pMindSpellbook.bIsSpellAvailable[6] = true; | |
4942 spellbook.pMindSpellbook.bIsSpellAvailable[7] = true; | |
4943 spellbook.pMindSpellbook.bIsSpellAvailable[8] = true; | |
4944 spellbook.pMindSpellbook.bIsSpellAvailable[9] = true; | |
4945 spellbook.pMindSpellbook.bIsSpellAvailable[10] = true; | |
924 | 4946 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; |
894 | 4947 spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true; |
4948 spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true; | |
4949 spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true; | |
4950 spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true; | |
4951 spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true; | |
4952 spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true; | |
4953 spellbook.pSpiritSpellbook.bIsSpellAvailable[7] = true; | |
4954 spellbook.pSpiritSpellbook.bIsSpellAvailable[8] = true; | |
4955 spellbook.pSpiritSpellbook.bIsSpellAvailable[9] = true; | |
4956 spellbook.pSpiritSpellbook.bIsSpellAvailable[10] = true; | |
4957 } | |
569 | 4958 break; |
886 | 4959 case PLAYER_SKILL_LIGHT: |
4960 spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; | |
4961 break; | |
4962 case PLAYER_SKILL_DARK: | |
4963 spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; | |
4964 break; | |
0 | 4965 } |
4966 } | |
4967 | |
4968 sHealth = GetMaxHealth(); | |
4969 sMana = GetMaxMana(); | |
4970 } | |
4971 | |
4972 //----- (004903C9) -------------------------------------------------------- | |
821 | 4973 PLAYER_SKILL_TYPE Player::GetSkillIdxByOrder(signed int order) |
4974 { | |
1271
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4975 int counter; // edx@5 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4976 bool canBeInactive; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4977 unsigned char requiredValue; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4978 signed int offset; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4979 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4980 if ( order <= 1 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4981 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4982 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4983 requiredValue = 2; // 2 - primary skill |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4984 offset = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4985 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4986 else if ( order <= 3 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4987 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4988 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4989 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4990 offset = 2; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4991 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4992 else if ( order <= 12 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4993 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4994 canBeInactive = true; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4995 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4996 offset = 4; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4997 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4998 else |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4999 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5000 return (PLAYER_SKILL_TYPE)37; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5001 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5002 counter = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5003 for (int i = 0; i < 37; i++) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5004 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5005 if ( (this->pActiveSkills[i] || canBeInactive) && pSkillAvailabilityPerClass[classType / 4][i] == requiredValue ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5006 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5007 if ( counter == order - offset ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5008 return (PLAYER_SKILL_TYPE)i; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5009 ++counter; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5010 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5011 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5012 |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
5013 return (PLAYER_SKILL_TYPE)37; |
0 | 5014 } |
5015 | |
5016 | |
5017 | |
5018 //----- (0049048D) -------------------------------------------------------- | |
5019 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) | |
5020 void Player::DecreaseAttribute(int eAttribute) | |
5021 { | |
5022 int v2; // eax@1 | |
5023 int pBaseValue; // ecx@1 | |
5024 int pDroppedStep; // ebx@1 | |
5025 int pStep; // esi@1 | |
5026 unsigned __int16 result; // ax@7 | |
5027 int uMinValue; // [sp+Ch] [bp-4h]@1 | |
5028 | |
5029 v2 = eAttribute + 7 * GetRace(); | |
290 | 5030 pBaseValue = StatTable[0][v2].uBaseValue; |
5031 pDroppedStep = StatTable[0][v2].uDroppedStep; | |
0 | 5032 uMinValue = pBaseValue - 2; |
290 | 5033 pStep = StatTable[0][v2].uBaseStep; |
1272 | 5034 unsigned short* AttrToChange = nullptr; |
5035 switch ( eAttribute ) | |
5036 { | |
5037 case CHARACTER_ATTRIBUTE_STRENGTH: | |
5038 AttrToChange = &this->uMight; | |
5039 break; | |
5040 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
5041 AttrToChange = &this->uIntelligence; | |
5042 break; | |
5043 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
5044 AttrToChange = &this->uWillpower; | |
5045 break; | |
5046 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
5047 AttrToChange = &this->uEndurance; | |
5048 break; | |
5049 case CHARACTER_ATTRIBUTE_ACCURACY: | |
5050 AttrToChange = &this->uAccuracy; | |
5051 break; | |
5052 case CHARACTER_ATTRIBUTE_SPEED: | |
5053 AttrToChange = &this->uSpeed; | |
5054 break; | |
5055 case CHARACTER_ATTRIBUTE_LUCK: | |
5056 AttrToChange = &this->uLuck; | |
5057 break; | |
5058 } | |
5059 if ( *AttrToChange <= pBaseValue ) | |
5060 pStep = pDroppedStep; | |
5061 if ( *AttrToChange - pStep >= uMinValue ) | |
5062 *AttrToChange -= pStep; | |
0 | 5063 } |
5064 | |
5065 //----- (004905F5) -------------------------------------------------------- | |
1458 | 5066 //signed int PartyCreation_BtnPlusClick(Player *this, int eAttribute) |
1273 | 5067 void Player::IncreaseAttribute( int eAttribute ) |
5068 { | |
5069 int raceId; // eax@1 | |
5070 int maxValue; // ebx@1 | |
5071 signed int baseStep; // edi@1 | |
5072 signed int tmp; // eax@17 | |
0 | 5073 signed int result; // eax@18 |
1273 | 5074 int baseValue; // [sp+Ch] [bp-8h]@1 |
5075 signed int droppedStep; // [sp+10h] [bp-4h]@1 | |
5076 unsigned short* statToChange; | |
5077 | |
5078 raceId = GetRace(); | |
5079 maxValue = StatTable[raceId][eAttribute].uMaxValue; | |
5080 baseStep = StatTable[raceId][eAttribute].uBaseStep; | |
5081 baseValue = StatTable[raceId][eAttribute].uBaseValue; | |
5082 droppedStep = StatTable[raceId][eAttribute].uDroppedStep; | |
5083 PlayerCreation_GetUnspentAttributePointCount(); | |
5084 switch ( eAttribute ) | |
5085 { | |
5086 case 0: | |
5087 statToChange = &this->uMight; | |
5088 break; | |
5089 case 1: | |
5090 statToChange = &this->uIntelligence; | |
5091 break; | |
5092 case 2: | |
5093 statToChange = &this->uWillpower; | |
5094 break; | |
5095 case 3: | |
5096 statToChange = &this->uEndurance; | |
5097 break; | |
5098 case 4: | |
5099 statToChange = &this->uAccuracy; | |
5100 break; | |
5101 case 5: | |
5102 statToChange = &this->uSpeed; | |
5103 break; | |
5104 case 6: | |
5105 statToChange = &this->uLuck; | |
5106 default: | |
5107 assert(false); | |
5108 return; | |
5109 break; | |
5110 } | |
5111 if ( *statToChange < baseValue ) | |
5112 { | |
5113 tmp = baseStep; | |
5114 baseStep = droppedStep; | |
5115 droppedStep = tmp; | |
5116 } | |
5117 result = PlayerCreation_GetUnspentAttributePointCount(); | |
5118 if ( result >= droppedStep ) | |
5119 { | |
5120 if ( baseStep + *statToChange <= maxValue ) | |
5121 *statToChange += baseStep; | |
5122 } | |
0 | 5123 } |
5124 | |
5125 //----- (0049070F) -------------------------------------------------------- | |
5126 void Player::Zero() | |
5127 { | |
5128 this->sLevelModifier = 0; | |
5129 this->sACModifier = 0; | |
5130 this->uLuckBonus = 0; | |
5131 this->uAccuracyBonus = 0; | |
5132 this->uSpeedBonus = 0; | |
5133 this->uEnduranceBonus = 0; | |
5134 this->uWillpowerBonus = 0; | |
5135 this->uIntelligenceBonus = 0; | |
5136 this->uMightBonus = 0; | |
5137 this->field_100 = 0; | |
5138 this->field_FC = 0; | |
5139 this->field_F8 = 0; | |
5140 this->field_F4 = 0; | |
5141 this->field_F0 = 0; | |
5142 this->field_EC = 0; | |
5143 this->field_E8 = 0; | |
5144 this->field_E4 = 0; | |
5145 this->field_E0 = 0; | |
766 | 5146 memset(&this->sResFireBonus, 0, 0x16u); |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5147 this->field_1A97 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5148 this->_ranged_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5149 this->field_1A95 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5150 this->_ranged_atk_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5151 this->field_1A93 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5152 this->_melee_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5153 this->field_1A91 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5154 this->_some_attack_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5155 this->_mana_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5156 this->uFullManaBonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5157 this->_health_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5158 this->uFullHealthBonus = 0; |
0 | 5159 } |
5160 | |
5161 //----- (004907E7) -------------------------------------------------------- | |
299 | 5162 unsigned int Player::GetStatColor(int uStat) |
0 | 5163 { |
290 | 5164 int attribute_value; // edx@1 |
1393 | 5165 |
5166 int base_attribute_value = StatTable[GetRace()][uStat].uBaseValue; | |
0 | 5167 switch (uStat) |
5168 { | |
5169 case 0: attribute_value = uMight; break; | |
5170 case 1: attribute_value = uIntelligence; break; | |
5171 case 2: attribute_value = uWillpower; break; | |
5172 case 3: attribute_value = uEndurance; break; | |
290 | 5173 case 4: attribute_value = uAccuracy; break; |
5174 case 5: attribute_value = uSpeed; break; | |
0 | 5175 case 6: attribute_value = uLuck; break; |
5176 }; | |
5177 | |
1393 | 5178 if (attribute_value == base_attribute_value) |
5179 return ui_character_stat_default_color; | |
5180 else if (attribute_value > base_attribute_value) | |
5181 return ui_character_stat_buffed_color; | |
0 | 5182 else |
1393 | 5183 return ui_character_stat_debuffed_color; |
0 | 5184 } |
5185 | |
5186 //----- (004908A8) -------------------------------------------------------- | |
5187 bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime) | |
5188 { | |
1014 | 5189 if ( pConditions[uCondition] && (uTime < pConditions[uCondition]) ) |
5190 { | |
1393 | 5191 pConditions[uCondition] = 0i64; |
1014 | 5192 return true; |
0 | 5193 } |
5194 else | |
1014 | 5195 return false; |
0 | 5196 } |
5197 | |
5198 //----- (004680ED) -------------------------------------------------------- | |
1019 | 5199 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) |
1021 | 5200 { |
5201 Player *v3; // esi@1 | |
5202 signed int v5; // eax@17 | |
5203 int v8; // edx@39 | |
5204 char *v13; // eax@45 | |
5205 signed int v15; // edi@68 | |
5206 int v16; // edx@73 | |
5207 unsigned __int16 v17; // edi@73 | |
5208 unsigned int v18; // eax@73 | |
5209 const char *v22; // eax@84 | |
5210 int scroll_id; // esi@96 | |
5211 int v25; // eax@109 | |
5212 int v26; // eax@113 | |
5213 int new_mana_val; // edi@114 | |
5214 signed __int64 v28; // qax@120 | |
5215 __int64 v30; // edi@137 | |
5216 __int64 v32; // ST3C_4@137 | |
5217 __int64 v34; // ST34_4@137 | |
5218 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 | |
5219 const char *v66; // [sp-4h] [bp-30h]@69 | |
5220 signed int v67; // [sp-4h] [bp-30h]@77 | |
5221 const char *v68; // [sp-4h] [bp-30h]@89 | |
5222 char v72; // [sp+20h] [bp-Ch]@68 | |
5223 signed int v73; // [sp+24h] [bp-8h]@1 | |
1032 | 5224 char* v74; // [sp+24h] [bp-8h]@23 |
1021 | 5225 Player *thisb; // [sp+28h] [bp-4h]@1 |
5226 unsigned int thisa; // [sp+28h] [bp-4h]@22 | |
5227 | |
5228 thisb = this; | |
5229 v3 = &pParty->pPlayers[player_num-1]; | |
5230 v73 = 1; | |
1340 | 5231 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3) ) |
1021 | 5232 return; |
5233 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) | |
0 | 5234 { |
1021 | 5235 if ( pParty->pPickedItem.uItemID == 160 ) |
5236 { | |
5237 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); | |
5238 } | |
5239 else if ( pParty->pPickedItem.uItemID == 161 ) | |
1019 | 5240 { |
1021 | 5241 new_mana_val = v3->sMana; |
5242 new_mana_val += 2; | |
5243 if ( new_mana_val > v3->GetMaxMana() ) | |
5244 new_mana_val = v3->GetMaxMana(); | |
5245 v3->PlaySound(SPEECH_36, 0); | |
5246 } | |
5247 else if ( pParty->pPickedItem.uItemID == 162 ) | |
5248 { | |
5249 pParty->pPlayers[player_num-1].Heal(2); | |
1019 | 5250 v3->PlaySound(SPEECH_36, 0); |
1021 | 5251 |
5252 } | |
5253 else | |
5254 { | |
5255 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5256 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5257 ShowStatusBarString(pTmpBuf.data(), 2); |
1021 | 5258 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
5259 return; | |
1019 | 5260 } |
1032 | 5261 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0); |
5262 | |
5263 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
5264 { | |
5265 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
5266 } | |
5267 if ( v73 ) | |
5268 { | |
5269 if ( pParty->bTurnBasedModeOn ) | |
5270 { | |
5271 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
5272 thisb->SetRecoveryTime(100); | |
1448 | 5273 pTurnEngine->ApplyPlayerAction(); |
1032 | 5274 } |
5275 else | |
5276 { | |
5277 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
5278 } | |
5279 } | |
5280 pMouse->RemoveHoldingItem(); | |
5281 return; | |
5282 | |
1021 | 5283 |
5284 } | |
5285 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) | |
0 | 5286 { |
1021 | 5287 switch ( pParty->pPickedItem.uItemID ) |
5288 { | |
5289 case 221: //Catalyst | |
5290 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); | |
5291 break; | |
5292 case 222: //Cure Wounds | |
5293 v25 = pParty->pPickedItem.uEnchantmentType + 10; | |
5294 pParty->pPlayers[player_num-1].Heal(v25); | |
5295 v3->PlaySound(SPEECH_36, 0); | |
5296 break; | |
5297 case 223: //Magic Potion | |
5298 v26 = pParty->pPickedItem.uEnchantmentType + 10; | |
5299 new_mana_val = v3->sMana; | |
5300 new_mana_val += v26; | |
5301 if ( new_mana_val > v3->GetMaxMana() ) | |
5302 new_mana_val = v3->GetMaxMana(); | |
5303 v3->PlaySound(SPEECH_36, 0); | |
5304 break; | |
5305 case 224: //Cure Weakness | |
5306 v3->pConditions[Condition_Weak] = 0i64; | |
5307 v3->PlaySound(SPEECH_36, 0); | |
5308 break; | |
5309 case 225: //Cure Disease | |
5310 v3->pConditions[Condition_Disease3] = 0i64; | |
5311 v3->pConditions[Condition_Disease2] = 0i64; | |
5312 v3->pConditions[Condition_Disease1] = 0i64; | |
5313 v3->PlaySound(SPEECH_36, 0); | |
5314 break; | |
5315 case 226: //Cure Poison | |
5316 v3->pConditions[Condition_Poison3] = 0i64; | |
5317 v3->pConditions[Condition_Poison2] = 0i64; | |
5318 v3->pConditions[Condition_Poison1] = 0i64; | |
5319 v3->PlaySound(SPEECH_36, 0); | |
5320 break; | |
5321 case 227: //Awaken | |
5322 v3->pConditions[Condition_Sleep] = 0i64; | |
5323 v3->PlaySound(SPEECH_36, 0); | |
5324 break; | |
5325 case 228: //Haste | |
5326 if ( !v3->pConditions[Condition_Weak] ) | |
5327 { | |
5328 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5329 v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5330 v3->PlaySound(SPEECH_36, 0); | |
5331 } | |
5332 break; | |
5333 case 229: //Heroism | |
5334 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5335 v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5336 v3->PlaySound(SPEECH_36, 0); | |
5337 break; | |
5338 case 230: //Bless | |
5339 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5340 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5341 v3->PlaySound(SPEECH_36, 0); | |
5342 break; | |
5343 case 231: //Preservation | |
1032 | 5344 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5345 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5346 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5347 v3->PlaySound(SPEECH_36, 0); | |
5348 break; | |
5349 case 232: //Shield | |
1032 | 5350 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5351 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5352 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5353 v3->PlaySound(SPEECH_36, 0); | |
5354 break; | |
5355 case 234: //Stoneskin | |
5356 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5357 v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5358 v3->PlaySound(SPEECH_36, 0); | |
5359 break; | |
5360 case 235: //Water Breathing | |
5361 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), | |
5362 v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); | |
5363 break; | |
5364 case 237: //Remove Fear | |
5365 v3->pConditions[Condition_Fear] = 0i64; | |
5366 v3->PlaySound(SPEECH_36, 0); | |
5367 break; | |
5368 case 238: //Remove Curse | |
5369 v3->pConditions[Condition_Cursed] = 0i64; | |
5370 v3->PlaySound(SPEECH_36, 0); | |
5371 break; | |
5372 case 239: //Cure Insanity | |
5373 v3->pConditions[Condition_Insane] = 0i64; | |
5374 v3->PlaySound(SPEECH_36, 0); | |
5375 break; | |
5376 case 240: //Might Boost | |
1032 | 5377 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5378 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5379 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5380 v3->PlaySound(SPEECH_36, 0); | |
5381 break; | |
5382 case 241: //Intellect Boost | |
1032 | 5383 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5384 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5385 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5386 v3->PlaySound(SPEECH_36, 0); | |
5387 break; | |
5388 case 242: //Personality Boost | |
1032 | 5389 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5390 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5391 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5392 v3->PlaySound(SPEECH_36, 0); | |
5393 break; | |
5394 case 243://Endurance Boost | |
1032 | 5395 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5396 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5397 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5398 v3->PlaySound(SPEECH_36, 0); | |
5399 break; | |
5400 case 244: //Speed Boost | |
1032 | 5401 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5402 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5403 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5404 v3->PlaySound(SPEECH_36, 0); | |
5405 break; | |
5406 case 245: //Accuracy Boost | |
1032 | 5407 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5408 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5409 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5410 v3->PlaySound(SPEECH_36, 0); | |
5411 break; | |
5412 case 251: //Cure Paralysis | |
5413 v3->pConditions[Condition_Paralyzed] = 0i64; | |
5414 v3->PlaySound(SPEECH_36, 0); | |
5415 break; | |
5416 case 252://Divine Restoration | |
5417 v30 = v3->pConditions[Condition_Dead]; | |
5418 v32 = v3->pConditions[Condition_Pertified]; | |
5419 v34 = v3->pConditions[Condition_Eradicated]; | |
5420 memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions)); | |
5421 v3->pConditions[Condition_Dead] = v30; | |
5422 v3->pConditions[Condition_Pertified] = v32; | |
5423 v3->pConditions[Condition_Eradicated] = v34; | |
5424 v3->PlaySound(SPEECH_36, 0); | |
5425 break; | |
5426 case 253: //Divine Cure | |
5427 v25 = 5 * pParty->pPickedItem.uEnchantmentType; | |
5428 pParty->pPlayers[player_num-1].Heal(v25); | |
5429 v3->PlaySound(SPEECH_36, 0); | |
5430 break; | |
5431 case 254: //Divine Power | |
5432 v26 = 5 * pParty->pPickedItem.uEnchantmentType; | |
5433 new_mana_val = v3->sMana; | |
5434 new_mana_val += v26; | |
5435 if ( new_mana_val > v3->GetMaxMana() ) | |
5436 new_mana_val = v3->GetMaxMana(); | |
5437 v3->PlaySound(SPEECH_36, 0); | |
5438 break; | |
5439 case 255: //Luck Boost | |
1032 | 5440 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5441 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5442 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5443 v3->PlaySound(SPEECH_36, 0); | |
5444 break; | |
5445 case 256: //Fire Resistance | |
1032 | 5446 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5447 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5448 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5449 v3->PlaySound(SPEECH_36, 0); | |
1032 | 5450 break; |
1021 | 5451 case 257: //Air Resistance |
1032 | 5452 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5453 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5454 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5455 v3->PlaySound(SPEECH_36, 0); | |
5456 break; | |
5457 case 258: //Water Resistance | |
1032 | 5458 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5459 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5460 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5461 v3->PlaySound(SPEECH_36, 0); | |
5462 break; | |
5463 case 259: //Earth Resistance | |
1032 | 5464 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5465 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5466 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5467 v3->PlaySound(SPEECH_36, 0); | |
5468 break; | |
5469 case 260: //Mind Resistance | |
1032 | 5470 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5471 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5472 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5473 v3->PlaySound(SPEECH_36, 0); | |
5474 break; | |
5475 case 261: //Body Resistance | |
1032 | 5476 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5477 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5478 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5479 v3->PlaySound(SPEECH_36, 0); | |
5480 break; | |
5481 case 262: //Stone to Flesh | |
5482 v3->pConditions[Condition_Pertified] = 0i64; | |
5483 v3->PlaySound(SPEECH_36, 0); | |
5484 break; | |
5485 case 264: //Pure Luck | |
5486 if ( !v3->pure_luck_used ) | |
5487 { | |
5488 v3->uLuck += 50; | |
5489 v3->pure_luck_used = 1; | |
5490 } | |
5491 v3->PlaySound(SPEECH_36, 0); | |
5492 break; | |
5493 case 265: //Pure Speed | |
5494 if ( !v3->pure_speed_used ) | |
5495 { | |
5496 v3->uSpeed += 50; | |
5497 v3->pure_speed_used = 1; | |
5498 } | |
5499 v3->PlaySound(SPEECH_36, 0); | |
5500 break; | |
5501 case 266: //Pure Intellect | |
5502 if ( !v3->pure_intellect_used ) | |
5503 { | |
5504 v3->uIntelligence += 50; | |
5505 v3->pure_intellect_used = 1; | |
5506 } | |
5507 v3->PlaySound(SPEECH_36, 0); | |
5508 break; | |
5509 case 267: //Pure Endurance | |
5510 if ( !v3->pure_endurance_used ) | |
5511 { | |
5512 v3->uEndurance += 50; | |
5513 v3->pure_endurance_used = 1; | |
5514 } | |
5515 v3->PlaySound(SPEECH_36, 0); | |
5516 break; | |
5517 case 268: //Pure Personality | |
5518 if ( !v3->pure_willpower_used ) | |
5519 { | |
5520 v3->uWillpower += 50; | |
5521 v3->pure_willpower_used = 1; | |
5522 } | |
5523 v3->PlaySound(SPEECH_36, 0); | |
5524 break; | |
5525 case 269: //Pure Accuracy | |
5526 if ( !v3->pure_accuracy_used ) | |
5527 { | |
5528 v3->uAccuracy += 50; | |
5529 v3->pure_accuracy_used = 1; | |
5530 } | |
5531 v3->PlaySound(SPEECH_36, 0); | |
5532 break; | |
5533 case 270: //Pure Might | |
5534 if ( !v3->pure_might_used ) | |
5535 { | |
5536 v3->uMight += 50; | |
5537 v3->pure_might_used = 1; | |
5538 } | |
5539 v3->PlaySound(SPEECH_36, 0); | |
5540 break; | |
5541 case 271: //Rejuvenation | |
5542 v3->sAgeModifier = 0; | |
5543 v3->PlaySound(SPEECH_36, 0); | |
5544 break; | |
5545 | |
5546 default: | |
5547 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5548 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5549 ShowStatusBarString(pTmpBuf.data(), 2u); |
1021 | 5550 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
5551 return; | |
1032 | 5552 } |
5553 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0); | |
5554 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
5555 { | |
5556 if ( !v73 ) | |
5557 { | |
5558 pMouse->RemoveHoldingItem(); | |
5559 return; | |
5560 } | |
5561 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1021 | 5562 } |
1032 | 5563 if ( v73 ) |
5564 { | |
5565 if ( pParty->bTurnBasedModeOn ) | |
5566 { | |
5567 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
5568 thisb->SetRecoveryTime(100); | |
1448 | 5569 pTurnEngine->ApplyPlayerAction(); |
1032 | 5570 } |
5571 else | |
5572 { | |
5573 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
5574 } | |
5575 } | |
5576 pMouse->RemoveHoldingItem(); | |
5577 return; | |
5578 | |
1021 | 5579 } |
5580 | |
5581 | |
5582 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL ) | |
5583 { | |
5584 | |
5585 | |
5586 if ( pCurrentScreen == SCREEN_CASTING ) | |
5587 return; | |
5588 if ( !pParty->pPlayers[player_num-1].CanAct() ) | |
5589 { | |
5590 | |
5591 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5592 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5593 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5594 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5595 return; |
5596 } | |
5597 if ( bUnderwater == 1 ) | |
5598 { | |
1032 | 5599 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2u);//"You can not do that while you are underwater!" |
5600 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
1021 | 5601 return; |
5602 } | |
5603 dword_50C9AC = 1; | |
5604 scroll_id = pParty->pPickedItem.uItemID - 299; | |
5605 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura | |
5606 { | |
5607 pMouse->RemoveHoldingItem(); | |
5608 pGUIWindow_CurrentMenu->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
5609 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
1021 | 5610 pCurrentScreen = SCREEN_GAME; |
5611 viewparams->bRedrawGameUI = 1; | |
5612 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0); | |
5613 } | |
5614 else | |
5615 { | |
5616 _720984_unused = pParty->pPickedItem.uItemID; | |
5617 pMouse->RemoveHoldingItem(); | |
5618 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); | |
5619 if ( pCurrentScreen && pGUIWindow_CurrentMenu | |
5620 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)) | |
5621 { | |
5622 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
5623 } | |
5624 } | |
5625 return; | |
5626 } | |
5627 | |
5628 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_BOOK ) | |
5629 | |
5630 { | |
5631 v15 = pParty->pPickedItem.uItemID - 400; | |
5632 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; | |
5633 if ( v72 ) | |
5634 { | |
5635 v66 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5636 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5637 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5638 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5639 return; |
5640 } | |
5641 if ( !pParty->pPlayers[player_num-1].CanAct() ) | |
5642 { | |
5643 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5644 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5645 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5646 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5647 return; |
5648 } | |
5649 v16 = v15 % 11 + 1; | |
5650 v17 = v3->pActiveSkills[v15 / 11 + 12]; | |
5651 v18 = SkillToMastery(v17) - 1; | |
1032 | 5652 switch (v18) |
5653 { | |
5654 case 0: v67 = 4; break; | |
5655 case 1: v67 = 7; break; | |
5656 case 2: v67 = 10; break; | |
5657 case 3: v67 = 11; break; | |
5658 default: | |
5659 v67 = player_num; | |
5660 } | |
5661 | |
5662 if ( v16 > v67 || !v17 ) | |
1021 | 5663 { |
1032 | 5664 v22 = pParty->pPickedItem.GetDisplayName(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5665 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5666 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5667 v3->PlaySound((PlayerSpeech)20, 0); |
5668 return; | |
5669 } | |
5670 // v72 = 1; | |
5671 v3->PlaySound(SPEECH_21, 0); | |
5672 v73 = 0; | |
5673 | |
5674 | |
5675 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
5676 { | |
5677 if ( !v73 ) | |
1021 | 5678 { |
1032 | 5679 pMouse->RemoveHoldingItem(); |
5680 return; | |
5681 } | |
5682 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
5683 } | |
5684 if ( v73 ) | |
5685 { | |
5686 if ( pParty->bTurnBasedModeOn ) | |
5687 { | |
5688 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
5689 thisb->SetRecoveryTime(100); | |
1448 | 5690 pTurnEngine->ApplyPlayerAction(); |
1021 | 5691 } |
5692 else | |
5693 { | |
1032 | 5694 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
1021 | 5695 } |
5696 } | |
1032 | 5697 pMouse->RemoveHoldingItem(); |
5698 return; | |
5699 | |
1021 | 5700 } |
5701 | |
5702 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL ) | |
5703 | |
5704 { | |
5705 if ( pParty->pPlayers[player_num-1].CanAct() ) | |
5706 { | |
5707 CreateMsgScrollWindow(pParty->pPickedItem.uItemID); | |
1032 | 5708 v3->PlaySound(SPEECH_37, 0); |
1021 | 5709 return; |
5710 } | |
5711 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5712 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5713 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5714 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5715 return; |
5716 } | |
5717 else | |
1459 | 5718 { |
5719 if (pParty->pPickedItem.uItemID == 616) //Genie Lamp | |
5720 { | |
1021 | 5721 thisa = pParty->uCurrentMonthWeek + 1; |
5722 if ( pParty->uCurrentMonth >= 7 ) | |
1032 | 5723 v74 = NULL; |
1021 | 5724 else |
5725 v74 = aAttributeNames[pParty->uCurrentMonth]; | |
5726 switch ( pParty->uCurrentMonth ) | |
5727 { | |
1019 | 5728 case 0: |
1021 | 5729 v3->uMight += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5730 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5731 break; |
1019 | 5732 case 1: |
1021 | 5733 v3->uIntelligence += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5734 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5735 break; |
1019 | 5736 case 2: |
1021 | 5737 v3->uWillpower += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5738 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5739 break; |
1019 | 5740 case 3: |
1021 | 5741 v3->uEndurance += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5742 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5743 break; |
1019 | 5744 case 4: |
1021 | 5745 v3->uAccuracy += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5746 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5747 break; |
1019 | 5748 case 5: |
1021 | 5749 v3->uSpeed += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5750 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5751 break; |
1019 | 5752 case 6: |
1021 | 5753 v3->uLuck += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5754 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 5755 break; |
1019 | 5756 case 7: |
1021 | 5757 party_finds_gold(1000 * thisa, 0); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5758 sprintf(pTmpBuf.data(), "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold" |
1021 | 5759 break; |
1019 | 5760 case 8: |
1021 | 5761 Party::GiveFood(5 * thisa); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5762 sprintf(pTmpBuf.data(), "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food" |
1021 | 5763 break; |
0 | 5764 case 9u: |
1021 | 5765 v3->uSkillPoints += 2 * thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5766 sprintf(pTmpBuf.data(), "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]); |
1021 | 5767 break; |
1019 | 5768 case 10: |
1021 | 5769 v3->uExperience += 2500 * thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5770 sprintf(pTmpBuf.data(), "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]); |
1021 | 5771 break; |
1019 | 5772 case 11: |
1021 | 5773 v8 = rand() % 6; |
5774 switch (v8) | |
5775 { | |
5776 case 0: | |
5777 v3->sResFireBase += thisa; | |
5778 v13 = pGlobalTXT_LocalizationStrings[87]; | |
5779 break; | |
5780 case 1: | |
5781 v3->sResAirBase += thisa; | |
5782 v13 = pGlobalTXT_LocalizationStrings[6]; | |
5783 break; | |
5784 case 2: | |
5785 v3->sResWaterBase += thisa; | |
5786 v13 = pGlobalTXT_LocalizationStrings[240]; | |
5787 break; | |
5788 case 3: | |
5789 v3->sResEarthBase += thisa; | |
5790 v13 = pGlobalTXT_LocalizationStrings[70]; | |
5791 break; | |
5792 case 4: | |
5793 v3->sResMindBase += thisa; | |
5794 v13 = pGlobalTXT_LocalizationStrings[142]; | |
5795 break; | |
5796 case 5: | |
5797 v3->sResBodyBase += thisa; | |
5798 v13 = pGlobalTXT_LocalizationStrings[29]; | |
1019 | 5799 break; |
1021 | 5800 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5801 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]); |
1021 | 5802 break; |
5803 | |
5804 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5805 ShowStatusBarString(pTmpBuf.data(), 2u); |
1021 | 5806 pMouse->RemoveHoldingItem(); |
1459 | 5807 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); |
1021 | 5808 v3->PlaySound(SPEECH_93, 0); |
1032 | 5809 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5810 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) |
0 | 5811 { |
1021 | 5812 v3->SetCondition(Condition_Eradicated, 0); |
5813 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
0 | 5814 } |
1021 | 5815 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) |
5816 { | |
5817 v3->SetCondition(Condition_Dead, 0); | |
5818 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
5819 } | |
5820 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) | |
5821 { | |
5822 v3->SetCondition(Condition_Pertified, 0); | |
5823 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
5824 } | |
1019 | 5825 return; |
1021 | 5826 } |
5827 else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple | |
1459 | 5828 { |
1021 | 5829 Party::GiveFood(1u); |
1459 | 5830 pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0); |
5831 } | |
1021 | 5832 else if ( pParty->pPickedItem.uItemID == 632 ) //Lute |
5833 { | |
1459 | 5834 pAudioPlayer->PlaySound(SOUND_PlayLute, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5835 return; |
5836 } | |
5837 else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes | |
5838 { | |
1459 | 5839 pAudioPlayer->PlaySound(SOUND_PlayFaeriePipes, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5840 return; |
5841 } | |
5842 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet | |
5843 { | |
1459 | 5844 pAudioPlayer->PlaySound(SOUND_PlayGryphonheartsTrumpet, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5845 return; |
5846 } | |
1032 | 5847 else if ( pParty->pPickedItem.uItemID == 646 ) //Horseshoe |
1459 | 5848 { |
5849 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); | |
5850 v5 = PID(OBJECT_Player, player_num + 49); | |
1021 | 5851 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); |
5852 v3->AddVariable(VAR_NumSkillPoints, 2); | |
5853 } | |
5854 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle | |
5855 { | |
1459 | 5856 TeleportToNWCDungeon(); |
1021 | 5857 return; |
5858 } | |
0 | 5859 else |
1021 | 5860 { |
5861 | |
5862 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5863 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way" |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5864 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5865 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5866 return; |
5867 } | |
1032 | 5868 |
0 | 5869 pMouse->RemoveHoldingItem(); |
5870 return; | |
5871 } | |
1021 | 5872 |
5873 } | |
0 | 5874 |
5875 //----- (00449BB4) -------------------------------------------------------- | |
484 | 5876 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue ) |
1033 | 5877 { |
0 | 5878 Player *v3; // esi@1 |
5879 signed int v4; // edi@1 | |
5880 unsigned int v5; // eax@8 | |
5881 int v6; // eax@9 | |
5882 enum CHARACTER_RACE v7; // eax@11 | |
5883 signed int v8; // eax@17 | |
5884 unsigned __int8 v9; // sf@17 | |
5885 unsigned __int8 v10; // of@17 | |
5886 int v11; // eax@19 | |
5887 unsigned int v12; // eax@20 | |
484 | 5888 unsigned int test_bit_value; // eax@25 |
5889 unsigned __int8 our_bit_value; // cl@25 | |
0 | 5890 signed int v15; // ecx@28 |
5891 ItemGen *v16; // eax@28 | |
5892 char v17; // zf@31 | |
5893 int v18; // edi@90 | |
5894 DDM_DLV_Header *v19; // eax@122 | |
5895 char v20; // cl@124 | |
5896 DDM_DLV_Header *v21; // eax@126 | |
5897 unsigned int v22; // edi@129 | |
100 | 5898 Player *v23; // esi@134 |
0 | 5899 ItemGen *v24; // ecx@135 |
5900 signed int v25; // edx@135 | |
5901 ITEM_EQUIP_TYPE v26; // ebx@155 | |
5902 char *v27; // edi@155 | |
5903 int v28; // ebx@161 | |
5904 int v29; // eax@161 | |
5905 | |
469 | 5906 v6 = 0; |
0 | 5907 v3 = this; |
5908 v4 = -1; | |
469 | 5909 if ( VarNum > VAR_AutoNotes ) |
5910 { | |
5911 switch ( VarNum ) | |
0 | 5912 { |
5913 case VAR_Invisible: | |
1167 | 5914 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 ) |
469 | 5915 return true; |
484 | 5916 return false; |
0 | 5917 case VAR_NumDeaths: |
5918 v4 = pParty->uNumDeaths; | |
469 | 5919 return v4 >= pValue; |
0 | 5920 case VAR_NumBounties: |
5921 v4 = pParty->uNumBountiesCollected; | |
469 | 5922 return v4 >= pValue; |
0 | 5923 case VAR_PrisonTerms: |
5924 v4 = pParty->uNumPrisonTerms; | |
469 | 5925 return v4 >= pValue; |
0 | 5926 case VAR_ArenaWinsPage: |
5927 v4 = (unsigned __int8)pParty->uNumArenaPageWins; | |
469 | 5928 return v4 >= pValue; |
0 | 5929 case VAR_ArenaWinsSquire: |
5930 v4 = (unsigned __int8)pParty->uNumArenaSquireWins; | |
469 | 5931 return v4 >= pValue; |
0 | 5932 case VAR_ArenaWinsKnight: |
5933 v4 = (unsigned __int8)pParty->uNumArenaKnightWins; | |
469 | 5934 return v4 >= pValue; |
0 | 5935 case VAR_ArenaWinsLord: |
5936 v4 = (unsigned __int8)pParty->uNumArenaLordWins; | |
469 | 5937 return v4 >= pValue; |
0 | 5938 case VAR_ReputationInCurrentLocation: |
5939 v19 = &pOutdoor->ddm; | |
5940 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5941 v19 = &pIndoor->dlv; | |
469 | 5942 v6 = v19->uReputation >= pValue; |
5943 return v6; | |
0 | 5944 case VAR_History_28|VAR_Sex: |
5945 v21 = &pOutdoor->ddm; | |
5946 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5947 v21 = &pIndoor->dlv; | |
469 | 5948 v6 = v21->field_C_alert == pValue; |
0 | 5949 return v6; |
5950 case VAR_MonthEquals2|VAR_Sex: | |
5951 case VAR_MonthEquals2|VAR_Class: | |
5952 case VAR_Counter1: | |
5953 case VAR_Counter2: | |
5954 case VAR_Counter3: | |
5955 case VAR_Counter4: | |
5956 case VAR_Counter5: | |
5957 case VAR_Counter6: | |
5958 case VAR_Counter7: | |
5959 case VAR_Counter8: | |
469 | 5960 v22 = *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304]; |
5961 if ( v22 | *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300] | |
5962 && (signed __int64)(__PAIR__(v22, *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]) | |
5963 + (signed __int64)((double)(460800 * pValue) * 0.033333335)) <= (signed __int64)pParty->uTimePlayed ) | |
5964 return true; | |
5965 return false; | |
0 | 5966 case VAR_NumSkillPoints: |
5967 v4 = this->uSkillPoints; | |
469 | 5968 return v4 >= pValue; |
0 | 5969 case VAR_CircusPrises: |
5970 v4 = 0; | |
100 | 5971 v23 = pParty->pPlayers;//[0].pInventoryItems; |
0 | 5972 do |
5973 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
5974 v24 = v23->pInventoryItemList; |
0 | 5975 v25 = 138; |
5976 do | |
5977 { | |
5978 switch ( v24->uItemID ) | |
5979 { | |
5980 case 0x1D6u: | |
5981 ++v4; | |
5982 break; | |
5983 case 0x1D7u: | |
5984 v4 += 3; | |
5985 break; | |
5986 case 0x1DDu: | |
5987 v4 += 5; | |
5988 break; | |
5989 } | |
5990 ++v24; | |
5991 --v25; | |
5992 } | |
5993 while ( v25 ); | |
100 | 5994 ++v23; |
0 | 5995 } |
100 | 5996 while ( v23 <= &pParty->pPlayers[3] ); |
469 | 5997 return v4 >= pValue; |
0 | 5998 case VAR_MonthEquals2: |
469 | 5999 v6 = pParty->uCurrentMonth == pValue; |
6000 return v6; | |
0 | 6001 case VAR_IsFlying: |
6002 if ( pParty->bFlying | |
1167 | 6003 && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) ) |
469 | 6004 return true; |
6005 return false; | |
0 | 6006 case VAR_HiredNPCHasSpeciality: |
469 | 6007 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue); |
0 | 6008 return v6; |
6009 case VAR_NPCs2: | |
469 | 6010 return pNPCStats->pNewNPCData[pValue].Hired(); |
0 | 6011 case VAR_MonthEquals|VAR_CurrentSP: |
1033 | 6012 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
6013 our_bit_value = this->field_1A50[((signed __int16)pValue - 1)/8]; | |
484 | 6014 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
469 | 6015 return v4 >= pValue; |
6016 v4 = pValue; | |
6017 return v4 >= pValue; | |
0 | 6018 case VAR_ItemEquipped: |
6019 v26 = (ITEM_EQUIP_TYPE)0; | |
6020 v27 = (char *)&this->pEquipment; | |
6021 break; | |
6022 case VAR_GoldInBank: | |
6023 v4 = pParty->uNumGoldInBank; | |
469 | 6024 return v4 >= pValue; |
0 | 6025 case VAR_ThieverySkill|0x80: |
6026 v28 = GetActualMight(); | |
6027 v29 = v3->GetBaseStrength(); | |
6028 goto LABEL_168; | |
6029 case VAR_DisarmTrapSkill|0x80: | |
6030 v28 = GetActualIntelligence(); | |
6031 v29 = v3->GetBaseIntelligence(); | |
6032 goto LABEL_168; | |
6033 case VAR_MonthEquals: | |
6034 v28 = GetActualWillpower(); | |
6035 v29 = v3->GetBaseWillpower(); | |
6036 goto LABEL_168; | |
6037 case VAR_MonthEquals|VAR_Sex: | |
6038 v28 = GetActualEndurance(); | |
6039 v29 = v3->GetBaseEndurance(); | |
6040 goto LABEL_168; | |
6041 case VAR_IdentifyMonsterSkill|0x80: | |
6042 v28 = GetActualSpeed(); | |
6043 v29 = v3->GetBaseSpeed(); | |
6044 goto LABEL_168; | |
6045 case VAR_ArmsmasterSkill|0x80: | |
6046 v28 = GetActualAccuracy(); | |
6047 v29 = v3->GetBaseAccuracy(); | |
6048 goto LABEL_168; | |
6049 case VAR_MonthEquals|VAR_MaxHP: | |
6050 v28 = GetActualLuck(); | |
6051 v29 = v3->GetBaseLuck(); | |
6052 LABEL_168: | |
6053 v10 = __OFSUB__(v28, v29); | |
6054 v9 = v28 - v29 < 0; | |
6055 LABEL_169: | |
6056 if ( v9 ^ v10 ) | |
469 | 6057 return v4 >= pValue; |
6058 return true; | |
0 | 6059 default: |
469 | 6060 return v4 >= pValue; |
0 | 6061 } |
6062 while ( !v3->HasItemEquipped(v26) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6063 || *(int *)&v3->pInventoryItemList[*(int *)v27-1] != pValue ) |
0 | 6064 { |
6065 v26 = (ITEM_EQUIP_TYPE)((int)v26 + 1); | |
6066 v27 += 4; | |
6067 if ( (signed int)v26 >= 16 ) | |
469 | 6068 return false; |
6069 } | |
6070 return true; | |
6071 } | |
6072 if ( VarNum == VAR_AutoNotes ) | |
0 | 6073 { |
1033 | 6074 test_bit_value = 0x80u >> ((signed __int16)(pValue - 1) - 1) % 8; |
6075 our_bit_value = pParty->_autonote_bits[((signed __int16)(pValue - 1) - 1) /8]; | |
484 | 6076 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
6077 return false; | |
6078 return true; | |
469 | 6079 } |
6080 if ( VarNum <= VAR_BaseLuck ) | |
6081 { | |
6082 if ( VarNum != VAR_BaseLuck ) | |
6083 { | |
6084 switch ( VarNum ) | |
0 | 6085 { |
6086 case VAR_Hour: | |
469 | 6087 if ( (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == pValue ) |
6088 return true; | |
6089 return false; | |
0 | 6090 case VAR_DayOfYear: |
469 | 6091 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 0x150 + 1; |
6092 v6 = v5 == pValue; | |
6093 return v6; | |
0 | 6094 case VAR_DayOfWeek: |
469 | 6095 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 7; |
6096 v6 = v5 == pValue; | |
0 | 6097 return v6; |
6098 case VAR_Sex: | |
469 | 6099 if ( pValue == (CHARACTER_RACE)this->uSex ) |
6100 return true; | |
6101 return v4 >= pValue; | |
0 | 6102 case VAR_Class: |
135 | 6103 v7 = (CHARACTER_RACE)this->classType; |
469 | 6104 if ( pValue == v7 ) |
6105 return true; | |
6106 return v4 >= pValue; | |
0 | 6107 case VAR_Race: |
6108 v7 = GetRace(); | |
469 | 6109 if ( pValue == v7 ) |
6110 return true; | |
6111 return v4 >= pValue; | |
0 | 6112 case VAR_CurrentHP: |
6113 v4 = this->sHealth; | |
469 | 6114 return v4 >= pValue; |
0 | 6115 case VAR_MaxHP: |
6116 v8 = GetMaxHealth(); | |
6117 v10 = __OFSUB__(v3->sHealth, v8); | |
6118 v9 = v3->sHealth - v8 < 0; | |
6119 goto LABEL_169; | |
6120 case VAR_CurrentSP: | |
6121 v4 = this->sMana; | |
469 | 6122 return v4 >= pValue; |
0 | 6123 case VAR_MaxSP: |
6124 v11 = GetMaxMana(); | |
6125 v10 = __OFSUB__(v3->sMana, v11); | |
6126 v9 = v3->sMana - v11 < 0; | |
6127 goto LABEL_169; | |
6128 case VAR_ActualAC: | |
6129 v12 = GetActualAC(); | |
6130 goto _j_cmp_against_arg; | |
6131 case VAR_ACModifier: | |
6132 v4 = this->sACModifier; | |
469 | 6133 return v4 >= pValue; |
0 | 6134 case VAR_BaseLevel: |
6135 v4 = this->uLevel; | |
469 | 6136 return v4 >= pValue; |
0 | 6137 case VAR_LevelModifier: |
6138 v4 = this->sLevelModifier; | |
469 | 6139 return v4 >= pValue; |
0 | 6140 case VAR_Age: |
6141 v12 = GetActualAge(); | |
6142 goto _j_cmp_against_arg; | |
6143 case VAR_Award: | |
1033 | 6144 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6145 our_bit_value = this->_achieved_awards_bits[((signed __int16)pValue - 1) /8]; |
484 | 6146 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
6147 return true; | |
6148 return false; | |
0 | 6149 case VAR_Experience: |
6150 v4 = LODWORD(this->uExperience); | |
469 | 6151 return v4 >= pValue; |
0 | 6152 case VAR_QBits_QuestsDone: |
484 | 6153 test_bit_value = 0x80u >> (pValue - 1) % 8; |
6154 our_bit_value = pParty->_quest_bits[(pValue - 1)/8]; | |
6155 if ( test_bit_value & our_bit_value ) | |
478 | 6156 return true; |
6157 return false; | |
0 | 6158 case VAR_PlayerItemInHands: |
6159 v15 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6160 v16 = v3->pInventoryItemList; |
0 | 6161 break; |
6162 case VAR_FixedGold: | |
6163 v4 = pParty->uNumGold; | |
469 | 6164 return v4 >= pValue; |
0 | 6165 case VAR_MightBonus: |
6166 v4 = this->uMightBonus; | |
469 | 6167 return v4 >= pValue; |
0 | 6168 case VAR_IntellectBonus: |
6169 v4 = this->uIntelligenceBonus; | |
469 | 6170 return v4 >= pValue; |
0 | 6171 case VAR_PersonalityBonus: |
6172 v4 = this->uWillpowerBonus; | |
469 | 6173 return v4 >= pValue; |
0 | 6174 case VAR_EnduranceBonus: |
6175 v4 = this->uEnduranceBonus; | |
469 | 6176 return v4 >= pValue; |
0 | 6177 case VAR_SpeedBonus: |
6178 v4 = this->uSpeedBonus; | |
469 | 6179 return v4 >= pValue; |
0 | 6180 case VAR_AccuracyBonus: |
6181 v4 = this->uAccuracyBonus; | |
469 | 6182 return v4 >= pValue; |
0 | 6183 case VAR_LuckBonus: |
6184 v4 = this->uLuckBonus; | |
469 | 6185 return v4 >= pValue; |
0 | 6186 case VAR_BaseMight: |
6187 v4 = this->uMight; | |
469 | 6188 return v4 >= pValue; |
0 | 6189 case VAR_BaseIntellect: |
6190 v4 = this->uIntelligence; | |
469 | 6191 return v4 >= pValue; |
0 | 6192 case VAR_BasePersonality: |
6193 v4 = this->uWillpower; | |
469 | 6194 return v4 >= pValue; |
0 | 6195 case VAR_BaseEndurance: |
6196 v4 = this->uEndurance; | |
469 | 6197 return v4 >= pValue; |
0 | 6198 case VAR_BaseSpeed: |
6199 v4 = this->uSpeed; | |
469 | 6200 return v4 >= pValue; |
0 | 6201 case VAR_BaseAccuracy: |
6202 v4 = this->uAccuracy; | |
469 | 6203 return v4 >= pValue; |
0 | 6204 case VAR_FixedFood: |
6205 v4 = pParty->uNumFoodRations; | |
469 | 6206 return v4 >= pValue; |
0 | 6207 default: |
469 | 6208 return v4 >= pValue; |
6209 } | |
6210 while ( v16->uItemID != pValue ) | |
0 | 6211 { |
6212 ++v15; | |
6213 ++v16; | |
6214 if ( v15 >= 138 ) | |
6215 { | |
469 | 6216 v6 = pParty->pPickedItem.uItemID == pValue; |
0 | 6217 return v6; |
6218 } | |
6219 } | |
469 | 6220 return true; |
0 | 6221 } |
6222 v4 = this->uLuck; | |
469 | 6223 return v4 >= pValue; |
6224 } | |
6225 if ( VarNum <= VAR_MagicResistance ) | |
6226 { | |
6227 if ( VarNum == VAR_MagicResistance ) | |
0 | 6228 { |
6229 v4 = this->sResMagicBase; | |
6230 } | |
6231 else | |
6232 { | |
469 | 6233 switch ( VarNum ) |
0 | 6234 { |
6235 case VAR_FireResistance: | |
6236 v4 = this->sResFireBase; | |
469 | 6237 return v4 >= pValue; |
0 | 6238 case VAR_AirResistance: |
6239 v4 = this->sResAirBase; | |
469 | 6240 return v4 >= pValue; |
0 | 6241 case VAR_WaterResistance: |
6242 v4 = this->sResWaterBase; | |
469 | 6243 return v4 >= pValue; |
0 | 6244 case VAR_EarthResistance: |
6245 v4 = this->sResEarthBase; | |
469 | 6246 return v4 >= pValue; |
0 | 6247 case VAR_SpiritResistance: |
6248 v4 = this->sResSpiritBase; | |
469 | 6249 return v4 >= pValue; |
0 | 6250 case VAR_MindResistance: |
6251 v4 = this->sResMindBase; | |
469 | 6252 return v4 >= pValue; |
0 | 6253 case VAR_BodyResistance: |
6254 v4 = this->sResBodyBase; | |
469 | 6255 return v4 >= pValue; |
0 | 6256 case VAR_LightResistance: |
6257 v4 = this->sResLightBase; | |
469 | 6258 return v4 >= pValue; |
0 | 6259 case VAR_DarkResistance: |
6260 v4 = this->sResDarkBase; | |
469 | 6261 return v4 >= pValue; |
0 | 6262 case VAR_ActualMight: |
6263 v12 = GetActualMight(); | |
6264 goto _j_cmp_against_arg; | |
6265 case VAR_ActualIntellect: | |
6266 v12 = GetActualIntelligence(); | |
6267 goto _j_cmp_against_arg; | |
6268 case VAR_ActualPersonality: | |
6269 v12 = GetActualWillpower(); | |
6270 goto _j_cmp_against_arg; | |
6271 case VAR_ActualEndurance: | |
6272 v12 = GetActualEndurance(); | |
6273 goto _j_cmp_against_arg; | |
6274 case VAR_ActualSpeed: | |
6275 v12 = GetActualSpeed(); | |
6276 goto _j_cmp_against_arg; | |
6277 case VAR_ActualAccuracy: | |
6278 v12 = GetActualAccuracy(); | |
6279 goto _j_cmp_against_arg; | |
6280 case VAR_ActualLuck: | |
6281 v12 = GetActualLuck(); | |
6282 _j_cmp_against_arg: | |
6283 v4 = v12; | |
6284 break; | |
6285 default: | |
469 | 6286 return v4 >= pValue; |
6287 } | |
6288 } | |
6289 return v4 >= pValue; | |
6290 } | |
6291 if ( VarNum <= VAR_DisarmTrapSkill ) | |
6292 { | |
6293 if ( VarNum != VAR_DisarmTrapSkill ) | |
6294 { | |
6295 if ( VarNum <= VAR_MindResistanceBonus ) | |
6296 { | |
6297 switch ( VarNum ) | |
0 | 6298 { |
6299 case VAR_MindResistanceBonus: | |
6300 v4 = this->sResMindBonus; | |
6301 break; | |
6302 case VAR_FireResistanceBonus: | |
6303 v4 = this->sResFireBonus; | |
6304 break; | |
6305 case VAR_AirResistanceBonus: | |
6306 v4 = this->sResAirBonus; | |
6307 break; | |
6308 case VAR_WaterResistanceBonus: | |
6309 v4 = this->sResWaterBonus; | |
6310 break; | |
6311 case VAR_EarthResistanceBonus: | |
6312 v4 = this->sResEarthBonus; | |
6313 break; | |
6314 case VAR_SpiritResistanceBonus: | |
6315 v4 = this->sResSpiritBonus; | |
6316 break; | |
6317 } | |
469 | 6318 return v4 >= pValue; |
6319 } | |
6320 if ( VarNum == VAR_BodyResistanceBonus ) | |
0 | 6321 { |
6322 v4 = this->sResBodyBonus; | |
469 | 6323 return v4 >= pValue; |
6324 } | |
6325 if ( VarNum == VAR_LightResistanceBonus ) | |
0 | 6326 { |
6327 v4 = this->sResLightBonus; | |
469 | 6328 return v4 >= pValue; |
6329 } | |
6330 if ( VarNum == VAR_DarkResistanceBonus ) | |
0 | 6331 { |
6332 v4 = this->sResDarkBonus; | |
469 | 6333 return v4 >= pValue; |
6334 } | |
6335 if ( VarNum == VAR_MagicResistanceBonus ) | |
0 | 6336 { |
6337 v4 = this->sResMagicBonus; | |
469 | 6338 return v4 >= pValue; |
6339 } | |
6340 if ( VarNum <= VAR_MagicResistanceBonus || VarNum > VAR_DiplomacySkill ) | |
6341 return v4 >= pValue; | |
0 | 6342 } |
6343 LABEL_90: | |
469 | 6344 v18 = *((short *)&this->pConditions[16] + VarNum); |
6345 if ( pValue <= 63 ) | |
0 | 6346 v4 = v18 & 0x3F; |
6347 else | |
469 | 6348 v4 = pValue & v18; |
6349 return v4 >= pValue; | |
6350 } | |
6351 if ( VarNum == 104 ) | |
0 | 6352 goto LABEL_90; |
469 | 6353 if ( (signed int)VarNum <= 104 ) |
6354 return v4 >= pValue; | |
6355 if ( (signed int)VarNum > 0x79 ) | |
6356 { | |
6357 if ( VarNum != 122 ) | |
6358 { | |
6359 if ( (signed int)VarNum > 122 && VarNum <= VAR_ActiveSpells ) | |
6360 v4 = (unsigned __int8)byte_5E4C15[VarNum]; | |
6361 return v4 >= pValue; | |
0 | 6362 } |
6363 v4 = GetMajorConditionIdx(); | |
6364 if ( v4 != 18 ) | |
6365 { | |
469 | 6366 return v4 >= pValue; |
6367 } | |
6368 v4 = pValue; | |
6369 return v4 >= pValue; | |
6370 } | |
1072 | 6371 return &LODWORD(this->pConditions[VarNum]);// *((int *)this + 2 * VarNum - 210); |
0 | 6372 } |
6373 | |
6374 | |
6375 //----- (0044A5CB) -------------------------------------------------------- | |
492 | 6376 void Player::SetVariable(enum VariableType var_type, signed int var_value) |
6377 { | |
6378 signed int currPlayerId; // ebx@1 | |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6379 Player *v4_unused; // esi@1 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6380 unsigned int v5_unused; // edi@1 |
0 | 6381 unsigned int v6; // esi@13 |
6382 unsigned int v7; // esi@14 | |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6383 signed int v8_unused; // eax@17 |
0 | 6384 ItemGen *v9; // ecx@17 |
6385 int v10; // eax@21 | |
6386 signed int v11; // eax@30 | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6387 Player *unused12; // ecx@44 |
0 | 6388 char *v13; // ecx@45 |
6389 Player *v14; // ecx@49 | |
6390 int v15; // ecx@86 | |
6391 int v16; // esi@106 | |
6392 char v17; // al@106 | |
6393 int v18; // eax@107 | |
6394 Player *v19; // ecx@112 | |
6395 Player *v20; // ecx@127 | |
6396 int v21; // eax@127 | |
6397 int v22; // eax@145 | |
6398 char v23; // zf@146 | |
6399 DDM_DLV_Header *v24; // ecx@148 | |
6400 signed int v25; // eax@172 | |
6401 int v26; // [sp-8h] [bp-3Ch]@84 | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6402 signed int unused27; // [sp-4h] [bp-38h]@4 |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6403 int v28_unused; // [sp-4h] [bp-38h]@84 |
0 | 6404 ItemGen item; // [sp+Ch] [bp-28h]@52 |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6405 char v30_unused; // [sp+32h] [bp-2h]@1 |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6406 char v31_unused; // [sp+33h] [bp-1h]@1 |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6407 |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6408 currPlayerId = -1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6409 for (int i = 1; i <= 4; i++) //TODO: add a member variable for playerid in the future |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6410 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6411 if ( this == pPlayers[i] ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6412 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6413 currPlayerId = i - 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6414 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6415 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6416 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6417 assert(currPlayerId != -1); |
492 | 6418 if ( var_type > VAR_AutoNotes ) |
6419 { | |
6420 if ( var_type <= VAR_GoldInBank ) | |
6421 { | |
6422 if ( var_type == VAR_GoldInBank ) | |
6423 { | |
6424 pParty->uNumGoldInBank = var_value; | |
0 | 6425 return; |
6426 } | |
492 | 6427 if ( var_type <= VAR_Counter8 ) |
6428 { | |
6429 if ( (signed int)var_type >= 0xF5 ) | |
0 | 6430 { |
492 | 6431 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); |
6432 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 6433 } |
6434 else | |
6435 { | |
492 | 6436 switch ( var_type ) |
0 | 6437 { |
6438 case VAR_MonthEquals|VAR_CurrentSP: | |
492 | 6439 _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u); |
0 | 6440 break; |
6441 case VAR_NPCs2: | |
6442 pParty->field_709 = 0; | |
492 | 6443 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; |
1035 | 6444 pParty->CountHirelings(); |
6445 viewparams->bRedrawGameUI = true; | |
0 | 6446 break; |
6447 case VAR_NumSkillPoints: | |
492 | 6448 this->uSkillPoints = var_value; |
0 | 6449 break; |
6450 } | |
6451 } | |
6452 return; | |
6453 } | |
492 | 6454 if ( var_type < VAR_Counter9 ) |
0 | 6455 return; |
492 | 6456 if ( (signed int)var_type <= 0x112 ) |
6457 { | |
6458 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); | |
6459 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 6460 } |
6461 else | |
6462 { | |
492 | 6463 if ( var_type == VAR_ReputationInCurrentLocation ) |
0 | 6464 { |
6465 v24 = &pOutdoor->ddm; | |
6466 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6467 v24 = &pIndoor->dlv; | |
492 | 6468 v24->uReputation = var_value; |
6469 if ( var_value > 10000 ) | |
0 | 6470 v24->uReputation = 10000; |
6471 return; | |
6472 } | |
492 | 6473 if ( var_type <= VAR_ReputationInCurrentLocation |
6474 || var_type > VAR_History_28 | |
6475 || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) | |
6476 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
1455 | 6477 v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0, |
492 | 6478 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 6479 v23) ) |
6480 return; | |
6481 bFlashHistoryBook = 1; | |
6482 } | |
492 | 6483 v25 = 8 * currPlayerId + 400; |
862 | 6484 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6485 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); |
0 | 6486 return; |
6487 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6488 switch ( var_type ) |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6489 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6490 case VAR_NumDeaths: |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6491 pParty->uNumDeaths = var_value; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6492 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6493 case VAR_NumBounties: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6494 pParty->uNumBountiesCollected = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6495 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6496 case VAR_PrisonTerms: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6497 pParty->uNumPrisonTerms = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6498 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6499 case VAR_ArenaWinsPage: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6500 pParty->uNumArenaPageWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6501 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6502 case VAR_ArenaWinsSquire: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6503 pParty->uNumArenaSquireWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6504 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6505 case VAR_ArenaWinsKnight: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6506 pParty->uNumArenaKnightWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6507 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6508 case VAR_ArenaWinsLord: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6509 pParty->uNumArenaLordWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6510 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6511 } |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6512 return; |
0 | 6513 } |
492 | 6514 if ( var_type == VAR_AutoNotes ) |
6515 { | |
6516 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_autonote_bits[((signed __int16)var_value - 1) >> 3]) | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
6517 //&& (&dword_723718_autonote_related)[8 * a3] ) |
1310 | 6518 && pAutonoteTxt[var_value].pText ) |
492 | 6519 { |
6520 v20 = pPlayers[currPlayerId + 1]; | |
187 | 6521 v20->PlaySound(SPEECH_96, 0); |
1453 | 6522 //v21 = pAutonoteTxt[var_value].eType;// dword_72371C[2 * a3]; |
0 | 6523 bFlashAutonotesBook = 1; |
1453 | 6524 _506568_autonote_type = pAutonoteTxt[var_value].eType; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6525 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
0 | 6526 } |
1453 | 6527 _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1); |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6528 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6529 return; |
0 | 6530 } |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6531 if ( var_type <= VAR_BaseLuck ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6532 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6533 switch ( var_type ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6534 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6535 case VAR_Sex: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6536 this->uSex = (PLAYER_SEX)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6537 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6538 case VAR_Class: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6539 this->classType = (PLAYER_CLASS_TYPE)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6540 if ( (char)var_value == PLAYER_CLASS_LICH ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6541 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6542 v9 = NULL; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6543 for (int i = 0; i < 138; i++) |
0 | 6544 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6545 v9 = &this->pInventoryItemList[i]; |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
6546 if (v9->uItemID == ITEM_LICH_JAR_EMPTY) |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6547 break; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6548 } |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
6549 if (v9 != NULL && v9->uItemID != ITEM_LICH_JAR_EMPTY) |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6550 { |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6551 v10 = (int)((char *)this + 36 * 138); //originally 36 * v8. the code got to this condition only if v8 was equal to 138 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6552 *(int *)(v10 + 532) = 601; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6553 *(char *)(v10 + 558) = currPlayerId + 1; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6554 } |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6555 if ( this->sResFireBase < 20 ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6556 this->sResFireBase = 20; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6557 if ( this->sResAirBase < 20 ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6558 this->sResAirBase = 20; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6559 if ( this->sResWaterBase < 20 ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6560 this->sResWaterBase = 20; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6561 if ( this->sResEarthBase < 20 ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6562 this->sResEarthBase = 20; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6563 this->sResMindBase = 200; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6564 this->sResBodyBase = 200; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6565 v11 = this->GetSexByVoice(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6566 this->uPrevVoiceID = this->uVoiceID; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6567 this->uPrevFace = this->uCurrentFace; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6568 if ( v11 ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6569 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6570 this->uCurrentFace = 21; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6571 this->uVoiceID = 21; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6572 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6573 else |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6574 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6575 this->uCurrentFace = 20; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6576 this->uVoiceID = 20; |
0 | 6577 } |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6578 ReloadPlayerPortraits(currPlayerId, this->uCurrentFace); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6579 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6580 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6581 case VAR_CurrentHP: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6582 this->sHealth = var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6583 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6584 case VAR_MaxHP: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6585 this->sHealth = GetMaxHealth(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6586 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6587 case VAR_CurrentSP: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6588 this->sMana = var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6589 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6590 case VAR_MaxSP: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6591 this->sMana = GetMaxMana(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6592 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6593 case VAR_ACModifier: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6594 this->sACModifier = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6595 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6596 case VAR_BaseLevel: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6597 this->uLevel = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6598 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6599 case VAR_LevelModifier: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6600 this->sLevelModifier = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6601 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6602 case VAR_Age: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6603 this->sAgeModifier = var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6604 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6605 case VAR_Award: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6606 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6607 pPlayers[currPlayerId + 1]->_achieved_awards_bits[((signed __int16)var_value - 1)/ 8]) |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6608 //&& dword_723E80_award_related[2 * a3] ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6609 && pAwards[var_value].pText ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6610 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6611 pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6612 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6613 PlaySoundBasedOnCondition(currPlayerId); |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6614 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6615 _449B7E_toggle_bit((unsigned char *)this->_achieved_awards_bits, var_value, 1u); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6616 return; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6617 case VAR_Experience: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6618 this->uExperience = var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6619 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6620 case VAR_QBits_QuestsDone: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6621 if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6622 // && (&dword_722F10)[4 * a3] ) |
1310 | 6623 && pQuestTable[var_value] ) |
0 | 6624 { |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6625 v14 = pPlayers[currPlayerId + 1]; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6626 bFlashQuestBook = 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6627 v14->PlaySound(SPEECH_93, 0); |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6628 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6629 PlaySoundBasedOnCondition(currPlayerId); |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6630 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6631 v13 = (char *)pParty->_quest_bits; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6632 _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6633 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6634 case VAR_PlayerItemInHands: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6635 item.Reset(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6636 item.Reset(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6637 item.uItemID = var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6638 item.uAttributes = 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6639 pParty->SetHoldingItem(&item); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6640 if ( var_value >= ITEM_ARTIFACT_PUCK && var_value <= ITEM_RELIC_MEKORIGS_HAMMER ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6641 pParty->pIsArtifactFound[var_value-500] = 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6642 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6643 case VAR_FixedGold: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6644 Party::SetGold(var_value); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6645 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6646 case VAR_RandomGold: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6647 v6 = rand() % var_value + 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6648 Party::SetGold(v6); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6649 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6650 ShowStatusBarString(pTmpBuf.data(), 2u); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6651 GameUI_DrawFoodAndGold(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6652 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6653 case VAR_FixedFood: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6654 Party::SetFood(var_value); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6655 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6656 case VAR_RandomFood: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6657 v7 = rand() % var_value + 1; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6658 Party::SetFood(v7); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6659 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6660 ShowStatusBarString(pTmpBuf.data(), 2u); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6661 GameUI_DrawFoodAndGold(); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6662 goto LABEL_124; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6663 case VAR_MightBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6664 goto LABEL_64; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6665 case VAR_IntellectBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6666 goto LABEL_68; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6667 case VAR_PersonalityBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6668 goto LABEL_69; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6669 case VAR_EnduranceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6670 goto LABEL_70; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6671 case VAR_SpeedBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6672 goto LABEL_71; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6673 case VAR_AccuracyBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6674 goto LABEL_72; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6675 case VAR_LuckBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6676 goto LABEL_73; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6677 case VAR_BaseMight: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6678 this->uMight = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6679 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6680 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6681 case VAR_BaseIntellect: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6682 this->uIntelligence = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6683 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6684 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6685 case VAR_BasePersonality: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6686 this->uWillpower = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6687 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6688 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6689 case VAR_BaseEndurance: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6690 this->uEndurance = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6691 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6692 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6693 case VAR_BaseSpeed: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6694 this->uSpeed = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6695 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6696 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6697 case VAR_BaseAccuracy: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6698 this->uAccuracy = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6699 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6700 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6701 case VAR_BaseLuck: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6702 this->uLuck = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6703 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6704 goto LABEL_112; |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6705 default: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6706 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6707 } |
0 | 6708 LABEL_111: |
187 | 6709 v26 = SPEECH_91; |
0 | 6710 LABEL_112: |
492 | 6711 v19 = pPlayers[currPlayerId + 1]; |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6712 v19->PlaySound((PlayerSpeech)v26, 0); |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6713 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6714 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6715 return; |
0 | 6716 } |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6717 if ( var_type <= VAR_MagicResistance ) |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6718 { |
492 | 6719 switch ( var_type ) |
0 | 6720 { |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6721 case VAR_ActualMight: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6722 LABEL_64: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6723 this->uMightBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6724 goto LABEL_111; |
0 | 6725 case VAR_ActualIntellect: |
6726 LABEL_68: | |
492 | 6727 this->uIntelligenceBonus = (unsigned __int8)var_value; |
0 | 6728 goto LABEL_111; |
6729 case VAR_ActualPersonality: | |
6730 LABEL_69: | |
492 | 6731 this->uWillpowerBonus = (unsigned __int8)var_value; |
0 | 6732 goto LABEL_111; |
6733 case VAR_ActualEndurance: | |
6734 LABEL_70: | |
492 | 6735 this->uEnduranceBonus = (unsigned __int8)var_value; |
0 | 6736 goto LABEL_111; |
6737 case VAR_ActualSpeed: | |
6738 LABEL_71: | |
492 | 6739 this->uSpeedBonus = (unsigned __int8)var_value; |
0 | 6740 goto LABEL_111; |
6741 case VAR_ActualAccuracy: | |
6742 LABEL_72: | |
492 | 6743 this->uAccuracyBonus = (unsigned __int8)var_value; |
0 | 6744 goto LABEL_111; |
6745 case VAR_ActualLuck: | |
6746 LABEL_73: | |
492 | 6747 this->uLuckBonus = (unsigned __int8)var_value; |
0 | 6748 goto LABEL_111; |
6749 case VAR_FireResistance: | |
492 | 6750 this->sResFireBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6751 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6752 goto LABEL_112; |
0 | 6753 case VAR_AirResistance: |
492 | 6754 this->sResAirBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6755 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6756 goto LABEL_112; |
0 | 6757 case VAR_WaterResistance: |
492 | 6758 this->sResWaterBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6759 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6760 goto LABEL_112; |
0 | 6761 case VAR_EarthResistance: |
492 | 6762 this->sResEarthBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6763 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6764 goto LABEL_112; |
0 | 6765 case VAR_SpiritResistance: |
492 | 6766 this->sResSpiritBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6767 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6768 goto LABEL_112; |
0 | 6769 case VAR_MindResistance: |
492 | 6770 this->sResMindBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6771 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6772 goto LABEL_112; |
0 | 6773 case VAR_BodyResistance: |
492 | 6774 this->sResBodyBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6775 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6776 goto LABEL_112; |
0 | 6777 case VAR_LightResistance: |
492 | 6778 this->sResLightBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6779 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6780 goto LABEL_112; |
0 | 6781 case VAR_DarkResistance: |
492 | 6782 this->sResDarkBase = (unsigned __int8)var_value; |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6783 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6784 goto LABEL_112; |
0 | 6785 case VAR_MagicResistance: |
492 | 6786 this->sResMagicBase = (unsigned __int8)var_value; |
0 | 6787 v26 = 92; |
6788 goto LABEL_112; | |
6789 default: | |
6790 return; | |
6791 } | |
6792 return; | |
6793 } | |
6794 HIWORD(v15) = 0; | |
492 | 6795 if ( var_type > VAR_DisarmTrapSkill ) |
6796 { | |
6797 if ( var_type != VAR_LearningSkill ) | |
6798 { | |
6799 if ( var_type <= VAR_LearningSkill ) | |
0 | 6800 return; |
492 | 6801 if ( var_type <= VAR_Eradicated ) |
6802 { | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6803 this->SetCondition(var_type - 105, 1); |
0 | 6804 } |
6805 else | |
6806 { | |
492 | 6807 if ( var_type != VAR_MajorCondition ) |
0 | 6808 { |
492 | 6809 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
6810 byte_5E4C15[var_type] = var_value; | |
0 | 6811 return; |
6812 } | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6813 memset(this, 0, 0xA0u); |
0 | 6814 } |
6815 } | |
6816 else | |
6817 { | |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6818 v16 = (int)((char *)&this->pConditions[16] + 2 * var_type); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6819 v17 = *(char *)v16; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6820 if ( var_value <= VAR_BodyResistanceBonus ) |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6821 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6822 LOWORD(v15) = (unsigned __int8)var_value; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6823 v18 = v15 | v17 & VAR_BodyResistanceBonus; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6824 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6825 else |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6826 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6827 LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6828 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6829 *(short *)v16 = v18; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6830 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6831 LABEL_124: |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6832 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6833 PlaySoundBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6834 return; |
0 | 6835 } |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6836 if ( var_type <= VAR_MagicResistanceBonus ) |
492 | 6837 { |
6838 switch ( var_type ) | |
0 | 6839 { |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6840 case VAR_FireResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6841 this->sResFireBonus = (unsigned __int8)var_value; |
0 | 6842 break; |
6843 case VAR_AirResistanceBonus: | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6844 this->sResAirBonus = (unsigned __int8)var_value; |
0 | 6845 break; |
6846 case VAR_WaterResistanceBonus: | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6847 this->sResWaterBonus = (unsigned __int8)var_value; |
0 | 6848 break; |
6849 case VAR_EarthResistanceBonus: | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6850 this->sResEarthBonus = (unsigned __int8)var_value; |
0 | 6851 break; |
6852 case VAR_SpiritResistanceBonus: | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6853 this->sResSpiritBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6854 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6855 case VAR_MindResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6856 this->sResMindBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6857 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6858 case VAR_BodyResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6859 this->sResBodyBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6860 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6861 case VAR_LightResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6862 this->sResLightBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6863 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6864 case VAR_DarkResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6865 this->sResDarkBonus = (unsigned __int8)var_value; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6866 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6867 case VAR_PhysicalResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6868 assert("VAR_PhysicalResistanceBonus variable unsupported" && false); |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6869 return; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6870 break; |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6871 case VAR_MagicResistanceBonus: |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6872 this->sResMagicBonus = (unsigned __int8)var_value; |
0 | 6873 break; |
6874 default: | |
1251
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
6875 assert("Unexpected var_type" && false); |
0 | 6876 return; |
6877 break; | |
6878 } | |
6879 goto LABEL_111; | |
6880 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6881 if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill || var_type == VAR_DisarmTrapSkill) //VAR_ThieverySkill wasn't present in the original function |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6882 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6883 return; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6884 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6885 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6886 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6887 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6888 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6889 void Player::PlaySoundBasedOnCondition(int currPlayerId) |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6890 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6891 signed int v25 = 8 * currPlayerId + 400; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6892 LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6893 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6894 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6895 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6896 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6897 void Player::DrawPlayerBuffAnimBasedOnCondition(int currPlayerId) |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6898 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6899 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6900 } |
0 | 6901 |
6902 //----- (0044AFFB) -------------------------------------------------------- | |
310 | 6903 void Player::AddVariable(enum VariableType var_type, signed int val) |
0 | 6904 { |
6905 char v3; // bl@1 | |
6906 Player *v4; // esi@1 | |
6907 signed int uPlayerIdx; // edi@1 | |
6908 int v6; // eax@15 | |
6909 unsigned int v7; // esi@18 | |
6910 int *v8; // ebx@21 | |
6911 int v9; // eax@22 | |
6912 signed int v10; // eax@24 | |
6913 int v11; // eax@27 | |
6914 __int16 *v12; // esi@28 | |
6915 Player *v13; // ecx@34 | |
6916 Player *v14; // ecx@36 | |
6917 char *v15; // ecx@37 | |
6918 unsigned __int8 v16; // cf@38 | |
6919 Player *v17; // ecx@42 | |
6920 __int16 *v18; // esi@53 | |
6921 __int16 *v19; // esi@62 | |
6922 char *v20; // esi@107 | |
6923 __int16 v21; // dx@107 | |
6924 int v22; // ecx@107 | |
6925 Player *v23; // ecx@132 | |
6926 int v24; // eax@132 | |
6927 int v25; // eax@150 | |
6928 char v26; // zf@151 | |
6929 DDM_DLV_Header *v27; // eax@153 | |
6930 signed int v28; // eax@176 | |
6931 int v29; // [sp-8h] [bp-40h]@84 | |
310 | 6932 // signed int v30; // [sp-4h] [bp-3Ch]@4 |
0 | 6933 int v31; // [sp-4h] [bp-3Ch]@84 |
6934 ItemGen item; // [sp+Ch] [bp-2Ch]@45 | |
6935 unsigned int v33; // [sp+30h] [bp-8h]@34 | |
6936 char v34; // [sp+37h] [bp-1h]@1 | |
6937 | |
6938 auto Dst = this; | |
6939 v3 = 0; | |
6940 v34 = 0; | |
6941 v4 = Dst; | |
6942 uPlayerIdx = 0; | |
6943 if ( Dst == pPlayers[2] ) | |
6944 uPlayerIdx = 1; | |
310 | 6945 else if ( Dst == pPlayers[3] ) |
6946 uPlayerIdx = 2; | |
6947 else if ( Dst == pPlayers[4] ) | |
6948 uPlayerIdx = 3; | |
6949 | |
6950 if ( var_type <= VAR_AutoNotes ) | |
6951 { | |
6952 if ( var_type != VAR_AutoNotes ) | |
6953 { | |
6954 if ( var_type <= VAR_ActualMight ) | |
6955 { | |
6956 if ( var_type != VAR_ActualMight ) | |
0 | 6957 { |
310 | 6958 switch ( var_type ) |
0 | 6959 { |
6960 case VAR_RandomGold: | |
6961 if ( !val ) | |
6962 val = 1; | |
6963 v6 = rand(); | |
6964 party_finds_gold(v6 % val + 1, 1); | |
6965 GameUI_DrawFoodAndGold(); | |
6966 return; | |
6967 case VAR_RandomFood: | |
6968 if ( !val ) | |
6969 val = 1; | |
6970 v7 = rand() % val + 1; | |
6971 Party::GiveFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6972 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6973 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 6974 GameUI_DrawFoodAndGold(); |
6975 goto _play_sound; | |
6976 case VAR_Sex: | |
6977 Dst->uSex = (PLAYER_SEX)val; | |
1507 | 6978 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6979 goto _play_sound; | |
0 | 6980 case VAR_Class: |
135 | 6981 Dst->classType = (PLAYER_CLASS_TYPE)val; |
1507 | 6982 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6983 goto _play_sound; | |
0 | 6984 case VAR_CurrentHP: |
6985 v8 = &Dst->sHealth; | |
6986 *v8 += val; | |
6987 if ( Dst->sHealth <= Dst->GetMaxHealth() ) | |
1507 | 6988 { |
6989 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6990 goto _play_sound; | |
6991 } | |
0 | 6992 v9 = v4->GetMaxHealth(); |
6993 goto LABEL_23; | |
6994 case VAR_MaxHP: | |
6995 v10 = Dst->GetMaxHealth(); | |
6996 v4->_health_related = 0; | |
6997 v4->uFullHealthBonus = 0; | |
6998 v4->sHealth = v10; | |
6999 return; | |
7000 case VAR_CurrentSP: | |
7001 v8 = &Dst->sMana; | |
7002 *v8 += val; | |
7003 if ( Dst->sMana > GetMaxMana() ) | |
7004 { | |
7005 v9 = v4->GetMaxMana(); | |
7006 LABEL_23: | |
7007 *v8 = v9; | |
7008 } | |
1507 | 7009 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7010 goto _play_sound; | |
0 | 7011 case VAR_MaxSP: |
7012 v11 = GetMaxMana(); | |
7013 v4->_mana_related = 0; | |
7014 v4->uFullManaBonus = 0; | |
7015 v4->sMana = v11; | |
7016 return; | |
7017 case VAR_ACModifier: | |
7018 v12 = &Dst->sACModifier; | |
7019 goto LABEL_29; | |
7020 case VAR_BaseLevel: | |
7021 v12 = (__int16 *)&Dst->uLevel; | |
7022 goto LABEL_29; | |
7023 case VAR_LevelModifier: | |
7024 v12 = &Dst->sLevelModifier; | |
7025 LABEL_29: | |
7026 *v12 += val; | |
7027 if ( *v12 > 255 ) | |
7028 *v12 = 255; | |
1507 | 7029 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7030 goto _play_sound; | |
0 | 7031 case VAR_Age: |
7032 Dst->sAgeModifier += val; | |
7033 return; | |
7034 case VAR_Award: | |
7035 v13 = pPlayers[uPlayerIdx + 1]; | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
7036 if (_449B57_test_bit((unsigned __int8 *)pPlayers[uPlayerIdx + 1]->_achieved_awards_bits, val) |
521 | 7037 |
492 | 7038 && pAwards[val].pText ) |
0 | 7039 { |
7040 v14 = pPlayers[uPlayerIdx + 1]; | |
7041 v34 = 1; | |
7042 v3 = 1; | |
187 | 7043 v14->PlaySound(SPEECH_96, 0); |
0 | 7044 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
7045 v15 = (char *)v4->_achieved_awards_bits; |
1507 | 7046 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
7047 if ( v34 != 1 ) | |
7048 { | |
7049 if ( v3 != 1 ) | |
7050 return; | |
7051 goto _play_sound; | |
7052 } | |
7053 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7054 if ( v3 != 1 ) | |
7055 return; | |
7056 goto _play_sound; | |
0 | 7057 case VAR_Experience: |
7058 v16 = __CFADD__(val, LODWORD(Dst->uExperience)); | |
7059 LODWORD(Dst->uExperience) += val; | |
7060 HIDWORD(Dst->uExperience) += ((unsigned __int64)val >> 32) + v16; | |
7061 if ( (signed __int64)Dst->uExperience > 4000000000i64 ) | |
7062 Dst->uExperience = 4000000000i64; | |
1507 | 7063 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7064 goto _play_sound; | |
0 | 7065 case VAR_QBits_QuestsDone: |
484 | 7066 if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_quest_bits[((signed __int16)val - 1) >> 3]) |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
7067 //&& (&dword_722F10)[4 * val] ) |
1310 | 7068 && pQuestTable[val] ) |
0 | 7069 { |
501 | 7070 //v17 = pPlayers[uPlayerIdx + 1]; |
0 | 7071 bFlashQuestBook = 1; |
7072 v34 = 1; | |
7073 v3 = 1; | |
501 | 7074 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0); |
0 | 7075 } |
484 | 7076 v15 = (char *)pParty->_quest_bits; |
1507 | 7077 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
7078 if ( v34 != 1 ) | |
7079 { | |
7080 if ( v3 != 1 ) | |
7081 return; | |
7082 goto _play_sound; | |
7083 } | |
7084 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7085 if ( v3 != 1 ) | |
7086 return; | |
7087 goto _play_sound; | |
0 | 7088 case VAR_PlayerItemInHands: |
7089 item.Reset(); | |
7090 item.Reset(); | |
7091 item.uAttributes = 1; | |
7092 item.uItemID = val; | |
7093 if ( val >= ITEM_ARTIFACT_PUCK && val <= ITEM_RELIC_MEKORIGS_HAMMER ) | |
484 | 7094 pParty->pIsArtifactFound[val-500] = 1; |
0 | 7095 if ( val >= ITEM_WAND_FIRE && val <= ITEM_WAND_INCENERATION ) |
7096 { | |
7097 item.uNumCharges = rand() % 6 + pItemsTable->pItems[item.uItemID].uDamageMod + 1; | |
7098 item.uMaxCharges = LOBYTE(item.uNumCharges); | |
7099 } | |
7100 pParty->SetHoldingItem(&item); | |
7101 return; | |
7102 case VAR_FixedGold: | |
7103 party_finds_gold(val, 1); | |
7104 return; | |
7105 case VAR_BaseMight: | |
7106 v18 = (__int16 *)&Dst->uMight; | |
7107 goto LABEL_82; | |
7108 case VAR_BaseIntellect: | |
7109 v18 = (__int16 *)&Dst->uIntelligence; | |
7110 goto LABEL_82; | |
7111 case VAR_BasePersonality: | |
7112 v18 = (__int16 *)&Dst->uWillpower; | |
7113 goto LABEL_82; | |
7114 case VAR_BaseEndurance: | |
7115 v18 = (__int16 *)&Dst->uEndurance; | |
7116 goto LABEL_82; | |
7117 case VAR_BaseSpeed: | |
7118 v18 = (__int16 *)&Dst->uSpeed; | |
7119 goto LABEL_82; | |
7120 case VAR_BaseAccuracy: | |
7121 v18 = (__int16 *)&Dst->uAccuracy; | |
7122 goto LABEL_82; | |
7123 case VAR_BaseLuck: | |
7124 v18 = (__int16 *)&Dst->uLuck; | |
7125 goto LABEL_82; | |
7126 case VAR_FixedFood: | |
7127 Party::GiveFood(val); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7128 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7129 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 7130 if ( pParty->uNumFoodRations > 0xFFFF ) |
7131 Party::SetFood(0xFFFFu); | |
7132 goto _play_sound; | |
7133 case VAR_MightBonus: | |
7134 goto LABEL_62; | |
7135 case VAR_IntellectBonus: | |
7136 goto LABEL_66; | |
7137 case VAR_PersonalityBonus: | |
7138 goto LABEL_67; | |
7139 case VAR_EnduranceBonus: | |
7140 goto LABEL_68; | |
7141 case VAR_SpeedBonus: | |
7142 goto LABEL_69; | |
7143 case VAR_AccuracyBonus: | |
7144 goto LABEL_70; | |
7145 case VAR_LuckBonus: | |
7146 goto LABEL_71; | |
7147 default: | |
7148 return; | |
7149 } | |
7150 return; | |
7151 } | |
7152 LABEL_62: | |
7153 v19 = (__int16 *)&Dst->uMightBonus; | |
7154 goto LABEL_113; | |
7155 } | |
310 | 7156 if ( var_type <= VAR_FireResistanceBonus ) |
7157 { | |
7158 if ( var_type != VAR_FireResistanceBonus ) | |
0 | 7159 { |
310 | 7160 switch ( var_type ) |
0 | 7161 { |
7162 case VAR_ActualIntellect: | |
7163 LABEL_66: | |
7164 v19 = (__int16 *)&Dst->uIntelligenceBonus; | |
7165 goto LABEL_113; | |
7166 case VAR_ActualPersonality: | |
7167 LABEL_67: | |
7168 v19 = (__int16 *)&Dst->uWillpowerBonus; | |
7169 goto LABEL_113; | |
7170 case VAR_ActualEndurance: | |
7171 LABEL_68: | |
7172 v19 = (__int16 *)&Dst->uEnduranceBonus; | |
7173 goto LABEL_113; | |
7174 case VAR_ActualSpeed: | |
7175 LABEL_69: | |
7176 v19 = (__int16 *)&Dst->uSpeedBonus; | |
7177 goto LABEL_113; | |
7178 case VAR_ActualAccuracy: | |
7179 LABEL_70: | |
7180 v19 = (__int16 *)&Dst->uAccuracyBonus; | |
7181 goto LABEL_113; | |
7182 case VAR_ActualLuck: | |
7183 LABEL_71: | |
7184 v19 = (__int16 *)&Dst->uLuckBonus; | |
7185 goto LABEL_113; | |
7186 case VAR_FireResistance: | |
7187 v18 = &Dst->sResFireBase; | |
7188 goto LABEL_82; | |
7189 case VAR_AirResistance: | |
7190 v18 = &Dst->sResAirBase; | |
7191 goto LABEL_82; | |
7192 case VAR_WaterResistance: | |
7193 v18 = &Dst->sResWaterBase; | |
7194 goto LABEL_82; | |
7195 case VAR_EarthResistance: | |
7196 v18 = &Dst->sResEarthBase; | |
7197 goto LABEL_82; | |
7198 case VAR_SpiritResistance: | |
7199 v18 = &Dst->sResSpiritBase; | |
7200 goto LABEL_82; | |
7201 case VAR_MindResistance: | |
7202 v18 = &Dst->sResMindBase; | |
7203 goto LABEL_82; | |
7204 case VAR_BodyResistance: | |
7205 v18 = &Dst->sResBodyBase; | |
7206 goto LABEL_82; | |
7207 case VAR_LightResistance: | |
7208 v18 = &Dst->sResLightBase; | |
7209 goto LABEL_82; | |
7210 case VAR_DarkResistance: | |
7211 v18 = &Dst->sResDarkBase; | |
7212 goto LABEL_82; | |
7213 case VAR_MagicResistance: | |
7214 v18 = &Dst->sResMagicBase; | |
7215 LABEL_82: | |
7216 *v18 += val; | |
7217 if ( *v18 > 255 ) | |
7218 *v18 = 255; | |
1507 | 7219 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_92, 0); |
7220 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7221 goto _play_sound; | |
0 | 7222 default: |
7223 return; | |
7224 } | |
7225 return; | |
7226 } | |
7227 v19 = &Dst->sResFireBonus; | |
7228 LABEL_113: | |
7229 *v19 += val; | |
7230 if ( *v19 > 255 ) | |
7231 *v19 = 255; | |
7232 v31 = 0; | |
187 | 7233 v29 = SPEECH_91; |
7234 pPlayers[uPlayerIdx + 1]->PlaySound((PlayerSpeech)v29, v31); | |
1507 | 7235 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7236 goto _play_sound; | |
0 | 7237 } |
310 | 7238 if ( var_type <= VAR_DisarmTrapSkill ) |
7239 { | |
7240 if ( var_type != VAR_DisarmTrapSkill ) | |
0 | 7241 { |
310 | 7242 if ( var_type <= VAR_BodyResistanceBonus ) |
0 | 7243 { |
310 | 7244 switch ( var_type ) |
0 | 7245 { |
7246 case VAR_BodyResistanceBonus: | |
7247 v19 = &Dst->sResBodyBonus; | |
7248 break; | |
7249 case VAR_AirResistanceBonus: | |
7250 v19 = &Dst->sResAirBonus; | |
7251 break; | |
7252 case VAR_WaterResistanceBonus: | |
7253 v19 = &Dst->sResWaterBonus; | |
7254 break; | |
7255 case VAR_EarthResistanceBonus: | |
7256 v19 = &Dst->sResEarthBonus; | |
7257 break; | |
7258 case VAR_SpiritResistanceBonus: | |
7259 v19 = &Dst->sResSpiritBonus; | |
7260 break; | |
7261 default: | |
310 | 7262 if ( var_type != 62 ) |
0 | 7263 return; |
7264 v19 = &Dst->sResMindBonus; | |
7265 break; | |
7266 } | |
7267 goto LABEL_113; | |
7268 } | |
310 | 7269 if ( var_type == VAR_LightResistanceBonus ) |
0 | 7270 { |
7271 v19 = &Dst->sResLightBonus; | |
7272 goto LABEL_113; | |
7273 } | |
310 | 7274 if ( var_type == VAR_DarkResistanceBonus ) |
0 | 7275 { |
7276 v19 = &Dst->sResDarkBonus; | |
7277 goto LABEL_113; | |
7278 } | |
310 | 7279 if ( var_type == VAR_MagicResistanceBonus ) |
0 | 7280 { |
7281 v19 = &Dst->sResMagicBonus; | |
7282 goto LABEL_113; | |
7283 } | |
310 | 7284 if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill ) |
0 | 7285 return; |
7286 } | |
7287 goto LABEL_106; | |
7288 } | |
310 | 7289 if ( var_type == VAR_LearningSkill ) |
0 | 7290 { |
7291 LABEL_106: | |
7292 if ( val <= VAR_BodyResistanceBonus ) | |
7293 { | |
310 | 7294 *((short *)&Dst->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&Dst->pConditions[16] + 2 * var_type) & VAR_BodyResistanceBonus; |
0 | 7295 } |
7296 else | |
7297 { | |
310 | 7298 v20 = (char *)&Dst->pConditions[16] + 2 * var_type; |
0 | 7299 v21 = *(short *)v20; |
7300 v22 = (unsigned __int8)val + (v21 & VAR_BodyResistanceBonus); | |
7301 if ( v22 > 60 ) | |
7302 LOWORD(v22) = 60; | |
7303 LOBYTE(v21) = v21 & 0xC0; | |
7304 *(short *)v20 = v22 | v21; | |
7305 } | |
1507 | 7306 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7307 goto _play_sound; | |
0 | 7308 } |
310 | 7309 if ( var_type <= VAR_LearningSkill ) |
0 | 7310 return; |
310 | 7311 if ( var_type <= VAR_Eradicated ) |
7312 { | |
7313 Dst->SetCondition(var_type - 105, 0); | |
0 | 7314 } |
7315 else | |
7316 { | |
310 | 7317 if ( var_type != VAR_MajorCondition ) |
0 | 7318 { |
310 | 7319 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
0 | 7320 { |
310 | 7321 if ( (unsigned __int8)val + (unsigned __int8)byte_5E4C15[var_type] <= 255 ) |
7322 byte_5E4C15[var_type] += val; | |
0 | 7323 else |
310 | 7324 byte_5E4C15[var_type] = -1; |
0 | 7325 } |
7326 return; | |
7327 } | |
7328 memset(Dst, 0, 0xA0u); | |
7329 } | |
7330 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7331 goto _play_sound; | |
7332 } | |
7333 if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_autonote_bits[((signed __int16)val - 1) >> 3]) | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
7334 //&& (&dword_723718_autonote_related)[8 * val] ) |
1310 | 7335 && pAutonoteTxt[val].pText ) |
0 | 7336 { |
7337 v23 = pPlayers[uPlayerIdx + 1]; | |
7338 v34 = 1; | |
187 | 7339 v23->PlaySound(SPEECH_96, 0); |
1453 | 7340 //v24 = pAutonoteTxt[val].eType;//dword_72371C[2 * val]; |
0 | 7341 bFlashAutonotesBook = 1; |
1453 | 7342 _506568_autonote_type = pAutonoteTxt[val].eType; |
7343 } | |
7344 _449B7E_toggle_bit(pParty->_autonote_bits, val, 1); | |
0 | 7345 v3 = 1; |
7346 if ( v34 != 1 ) | |
1507 | 7347 { |
7348 if ( v3 != 1 ) | |
7349 return; | |
7350 goto _play_sound; | |
7351 } | |
7352 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7353 if ( v3 != 1 ) | |
7354 return; | |
7355 goto _play_sound; | |
0 | 7356 } |
310 | 7357 if ( var_type > VAR_GoldInBank ) |
7358 { | |
7359 if ( var_type == 307 ) | |
0 | 7360 { |
7361 pParty->uNumDeaths += val; | |
1507 | 7362 if ( v34 != 1 ) |
7363 { | |
7364 if ( v3 != 1 ) | |
7365 return; | |
7366 goto _play_sound; | |
7367 } | |
7368 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7369 if ( v3 != 1 ) | |
7370 return; | |
7371 goto _play_sound; | |
0 | 7372 } |
310 | 7373 switch ( var_type ) |
0 | 7374 { |
7375 case 308: | |
7376 pParty->uNumBountiesCollected += val; | |
7377 break; | |
7378 case 309: | |
7379 pParty->uNumPrisonTerms += val; | |
7380 break; | |
7381 case 310: | |
7382 pParty->uNumArenaPageWins += val; | |
7383 break; | |
7384 case 311: | |
7385 pParty->uNumArenaSquireWins += val; | |
7386 break; | |
7387 case 312: | |
7388 pParty->uNumArenaKnightWins += val; | |
7389 break; | |
7390 case 313: | |
7391 pParty->uNumArenaLordWins += val; | |
7392 break; | |
7393 } | |
7394 } | |
7395 else | |
7396 { | |
310 | 7397 if ( var_type == VAR_GoldInBank ) |
0 | 7398 { |
7399 pParty->uNumGoldInBank += val; | |
7400 return; | |
7401 } | |
310 | 7402 if ( var_type <= VAR_Counter8 ) |
7403 { | |
7404 if ( (signed int)var_type >= 245 ) | |
7405 { | |
7406 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); | |
7407 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 7408 } |
7409 else | |
7410 { | |
310 | 7411 switch ( var_type ) |
0 | 7412 { |
7413 case VAR_MonthEquals|VAR_CurrentSP: | |
7414 _449B7E_toggle_bit((unsigned char *)Dst->field_1A50, val, 1u); | |
7415 break; | |
7416 case VAR_NPCs2: | |
7417 pParty->field_709 = 0; | |
7418 LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u; | |
1035 | 7419 pParty->CountHirelings(); |
7420 viewparams->bRedrawGameUI = true; | |
0 | 7421 break; |
7422 case VAR_NumSkillPoints: | |
7423 Dst->uSkillPoints += val; | |
7424 break; | |
7425 } | |
7426 } | |
7427 return; | |
7428 } | |
310 | 7429 if ( var_type < VAR_Counter9 ) |
0 | 7430 return; |
310 | 7431 if ( (signed int)var_type <= 274 ) |
7432 { | |
7433 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); | |
7434 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 7435 goto _play_sound; |
7436 } | |
310 | 7437 if ( var_type != VAR_ReputationInCurrentLocation ) |
7438 { | |
7439 if ( var_type <= VAR_ReputationInCurrentLocation | |
7440 || var_type > VAR_History_28 | |
7441 || (v25 = var_type - 276, pParty->field_3C.field_4F0[2 * v25 + 1] | pParty->field_3C.field_4F0[2 * v25]) | |
7442 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
233 | 7443 v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0, |
310 | 7444 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 7445 v26) ) |
7446 return; | |
7447 bFlashHistoryBook = 1; | |
7448 _play_sound: | |
7449 v28 = 8 * uPlayerIdx + 400; | |
862 | 7450 LOBYTE(v28) = PID(OBJECT_Player,uPlayerIdx - 112); |
0 | 7451 pAudioPlayer->PlaySound(SOUND_20001, v28, 0, -1, 0, 0, 0, 0); |
7452 return; | |
7453 } | |
7454 v27 = &pOutdoor->ddm; | |
7455 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
7456 v27 = &pIndoor->dlv; | |
7457 v27->uReputation += val; | |
7458 if ( v27->uReputation > 10000 ) | |
7459 v27->uReputation = 10000; | |
7460 } | |
7461 } | |
7462 | |
7463 | |
7464 //----- (0044B9C4) -------------------------------------------------------- | |
501 | 7465 bool Player::SubtractVariable(enum VariableType VarNum, signed int pValue) |
0 | 7466 { |
7467 unsigned int v3; // ebx@1 | |
7468 signed int v4; // esi@1 | |
501 | 7469 bool result; // eax@8 |
0 | 7470 int v6; // esi@11 |
7471 int v7; // edi@14 | |
7472 signed int v8; // eax@17 | |
7473 char *v9; // eax@20 | |
7474 char v10; // sf@20 | |
7475 char *v11; // ecx@26 | |
7476 char *v12; // ecx@27 | |
7477 __int64 v13; // qax@27 | |
7478 unsigned __int8 v14; // cf@27 | |
501 | 7479 int *v15; // edx@29 |
0 | 7480 char *v16; // eax@90 |
7481 char *v17; // ecx@94 | |
501 | 7482 int v18; // esi@97 |
0 | 7483 signed int v19; // edx@97 |
7484 char *v20; // ecx@98 | |
7485 int v21; // eax@100 | |
7486 __int16 v22; // dx@112 | |
7487 int v23; // [sp-8h] [bp-14h]@45 | |
7488 signed int v24; // [sp-4h] [bp-10h]@4 | |
7489 int v25; // [sp-4h] [bp-10h]@45 | |
7490 | |
7491 v3 = 0; | |
605 | 7492 v4 = uActiveCharacter - 1; |
501 | 7493 result = false; |
7494 if ( (signed int)VarNum > 222 ) | |
7495 { | |
7496 if ( (signed int)VarNum <= 307 ) | |
7497 { | |
7498 if ( VarNum == 307 ) | |
7499 { | |
7500 pParty->uNumDeaths -= (unsigned int)pValue; | |
7501 return pValue; | |
7502 } | |
7503 if ( VarNum == 223 ) | |
0 | 7504 { |
7505 v11 = (char *)pParty->_autonote_bits; | |
501 | 7506 v22 = (short)pValue - 1; |
0 | 7507 } |
7508 else | |
7509 { | |
501 | 7510 if ( VarNum != 231 ) |
0 | 7511 { |
501 | 7512 switch ( VarNum ) |
0 | 7513 { |
7514 case 232: | |
501 | 7515 VarNum = (VariableType)0; |
1094 | 7516 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int*)&VarNum); |
501 | 7517 result = (bool) pValue; |
7518 dword_5B65CC = 0; | |
7519 if ( (int)VarNum == pValue ) | |
0 | 7520 { |
501 | 7521 dword_5B65CC = (int)pValue; |
0 | 7522 } |
7523 else | |
7524 { | |
7525 pParty->field_709 = 0; | |
501 | 7526 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
1035 | 7527 pParty->CountHirelings(); |
7528 viewparams->bRedrawGameUI = true; | |
0 | 7529 } |
7530 break; | |
7531 case 241: | |
7532 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
7533 { | |
7534 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; | |
605 | 7535 for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 ) |
0 | 7536 { |
605 | 7537 if ( *((void **)v20 + 4) == (void *)pValue ) |
0 | 7538 { |
7539 v21 = *(int *)v20; | |
7540 if ( (char)*(int *)v20 < 0 ) | |
7541 { | |
7542 LOBYTE(v21) = v21 & 0x7F; | |
7543 *(int *)v20 = v21; | |
7544 } | |
7545 } | |
7546 v20 += 76; | |
7547 } | |
7548 } | |
605 | 7549 if ( pParty->pHirelings[0].uProfession == pValue ) |
0 | 7550 memset(pParty->pHirelings, 0, 0x4Cu); |
605 | 7551 if ( pParty->pHirelings[1].uProfession == pValue ) |
0 | 7552 memset(&pParty->pHirelings[1], 0, 0x4Cu); |
7553 pParty->field_709 = 0; | |
1035 | 7554 pParty->CountHirelings(); |
0 | 7555 break; |
7556 case 243: | |
7557 v17 = (char *)&this->uSkillPoints; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7558 result = *v17 != NULL; |
501 | 7559 if ( (unsigned int)pValue <= *(int *)v17 ) |
7560 { | |
7561 *(int *)v17 -= (int)pValue; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7562 result = (v17 != NULL); |
501 | 7563 } |
0 | 7564 else |
7565 *(int *)v17 = 0; | |
7566 break; | |
7567 case 275: | |
7568 v16 = (char *)&pOutdoor->ddm; | |
7569 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
7570 v16 = (char *)&pIndoor->dlv; | |
501 | 7571 *((int *)v16 + 2) -= (int)pValue; |
0 | 7572 if ( *((int *)v16 + 2) < -10000 ) |
7573 *((int *)v16 + 2) = -10000; | |
7574 break; | |
7575 case 306: | |
501 | 7576 result = VarNum - 306; |
7577 if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) | |
7578 { | |
7579 result = (bool)pValue; | |
7580 pParty->uNumGoldInBank -= (unsigned int)pValue; | |
605 | 7581 } |
0 | 7582 else |
7583 LABEL_88: | |
7584 dword_5B65C4 = 1; | |
7585 break; | |
7586 } | |
501 | 7587 return result; |
0 | 7588 } |
7589 v11 = this->field_1A50; | |
501 | 7590 v22 = (signed __int16)pValue; |
0 | 7591 } |
7592 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); | |
501 | 7593 return result; |
7594 } | |
7595 switch ( VarNum ) | |
0 | 7596 { |
7597 case 308: | |
501 | 7598 result = (bool)pValue; |
7599 pParty->uNumBountiesCollected -= (unsigned int)pValue; | |
0 | 7600 break; |
7601 case 309: | |
501 | 7602 result = (bool)pValue; |
7603 pParty->uNumPrisonTerms -= (int)pValue; | |
0 | 7604 break; |
7605 case 310: | |
501 | 7606 result = (bool)pValue; |
7607 pParty->uNumArenaPageWins -= (char)pValue; | |
0 | 7608 break; |
7609 case 311: | |
501 | 7610 result = (bool)pValue; |
7611 pParty->uNumArenaSquireWins -= (char)pValue; | |
0 | 7612 break; |
7613 case 312: | |
501 | 7614 result = (bool)pValue; |
7615 pParty->uNumArenaKnightWins -= (char)pValue; | |
0 | 7616 break; |
7617 case 313: | |
501 | 7618 result = (bool)pValue; |
7619 pParty->uNumArenaLordWins -= (char)pValue; | |
0 | 7620 break; |
7621 } | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7622 assert(false && "Function not returning any value!"); |
0 | 7623 } |
7624 else | |
7625 { | |
501 | 7626 if ( (signed int)VarNum >= 123 ) |
7627 { | |
7628 byte_5E4C15[VarNum] -= (char)pValue; | |
0 | 7629 } |
7630 else | |
7631 { | |
501 | 7632 switch ( VarNum ) |
0 | 7633 { |
7634 case VAR_RandomGold: | |
501 | 7635 v6 = rand() % (signed int)pValue + 1; |
0 | 7636 if ( v6 > pParty->uNumGold ) |
7637 v6 = pParty->uNumGold; | |
7638 Party::TakeGold(v6); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7639 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7640 ShowStatusBarString(pTmpBuf.data(), 2); |
0 | 7641 GameUI_DrawFoodAndGold(); |
501 | 7642 return result; |
0 | 7643 case VAR_RandomFood: |
501 | 7644 v7 = rand() % (signed int)pValue + 1; |
0 | 7645 if ( v7 > pParty->uNumFoodRations ) |
7646 v7 = pParty->uNumFoodRations; | |
7647 Party::TakeFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7648 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7649 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 7650 GameUI_DrawFoodAndGold(); |
605 | 7651 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7652 v8 = 8 * v4 + 400; | |
862 | 7653 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7654 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 7655 return result; |
0 | 7656 case VAR_CurrentHP: |
1036 | 7657 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL); |
605 | 7658 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7659 v8 = 8 * v4 + 400; | |
862 | 7660 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7661 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7662 return result; | |
0 | 7663 case VAR_CurrentSP: |
7664 v9 = (char *)&this->sMana; | |
501 | 7665 v10 = this->sMana - (signed int)pValue < 0; |
7666 *(int *)v9 -= (int)pValue; | |
0 | 7667 if ( v10 ) |
7668 *(int *)v9 = 0; | |
605 | 7669 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7670 v8 = 8 * v4 + 400; | |
862 | 7671 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7672 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7673 return result; | |
0 | 7674 case VAR_ACModifier: |
501 | 7675 this->sACModifier -= (unsigned __int8)pValue; |
605 | 7676 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7677 v8 = 8 * v4 + 400; | |
862 | 7678 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7679 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7680 return result; | |
0 | 7681 case VAR_BaseLevel: |
501 | 7682 this->uLevel -= (unsigned __int8)pValue; |
605 | 7683 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7684 v8 = 8 * v4 + 400; | |
862 | 7685 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7686 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7687 return result; | |
0 | 7688 case VAR_LevelModifier: |
501 | 7689 this->sLevelModifier -= (unsigned __int8)pValue; |
605 | 7690 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7691 v8 = 8 * v4 + 400; | |
862 | 7692 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7693 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7694 return result; | |
0 | 7695 case VAR_Age: |
501 | 7696 this->sAgeModifier -= (signed __int16)pValue; |
7697 return result; | |
0 | 7698 case VAR_Award: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
7699 _449B7E_toggle_bit((unsigned char *)this->_achieved_awards_bits, (signed __int16)pValue, 0); |
605 | 7700 return result; |
0 | 7701 case VAR_Experience: |
7702 v12 = (char *)&this->uExperience; | |
501 | 7703 v13 = (signed int)pValue; |
7704 v14 = *(int *)v12 < (unsigned int)pValue; | |
7705 *(int *)v12 -= (int)pValue; | |
0 | 7706 *((int *)v12 + 1) -= v14 + HIDWORD(v13); |
605 | 7707 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7708 v8 = 8 * v4 + 400; | |
862 | 7709 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7710 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7711 return result; | |
0 | 7712 case VAR_QBits_QuestsDone: |
501 | 7713 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); |
187 | 7714 pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); |
501 | 7715 return true; |
0 | 7716 case VAR_PlayerItemInHands: |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
7717 v15 = this->pInventoryMatrix; |
0 | 7718 break; |
7719 case VAR_FixedGold: | |
501 | 7720 if ( (unsigned int)pValue > pParty->uNumGold ) |
0 | 7721 goto LABEL_88; |
501 | 7722 Party::TakeGold((unsigned int)pValue); |
7723 return result; | |
0 | 7724 case VAR_MightBonus: |
7725 case VAR_ActualMight: | |
501 | 7726 this->uMightBonus -= (unsigned __int16)pValue; |
605 | 7727 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7728 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7729 v8 = 8 * v4 + 400; | |
862 | 7730 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7731 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7732 return result; | |
0 | 7733 case VAR_IntellectBonus: |
7734 case VAR_ActualIntellect: | |
501 | 7735 this->uIntelligenceBonus -= (unsigned __int16)pValue; |
605 | 7736 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7737 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7738 v8 = 8 * v4 + 400; | |
862 | 7739 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7740 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7741 return result; | |
0 | 7742 case VAR_PersonalityBonus: |
7743 case VAR_ActualPersonality: | |
501 | 7744 this->uWillpowerBonus -= (unsigned __int16)pValue; |
605 | 7745 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7746 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7747 v8 = 8 * v4 + 400; | |
862 | 7748 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7749 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7750 return result; | |
0 | 7751 case VAR_EnduranceBonus: |
7752 case VAR_ActualEndurance: | |
501 | 7753 this->uEnduranceBonus -= (unsigned __int16)pValue; |
605 | 7754 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7755 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7756 v8 = 8 * v4 + 400; | |
862 | 7757 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7758 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7759 return result; | |
0 | 7760 case VAR_SpeedBonus: |
7761 case VAR_ActualSpeed: | |
501 | 7762 this->uSpeedBonus -= (unsigned __int16)pValue; |
605 | 7763 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7764 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7765 v8 = 8 * v4 + 400; | |
862 | 7766 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7767 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7768 return result; | |
0 | 7769 case VAR_AccuracyBonus: |
7770 case VAR_ActualAccuracy: | |
501 | 7771 this->uAccuracyBonus -= (unsigned __int16)pValue; |
605 | 7772 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7773 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7774 v8 = 8 * v4 + 400; | |
862 | 7775 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7776 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7777 return result; | |
0 | 7778 case VAR_LuckBonus: |
7779 case VAR_ActualLuck: | |
501 | 7780 this->uLuckBonus -= (unsigned __int16)pValue; |
605 | 7781 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7782 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7783 v8 = 8 * v4 + 400; | |
862 | 7784 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7785 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7786 return result; | |
0 | 7787 case VAR_BaseMight: |
501 | 7788 this->uMight -= (unsigned __int16)pValue; |
605 | 7789 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7790 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7791 v8 = 8 * v4 + 400; | |
862 | 7792 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7793 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7794 return result; | |
0 | 7795 case VAR_BaseIntellect: |
501 | 7796 this->uIntelligence -= (unsigned __int16)pValue; |
605 | 7797 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7798 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7799 v8 = 8 * v4 + 400; | |
862 | 7800 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7801 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7802 return result; | |
0 | 7803 case VAR_BasePersonality: |
501 | 7804 this->uWillpower -= (unsigned __int16)pValue; |
605 | 7805 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7806 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7807 v8 = 8 * v4 + 400; | |
862 | 7808 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7809 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7810 return result; | |
0 | 7811 case VAR_BaseEndurance: |
501 | 7812 this->uEndurance -= (unsigned __int16)pValue; |
605 | 7813 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7814 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7815 v8 = 8 * v4 + 400; | |
862 | 7816 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7817 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7818 return result; | |
0 | 7819 case VAR_BaseSpeed: |
501 | 7820 this->uSpeed -= (unsigned __int16)pValue; |
605 | 7821 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7822 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7823 v8 = 8 * v4 + 400; | |
862 | 7824 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7825 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7826 return result; | |
0 | 7827 case VAR_BaseAccuracy: |
501 | 7828 this->uAccuracy -= (unsigned __int16)pValue; |
605 | 7829 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7830 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7831 v8 = 8 * v4 + 400; | |
862 | 7832 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7833 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7834 return result; | |
0 | 7835 case VAR_BaseLuck: |
501 | 7836 this->uLuck -= (unsigned __int16)pValue; |
605 | 7837 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7838 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7839 v8 = 8 * v4 + 400; | |
862 | 7840 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7841 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7842 return result; | |
0 | 7843 case VAR_FireResistance: |
501 | 7844 this->sResFireBase -= (signed __int16)pValue; |
605 | 7845 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7846 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7847 v8 = 8 * v4 + 400; | |
862 | 7848 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7849 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7850 return result; | |
0 | 7851 case VAR_AirResistance: |
501 | 7852 this->sResAirBase -= (signed __int16)pValue; |
605 | 7853 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7854 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7855 v8 = 8 * v4 + 400; | |
862 | 7856 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7857 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7858 return result; | |
0 | 7859 case VAR_WaterResistance: |
501 | 7860 this->sResWaterBase -= (signed __int16)pValue; |
605 | 7861 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7862 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7863 v8 = 8 * v4 + 400; | |
862 | 7864 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7865 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7866 return result; | |
0 | 7867 case VAR_EarthResistance: |
501 | 7868 this->sResEarthBase -= (signed __int16)pValue; |
605 | 7869 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7870 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7871 v8 = 8 * v4 + 400; | |
862 | 7872 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7873 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7874 return result; | |
0 | 7875 case VAR_SpiritResistance: |
501 | 7876 this->sResSpiritBase -= (signed __int16)pValue; |
605 | 7877 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7878 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7879 v8 = 8 * v4 + 400; | |
862 | 7880 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7881 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7882 return result; | |
0 | 7883 case VAR_MindResistance: |
501 | 7884 this->sResMindBase -= (signed __int16)pValue; |
605 | 7885 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7886 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7887 v8 = 8 * v4 + 400; | |
862 | 7888 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7889 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7890 return result; | |
0 | 7891 case VAR_BodyResistance: |
501 | 7892 this->sResBodyBase -= (signed __int16)pValue; |
605 | 7893 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7894 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7895 v8 = 8 * v4 + 400; | |
862 | 7896 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7897 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7898 return result; | |
0 | 7899 case VAR_LightResistance: |
501 | 7900 this->sResLightBase -= (signed __int16)pValue; |
605 | 7901 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7902 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7903 v8 = 8 * v4 + 400; | |
862 | 7904 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7905 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7906 return result; | |
0 | 7907 case VAR_DarkResistance: |
501 | 7908 this->sResDarkBase -= (signed __int16)pValue; |
605 | 7909 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7910 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7911 v8 = 8 * v4 + 400; | |
862 | 7912 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7913 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7914 return result; | |
0 | 7915 case VAR_MagicResistance: |
501 | 7916 this->sResMagicBase -= (signed __int16)pValue; |
605 | 7917 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7918 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7919 v8 = 8 * v4 + 400; | |
862 | 7920 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7921 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7922 return result; | |
0 | 7923 case VAR_FireResistanceBonus: |
501 | 7924 this->sResFireBonus -= (signed __int16)pValue; |
605 | 7925 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7926 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7927 v8 = 8 * v4 + 400; | |
862 | 7928 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7929 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7930 return result; | |
0 | 7931 case VAR_AirResistanceBonus: |
501 | 7932 this->sResAirBonus -= (signed __int16)pValue; |
605 | 7933 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7934 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7935 v8 = 8 * v4 + 400; | |
862 | 7936 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7937 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7938 return result; | |
0 | 7939 case VAR_WaterResistanceBonus: |
501 | 7940 this->sResWaterBonus -= (signed __int16)pValue; |
605 | 7941 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7942 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7943 v8 = 8 * v4 + 400; | |
862 | 7944 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7945 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7946 return result; | |
0 | 7947 case VAR_EarthResistanceBonus: |
501 | 7948 this->sResEarthBonus -= (signed __int16)pValue; |
605 | 7949 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7950 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7951 v8 = 8 * v4 + 400; | |
862 | 7952 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7953 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7954 return result; | |
0 | 7955 case VAR_SpiritResistanceBonus: |
501 | 7956 this->sResSpiritBonus -= (signed __int16)pValue; |
605 | 7957 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7958 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7959 v8 = 8 * v4 + 400; | |
862 | 7960 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7961 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7962 return result; | |
0 | 7963 case VAR_MindResistanceBonus: |
501 | 7964 this->sResMindBonus -= (signed __int16)pValue; |
605 | 7965 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7966 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7967 v8 = 8 * v4 + 400; | |
862 | 7968 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7969 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7970 return result; | |
0 | 7971 case VAR_BodyResistanceBonus: |
501 | 7972 this->sResBodyBonus -= (signed __int16)pValue; |
605 | 7973 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7974 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7975 v8 = 8 * v4 + 400; | |
862 | 7976 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7977 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7978 return result; | |
0 | 7979 case VAR_LightResistanceBonus: |
501 | 7980 this->sResLightBonus -= (signed __int16)pValue; |
605 | 7981 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7982 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7983 v8 = 8 * v4 + 400; | |
862 | 7984 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7985 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7986 return result; | |
0 | 7987 case VAR_DarkResistanceBonus: |
501 | 7988 this->sResDarkBonus -= (signed __int16)pValue; |
605 | 7989 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7990 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7991 v8 = 8 * v4 + 400; | |
862 | 7992 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7993 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7994 return result; | |
0 | 7995 case VAR_MagicResistanceBonus: |
501 | 7996 this->sResMagicBonus -= (signed __int16)pValue; |
0 | 7997 v25 = 0; |
187 | 7998 v23 = SPEECH_91; |
7999 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); | |
605 | 8000 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8001 v8 = 8 * v4 + 400; | |
862 | 8002 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8003 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8004 return result; | |
0 | 8005 case VAR_FixedFood: |
501 | 8006 Party::TakeFood((unsigned int)pValue); |
605 | 8007 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8008 v8 = 8 * v4 + 400; | |
862 | 8009 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8010 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8011 return result; | |
0 | 8012 case VAR_StaffSkill: |
8013 case VAR_SwordSkill: | |
8014 case VAR_DaggerSkill: | |
8015 case VAR_AxeSkill: | |
8016 case VAR_SpearSkill: | |
8017 case VAR_BowSkill: | |
8018 case VAR_MaceSkill: | |
8019 case VAR_BlasterSkill: | |
8020 case VAR_ShieldSkill: | |
8021 case VAR_LeatherSkill: | |
8022 case VAR_SkillChain: | |
8023 case VAR_PlateSkill: | |
8024 case VAR_FireSkill: | |
8025 case VAR_AirSkill: | |
8026 case VAR_WaterSkill: | |
8027 case VAR_EarthSkill: | |
8028 case VAR_SpiritSkill: | |
8029 case VAR_MindSkill: | |
8030 case VAR_BodySkill: | |
8031 case VAR_LightSkill: | |
8032 case VAR_DarkSkill: | |
8033 case VAR_IdentifyItemSkill: | |
8034 case VAR_MerchantSkill: | |
8035 case VAR_RepairSkill: | |
8036 case VAR_BodybuildingSkill: | |
8037 case VAR_MeditationSkill: | |
8038 case VAR_PerceptionSkill: | |
8039 case VAR_DiplomacySkill: | |
8040 case VAR_DisarmTrapSkill: | |
8041 case VAR_LearningSkill: | |
501 | 8042 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue; |
605 | 8043 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8044 v8 = 8 * v4 + 400; | |
862 | 8045 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8046 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8047 return result; | |
0 | 8048 case VAR_Cursed: |
8049 case VAR_Weak: | |
8050 case VAR_Asleep: | |
8051 case VAR_Afraid: | |
8052 case VAR_Drunk: | |
8053 case VAR_Insane: | |
8054 case VAR_PoisonedGreen: | |
8055 case VAR_DiseasedGreen: | |
8056 case VAR_PoisonedYellow: | |
8057 case VAR_DiseasedYellow: | |
8058 case VAR_PoisonedRed: | |
8059 case VAR_DiseasedRed: | |
8060 case VAR_Paralyzed: | |
8061 case VAR_Unconsious: | |
8062 case VAR_Dead: | |
8063 case VAR_Stoned: | |
8064 case VAR_Eradicated: | |
1071 | 8065 //*((int *)this + 2 * VarNum - 210) = 0; |
8066 //*((int *)this + 2 * result - 209) = 0; | |
8067 this->pConditions[VarNum] = 0; | |
0 | 8068 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8069 v8 = 8 * v4 + 400; | |
862 | 8070 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
0 | 8071 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 8072 return result; |
605 | 8073 default: |
8074 return result; | |
8075 } | |
8076 for (v3 = 1; v3 < 126; v3++) | |
8077 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8078 if ( *(&this->pInventoryItemList[pInventoryMatrix[v3] - 1].uItemID) == pValue ) |
0 | 8079 { |
605 | 8080 RemoveItemAtInventoryIndex(v3); |
501 | 8081 return true; |
0 | 8082 } |
605 | 8083 } |
501 | 8084 if ( pParty->pPickedItem.uItemID == pValue ) |
8085 { | |
605 | 8086 pMouse->RemoveHoldingItem(); |
8087 return true; | |
8088 } | |
8089 return false; | |
0 | 8090 } |
8091 } | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
8092 |
1430 | 8093 //assert(false); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
8094 return false; |
0 | 8095 } |
8096 // 5B65C4: using guessed type int dword_5B65C4; | |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8097 // 5B65CC: using guessed type int dword_5B65CC; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8098 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8099 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8100 //----- (00467E7F) -------------------------------------------------------- |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8101 void Player::EquipBody(ITEM_EQUIP_TYPE uEquipType) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8102 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8103 //unsigned int v1; // esi@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8104 int v2; // ebx@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8105 Player *v3; // eax@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8106 int v4; // edx@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8107 int v5; // esi@2 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8108 //int v6; // eax@2 |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
8109 int v7; // eax@3 |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8110 ItemGen _this; // [sp+Ch] [bp-30h]@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8111 //Player *v9; // [sp+30h] [bp-Ch]@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8112 int v10; // [sp+34h] [bp-8h]@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8113 int *v11; // [sp+38h] [bp-4h]@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8114 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8115 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8116 _this.Reset(); |
1374 | 8117 v2 = pEquipTypeToBodyAnchor[uEquipType]; |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8118 v3 = pPlayers[uActiveCharacter]; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8119 v11 = (int *)&v3->pEquipment.pIndices[v2]; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8120 v4 = *v11; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8121 v10 = *v11; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8122 if ( v10 ) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8123 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8124 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8125 v5 = (int)((char *)v3 + 4 * (9 * v4 - 9)); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8126 *(char *)(v5 + 556) = 0; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8127 pParty->pPickedItem.Reset(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8128 pParty->SetHoldingItem((ItemGen *)(v5 + 532)); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8129 _this.uBodyAnchor = v2 + 1; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8130 memcpy((void *)(v5 + 532), &_this, 0x24u); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8131 *v11 = v10; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8132 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8133 else |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8134 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8135 v7 = v3->FindFreeInventoryListSlot(); |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8136 if (v7 >= 0) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8137 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8138 pParty->pPickedItem.uBodyAnchor = v2 + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8139 memcpy(&v3->pInventoryItemList[v7], &pParty->pPickedItem, sizeof(v3->pInventoryItemList[v7])); |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8140 *v11 = v7 + 1; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8141 pMouse->RemoveHoldingItem(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8142 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8143 } |
1295 | 8144 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8145 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8146 |
1295 | 8147 //----- (0049387A) -------------------------------------------------------- |
1459 | 8148 int CycleCharacter(bool backwards) |
1295 | 8149 { |
8150 signed int result; // eax@1 | |
8151 signed int v2; // ecx@2 | |
8152 signed int v3; // ecx@8 | |
8153 | |
8154 result = uActiveCharacter; | |
1459 | 8155 if ( backwards ) |
1295 | 8156 { |
8157 v2 = 0; | |
8158 while ( 1 ) | |
8159 { | |
8160 --result; | |
8161 if ( result < 1 ) | |
8162 result = 4; | |
8163 if ( !pPlayers[result]->uTimeToRecovery ) | |
8164 break; | |
8165 ++v2; | |
8166 if ( v2 >= 4 ) | |
8167 return uActiveCharacter; | |
8168 } | |
8169 } | |
8170 else | |
8171 { | |
8172 v3 = 0; | |
8173 while ( 1 ) | |
8174 { | |
8175 ++result; | |
8176 if ( result > 4 ) | |
8177 result = 1; | |
8178 if ( !pPlayers[result]->uTimeToRecovery ) | |
8179 break; | |
8180 ++v3; | |
8181 if ( v3 >= 4 ) | |
8182 return uActiveCharacter; | |
8183 } | |
8184 } | |
8185 return result; | |
1297 | 8186 } |
8187 //----- (0043EE77) -------------------------------------------------------- | |
8188 bool __fastcall sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(signed int a1) | |
8189 { | |
8190 bool result; // eax@0 | |
8191 Player *v2; // edx@3 | |
8192 int v3; // ecx@3 | |
8193 Player **pPlayers; // esi@8 | |
1424 | 8194 //bool item_flag; |
1297 | 8195 Player *v6; // edx@9 |
8196 | |
1424 | 8197 //if ( a1 < 1 || a1 > 4 ) |
8198 //{ | |
8199 //if ( !a1 ) | |
8200 //{ | |
8201 //pPlayers = &::pPlayers[1]; | |
8202 //v5 = 604; | |
8203 //while ( 1 ) | |
8204 assert ( a1 > 0 && a1 < 5 ); | |
1432 | 8205 for ( uint i = 1; i < 5; ++i ) |
1424 | 8206 { |
8207 //item_flag = Player_has_item(604, *pPlayers, 0); | |
8208 if ( !Player_has_item(604, ::pPlayers[i], 0) ) | |
8209 return false; | |
8210 //__debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used | |
8211 //result = ::pPlayers[i]->pEquipment.uArmor; | |
8212 if ( !::pPlayers[i]->pEquipment.uArmor ) | |
8213 return false; | |
8214 //result *= 9; | |
1432 | 8215 if (::pPlayers[i]->pEquippedItems[::pPlayers[i]->pEquipment.uArmor].uItemID != 604 ) |
1424 | 8216 return false; |
8217 //++pPlayers; | |
8218 //if ( (signed int)pPlayers >= (signed int)&qword_A750D8 ) | |
8219 //return true; | |
8220 } | |
8221 return true; | |
8222 } | |
1432 | 8223 |
1297 | 8224 //----- (0043EE15) -------------------------------------------------------- |
8225 bool __fastcall Player_has_item(unsigned int uItemID, Player *pPlayer, char a3) | |
8226 { | |
8227 if ( !a3 || pParty->pPickedItem.uItemID != uItemID ) | |
8228 { | |
8229 for ( uint i = 0; i < 126; ++i ) | |
8230 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8231 if ( pPlayer->pInventoryMatrix[i] > 0 ) |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8232 { |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8233 if ( (unsigned int)pPlayer->pInventoryItemList[pPlayer->pInventoryMatrix[i] - 1].uItemID == uItemID ) |
1297 | 8234 return true; |
8235 } | |
8236 } | |
8237 for ( uint i = 0; i < 16; ++i ) | |
8238 { | |
8239 if ( pPlayer->pEquipment.pIndices[i] ) | |
8240 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8241 if ( (unsigned int)pPlayer->pInventoryItemList[pPlayer->pEquipment.pIndices[i] - 1].uItemID == uItemID ) |
1297 | 8242 return true; |
8243 } | |
8244 } | |
8245 } | |
8246 return false; | |
8247 } | |
8248 //----- (0043EDB9) -------------------------------------------------------- | |
1458 | 8249 bool sub_43EDB9_get_some_race_sex_relation_2(unsigned int a1) |
1297 | 8250 { |
8251 unsigned int pNum; // ebp@1 | |
8252 Player **pPlayer; // ebx@1 | |
8253 Player *pPlayer2; // esi@2 | |
8254 enum CHARACTER_RACE pRace; // edi@2 | |
8255 bool pSex; // eax@2 | |
8256 char v6; // zf@7 | |
8257 | |
8258 //pPlayer = &pPlayers[1]; | |
8259 /*pNum = a1; | |
8260 | |
8261 while ( 1 ) | |
8262 { | |
8263 pPlayer2 = *pPlayer; | |
8264 pRace = pPlayer2->GetRace(); | |
8265 pSex = pPlayer2->GetSexByVoice(); | |
8266 if ( !pRace ) | |
8267 break; | |
8268 if ( pRace == 1 || pRace == 2 ) | |
8269 break; | |
8270 if ( !pSex && pNum == 2 )// | |
8271 //goto LABEL_15; | |
8272 { | |
8273 pSex = 1; | |
8274 return pSex; | |
8275 } | |
8276 v6 = pNum == 3;// | |
8277 LABEL_11: | |
8278 if ( v6 ) | |
8279 //goto LABEL_15; | |
8280 { | |
8281 pSex = 1; | |
8282 return pSex; | |
8283 } | |
8284 ++pPlayer; | |
8285 if ( (signed int)pPlayer >= (signed int)&qword_A750D8 )// | |
8286 { | |
8287 pSex = 0; | |
8288 return pSex; | |
8289 } | |
8290 } | |
8291 if ( pSex || pNum ) | |
8292 { | |
8293 v6 = pNum == 1; | |
8294 goto LABEL_11; | |
8295 } | |
8296 //LABEL_15: | |
8297 pSex = 1; | |
8298 return pSex;*/ | |
8299 for (uint i = 1; i <= 4; ++i) | |
8300 { | |
8301 pRace = pPlayers[i]->GetRace(); | |
8302 pSex = pPlayers[i]->GetSexByVoice(); | |
8303 if (pRace == 0 || pRace == 1 || pRace == 2 || pSex == 0 ) | |
8304 return 1; | |
8305 } | |
8306 return 0; | |
8307 } | |
8308 //----- (0043ED6F) -------------------------------------------------------- | |
8309 bool _43ED6F_check_party_races(bool a1) | |
8310 { | |
8311 bool v6; // zf@5 | |
8312 | |
8313 for (uint i = 0; i < 4; ++i) | |
8314 { | |
8315 auto player = pParty->pPlayers + i; | |
8316 auto race = player->GetRace(); | |
8317 | |
8318 if (race != CHARACTER_RACE_HUMAN && | |
8319 race != CHARACTER_RACE_ELF && | |
8320 race != CHARACTER_RACE_GOBLIN) | |
8321 v6 = a1 == 1; | |
8322 else | |
8323 v6 = !a1; | |
8324 | |
8325 if (v6) | |
8326 return true; | |
8327 } | |
8328 return false; | |
8329 } | |
8330 //----- (00439FCB) -------------------------------------------------------- | |
8331 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4) | |
8332 { | |
8333 signed int v4; // esi@1 | |
8334 unsigned int v5; // ecx@1 | |
8335 Player *v6; // ebx@3 | |
8336 Actor *v7; // esi@3 | |
8337 unsigned int v8; // eax@4 | |
8338 char *v9; // eax@5 | |
8339 signed int v10; // eax@6 | |
8340 int v11; // edx@8 | |
8341 int v12; // edx@9 | |
8342 int v13; // edx@10 | |
8343 int v14; // edx@16 | |
8344 int v15; // edx@17 | |
8345 int v16; // edx@18 | |
8346 enum SoundID v17; // eax@24 | |
8347 int v18; // eax@26 | |
8348 unsigned __int8 v19; // zf@26 | |
8349 unsigned __int8 v20; // sf@26 | |
8350 unsigned __int16 v21; // ax@29 | |
8351 signed int v22; // edi@36 | |
8352 int v23; // eax@38 | |
8353 signed int v24; // eax@44 | |
8354 unsigned __int16 v25; // cx@47 | |
8355 signed int v26; // eax@49 | |
8356 int v27; // eax@54 | |
8357 float v28; // ST18_4@58 | |
8358 double v29; // st7@58 | |
8359 float v30; // ST08_4@58 | |
8360 double v31; // st7@58 | |
8361 float v32; // ST04_4@58 | |
8362 float v33; // ST00_4@58 | |
8363 int v34; // edi@61 | |
8364 int v35; // eax@70 | |
8365 double v36; // st7@70 | |
8366 SpriteObject *v37; // ebx@77 | |
8367 int v38; // edi@77 | |
8368 int v39; // esi@77 | |
8369 int v40; // eax@77 | |
8370 int v41; // eax@77 | |
8371 int v42; // eax@78 | |
8372 Player *v43; // eax@81 | |
8373 Actor *v44; // esi@82 | |
8374 Player *v45; // edi@84 | |
8375 unsigned __int16 v46; // ax@84 | |
8376 int v47; // ebx@105 | |
8377 int v48; // eax@107 | |
8378 unsigned __int16 v49; // ax@116 | |
8379 int v50; // ebx@123 | |
8380 unsigned __int16 v51; // ax@124 | |
8381 char v52; // bl@124 | |
8382 int v53; // eax@128 | |
8383 signed int v54; // eax@134 | |
8384 unsigned __int16 v55; // cx@137 | |
8385 signed int v56; // eax@139 | |
8386 int v57; // eax@144 | |
8387 float v58; // ST18_4@148 | |
8388 double v59; // st7@148 | |
8389 float v60; // ST08_4@148 | |
8390 double v61; // st7@148 | |
8391 float v62; // ST04_4@148 | |
8392 float v63; // ST00_4@148 | |
8393 int v64; // ebx@151 | |
8394 int v65; // eax@161 | |
8395 double v66; // st7@161 | |
8396 signed int v67; // ecx@164 | |
8397 signed int v68; // eax@170 | |
8398 int v69; // ecx@170 | |
8399 int v70; // eax@171 | |
8400 enum SoundID v71; // [sp+20h] [bp-34h]@12 | |
8401 int v72; // [sp+30h] [bp-24h]@164 | |
8402 double v73; // [sp+40h] [bp-14h]@72 | |
8403 signed int v74; // [sp+44h] [bp-10h]@1 | |
8404 unsigned int v75; // [sp+48h] [bp-Ch]@3 | |
8405 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 | |
8406 int v77; // [sp+50h] [bp-4h]@26 | |
8407 signed int a4a; // [sp+60h] [bp+Ch]@162 | |
8408 Player *a4b; // [sp+60h] [bp+Ch]@168 | |
8409 | |
8410 v4 = PID_ID(uObjID); | |
8411 v5 = PID_TYPE(uObjID) - 2; | |
8412 v74 = a2; | |
8413 uActorID = v4; | |
8414 if ( v5 ) | |
8415 { | |
8416 if ( v5 != 1 | |
8417 || (v6 = &pParty->pPlayers[a4], v7 = &pActors[v4], | |
8418 v75 = v6->sHealth, | |
8419 !stru_50C198.ActorHitOrMiss(v7, v6)) ) | |
8420 return; | |
8421 v8 = v6->pEquipment.uArmor; | |
8422 if ( !v8 | |
8423 || (v9 = (char *)v6 + 36 * v8, v9[516] & 2) | |
8424 || (v10 = pItemsTable->pItems[*((int *)v9 + 124)].uSkillType, v10 < 10) | |
8425 || v10 > 11 ) | |
8426 { | |
8427 v14 = rand() % 4; | |
8428 if ( !v14 ) | |
8429 { | |
8430 v71 = (SoundID)108; | |
8431 goto LABEL_24; | |
8432 } | |
8433 v15 = v14 - 1; | |
8434 if ( !v15 ) | |
8435 { | |
8436 v71 = (SoundID)109; | |
8437 goto LABEL_24; | |
8438 } | |
8439 v16 = v15 - 1; | |
8440 if ( !v16 ) | |
8441 { | |
8442 v71 = (SoundID)110; | |
8443 goto LABEL_24; | |
8444 } | |
8445 if ( v16 == 1 ) | |
8446 { | |
8447 v71 = (SoundID)44; | |
8448 goto LABEL_24; | |
8449 } | |
8450 } | |
8451 else | |
8452 { | |
8453 v11 = rand() % 4; | |
8454 if ( !v11 ) | |
8455 { | |
8456 v71 = (SoundID)105; | |
8457 goto LABEL_24; | |
8458 } | |
8459 v12 = v11 - 1; | |
8460 if ( !v12 ) | |
8461 { | |
8462 v71 = (SoundID)106; | |
8463 goto LABEL_24; | |
8464 } | |
8465 v13 = v12 - 1; | |
8466 if ( !v13 ) | |
8467 { | |
8468 v71 = (SoundID)107; | |
8469 goto LABEL_24; | |
8470 } | |
8471 if ( v13 == 1 ) | |
8472 { | |
8473 v71 = (SoundID)45; | |
8474 LABEL_24: | |
8475 v17 = v71; | |
8476 goto LABEL_26; | |
8477 } | |
8478 } | |
8479 v17 = (SoundID)a4; | |
8480 LABEL_26: | |
8481 pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); | |
8482 v18 = Actor::_43B3E0_CalcDamage(v7, v74); | |
8483 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; | |
8484 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; | |
8485 v77 = v18; | |
8486 if ( !v20 && (!(v20 | v19) || LODWORD(v7->pActorBuffs[3].uExpireTime) > 0) ) | |
8487 { | |
8488 v21 = v7->pActorBuffs[3].uPower; | |
8489 if ( v21 ) | |
8490 v77 /= (signed int)v21; | |
8491 } | |
8492 if ( v74 ) | |
8493 { | |
8494 if ( v74 == 1 ) | |
8495 { | |
8496 v22 = v7->pMonsterInfo.uAttack2Type; | |
8497 } | |
8498 else | |
8499 { | |
8500 if ( v74 == 2 ) | |
8501 { | |
8502 v23 = v7->pMonsterInfo.uSpell1ID; | |
8503 } | |
8504 else | |
8505 { | |
8506 if ( v74 != 3 ) | |
8507 { | |
8508 if ( v74 == 4 ) | |
8509 v22 = v7->pMonsterInfo.field_3C_some_special_attack; | |
8510 else | |
8511 v22 = 4; | |
8512 goto LABEL_43; | |
8513 } | |
8514 v23 = v7->pMonsterInfo.uSpell2ID; | |
8515 } | |
8516 v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool); | |
8517 } | |
8518 } | |
8519 else | |
8520 { | |
8521 v22 = v7->pMonsterInfo.uAttack1Type; | |
8522 } | |
8523 LABEL_43: | |
8524 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
8525 { | |
8526 v24 = v6->ReceiveDamage(v77, (DAMAGE_TYPE)v22); | |
8527 if ( SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) >= 0 | |
8528 && (SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v6->pPlayerBuffs[10].uExpireTime)) ) | |
8529 { | |
8530 v25 = v7->uAIState; | |
8531 if ( v25 != 5 ) | |
8532 { | |
8533 if ( v25 != 4 ) | |
8534 { | |
8535 v26 = stru_50C198.CalcMagicalDamageToActor(v7, v22, v24); | |
8536 v7->sCurrentHP -= v26; | |
8537 if ( v26 ) | |
8538 { | |
8539 if ( v7->sCurrentHP >= 1 ) | |
8540 { | |
8541 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); | |
8542 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8543 } | |
8544 else | |
8545 { | |
8546 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) | |
8547 { | |
8548 v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v7->uActorRadius : v7->uActorRadius; | |
8549 v74 = v27; | |
8550 if ( pRenderer->pRenderD3D ) | |
8551 { | |
8552 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | |
8553 { | |
8554 v28 = (double)v74; | |
8555 v74 = v7->vPosition.z; | |
8556 v29 = (double)v74; | |
8557 v74 = v7->vPosition.y; | |
8558 v30 = v29; | |
8559 v31 = (double)v74; | |
8560 v74 = v7->vPosition.x; | |
8561 v32 = v31; | |
8562 v33 = (double)v74; | |
8563 pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0); | |
8564 } | |
8565 } | |
8566 } | |
8567 Actor::Die(uActorID); | |
8568 Actor::ApplyFineForKillingPeasant(uActorID); | |
8569 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8570 if ( v7->pMonsterInfo.uExp ) | |
8571 GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); | |
8572 v34 = SPEECH_51; | |
8573 if ( rand() % 100 < 20 ) | |
8574 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; | |
8575 v6->PlaySound((PlayerSpeech)v34, 0); | |
8576 } | |
8577 } | |
8578 } | |
8579 } | |
8580 } | |
8581 if ( !(dword_6BE368_debug_settings_2 & 0x10) | |
8582 && v7->pMonsterInfo.uSpecialAttack | |
8583 && rand() % 100 < v7->pMonsterInfo.uLevel * v7->pMonsterInfo.uSpecialAttackType ) | |
8584 v6->_48DCF6(v7->pMonsterInfo.uSpecialAttack, v7); | |
8585 } | |
8586 if ( !pParty->bTurnBasedModeOn ) | |
8587 { | |
8588 v35 = v6->GetActualEndurance(); | |
8589 v36 = (double)(20 - v6->GetParameterBonus(v35)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; | |
8590 v6->SetRecoveryTime((signed __int64)v36); | |
8591 } | |
8592 if ( v77 ) | |
8593 { | |
8594 v73 = (double)(signed int)v75; | |
8595 if ( (double)v6->GetMaxHealth() * 0.25 < v73 ) | |
8596 { | |
8597 if ( v6->sHealth > 0 ) | |
8598 { | |
8599 if ( (double)v6->GetMaxHealth() * 0.25 >= (double)v6->sHealth ) | |
8600 v6->PlaySound(SPEECH_48, 0); | |
8601 } | |
8602 } | |
8603 } | |
8604 viewparams->bRedrawGameUI = 1; | |
8605 return; | |
8606 } | |
8607 v37 = &pSpriteObjects[uActorID]; | |
8608 v38 = PID_TYPE(v37->spell_caster_pid); | |
8609 v39 = PID_ID(v37->spell_caster_pid); | |
8610 v40 = PID_TYPE(v37->spell_caster_pid); | |
8611 uActorID = PID_ID(v37->spell_caster_pid); | |
8612 v41 = v40 - 2; | |
8613 if ( !v41 ) | |
8614 goto LABEL_80; | |
8615 v42 = v41 - 1; | |
8616 if ( !v42 ) | |
8617 { | |
8618 v44 = &pActors[v39]; | |
8619 if ( a4 == -1 ) | |
8620 a4 = stru_50C198.which_player_would_attack(v44); | |
8621 v45 = &pParty->pPlayers[a4]; | |
8622 v77 = Actor::_43B3E0_CalcDamage(v44, v74); | |
8623 v46 = v37->uType; | |
8624 if ( v37->uType == 545 ) | |
8625 { | |
8626 LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
8627 v52 = v51; | |
8628 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) | |
8629 { | |
8630 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName); | |
8631 ShowStatusBarString(pTmpBuf.data(), 2u); | |
8632 v45->PlaySound(SPEECH_6, 0); | |
8633 return; | |
8634 } | |
8635 } | |
8636 else | |
8637 { | |
8638 if ( v46 != 555 | |
8639 && v46 != 510 | |
8640 && v46 != 500 | |
8641 && v46 != 515 | |
8642 && v46 != 505 | |
8643 && v46 != 530 | |
8644 && v46 != 525 | |
8645 && v46 != 520 | |
8646 && v46 != 535 | |
8647 && v46 != 540 ) | |
8648 goto LABEL_115; | |
8649 } | |
8650 if ( !stru_50C198.ActorHitOrMiss(v44, v45) ) | |
8651 return; | |
8652 if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 ) | |
8653 v77 >>= 1; | |
8654 if ( v45->HasEnchantedItemEquipped(36) ) | |
8655 v77 >>= 1; | |
8656 if ( v45->HasEnchantedItemEquipped(69) ) | |
8657 v77 >>= 1; | |
8658 if ( v45->HasItemEquipped(EQUIP_ARMOUR) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8659 && *(_DWORD *)&v45->pInventoryItemList[v45->pEquipment.uArmor-1] == 504 ) |
1297 | 8660 v77 >>= 1; |
8661 v75 = 0; | |
8662 v47 = (int)&v45->pEquipment; | |
8663 do | |
8664 { | |
8665 if ( v45->HasItemEquipped((ITEM_EQUIP_TYPE)v75) ) | |
8666 { | |
8667 v48 = *(int *)&v45[36 * *(int *)v47 + 496]; | |
8668 if ( v48 == 520 ) | |
8669 v77 >>= 1; | |
8670 if ( v48 == 531 ) | |
8671 v77 >>= 1; | |
8672 if ( v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4 ) | |
8673 v77 >>= 1; | |
8674 } | |
8675 ++v75; | |
8676 v47 += 4; | |
8677 } | |
8678 while ( (signed int)v75 <= 1 ); | |
8679 LABEL_115: | |
8680 if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 ) | |
8681 { | |
8682 v49 = v44->pActorBuffs[3].uPower; | |
8683 if ( v49 ) | |
8684 v77 /= (signed int)v49; | |
8685 } | |
8686 if ( !v74 ) | |
8687 { | |
8688 v50 = v44->pMonsterInfo.uAttack1Type; | |
8689 goto LABEL_133; | |
8690 } | |
8691 if ( v74 == 1 ) | |
8692 { | |
8693 v50 = v44->pMonsterInfo.uAttack2Type; | |
8694 goto LABEL_133; | |
8695 } | |
8696 if ( v74 == 2 ) | |
8697 { | |
8698 v53 = v44->pMonsterInfo.uSpell1ID; | |
8699 } | |
8700 else | |
8701 { | |
8702 if ( v74 != 3 ) | |
8703 { | |
8704 if ( v74 == 4 ) | |
8705 v50 = v44->pMonsterInfo.field_3C_some_special_attack; | |
8706 else | |
8707 v50 = 4; | |
8708 LABEL_133: | |
8709 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
8710 { | |
8711 v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50); | |
8712 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 ) | |
8713 { | |
8714 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) ) | |
8715 { | |
8716 v55 = v44->uAIState; | |
8717 if ( v55 != 5 ) | |
8718 { | |
8719 if ( v55 != 4 ) | |
8720 { | |
8721 v56 = stru_50C198.CalcMagicalDamageToActor(v44, v50, v54); | |
8722 v44->sCurrentHP -= v56; | |
8723 if ( v56 ) | |
8724 { | |
8725 if ( v44->sCurrentHP >= 1 ) | |
8726 { | |
8727 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); | |
8728 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8729 } | |
8730 else | |
8731 { | |
8732 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) | |
8733 { | |
8734 v57 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v44->uActorRadius : v44->uActorRadius; | |
8735 v75 = v57; | |
8736 if ( pRenderer->pRenderD3D ) | |
8737 { | |
8738 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | |
8739 { | |
8740 v58 = (double)(signed int)v75; | |
8741 v75 = v44->vPosition.z; | |
8742 v59 = (double)(signed int)v75; | |
8743 v75 = v44->vPosition.y; | |
8744 v60 = v59; | |
8745 v61 = (double)(signed int)v75; | |
8746 v75 = v44->vPosition.x; | |
8747 v62 = v61; | |
8748 v63 = (double)(signed int)v75; | |
8749 pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0); | |
8750 } | |
8751 } | |
8752 } | |
8753 Actor::Die(uActorID); | |
8754 Actor::ApplyFineForKillingPeasant(uActorID); | |
8755 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8756 if ( v44->pMonsterInfo.uExp ) | |
8757 GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp); | |
8758 v64 = SPEECH_51; | |
8759 if ( rand() % 100 < 20 ) | |
8760 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1; | |
8761 v45->PlaySound((PlayerSpeech)v64, 0); | |
8762 } | |
8763 } | |
8764 } | |
8765 } | |
8766 } | |
8767 } | |
8768 } | |
8769 if ( !v74 | |
8770 && !(dword_6BE368_debug_settings_2 & 0x10) | |
8771 && v44->pMonsterInfo.uSpecialAttack | |
8772 && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType ) | |
8773 v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); | |
8774 if ( !pParty->bTurnBasedModeOn ) | |
8775 { | |
8776 v65 = v45->GetActualEndurance(); | |
8777 v66 = (double)(20 - v45->GetParameterBonus(v65)) | |
8778 * flt_6BE3A4_debug_recmod1 | |
8779 * 2.133333333333333; | |
8780 v45->SetRecoveryTime((signed __int64)v66); | |
8781 } | |
8782 return; | |
8783 } | |
8784 v53 = v44->pMonsterInfo.uSpell2ID; | |
8785 } | |
8786 v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool); | |
8787 goto LABEL_133; | |
8788 } | |
8789 if ( v42 != 1 ) | |
8790 return; | |
8791 LABEL_80: | |
8792 if ( a4 != -1 ) | |
8793 { | |
8794 v43 = &pParty->pPlayers[a4]; | |
8795 LABEL_168: | |
8796 a4b = v43; | |
8797 if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) | |
8798 { | |
8799 v70 = v43->GetMaxHealth(); | |
8800 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70); | |
8801 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); | |
8802 } | |
8803 else | |
8804 { | |
8805 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); | |
8806 v69 = 0; | |
8807 } | |
8808 a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69); | |
8809 if ( v38 == OBJECT_Player && !qword_A750D8 ) | |
8810 { | |
8811 qword_A750D8 = 256i64; | |
1406 | 8812 PlayerSpeechID = SPEECH_44; |
1407 | 8813 uSpeakingCharacter = uActorID + 1; |
1297 | 8814 } |
8815 return; | |
8816 } | |
8817 v74 = 0; | |
8818 a4a = 1; | |
8819 do | |
8820 { | |
8821 if ( pPlayers[a4a]->CanAct() ) | |
8822 { | |
8823 v67 = v74++; | |
8824 *(&v72 + v67) = a4a; | |
8825 } | |
8826 ++a4a; | |
8827 } | |
8828 while ( a4a <= 4 ); | |
8829 if ( v74 ) | |
8830 { | |
8831 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; | |
8832 goto LABEL_168; | |
8833 } | |
8834 } | |
8835 //----- (00421EA6) -------------------------------------------------------- | |
1458 | 8836 void OnInventoryLeftClick() |
1297 | 8837 { |
8838 Player *v0; // ebx@1 | |
8839 signed int v1; // eax@2 | |
8840 signed int v2; // ecx@2 | |
8841 int v3; // eax@2 | |
8842 char v4; // sf@2 | |
8843 int v5; // eax@2 | |
8844 unsigned int v6; // eax@7 | |
8845 unsigned int v7; // esi@12 | |
8846 unsigned int v8; // eax@12 | |
8847 unsigned int v9; // eax@16 | |
8848 unsigned int v10; // eax@18 | |
8849 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
8850 POINT a2; // [sp+30h] [bp-18h]@4 | |
8851 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
8852 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
8853 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
8854 int a4; // [sp+44h] [bp-4h]@2 | |
8855 | |
8856 v0 = pPlayers[uActiveCharacter]; | |
8857 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) | |
8858 { | |
8859 pMouse->GetClickPos(&pX, &pY); | |
8860 pY = pY - 17; | |
8861 v2 =pX - 14; | |
8862 pX = v2; | |
8863 v3 = 14 * (pY >> 5); | |
8864 v2 >>= 5; | |
8865 v4 = v2 + v3 < 0; | |
8866 v5 = v2 + v3; | |
8867 a4 = v5; | |
8868 if ( !v4 ) | |
8869 { | |
8870 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 | |
8871 && pMouse->GetCursorPos(&a2)->x >= 14 ) | |
8872 { | |
8873 if ( unk_50C9A0 ) | |
8874 { | |
8875 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
8876 if ( v6 ) | |
8877 { | |
8878 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
8879 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
8880 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
8881 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8882 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItemList[v6-1]; |
1297 | 8883 unk_50C9A0 = 0; |
8884 if ( pMessageQueue_50CBD0->uNumMessages ) | |
8885 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
8886 pMouse->SetCursorBitmap("MICON1"); | |
8887 dword_50C9D0 = 113; | |
8888 dword_50C9D4 = 0; | |
8889 dword_50C9D8 = 256; | |
8890 } | |
8891 return; | |
8892 } | |
8893 if ( ptr_50C9A4 ) | |
8894 return; | |
8895 v7 = pParty->pPickedItem.uItemID; | |
8896 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
8897 if ( !v7 ) | |
8898 { | |
8899 if ( !v8 ) | |
8900 return; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8901 memcpy(&pParty->pPickedItem, &v0->pInventoryItemList[v8-1], sizeof(pParty->pPickedItem)); |
1297 | 8902 v0->RemoveItemAtInventoryIndex(a4); |
8903 v9 = pParty->pPickedItem.uItemID; | |
8904 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
8905 return; | |
8906 } | |
8907 v13 = v8; | |
8908 if ( v8 ) | |
8909 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8910 a2.y = (LONG)&v0->pInventoryItemList[v8-1]; |
1297 | 8911 memcpy(&this_, (const void *)a2.y, sizeof(this_)); |
8912 v0->RemoveItemAtInventoryIndex(a4); | |
8913 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
8914 if ( !pX ) | |
8915 { | |
8916 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
8917 if ( !pX ) | |
8918 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
8919 v0->PutItemArInventoryIndex(this_.uItemID, v13 - 1, a4); |
1297 | 8920 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); |
8921 return; | |
8922 } | |
8923 } | |
8924 v9 = this_.uItemID; | |
8925 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
8926 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
8927 return; | |
8928 } | |
8929 v10 = v0->AddItem(a4, v7); | |
8930 pX = v10; | |
8931 if ( v10 || (v10 = v0->AddItem(-1, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
8932 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8933 memcpy(&v0->pInventoryItemList[v10-1], &pParty->pPickedItem, 0x24u); |
1297 | 8934 pMouse->RemoveHoldingItem(); |
8935 } | |
8936 } | |
8937 } | |
8938 } | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8939 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8940 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8941 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8942 bool Player::IsWeak() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8943 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8944 return pConditions[Condition_Weak] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8945 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8946 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8947 bool Player::IsDead() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8948 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8949 return pConditions[Condition_Dead] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8950 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8951 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8952 bool Player::IsEradicated() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8953 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8954 return pConditions[Condition_Eradicated] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8955 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8956 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8957 bool Player::IsZombie() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8958 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8959 return pConditions[Condition_Zombie] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8960 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8961 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8962 bool Player::IsCursed() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8963 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8964 return pConditions[Condition_Cursed] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8965 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8966 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8967 bool Player::IsPertified() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8968 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8969 return pConditions[Condition_Pertified] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8970 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8971 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8972 bool Player::IsUnconcious() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8973 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8974 return pConditions[Condition_Unconcious] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8975 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8976 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8977 bool Player::IsAsleep() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8978 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8979 return pConditions[Condition_Sleep] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8980 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8981 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8982 bool Player::IsParalyzed() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8983 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8984 return pConditions[Condition_Paralyzed] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8985 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8986 |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8987 void Player::SetCursed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8988 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8989 pConditions[Condition_Cursed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8990 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8991 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8992 void Player::SetWeak( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8993 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8994 pConditions[Condition_Weak] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8995 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8996 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8997 void Player::SetAsleep( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8998 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8999 pConditions[Condition_Sleep] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9000 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9001 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9002 void Player::SetAfraid( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9003 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9004 pConditions[Condition_Fear] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9005 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9006 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9007 void Player::SetDrunk( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9008 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9009 pConditions[Condition_Drunk] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9010 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9011 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9012 void Player::SetInsane( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9013 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9014 pConditions[Condition_Insane] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9015 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9016 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9017 void Player::SetPoison1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9018 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9019 pConditions[Condition_Poison1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9020 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9021 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9022 void Player::SetDisease1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9023 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9024 pConditions[Condition_Disease1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9025 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9026 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9027 void Player::SetPoison2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9028 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9029 pConditions[Condition_Poison2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9030 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9031 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9032 void Player::SetDisease2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9033 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9034 pConditions[Condition_Disease2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9035 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9036 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9037 void Player::SetPoison3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9038 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9039 pConditions[Condition_Poison3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9040 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9041 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9042 void Player::SetDisease3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9043 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9044 pConditions[Condition_Disease3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9045 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9046 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9047 void Player::SetParalyzed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9048 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9049 pConditions[Condition_Paralyzed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9050 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9051 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9052 void Player::SetUnconcious( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9053 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9054 pConditions[Condition_Unconcious] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9055 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9056 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9057 void Player::SetDead( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9058 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9059 pConditions[Condition_Dead] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9060 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9061 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9062 void Player::SetPertified( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9063 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9064 pConditions[Condition_Pertified] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9065 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9066 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9067 void Player::SetEradicated( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9068 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9069 pConditions[Condition_Eradicated] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9070 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9071 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9072 void Player::SetZombie( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9073 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9074 pConditions[Condition_Zombie] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9075 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9076 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9077 void Player::SetCondWeakWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9078 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9079 SetCondition(Condition_Weak, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9080 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9081 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9082 void Player::SetCondInsaneWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9083 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9084 SetCondition(Condition_Insane, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9085 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9086 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9087 void Player::SetCondDeadWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9088 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9089 SetCondition(Condition_Dead, blockable); |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9090 } |