Mercurial > mm7
annotate Player.cpp @ 1547:778916dfa666
Player::GetRangedDamageString fix + some small chnages
author | Grumpy7 |
---|---|
date | Sat, 07 Sep 2013 06:51:56 +0200 |
parents | 5cf28ec7322d |
children | 5a3afcaa6717 |
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 { | |
818 assert("Items should have nonzero dimensions"); | |
819 return 1; | |
820 } | |
821 if ( (slotWidth + uSlot % INVETORYSLOTSWIDTH) <= INVETORYSLOTSWIDTH && (slotHeight + uSlot / INVETORYSLOTSWIDTH) <= INVETORYSLOTSHEIGHT ) | |
822 { | |
823 int startOfInnerLoop = uSlot; | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
824 for (unsigned int y = 0; y < slotHeight; y++) |
1363 | 825 { |
826 int innerLoopPos = startOfInnerLoop; | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
827 for (unsigned int x = 0; x < slotWidth; x++) |
1363 | 828 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
829 if (pInventoryMatrix[innerLoopPos] != 0) |
1363 | 830 { |
831 return false; | |
832 } | |
833 innerLoopPos++; | |
834 } | |
835 startOfInnerLoop += INVETORYSLOTSWIDTH; | |
836 } | |
837 return true; | |
838 } | |
839 return false; | |
0 | 840 } |
841 // 506128: using guessed type int areWeLoadingTexture; | |
842 | |
843 //----- (004925E6) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
844 int Player::FindFreeInventoryListSlot() |
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 for (int i = 0; i < 126; i++ ) |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
847 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
848 if (pInventoryItemList[i].uItemID == 0) |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
849 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
850 return i; |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
851 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
852 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
853 return -1; |
0 | 854 } |
855 | |
856 //----- (00492600) -------------------------------------------------------- | |
857 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) | |
858 { | |
859 int result; // eax@8 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
860 signed int freeSlot; // [sp+8h] [bp-4h]@4 |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
861 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
862 freeSlot = FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
863 if ( freeSlot == -1 ) |
0 | 864 { |
865 if ( uActiveCharacter ) | |
201 | 866 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
1366
8f339c3bbdaf
Player::CreateItemInInventory small bugfix from previous change
Grumpy7
parents:
1365
diff
changeset
|
867 return 0; |
0 | 868 } |
869 else | |
870 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
871 PutItemArInventoryIndex(uItemID, freeSlot, uSlot); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
872 result = freeSlot + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
873 this->pInventoryItemList[freeSlot].uItemID = uItemID; |
0 | 874 } |
875 return result; | |
876 } | |
877 // 506128: using guessed type int areWeLoadingTexture; | |
878 | |
879 //----- (00492700) -------------------------------------------------------- | |
880 int Player::HasSkill(unsigned int uSkillType) | |
881 { | |
1374 | 882 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) |
883 { | |
884 return 1; | |
0 | 885 } |
886 else | |
887 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
888 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
889 ShowStatusBarString(pTmpBuf.data(), 2u); |
1374 | 890 return 0; |
891 } | |
0 | 892 } |
893 | |
894 //----- (00492745) -------------------------------------------------------- | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
895 void Player::WearItem( unsigned int uItemID ) |
0 | 896 { |
1010 | 897 int item_body_anch; // edi@6 |
898 int item_indx; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
899 item_indx = FindFreeInventoryListSlot(); |
1010 | 900 |
901 if ( item_indx != -1 ) | |
902 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
903 pInventoryItemList[item_indx].uItemID = uItemID; |
1374 | 904 item_body_anch = pEquipTypeToBodyAnchor[pItemsTable->pItems[uItemID].uEquipType]; |
905 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
|
906 pInventoryItemList[item_indx].uBodyAnchor = item_body_anch + 1; |
0 | 907 } |
908 } | |
909 | |
910 //----- (004927A8) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
911 int Player::AddItem(int index, unsigned int uItemID) |
0 | 912 { |
1374 | 913 int xStartValue = 0; |
1385 | 914 int startOfInnerLoop = 0; |
1374 | 915 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
916 if ( index == -1 ) |
0 | 917 { |
1374 | 918 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) |
919 { | |
1385 | 920 int innerLoopPos = startOfInnerLoop; |
921 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) | |
922 { | |
923 if ( CanFitItem(innerLoopPos, uItemID) ) | |
0 | 924 { |
1385 | 925 return CreateItemInInventory(innerLoopPos, uItemID); |
0 | 926 } |
1385 | 927 innerLoopPos++; |
928 } | |
929 startOfInnerLoop += INVETORYSLOTSWIDTH; | |
0 | 930 } |
931 return 0; | |
932 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
933 if ( !CanFitItem(index, uItemID) ) |
0 | 934 { |
935 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
936 return 0; | |
937 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
938 return CreateItemInInventory(index, uItemID); |
0 | 939 } |
940 | |
941 //----- (00492826) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
942 int Player::AddItem2(int index, ItemGen *Src) |
0 | 943 { |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
944 int xStartValue = 0; |
0 | 945 pItemsTable->SetSpecialBonus(Src); |
1385 | 946 int startOfInnerLoop = 0; |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
947 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
948 if ( index == -1 ) |
0 | 949 { |
1385 | 950 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) //TODO: change pInventoryMatrix to 2 dimensional array. |
951 { | |
952 int innerLoopPos = startOfInnerLoop; | |
953 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) | |
954 { | |
955 if ( CanFitItem(innerLoopPos, Src->uItemID) ) | |
0 | 956 { |
1385 | 957 return CreateItemInInventory2(innerLoopPos, Src); |
0 | 958 } |
1385 | 959 innerLoopPos++; |
960 } | |
961 startOfInnerLoop += INVETORYSLOTSWIDTH; | |
0 | 962 } |
963 return 0; | |
964 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
965 if ( !CanFitItem(index, Src->uItemID) ) |
0 | 966 return 0; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
967 return CreateItemInInventory2(index, Src); |
0 | 968 } |
969 | |
970 //----- (0049289C) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
971 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src ) |
0 | 972 { |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
973 signed int freeSlot; // ebx@1 |
0 | 974 int result; // eax@6 |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
975 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
976 freeSlot = FindFreeInventoryListSlot(); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
977 if ( freeSlot == -1 ) |
0 | 978 { |
979 result = 0; | |
980 } | |
981 else | |
982 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
983 PutItemArInventoryIndex(Src->uItemID, freeSlot, index); |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
984 memcpy(&pInventoryItemList[freeSlot], Src, sizeof(ItemGen)); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
985 result = freeSlot + 1; |
0 | 986 } |
987 return result; | |
988 } | |
989 // 506128: using guessed type int areWeLoadingTexture; | |
990 | |
991 //----- (0049298B) -------------------------------------------------------- | |
1385 | 992 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
|
993 { |
1014 | 994 Texture *item_texture; // esi@1 |
995 int *pInvPos; // esi@4 | |
996 unsigned int slot_width; // [sp+Ch] [bp-4h]@1 | |
997 unsigned int slot_height; // [sp+18h] [bp+8h]@1 | |
998 | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
999 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1014 | 1000 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); |
1001 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 1002 if ( !areWeLoadingTexture ) |
1003 { | |
1014 | 1004 item_texture->Release(); |
1006 | 1005 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1006 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1007 if ( slot_width > 0 ) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1008 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1009 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1010 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1011 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1012 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
|
1013 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1014 } |
1014 | 1015 } |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1016 pInventoryMatrix[index] = itemListPos + 1; |
0 | 1017 } |
278 | 1018 |
0 | 1019 // 506128: using guessed type int areWeLoadingTexture; |
1020 | |
1021 //----- (00492A36) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1022 void Player::RemoveItemAtInventoryIndex( unsigned int index ) |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1023 { |
1014 | 1024 ItemGen *item_in_slot; // ecx@1 |
1025 Texture *item_texture; // esi@1 | |
1026 unsigned int slot_height; // ebp@1 | |
1027 int *pInvPos; // edx@4 | |
1028 unsigned int slot_width; // [sp+14h] [bp+4h]@1 | |
1029 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1030 item_in_slot = &this->pInventoryItemList[pInventoryMatrix[index]-1]; |
1014 | 1031 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item_in_slot->uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1032 item_in_slot->Reset(); | |
1033 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); | |
1034 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 1035 if ( !areWeLoadingTexture ) |
1036 { | |
1014 | 1037 item_texture->Release(); |
1006 | 1038 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1039 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1040 if ( slot_width > 0 ) |
1014 | 1041 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1042 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1043 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1044 { |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1045 memset32(pInvPos, 0, slot_width); |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1046 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1047 } |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1048 } |
0 | 1049 } |
1050 // 506128: using guessed type int areWeLoadingTexture; | |
1051 | |
1052 //----- (00490EEE) -------------------------------------------------------- | |
1386 | 1053 int Player::SelectPhrasesTransaction(ItemGen *pItem, int building_type, int BuildID_2Events, int ShopMenuType) //TODO: probably move this somewhere else, not really Player:: stuff |
1054 { | |
1055 unsigned int idemId; // edx@1 | |
1056 signed int equipType; // esi@1 | |
1057 float multiplier; // ST04_4@26 | |
1058 int price; // edi@26 | |
1059 int merchantLevel; // [sp+10h] [bp-8h]@1 | |
1060 int itemValue; | |
1061 | |
1062 merchantLevel = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); | |
1063 idemId = pItem->uItemID; | |
1064 equipType = pItemsTable->pItems[idemId].uEquipType; | |
1065 itemValue = pItem->GetValue(); | |
1066 | |
1067 switch (building_type) | |
1068 { | |
1411 | 1069 case BuildingType_WeaponShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1070 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1071 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1072 if (equipType > EQUIP_BOW) |
1386 | 1073 return 4; |
1074 break; | |
1411 | 1075 case BuildingType_ArmorShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1076 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1077 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1078 if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS) |
1386 | 1079 return 4; |
1080 break; | |
1411 | 1081 case BuildingType_MagicShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1082 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1083 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1084 if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC ) |
1386 | 1085 return 4; |
1086 break; | |
1411 | 1087 case BuildingType_AlchemistShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1088 if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE) |
1386 | 1089 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1090 if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL)) |
1386 | 1091 return 4; |
1092 break; | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1093 default: |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1094 assert(false); |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1095 break; |
1386 | 1096 } |
1097 if (pItem->Stolen()) | |
1098 return 6; | |
1099 | |
1100 multiplier = p2DEvents[BuildID_2Events - 1].fPriceMultiplier; | |
1101 switch (ShopMenuType) | |
1102 { | |
1103 case 2: | |
1104 price = GetBuyingPrice(itemValue, multiplier); | |
1105 break; | |
1106 case 3: | |
917 | 1107 if (pItem->Broken()) |
1386 | 1108 price = 1; |
917 | 1109 else |
1386 | 1110 price = this->GetPriceSell(itemValue, multiplier); |
1111 break; | |
1112 case 4: | |
1113 price = this->GetPriceIdentification(multiplier); | |
1114 break; | |
1115 case 5: | |
1116 price = this->GetPriceRepair(itemValue, multiplier); | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1117 break; |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1118 default: |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1119 assert(false); |
1386 | 1120 break; |
1121 } | |
1122 if ( merchantLevel ) | |
1123 { | |
1124 if (price == itemValue) | |
1125 { | |
1126 return 3; | |
1127 } | |
917 | 1128 else |
1386 | 1129 { |
1130 return 2; | |
1131 } | |
1132 } | |
0 | 1133 else |
1386 | 1134 { |
1135 return 1; | |
1136 } | |
0 | 1137 } |
1138 | |
1139 //----- (0049107D) -------------------------------------------------------- | |
1140 int Player::GetBodybuilding() | |
1141 { | |
1010 | 1142 int v1; // al@1 |
0 | 1143 int v2; // ecx@1 |
1144 int v4; // eax@3 | |
1145 signed int v6; // [sp-4h] [bp-4h]@2 | |
1146 | |
1147 v1 = GetActualSkillLevel(PLAYER_SKILL_BODYBUILDING); | |
1148 v2 = v1 & 0x3F; | |
1149 if ( v1 & 0x100 ) | |
1150 { | |
1151 v6 = 5; | |
1152 } | |
1153 else | |
1154 { | |
1008 | 1155 if ( (v1&0xFF) >= 0 ) |
0 | 1156 { |
1157 v4 = ((v1 & 0x40) != 0) + 1; | |
1158 return v2 * v4; | |
1159 } | |
1160 v6 = 3; | |
1161 } | |
1162 v4 = v6; | |
1163 return v2 * v4; | |
1164 } | |
1165 | |
1166 //----- (004910A8) -------------------------------------------------------- | |
607 | 1167 int Player::GetMeditation() |
0 | 1168 { |
1010 | 1169 int v1; // al@1 |
1008 | 1170 int base_level; // ecx@1 |
0 | 1171 int v4; // eax@3 |
1172 signed int v6; // [sp-4h] [bp-4h]@2 | |
1173 | |
1174 v1 = GetActualSkillLevel(PLAYER_SKILL_MEDITATION); | |
1008 | 1175 base_level = v1 & 0x3F; |
0 | 1176 if ( v1 & 0x100 ) |
1177 { | |
1178 v6 = 5; | |
1179 } | |
1180 else | |
1181 { | |
1008 | 1182 if ( (v1&0xFF) >= 0 ) |
0 | 1183 { |
1184 v4 = ((v1 & 0x40) != 0) + 1; | |
1008 | 1185 return base_level * v4; |
0 | 1186 } |
1187 v6 = 3; | |
1188 } | |
1189 v4 = v6; | |
1008 | 1190 return base_level * v4; |
0 | 1191 } |
1192 | |
1193 //----- (004910D3) -------------------------------------------------------- | |
1194 int Player::CanIdentify(ItemGen *pItem) | |
1195 { | |
1196 unsigned __int16 v2; // ax@1 | |
1197 unsigned __int16 v3; // bx@1 | |
1198 int uSkillMult; // eax@3 | |
1199 int v5; // edi@7 | |
1200 signed int v6; // ebp@7 | |
1201 char *v7; // esi@7 | |
1202 signed int uSkillMultiplier; // [sp-4h] [bp-14h]@2 | |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
1203 |
652 | 1204 if (CheckHiredNPCSpeciality(Scholar)) |
1205 return true; | |
0 | 1206 |
179 | 1207 v2 = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_ITEM_ID); |
0 | 1208 v3 = v2; |
179 | 1209 if ( v2 & 1 ) |
0 | 1210 { |
1211 uSkillMultiplier = 5; | |
1212 } | |
1213 else | |
1214 { | |
1215 if ( (v2 & 0x80u) == 0 ) | |
1216 { | |
1217 uSkillMult = ((v2 & 0x40) != 0) + 1; | |
179 | 1218 v5 = uSkillMult * (v3 & 0x3F); |
1219 v6 = 0; | |
1220 v7 = (char *)&pItemsTable->pItems[pItem->uItemID].pIconName; | |
652 | 1221 |
179 | 1222 if ( (signed int)SkillToMastery(v3) >= 4 ) |
1223 v6 = 1; | |
1224 if ( v5 >= (unsigned __int8)v7[46] ) | |
1225 v6 = 1; | |
1226 return v6; | |
0 | 1227 } |
1228 uSkillMultiplier = 3; | |
1229 } | |
1230 uSkillMult = uSkillMultiplier; | |
1231 v5 = uSkillMult * (v3 & 0x3F); | |
1232 v6 = 0; | |
1233 v7 = (char *)&pItemsTable->pItems[pItem->uItemID].pIconName; | |
652 | 1234 |
0 | 1235 if ( (signed int)SkillToMastery(v3) >= 4 ) |
1236 v6 = 1; | |
1237 if ( v5 >= (unsigned __int8)v7[46] ) | |
1238 v6 = 1; | |
1239 return v6; | |
1240 } | |
1241 | |
1242 //----- (00491151) -------------------------------------------------------- | |
1243 int Player::CanRepair(ItemGen *a2) | |
1244 { | |
1245 unsigned __int16 v2; // ax@1 | |
1246 unsigned __int16 v3; // bx@1 | |
1247 int v4; // eax@3 | |
1248 int v5; // edi@7 | |
1249 signed int v6; // ebp@7 | |
1250 signed int v10; // [sp-4h] [bp-14h]@2 | |
1251 | |
652 | 1252 |
1253 auto v7 = &pItemsTable->pItems[a2->uItemID]; | |
1254 if (CheckHiredNPCSpeciality(Smith) && v7->uEquipType <= 2 || | |
1255 CheckHiredNPCSpeciality(Armorer) && v7->uEquipType >= 3 && v7->uEquipType <= 9 || | |
1256 CheckHiredNPCSpeciality(Alchemist) && v7->uEquipType >= 9 ) | |
1257 return true; | |
1258 | |
1010 | 1259 v2 = GetActualSkillLevel(PLAYER_SKILL_REPAIR); |
0 | 1260 v3 = v2; |
1010 | 1261 if (v2 & 0x100 ) |
0 | 1262 { |
1263 v10 = 5; | |
1264 } | |
1265 else | |
1266 { | |
1267 if ( (v2 & 0x80u) == 0 ) | |
1268 { | |
1269 v4 = ((v2 & 0x40) != 0) + 1; | |
1270 goto LABEL_7; | |
1271 } | |
1272 v10 = 3; | |
1273 } | |
1274 v4 = v10; | |
1275 LABEL_7: | |
1276 v5 = v4 * (v3 & 0x3F); | |
1277 v6 = 0; | |
1278 if ( (signed int)SkillToMastery(v3) >= 4 ) | |
1279 return true; | |
1280 if ( v5 >= *((char *)(v7 + 1) + 2) ) | |
1281 { | |
1282 __debugbreak(); // really odd | |
1283 return true; | |
1284 } | |
1285 return false; | |
1286 } | |
1287 | |
1288 //----- (004911F3) -------------------------------------------------------- | |
1289 int Player::GetMerchant() | |
1290 { | |
1291 Player *v1; // edi@1 | |
1292 unsigned __int16 v2; // ax@1 | |
1293 unsigned __int16 v3; // bx@1 | |
1294 int v4; // esi@1 | |
1295 int v5; // edi@1 | |
1296 int v7; // eax@3 | |
1297 int v8; // ecx@7 | |
1298 signed int v9; // [sp-4h] [bp-10h]@6 | |
1299 | |
1300 v1 = this; | |
607 | 1301 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); |
1010 | 1302 v3 = v1->pActiveSkills[PLAYER_SKILL_MERCHANT]; |
607 | 1303 v4 = v2 & 0x003F; |
1010 | 1304 v5 = v1->pActiveSkills[PLAYER_SKILL_MERCHANT] & 0x3F; |
0 | 1305 if ( (signed int)SkillToMastery(v2) >= 4 ) |
1306 return 10000; | |
1307 v7 = GetPartyReputation(); | |
1308 if ( !v4 ) | |
1309 return -v7; | |
1010 | 1310 if ( v3 & 0x100 ) |
0 | 1311 { |
1312 v9 = 5; | |
1313 } | |
1314 else | |
1315 { | |
1316 if ( (v3 & 0x80u) == 0 ) | |
1317 { | |
1318 v8 = ((v3 & 0x40) != 0) + 1; | |
1319 return v5 * (v8 - 1) - v7 + v4 + 7; | |
1320 } | |
1321 v9 = 3; | |
1322 } | |
1323 v8 = v9; | |
1324 return v5 * (v8 - 1) - v7 + v4 + 7; | |
1325 } | |
1326 | |
1327 //----- (0049125A) -------------------------------------------------------- | |
1328 int Player::GetPerception() | |
1329 { | |
1330 Player *v1; // edi@1 | |
1331 unsigned __int16 v2; // ax@1 | |
1332 unsigned __int16 v3; // bx@1 | |
1333 int v4; // esi@1 | |
1334 int v5; // edi@1 | |
1335 int v7; // eax@5 | |
1336 signed int v8; // [sp-4h] [bp-10h]@4 | |
1337 | |
1338 v1 = this; | |
1010 | 1339 v2 = GetActualSkillLevel(PLAYER_SKILL_PERCEPTION); |
1340 v3 = v1->pActiveSkills[PLAYER_SKILL_PERCEPTION]; | |
0 | 1341 v4 = v2 & 0x3F; |
1010 | 1342 v5 = v1->pActiveSkills[PLAYER_SKILL_PERCEPTION] & 0x3F; |
0 | 1343 if ( (signed int)SkillToMastery(v2) >= 4 ) |
1344 return 10000; | |
1010 | 1345 if ( v3 & 0x100 ) |
0 | 1346 { |
1347 v8 = 5; | |
1348 } | |
1349 else | |
1350 { | |
1351 if ( (v3 & 0x80u) == 0 ) | |
1352 { | |
1353 v7 = ((v3 & 0x40) != 0) + 1; | |
1354 return v4 + v5 * (v7 - 1); | |
1355 } | |
1356 v8 = 3; | |
1357 } | |
1358 v7 = v8; | |
1359 return v4 + v5 * (v7 - 1); | |
1360 } | |
1361 | |
1362 //----- (004912B0) -------------------------------------------------------- | |
1363 int Player::GetDisarmTrap() | |
1364 { | |
1365 Player *v1; // ebp@1 | |
1366 unsigned __int16 v2; // ax@1 | |
1367 unsigned __int16 v3; // bx@1 | |
1368 int v4; // esi@1 | |
1369 int v5; // edi@1 | |
1370 int v7; // eax@7 | |
1371 signed int v8; // [sp-4h] [bp-14h]@6 | |
1372 | |
1373 v1 = this; | |
1010 | 1374 v2 = GetActualSkillLevel(PLAYER_SKILL_TRAP_DISARM); |
0 | 1375 v3 = v1->pActiveSkills[29]; |
1376 v4 = v2 & 0x3F; | |
1377 v5 = v1->pActiveSkills[29] & 0x3F; | |
1378 if ( (signed int)SkillToMastery(v2) >= 4 ) | |
1379 return 10000; | |
1380 if ( HasEnchantedItemEquipped(35) ) | |
1381 v4 *= 2; | |
1010 | 1382 if ( v3 & 0x100 ) |
0 | 1383 { |
1384 v8 = 5; | |
1385 } | |
1386 else | |
1387 { | |
1388 if ( (v3 & 0x80u) == 0 ) | |
1389 { | |
1390 v7 = ((v3 & 0x40) != 0) + 1; | |
1391 return v4 + v5 * (v7 - 1); | |
1392 } | |
1393 v8 = 3; | |
1394 } | |
1395 v7 = v8; | |
1396 return v4 + v5 * (v7 - 1); | |
1397 } | |
1398 | |
1399 //----- (00491317) -------------------------------------------------------- | |
1400 char Player::GetLearningPercent() | |
1401 { | |
1402 Player *v1; // esi@1 | |
1403 int v2; // eax@1 | |
1404 unsigned __int16 v3; // bx@1 | |
1405 int v4; // ecx@1 | |
1406 int v5; // eax@4 | |
1407 signed int v7; // [sp-4h] [bp-Ch]@3 | |
1408 | |
1409 v1 = this; | |
1010 | 1410 v2 = GetActualSkillLevel(PLAYER_SKILL_LEARNING); |
0 | 1411 v3 = v1->pActiveSkills[36]; |
1412 v4 = v2 & 0x3F; | |
1413 if ( v2 ) | |
1414 { | |
1010 | 1415 if (v3 & 0x100 ) |
0 | 1416 { |
1417 v7 = 5; | |
1418 } | |
1419 else | |
1420 { | |
1421 if ( (v3 & 0x80u) == 0 ) | |
1422 { | |
1423 v5 = ((v3 & 0x40) != 0) + 1; | |
1424 goto LABEL_8; | |
1425 } | |
1426 v7 = 3; | |
1427 } | |
1428 v5 = v7; | |
1429 LABEL_8: | |
1430 v2 = (v1->pActiveSkills[36] & 0x3F) * (v5 - 1) + v4 + 9; | |
1431 } | |
1432 return v2; | |
1433 } | |
1434 | |
1435 //----- (0048C6AF) -------------------------------------------------------- | |
1436 Player::Player() | |
1437 { | |
1438 memset(&pEquipment, 0, sizeof(PlayerEquipment)); | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1439 memset(pInventoryMatrix, 0, 126 * sizeof(int)); |
0 | 1440 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
|
1441 pInventoryItemList[i].Reset(); |
0 | 1442 for (uint i = 0; i < 12; ++i) |
1443 pEquippedItems[i].Reset(); | |
1444 | |
1445 | |
1446 for (uint i = 0; i < 24; ++i) | |
1447 { | |
1448 pPlayerBuffs[i].uSkill = 0; | |
1449 pPlayerBuffs[i].uSkill = 0; | |
1450 pPlayerBuffs[i].uPower = 0; | |
1451 pPlayerBuffs[i].uExpireTime = 0; | |
1452 pPlayerBuffs[i].uCaster = 0; | |
1453 pPlayerBuffs[i].uFlags = 0; | |
1454 } | |
1455 | |
1456 pName[0] = 0; | |
1014 | 1457 uCurrentFace = 0; |
0 | 1458 uVoiceID = 0; |
1459 memset(pConditions, 0, 20 * sizeof(__int64)); | |
1460 | |
1461 field_BB = 0; | |
1462 | |
1463 uMight = uMightBonus = 0; | |
1464 uIntelligence = uIntelligenceBonus = 0; | |
1465 uWillpower = uWillpowerBonus = 0; | |
1466 uEndurance = uEnduranceBonus = 0; | |
1467 uSpeed = uSpeedBonus = 0; | |
1468 uAccuracy = uAccuracyBonus = 0; | |
1469 uLuck = uLuckBonus = 0; | |
1470 uLevel = sLevelModifier = 0; | |
1471 sAgeModifier = 0; | |
1388
60d4885eb107
sACModifier zeroed in player constructor so AC is not always 0(or -some value) ingame
Grumpy7
parents:
1387
diff
changeset
|
1472 sACModifier = 0; |
0 | 1473 |
1019 | 1474 // memset(field_1F5, 0, 30); |
1475 pure_luck_used=0; | |
1476 pure_speed_used=0; | |
1477 pure_intellect_used=0; | |
1478 pure_endurance_used=0; | |
1479 pure_willpower_used=0; | |
1480 pure_accuracy_used=0; | |
1481 pure_might_used=0; | |
0 | 1482 |
1483 sResFireBase = sResFireBonus = 0; | |
1484 sResAirBase = sResAirBonus = 0; | |
1485 sResWaterBase = sResWaterBonus = 0; | |
1486 sResEarthBase = sResEarthBonus = 0; | |
1487 sResMagicBase = sResMagicBonus = 0; | |
1488 sResSpiritBase = sResSpiritBonus = 0; | |
1489 sResMindBase = sResMindBonus = 0; | |
1490 sResBodyBase = sResBodyBonus = 0; | |
1491 sResLightBase = sResLightBonus = 0; | |
1492 sResDarkBase = sResDarkBonus = 0; | |
1493 | |
1494 uTimeToRecovery = 0; | |
1495 | |
1496 uSkillPoints = 0; | |
1497 | |
1498 sHealth = 0; | |
1499 uFullHealthBonus = 0; | |
1500 _health_related = 0; | |
1501 | |
1502 sMana = 0; | |
1503 uFullManaBonus = 0; | |
1504 _mana_related = 0; | |
1505 | |
1506 uQuickSpell = 0; | |
1507 memset(pInstalledBeacons, 0, 5 * sizeof(LloydBeacon)); | |
1508 | |
1509 _some_attack_bonus = 0; | |
1510 field_1A91 = 0; | |
1511 _melee_dmg_bonus = 0; | |
1512 field_1A93 = 0; | |
1513 _ranged_atk_bonus = 0; | |
1514 field_1A95 = 0; | |
1515 _ranged_dmg_bonus = 0; | |
1516 field_1A97 = 0; | |
1517 | |
130 | 1518 expression = CHARACTER_EXPRESSION_INVALID; |
0 | 1519 uExpressionTimePassed = 0; |
1520 uExpressionTimeLength = 0; | |
1521 | |
1522 uNumDivineInterventionCastsThisDay = 0; | |
1523 uNumArmageddonCasts = 0; | |
1524 uNumFireSpikeCasts = 0; | |
1525 | |
1526 memset(field_1988, 0, 49 * sizeof(int)); | |
1527 memset(field_1A50, 0, 64 * sizeof(char)); | |
1528 | |
1529 field_E0 = 0; | |
1530 field_E4 = 0; | |
1531 field_E8 = 0; | |
1532 field_EC = 0; | |
1533 field_F0 = 0; | |
1534 field_F4 = 0; | |
1535 field_F8 = 0; | |
1536 field_FC = 0; | |
1537 field_100 = 0; | |
1538 field_104 = 0; | |
198 | 1539 |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1540 _expression21_animtime = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1541 _expression21_frameset = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1542 |
198 | 1543 lastOpenedSpellbookPage = 0; |
0 | 1544 } |
1545 | |
1546 //----- (0048C6F6) -------------------------------------------------------- | |
1547 bool Party::AddItem(ItemGen *pItem) | |
1548 { | |
1549 unsigned int v2; // eax@1 | |
1550 unsigned int v3; // ecx@4 | |
1551 signed int v4; // edx@4 | |
1552 char *v5; // eax@8 | |
973 | 1553 //unsigned int v6; // eax@10 |
0 | 1554 Texture *v7; // ebx@10 |
1555 signed int v8; // esi@10 | |
1556 Player *v9; // edi@11 | |
1557 int v10; // eax@11 | |
1558 bool result; // eax@15 | |
1559 std::string v12; // [sp-18h] [bp-40h]@9 | |
1010 | 1560 |
1561 | |
188 | 1562 int v15[4] = {0, 1, 2, 3}; // [sp+Ch] [bp-1Ch]@3 |
1563 //int v16; // [sp+10h] [bp-18h]@3 | |
1564 //int v17; // [sp+14h] [bp-14h]@3 | |
1565 //int v18; // [sp+18h] [bp-10h]@3 | |
0 | 1566 Player *v19; // [sp+1Ch] [bp-Ch]@9 |
1567 Party *v20; // [sp+20h] [bp-8h]@1 | |
1568 int v21; // [sp+24h] [bp-4h]@10 | |
1569 | |
1570 auto thos = this; | |
1571 | |
1572 v20 = thos; | |
1573 v2 = pItem->uItemID; | |
222 | 1574 if ( !pItemsTable->pItems[v2].uItemID_Rep_St ) |
315 | 1575 pItem->SetIdentified(); |
188 | 1576 ///v15 = 0; |
1577 //v16 = 1; | |
1578 //v18 = 3; | |
1579 //v17 = 2; | |
0 | 1580 if ( uActiveCharacter ) |
1581 { | |
1582 v3 = uActiveCharacter - 1; | |
1583 v4 = 0; | |
1584 do | |
1585 { | |
188 | 1586 v15[v4++] = v3++; |
0 | 1587 if ( (signed int)v3 >= 4 ) |
1588 v3 = 0; | |
1589 } | |
1590 while ( v4 < 4 ); | |
1591 } | |
1592 v5 = pItemsTable->pItems[v2].pIconName; | |
1593 if ( v5 ) | |
1594 { | |
973 | 1595 v7 = pIcons_LOD->LoadTexturePtr(v5, TEXTURE_16BIT_PALETTE); |
0 | 1596 v21 = areWeLoadingTexture; |
1597 v8 = 0; | |
1598 while ( 1 ) | |
1599 { | |
188 | 1600 v9 = &v20->pPlayers[v15[v8]]; |
1601 v19 = &v20->pPlayers[v15[v8]]; | |
1014 | 1602 v10 = v19->AddItem(-1, pItem->uItemID); |
0 | 1603 if ( v10 ) |
1604 break; | |
1605 ++v8; | |
1606 if ( v8 >= 4 ) | |
1607 { | |
1608 if ( !v21 ) | |
1609 { | |
1610 v7->Release(); | |
1006 | 1611 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1612 } |
1613 goto LABEL_15; | |
1614 } | |
1615 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1616 memcpy(&v9->pInventoryItemList[v10-1], pItem, 0x24u); |
0 | 1617 pItem->Reset(); |
1618 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); | |
187 | 1619 v19->PlaySound(SPEECH_60, 0); |
0 | 1620 if ( !v21 ) |
1621 { | |
1622 v7->Release(); | |
1006 | 1623 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1624 } |
1625 result = 1; | |
1626 } | |
1627 else | |
1628 { | |
1629 MessageBoxW(nullptr, L"Invalid picture_name detected ::addItem()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Party.cpp:795", 0); | |
1630 LABEL_15: | |
1631 result = 0; | |
1632 } | |
1633 return result; | |
1634 } | |
1635 // 506128: using guessed type int areWeLoadingTexture; | |
1636 | |
1637 //----- (0048C855) -------------------------------------------------------- | |
1638 int Player::GetBaseStrength() | |
1639 { | |
1640 return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH, 0); | |
1641 } | |
1642 | |
1643 //----- (0048C86C) -------------------------------------------------------- | |
1644 int Player::GetBaseIntelligence() | |
1645 { | |
1646 return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE, 0); | |
1647 } | |
1648 | |
1649 //----- (0048C883) -------------------------------------------------------- | |
1650 int Player::GetBaseWillpower() | |
1651 { | |
1652 return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER, 0); | |
1653 } | |
1654 | |
1655 //----- (0048C89A) -------------------------------------------------------- | |
1656 int Player::GetBaseEndurance() | |
1657 { | |
1658 return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0); | |
1659 } | |
1660 | |
1661 //----- (0048C8B1) -------------------------------------------------------- | |
1662 int Player::GetBaseAccuracy() | |
1663 { | |
1664 return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY, 0); | |
1665 } | |
1666 | |
1667 //----- (0048C8C8) -------------------------------------------------------- | |
1668 int Player::GetBaseSpeed() | |
1669 { | |
1670 return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED, 0); | |
1671 } | |
1672 | |
1673 //----- (0048C8DF) -------------------------------------------------------- | |
1674 int Player::GetBaseLuck() | |
1675 { | |
1676 return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK, 0); | |
1677 } | |
1678 | |
1679 //----- (0048C8F6) -------------------------------------------------------- | |
1680 int Player::GetBaseLevel() | |
1681 { | |
1682 return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0); | |
1683 } | |
1684 | |
1685 //----- (0048C90D) -------------------------------------------------------- | |
1686 int Player::GetActualLevel() | |
1687 { | |
1688 return uLevel + sLevelModifier + | |
1689 GetMagicalBonus(CHARACTER_ATTRIBUTE_LEVEL) + | |
1690 GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL, 0); | |
1691 } | |
1692 | |
1693 //----- (0048C93C) -------------------------------------------------------- | |
1694 int Player::GetActualMight() | |
1695 { | |
1325 | 1696 return GetActualAttribute(CHARACTER_ATTRIBUTE_STRENGTH); |
0 | 1697 } |
1698 | |
1699 //----- (0048C9C2) -------------------------------------------------------- | |
1700 int Player::GetActualIntelligence() | |
1701 { | |
1325 | 1702 return GetActualAttribute(CHARACTER_ATTRIBUTE_INTELLIGENCE); |
0 | 1703 } |
1704 | |
1705 //----- (0048CA3F) -------------------------------------------------------- | |
1706 int Player::GetActualWillpower() | |
1707 { | |
1325 | 1708 return GetActualAttribute(CHARACTER_ATTRIBUTE_WILLPOWER); |
0 | 1709 } |
1710 | |
1711 //----- (0048CABC) -------------------------------------------------------- | |
1712 int Player::GetActualEndurance() | |
1713 { | |
1325 | 1714 return GetActualAttribute(CHARACTER_ATTRIBUTE_ENDURANCE); |
0 | 1715 } |
1716 | |
1717 //----- (0048CB39) -------------------------------------------------------- | |
1718 int Player::GetActualAccuracy() | |
1719 { | |
1325 | 1720 return GetActualAttribute(CHARACTER_ATTRIBUTE_ACCURACY); |
0 | 1721 } |
1722 | |
1723 //----- (0048CBB6) -------------------------------------------------------- | |
1724 int Player::GetActualSpeed() | |
1725 { | |
1325 | 1726 return GetActualAttribute(CHARACTER_ATTRIBUTE_SPEED); |
0 | 1727 } |
1728 | |
1729 //----- (0048CC33) -------------------------------------------------------- | |
1730 int Player::GetActualLuck() | |
1731 { | |
1036 | 1732 signed int npc_luck_bonus; // [sp+10h] [bp-4h]@1 |
1733 | |
1734 npc_luck_bonus = 0; | |
652 | 1735 if ( CheckHiredNPCSpeciality(Fool) ) |
1036 | 1736 npc_luck_bonus = 5; |
652 | 1737 if ( CheckHiredNPCSpeciality(ChimneySweep) ) |
1036 | 1738 npc_luck_bonus += 20; |
652 | 1739 if ( CheckHiredNPCSpeciality(Psychic) ) |
1036 | 1740 npc_luck_bonus += 10; |
1324 | 1741 |
1325 | 1742 return GetActualAttribute(CHARACTER_ATTRIBUTE_LUCK) |
1743 + npc_luck_bonus; | |
1744 } | |
1745 | |
1746 //----- (new function) -------------------------------------------------------- | |
1747 int Player::GetActualAttribute( CHARACTER_ATTRIBUTE_TYPE attrId ) | |
1748 { | |
1749 unsigned __int16 attrValue = 0; | |
1750 unsigned __int16 attrBonus = 0; | |
1751 switch (attrId) | |
1752 { | |
1753 case CHARACTER_ATTRIBUTE_STRENGTH: | |
1754 attrValue = uMight; | |
1755 attrBonus = uMightBonus; | |
1756 break; | |
1757 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
1758 attrValue = uIntelligence; | |
1759 attrBonus = uIntelligenceBonus; | |
1760 break; | |
1761 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
1762 attrValue = uWillpower; | |
1763 attrBonus = uWillpowerBonus; | |
1764 break; | |
1765 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
1766 attrValue = uEndurance; | |
1767 attrBonus = uEnduranceBonus; | |
1768 break; | |
1769 case CHARACTER_ATTRIBUTE_ACCURACY: | |
1770 attrValue = uAccuracy; | |
1771 attrBonus = uAccuracyBonus; | |
1772 break; | |
1773 case CHARACTER_ATTRIBUTE_SPEED: | |
1774 attrValue = uSpeed; | |
1775 attrBonus = uSpeedBonus; | |
1776 break; | |
1777 case CHARACTER_ATTRIBUTE_LUCK: | |
1778 attrValue = uLuck; | |
1779 attrBonus = uLuckBonus; | |
1780 break; | |
1781 default: | |
1782 return 0; | |
1783 } | |
1784 | |
1324 | 1785 uint uActualAge = this->sAgeModifier + GetBaseAge(); |
1786 uint uAgeingMultiplier = 100; | |
1787 for (uint i = 0; i < 4; ++i) | |
1325 | 1788 { |
1324 | 1789 if (uActualAge >= pAgeingTable[i]) |
1325 | 1790 uAgeingMultiplier = pAgingAttributeModifier[attrId][i]; |
1791 else | |
1792 break; | |
1793 } | |
1794 | |
1795 auto uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()]; | |
1796 int magicBonus = GetMagicalBonus(attrId); | |
1797 int itemBonus = GetItemsBonus(attrId, 0); | |
1798 return uConditionMult * uAgeingMultiplier * attrValue / 100 / 100 | |
1799 + magicBonus | |
1800 + magicBonus | |
1801 + attrBonus; | |
0 | 1802 } |
1803 | |
1804 //----- (0048CCF5) -------------------------------------------------------- | |
1805 int Player::GetActualAttack(int a2) | |
1806 { | |
1807 Player *v2; // esi@1 | |
1808 int v3; // eax@1 | |
1809 int v4; // edi@1 | |
1810 int v5; // ebx@1 | |
1811 int v6; // ebp@1 | |
1812 | |
1813 v2 = this; | |
1814 v3 = GetActualAccuracy(); | |
1036 | 1815 v4 = GetParameterBonus(v3); |
0 | 1816 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_ATTACK); |
1817 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_ATTACK, a2); | |
1818 return v4 + v5 + v6 + GetMagicalBonus(CHARACTER_ATTRIBUTE_ATTACK) + v2->_some_attack_bonus; | |
1819 } | |
1820 | |
1821 //----- (0048CD45) -------------------------------------------------------- | |
1822 int Player::GetMeleeDamageMinimal() | |
1823 { | |
1824 Player *v1; // edi@1 | |
1825 int v2; // eax@1 | |
1826 int v3; // esi@1 | |
1827 int v4; // esi@1 | |
1828 int v5; // esi@1 | |
1829 int v6; // esi@1 | |
1830 signed int result; // eax@1 | |
1831 | |
1036 | 1832 |
0 | 1833 v2 = GetActualMight(); |
1036 | 1834 v3 = GetParameterBonus(v2); |
0 | 1835 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 0) + v3; |
1836 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; | |
1036 | 1837 result = _melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
1838 if ( result < 1 ) | |
1839 result = 1; | |
0 | 1840 return result; |
1841 } | |
1842 | |
1843 //----- (0048CD90) -------------------------------------------------------- | |
1844 int Player::GetMeleeDamageMaximal() | |
1845 { | |
1846 Player *v1; // edi@1 | |
1847 int v2; // eax@1 | |
1848 int v3; // esi@1 | |
1849 int v4; // esi@1 | |
1850 int v5; // esi@1 | |
1851 int v6; // esi@1 | |
1852 signed int result; // eax@1 | |
1853 | |
1854 v1 = this; | |
1855 v2 = GetActualMight(); | |
1036 | 1856 v3 = GetParameterBonus(v2); |
0 | 1857 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 0) + v3; |
1858 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; | |
1859 v6 = v1->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; | |
1860 result = 1; | |
1861 if ( v6 >= 1 ) | |
1862 result = v6; | |
1863 return result; | |
1864 } | |
1865 | |
1866 //----- (0048CDDB) -------------------------------------------------------- | |
1867 int Player::CalculateMeleeDamageTo(int a2, int a3, unsigned int uTargetActorID) | |
1868 { | |
1869 int v4; // esi@1 | |
1870 Player *v5; // edi@1 | |
1871 ItemGen *v6; // ebx@4 | |
1872 unsigned int v7; // ebp@4 | |
1873 unsigned int v8; // esi@4 | |
1874 int v9; // eax@4 | |
1875 int v10; // eax@9 | |
1876 char v11; // zf@9 | |
1877 int v12; // esi@10 | |
1878 int v13; // eax@11 | |
1879 enum MONSTER_SUPERTYPE v14; // edx@24 | |
1880 ItemGen *v15; // ebx@35 | |
1881 unsigned int v16; // ebp@35 | |
1882 unsigned int v17; // esi@35 | |
1883 int v18; // edx@38 | |
1884 int v19; // eax@40 | |
1885 enum MONSTER_SUPERTYPE v20; // edx@53 | |
1886 int v21; // esi@62 | |
1887 int v22; // eax@63 | |
1888 int v23; // ebx@63 | |
1889 int v24; // ebx@63 | |
1890 signed int result; // eax@64 | |
1891 MONSTER_SUPERTYPE v26; // [sp-4h] [bp-24h]@20 | |
1892 MONSTER_SUPERTYPE v27; // [sp-4h] [bp-24h]@49 | |
1893 int v28; // [sp+10h] [bp-10h]@1 | |
1894 int v29; // [sp+10h] [bp-10h]@33 | |
1895 signed int v30; // [sp+14h] [bp-Ch]@7 | |
1896 signed int v31; // [sp+14h] [bp-Ch]@36 | |
1897 int v32; // [sp+18h] [bp-8h]@1 | |
1898 int v33; // [sp+18h] [bp-8h]@8 | |
1899 int v34; // [sp+1Ch] [bp-4h]@1 | |
1900 int v35; // [sp+28h] [bp+8h]@37 | |
1901 | |
1902 v4 = 0; | |
1903 v5 = this; | |
1904 v34 = 0; | |
1905 v32 = 0; | |
1906 v28 = 0; | |
1907 if ( IsUnarmed() == 1 ) | |
1908 { | |
1909 v32 = rand() % 3 + 1; | |
1910 LABEL_61: | |
1911 v34 = v4; | |
1912 goto LABEL_62; | |
1913 } | |
816 | 1914 if ( HasItemEquipped(EQUIP_MAIN_HAND) ) |
0 | 1915 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1916 v6 = (ItemGen *)&v5->pInventoryItemList[v5->pEquipment.uMainHand-1]; |
0 | 1917 v7 = v6->uItemID; |
1918 v8 = v6->uItemID; | |
1919 v9 = pItemsTable->pItems[v8].uDamageDice; | |
898 | 1920 if ( pItemsTable->pItems[v8].uSkillType == PLAYER_SKILL_SPEAR && !v5->pEquipment.uShield ) |
0 | 1921 ++v9; |
1922 v30 = pItemsTable->pItems[v8].uDamageRoll; | |
1923 if ( v9 > 0 ) | |
1924 { | |
1925 v33 = v9; | |
1926 do | |
1927 { | |
1928 v10 = rand(); | |
1929 v11 = v33-- == 1; | |
1930 v28 += v10 % v30 + 1; | |
1931 } | |
1932 while ( !v11 ); | |
1933 } | |
1934 v12 = pItemsTable->pItems[v8].uDamageMod + v28; | |
1935 if ( !uTargetActorID ) | |
1936 goto LABEL_28; | |
377 | 1937 v13 = v6->uSpecEnchantmentType; |
0 | 1938 if ( v13 == 64 || v7 == 507 || v7 == 508 || v7 == 527 ) |
1939 { | |
1940 v14 = (MONSTER_SUPERTYPE)1; | |
1941 } | |
1942 else | |
1943 { | |
1944 if ( v13 == 39 ) | |
1945 { | |
1946 v26 = MONSTER_SUPERTYPE_KREEGAN; | |
1947 } | |
1948 else | |
1949 { | |
1950 if ( v13 == 40 ) | |
1951 { | |
1952 v26 = MONSTER_SUPERTYPE_DRAGON; | |
1953 } | |
1954 else | |
1955 { | |
1956 if ( v13 == 63 || v7 == 517 ) | |
1957 { | |
1958 v26 = MONSTER_SUPERTYPE_ELF; | |
1959 } | |
1960 else | |
1961 { | |
1962 if ( v13 != 65 ) | |
1963 { | |
1964 LABEL_28: | |
1965 if ( (signed int)SkillToMastery(v5->pActiveSkills[2]) >= 3 | |
1966 && pItemsTable->pItems[v6->uItemID].uSkillType == 2 | |
1967 && rand() % 100 < 10 ) | |
1968 v12 *= 3; | |
1969 v32 = v12; | |
1970 goto LABEL_33; | |
1971 } | |
1972 v26 = MONSTER_SUPERTYPE_TITAN; | |
1973 } | |
1974 } | |
1975 } | |
1976 v14 = v26; | |
1977 } | |
1978 if ( MonsterStats::BelongsToSupertype(uTargetActorID, v14) ) | |
1979 v12 *= 2; | |
1980 goto LABEL_28; | |
1981 } | |
1982 LABEL_33: | |
1983 v29 = 0; | |
1984 if ( !a3 ) | |
1985 { | |
1986 if ( v5->HasItemEquipped((ITEM_EQUIP_TYPE)0) ) | |
1987 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1988 v15 = (ItemGen *)&v5->pInventoryItemList[v5->pEquipment.uShield - 1]; |
0 | 1989 v16 = v15->uItemID; |
1990 v17 = v15->uItemID; | |
1991 if ( pItemsTable->pItems[v17].uEquipType != 4 ) | |
1992 { | |
1993 v31 = pItemsTable->pItems[v17].uDamageRoll; | |
1994 if ( (signed int)pItemsTable->pItems[v17].uDamageDice > 0 ) | |
1995 { | |
1996 v35 = pItemsTable->pItems[v17].uDamageDice; | |
1997 do | |
1998 { | |
1999 v18 = rand() % v31; | |
2000 v11 = v35-- == 1; | |
2001 v29 += v18 + 1; | |
2002 } | |
2003 while ( !v11 ); | |
2004 } | |
2005 v4 = pItemsTable->pItems[v17].uDamageMod + v29; | |
2006 if ( !uTargetActorID ) | |
2007 goto LABEL_57; | |
377 | 2008 v19 = v15->uSpecEnchantmentType; |
0 | 2009 if ( v19 == 64 || v16 == 507 || v16 == 508 || v16 == 527 ) |
2010 { | |
2011 v20 = (MONSTER_SUPERTYPE)1; | |
2012 } | |
2013 else | |
2014 { | |
2015 if ( v19 == 39 ) | |
2016 { | |
2017 v27 = MONSTER_SUPERTYPE_KREEGAN; | |
2018 } | |
2019 else | |
2020 { | |
2021 if ( v19 == 40 ) | |
2022 { | |
2023 v27 = MONSTER_SUPERTYPE_DRAGON; | |
2024 } | |
2025 else | |
2026 { | |
2027 if ( v19 == 63 || v16 == 517 ) | |
2028 { | |
2029 v27 = MONSTER_SUPERTYPE_ELF; | |
2030 } | |
2031 else | |
2032 { | |
2033 if ( v19 != 65 ) | |
2034 { | |
2035 LABEL_57: | |
2036 if ( pItemsTable->pItems[v15->uItemID].uSkillType == PLAYER_SKILL_DAGGER | |
2037 && SkillToMastery(v5->pActiveSkills[2] >= 3u) | |
2038 && rand() % 100 < 10 ) | |
2039 v4 *= 3; | |
2040 goto LABEL_61; | |
2041 } | |
2042 v27 = MONSTER_SUPERTYPE_TITAN; | |
2043 } | |
2044 } | |
2045 } | |
2046 v20 = v27; | |
2047 } | |
2048 if ( MonsterStats::BelongsToSupertype(uTargetActorID, v20) ) | |
2049 v4 *= 2; | |
2050 goto LABEL_57; | |
2051 } | |
2052 } | |
2053 } | |
2054 LABEL_62: | |
2055 v21 = v32 + v34; | |
2056 if ( !a2 ) | |
2057 { | |
2058 v22 = GetActualMight(); | |
1036 | 2059 v23 = GetParameterBonus(v22); |
0 | 2060 v24 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v23; |
2061 v21 += v5->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v24; | |
2062 } | |
2063 result = 1; | |
2064 if ( v21 >= 1 ) | |
2065 result = v21; | |
2066 return result; | |
2067 } | |
2068 | |
2069 //----- (0048D0B9) -------------------------------------------------------- | |
2070 int Player::GetRangedAttack() | |
2071 { | |
2072 Player *v1; // esi@1 | |
2073 int v2; // eax@1 | |
2074 int v3; // edi@3 | |
2075 int v4; // eax@4 | |
2076 int v5; // edi@4 | |
2077 int v6; // edi@4 | |
2078 int v7; // edi@4 | |
2079 | |
2080 v1 = this; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2081 v2 = *(int *)&this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2082 if ( v2 < ITEM_BLASTER || v2 > ITEM_LASER_RIFLE ) |
0 | 2083 { |
2084 v4 = GetActualAccuracy(); | |
1036 | 2085 v5 = GetParameterBonus(v4); |
0 | 2086 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK, 0) + v5; |
2087 v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6; | |
2088 v3 = v1->_ranged_atk_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v7; | |
2089 } | |
2090 else | |
2091 { | |
2092 v3 = GetActualAttack(1); | |
2093 } | |
2094 return v3; | |
2095 } | |
2096 | |
2097 //----- (0048D124) -------------------------------------------------------- | |
2098 int Player::GetRangedDamageMin() | |
2099 { | |
2100 Player *v1; // esi@1 | |
2101 int v2; // edi@1 | |
2102 int v3; // edi@1 | |
2103 int v4; // edi@1 | |
2104 unsigned __int16 v5; // ax@1 | |
2105 int result; // eax@6 | |
2106 | |
2107 v1 = this; | |
1040 | 2108 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN, 0); |
2109 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; | |
2110 v4 = v1->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; | |
0 | 2111 if ( v4 >= 1 ) |
2112 result = v4; | |
2113 else | |
2114 result = 0; | |
2115 return result; | |
2116 } | |
2117 | |
2118 //----- (0048D191) -------------------------------------------------------- | |
2119 int Player::GetRangedDamageMax() | |
2120 { | |
2121 Player *v1; // esi@1 | |
2122 int v2; // edi@1 | |
2123 int v3; // edi@1 | |
2124 int v4; // edi@1 | |
2125 unsigned __int16 v5; // ax@1 | |
2126 int result; // eax@6 | |
2127 | |
2128 v1 = this; | |
1040 | 2129 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX, 0); |
2130 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; | |
2131 v4 = v1->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; | |
0 | 2132 if ( v4 >= 1 ) |
2133 result = v4; | |
2134 else | |
2135 result = 0; | |
2136 return result; | |
2137 } | |
2138 | |
2139 //----- (0048D1FE) -------------------------------------------------------- | |
2140 bool Player::CalculateRangedDamageTo(int a2) | |
2141 { | |
2142 Player *v2; // ebx@1 | |
2143 bool result; // eax@1 | |
2144 ItemGen *v4; // ebx@2 | |
2145 unsigned int v5; // edi@2 | |
2146 unsigned int v6; // esi@2 | |
2147 int v7; // edx@4 | |
2148 char v8; // zf@4 | |
2149 int v9; // esi@5 | |
2150 int v10; // ebx@6 | |
2151 enum MONSTER_SUPERTYPE v11; // edx@7 | |
2152 unsigned __int16 v12; // ax@19 | |
2153 MONSTER_SUPERTYPE v13; // [sp-Ch] [bp-20h]@13 | |
2154 Player *v14; // [sp+4h] [bp-10h]@1 | |
2155 signed int v15; // [sp+8h] [bp-Ch]@2 | |
2156 int v16; // [sp+Ch] [bp-8h]@3 | |
2157 int v17; // [sp+10h] [bp-4h]@1 | |
2158 | |
2159 v17 = 0; | |
2160 v2 = this; | |
2161 v14 = this; | |
2162 result = HasItemEquipped(EQUIP_BOW); | |
2163 if ( !result ) | |
2164 return result; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2165 v4 = (ItemGen *)&v2->pInventoryItemList[v2->pEquipment.uBow-1]; |
0 | 2166 v5 = v4->uItemID; |
2167 v6 = v4->uItemID; | |
2168 v15 = pItemsTable->pItems[v6].uDamageRoll; | |
2169 if ( (signed int)pItemsTable->pItems[v6].uDamageDice > 0 ) | |
2170 { | |
2171 v16 = pItemsTable->pItems[v6].uDamageDice; | |
2172 do | |
2173 { | |
2174 v7 = rand() % v15; | |
2175 v8 = v16-- == 1; | |
2176 v17 += v7 + 1; | |
2177 } | |
2178 while ( !v8 ); | |
2179 } | |
2180 v9 = pItemsTable->pItems[v6].uDamageMod + v17; | |
2181 if ( a2 ) | |
2182 { | |
377 | 2183 v10 = v4->uSpecEnchantmentType; |
0 | 2184 if ( v10 == 64 ) |
2185 { | |
2186 v11 = (MONSTER_SUPERTYPE)1; | |
2187 goto LABEL_17; | |
2188 } | |
2189 if ( v10 == 39 || v5 == 508 ) | |
2190 { | |
2191 v13 = MONSTER_SUPERTYPE_KREEGAN; | |
2192 goto LABEL_16; | |
2193 } | |
2194 if ( v10 == 40 ) | |
2195 { | |
2196 v13 = MONSTER_SUPERTYPE_DRAGON; | |
2197 goto LABEL_16; | |
2198 } | |
2199 if ( v10 == 63 || v5 == 517 ) | |
2200 { | |
2201 v13 = MONSTER_SUPERTYPE_ELF; | |
2202 LABEL_16: | |
2203 v11 = v13; | |
2204 LABEL_17: | |
2205 if ( MonsterStats::BelongsToSupertype(a2, v11) ) | |
2206 v9 *= 2; | |
2207 goto LABEL_19; | |
2208 } | |
2209 } | |
2210 LABEL_19: | |
2211 v12 = v14->pActiveSkills[5]; | |
2212 if ( v12 ) | |
2213 { | |
2214 if ( (signed int)SkillToMastery(v12) >= 4 ) | |
2215 v9 += v14->pActiveSkills[5] & 0x3F; | |
2216 } | |
2217 return v9; | |
2218 } | |
2219 | |
2220 //----- (0048D2EA) -------------------------------------------------------- | |
2221 char *Player::GetMeleeDamageString() | |
2222 { | |
1036 | 2223 signed int itemid; // eax@1 |
2224 int min_damage; // edi@3 | |
2225 int max_damage; // eax@3 | |
0 | 2226 |
2227 static char player__getmeleedamagestring_static_buff[40]; // idb | |
2228 | |
1036 | 2229 if ( pEquipment.uMainHand) |
2230 { | |
2231 itemid= pOwnItems[this->pEquipment.uMainHand-1].uItemID; | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2232 if ( itemid < ITEM_BLASTER || itemid > ITEM_LASER_RIFLE ) //blasters |
1036 | 2233 { |
2234 min_damage = GetMeleeDamageMinimal(); | |
2235 max_damage = GetMeleeDamageMaximal(); | |
2236 } | |
2237 else | |
2238 { //for blasters | |
2239 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 0); | |
2240 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 0); | |
2241 } | |
2242 if ( max_damage ) | |
2243 { | |
2244 if ( min_damage == max_damage ) | |
2245 { | |
2246 sprintf(player__getmeleedamagestring_static_buff, "%d", min_damage); | |
2247 } | |
2248 else | |
2249 { | |
2250 sprintf(player__getmeleedamagestring_static_buff, "%d - %d", min_damage, max_damage); | |
2251 } | |
2252 } | |
2253 else | |
2254 { | |
2255 strcpy(player__getmeleedamagestring_static_buff, "N/A"); | |
2256 } | |
2257 | |
2258 if (( itemid >= 135 )&&( itemid <= 159 )) //wands | |
2259 { | |
2260 strcpy(player__getmeleedamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" | |
2261 } | |
2262 } | |
0 | 2263 else |
1036 | 2264 strcpy(player__getmeleedamagestring_static_buff, "N/A"); |
2265 return player__getmeleedamagestring_static_buff; | |
0 | 2266 } |
2267 | |
2268 //----- (0048D396) -------------------------------------------------------- | |
2269 char *Player::GetRangedDamageString() | |
1036 | 2270 { |
2271 signed int itemid; // eax@1 | |
2272 int min_damage; // edi@3 | |
2273 int max_damage; // eax@3 | |
2274 | |
2275 static char player__getrangeddamagestring_static_buff[40]; // idb | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2276 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2277 if (pEquipment.uMainHand >= 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2278 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2279 itemid = pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2280 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2281 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2282 if (pEquipment.uMainHand >= 0 && ( itemid >= 135 ) && ( itemid <= 159 )) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2283 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2284 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2285 return player__getrangeddamagestring_static_buff; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2286 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2287 else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE)) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2288 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2289 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, 1); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2290 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, 1); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2291 } |
0 | 2292 else |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2293 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2294 min_damage = GetRangedDamageMin(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2295 max_damage = GetRangedDamageMax(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2296 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2297 if ( max_damage > 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2298 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2299 if ( min_damage == max_damage ) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2300 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2301 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2302 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2303 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2304 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2305 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2306 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2307 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2308 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2309 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2310 strcpy(player__getrangeddamagestring_static_buff, "N/A"); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2311 } |
1036 | 2312 return player__getrangeddamagestring_static_buff; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
2313 } |
0 | 2314 |
2315 //----- (0048D45A) -------------------------------------------------------- | |
2316 bool Player::CanTrainToNextLevel() | |
2317 { | |
2318 int v1; // edx@1 | |
2319 int v2; // eax@1 | |
2320 int i; // esi@1 | |
2321 | |
2322 v1 = this->uLevel; | |
2323 v2 = 0; | |
2324 for ( i = 0; i < v1; ++i ) | |
2325 v2 += i + 1; | |
2326 return (signed __int64)this->uExperience >= 1000 * v2; | |
2327 } | |
2328 | |
2329 //----- (0048D498) -------------------------------------------------------- | |
2330 unsigned int Player::GetExperienceDisplayColor() | |
2331 { | |
2332 unsigned int result; // eax@2 | |
2333 | |
2334 if ( CanTrainToNextLevel() ) | |
995 | 2335 result = ui_character_bonus_text_color; |
0 | 2336 else |
995 | 2337 result = ui_character_default_text_color; |
0 | 2338 return result; |
2339 } | |
2340 | |
2341 //----- (0048D4B3) -------------------------------------------------------- | |
1036 | 2342 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int amount ) |
2343 { | |
2344 | |
2345 int resist_value; // edi@8 | |
2346 int player_luck; // eax@21 | |
2347 signed int res_rand_divider; // ebx@2 | |
2348 int armor_skill; // eax@29 | |
2349 enum CHARACTER_ATTRIBUTE_TYPE player_resist; // [sp-4h] [bp-10h]@9 | |
2350 signed int result_amount_dmg; // [sp+8h] [bp-4h]@17 | |
2351 | |
2352 player_resist=CHARACTER_ATTRIBUTE_STRENGTH; | |
2353 switch(dmg_type) | |
2354 { | |
2355 case DMGT_FIRE: player_resist=CHARACTER_ATTRIBUTE_RESIST_FIRE; break; | |
2356 case DMGT_ELECTR: player_resist=CHARACTER_ATTRIBUTE_RESIST_AIR; break; | |
2357 case DMGT_COLD: player_resist=CHARACTER_ATTRIBUTE_RESIST_WATER; break; | |
2358 case DMGT_3: player_resist=CHARACTER_ATTRIBUTE_RESIST_EARTH; break; | |
2359 | |
2360 case DMGT_SPIRIT: player_resist=CHARACTER_ATTRIBUTE_RESIST_SPIRIT;break; | |
2361 case DMGT_MIND: player_resist=CHARACTER_ATTRIBUTE_RESIST_MIND; break; | |
2362 case DMGT_BODY: player_resist=CHARACTER_ATTRIBUTE_RESIST_BODY; break; | |
2363 } | |
2364 if (player_resist) | |
2365 resist_value = GetActualResistance(player_resist); | |
2366 else | |
2367 resist_value = 0; | |
2368 | |
2369 result_amount_dmg = amount; | |
2370 if ( classType == PLAYER_CLASS_LICH && resist_value >= 200 ) | |
0 | 2371 return 0; |
1036 | 2372 player_luck = GetActualLuck(); |
2373 res_rand_divider = GetParameterBonus(player_luck) + resist_value + 30; | |
2374 | |
2375 if ( resist_value ) | |
2376 { | |
2377 if ( rand() % res_rand_divider >= 30 ) | |
2378 { | |
2379 result_amount_dmg = amount >> 1; | |
2380 if ( rand() % res_rand_divider >= 30 ) | |
0 | 2381 { |
1036 | 2382 result_amount_dmg = amount >> 2; |
2383 if ( rand() % res_rand_divider >= 30 ) | |
0 | 2384 { |
1036 | 2385 result_amount_dmg = amount >> 3; |
2386 if ( rand() % res_rand_divider >= 30 ) | |
2387 result_amount_dmg = amount >> 4; | |
0 | 2388 } |
2389 } | |
2390 } | |
2391 } | |
1036 | 2392 if (( dmg_type == DMGT_PHISYCAL )&&( pEquipment.uArmor )) |
2393 { | |
2394 if (!pOwnItems[pEquipment.uArmor-1].Broken()) | |
0 | 2395 { |
1036 | 2396 armor_skill = GetEquippedItemSkillType(EQUIP_ARMOUR); |
2397 if ( armor_skill==PLAYER_SKILL_PLATE ) | |
0 | 2398 { |
1036 | 2399 if ( SkillToMastery(pActiveSkills[PLAYER_SKILL_PLATE]) >= 3 ) |
2400 return (int)(double)result_amount_dmg * 0.5; | |
0 | 2401 } |
1036 | 2402 if (armor_skill==PLAYER_SKILL_CHAIN ) |
0 | 2403 { |
1036 | 2404 if (SkillToMastery(pActiveSkills[PLAYER_SKILL_CHAIN]) == 4) |
2405 return (int)(double)result_amount_dmg * 0.66670001; | |
0 | 2406 } |
2407 } | |
1036 | 2408 } |
2409 return result_amount_dmg; | |
0 | 2410 } |
2411 | |
2412 //----- (0048D62C) -------------------------------------------------------- | |
816 | 2413 ITEM_EQUIP_TYPE Player::GetEquippedItemEquipType(ITEM_EQUIP_TYPE uEquipSlot) |
2414 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2415 return pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uEquipType; |
0 | 2416 } |
2417 | |
2418 //----- (0048D651) -------------------------------------------------------- | |
816 | 2419 PLAYER_SKILL_TYPE Player::GetEquippedItemSkillType(ITEM_EQUIP_TYPE uEquipSlot) |
2420 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2421 return (PLAYER_SKILL_TYPE)pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uSkillType; |
0 | 2422 } |
2423 | |
2424 //----- (0048D676) -------------------------------------------------------- | |
2425 bool Player::IsUnarmed() | |
2426 { | |
1091 | 2427 return HasItemEquipped(EQUIP_MAIN_HAND) != 0 && |
2428 !(HasItemEquipped(EQUIP_OFF_HAND) == 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD); | |
0 | 2429 } |
2430 | |
2431 //----- (0048D6AA) -------------------------------------------------------- | |
2432 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex) | |
2433 { | |
2434 auto i = pEquipment.pIndices[uEquipIndex]; | |
2435 if (i) | |
1080 | 2436 return ~(pOwnItems[i - 1].uAttributes & ITEM_BROKEN); |
1036 | 2437 else |
2438 return false; | |
0 | 2439 } |
2440 | |
2441 //----- (0048D6D0) -------------------------------------------------------- | |
2442 bool Player::HasEnchantedItemEquipped(int uEnchantment) | |
2443 { | |
2444 for (uint i = 0; i < 16; ++i) | |
2445 { | |
2446 if (HasItemEquipped((ITEM_EQUIP_TYPE)i) && | |
1080 | 2447 pOwnItems[pEquipment.pIndices[i]-1].uSpecEnchantmentType == uEnchantment) |
0 | 2448 // *(int *)&this->field_1F6[36 * pEquipment[i] + 6] != uEnchantment) |
2449 return true; | |
2450 } | |
2451 return false; | |
2452 } | |
2453 | |
2454 //----- (0048D709) -------------------------------------------------------- | |
1080 | 2455 bool Player::WearsItem( int item_id, ITEM_EQUIP_TYPE equip_type ) |
2456 { | |
1010 | 2457 |
0 | 2458 int v6; // esi@5 |
2459 | |
1080 | 2460 if ( equip_type >= 16 ) |
0 | 2461 { |
2462 v6 = 0; | |
2463 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
|
2464 || pInventoryItemList[pEquipment.pIndices[v6] - 1].uItemID != item_id ) |
0 | 2465 { |
2466 ++v6; | |
2467 if ( (signed int)v6 >= 16 ) | |
2468 return 0; | |
2469 } | |
2470 return 1; | |
2471 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2472 if ( HasItemEquipped(equip_type) && pInventoryItemList[pEquipment.pIndices[equip_type - 1]].uItemID == item_id ) |
0 | 2473 return 1; |
2474 return 0; | |
2475 } | |
2476 | |
2477 //----- (0048D76C) -------------------------------------------------------- | |
2478 bool Player::StealFromShop(ItemGen *a2, int a3, int a4, int a5, int *a6) | |
2479 { | |
2480 unsigned __int16 v6; // cx@8 | |
2481 int v7; // edi@8 | |
2482 unsigned int v8; // ebx@8 | |
2483 unsigned int v9; // esi@8 | |
2484 int v10; // eax@8 | |
2485 int v11; // edi@12 | |
2486 bool result; // eax@13 | |
2487 | |
2488 if ( !a2 | |
2489 || this->pConditions[16] | |
2490 || this->pConditions[14] | |
2491 || this->pConditions[15] | |
2492 || this->pConditions[4] | |
2493 || this->pConditions[13] | |
2494 || this->pConditions[2] ) | |
2495 { | |
2496 result = 0; | |
2497 } | |
2498 else | |
2499 { | |
2500 v6 = this->pActiveSkills[34]; | |
2501 v7 = v6 & 0x3F; | |
2502 v8 = SkillToMastery(v6); | |
2503 v9 = a2->GetValue(); | |
2504 v10 = pItemsTable->pItems[a2->uItemID].uEquipType; | |
2505 if ( !pItemsTable->pItems[a2->uItemID].uEquipType || v10 == 1 || v10 == 2 ) | |
2506 v9 *= 3; | |
2507 v11 = dword_4EDEB4[rand() % 100 / 20] + v7 * dword_4EDEA0[v8]; | |
2508 *a6 = 100 * (a4 + a3) + v9 + (a5 != 0 ? 0x1F4 : 0); | |
2509 if ( rand() % 100 >= 5 ) | |
2510 { | |
2511 if ( *a6 > v11 ) | |
2512 result = *a6 - v11 < 500; | |
2513 else | |
2514 result = 2; | |
2515 } | |
2516 else | |
2517 { | |
2518 result = 0; | |
2519 } | |
2520 } | |
2521 return result; | |
2522 } | |
2523 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2524 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2525 | |
2526 //----- (0048D88B) -------------------------------------------------------- | |
2527 int Player::StealFromActor(unsigned int uActorID, int _steal_perm, int reputation) | |
2528 { | |
2529 Player *v4; // esi@1 | |
2530 Actor *v5; // edi@1 | |
2531 unsigned __int16 v6; // cx@10 | |
2532 int v7; // ebx@10 | |
2533 unsigned int v8; // esi@10 | |
2534 int v9; // eax@10 | |
2535 int v10; // esi@10 | |
2536 int v11; // eax@13 | |
2537 signed int v12; // ebx@15 | |
2538 signed int v13; // edx@15 | |
2539 int v14; // ecx@15 | |
2540 unsigned __int16 v15; // si@21 | |
2541 unsigned int v16; // ebx@24 | |
2542 int v17; // esi@24 | |
2543 const void *v18; // eax@29 | |
2544 unsigned int v19; // esi@31 | |
2545 int v20; // eax@34 | |
2546 char v21; // zf@36 | |
2547 unsigned int v22; // ST0C_4@39 | |
2548 char *v23; // esi@39 | |
2549 const char *v25; // [sp-Ch] [bp-48h]@40 | |
2550 int v26; // [sp-8h] [bp-44h]@40 | |
2551 ItemGen v27; // [sp+8h] [bp-34h]@15 | |
2552 unsigned int v28; // [sp+2Ch] [bp-10h]@10 | |
2553 int v29; // [sp+30h] [bp-Ch]@10 | |
2554 int v30; // [sp+34h] [bp-8h]@10 | |
2555 Player *v31; // [sp+38h] [bp-4h]@1 | |
2556 signed int _steal_perma; // [sp+48h] [bp+Ch]@12 | |
2557 | |
2558 v4 = this; | |
2559 v5 = &pActors[uActorID]; | |
2560 v31 = this; | |
2561 if ( &pActors[uActorID] | |
2562 && !this->pConditions[16] | |
2563 && !this->pConditions[14] | |
2564 && !this->pConditions[15] | |
2565 && !this->pConditions[4] | |
2566 && !this->pConditions[13] | |
2567 && !this->pConditions[2] ) | |
2568 { | |
2569 if ( !(BYTE2(v5->uAttributes) & 0x80) ) | |
2570 pActors[uActorID].SetRandomGoldIfTheresNoItem(); | |
2571 v6 = v4->pActiveSkills[34]; | |
2572 v7 = v6 & 0x3F; | |
2573 v8 = SkillToMastery(v6); | |
2574 v9 = rand(); | |
2575 v28 = 4 * v8; | |
2576 v30 = dword_4EDEA0[v8]; | |
2577 v29 = dword_4EDEB4[v9 % 100 / 20]; | |
2578 v10 = v5->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); | |
2579 if ( rand() % 100 < 5 || v10 > v29 + v7 * v30 || (_steal_perma = 2, BYTE2(v5->uAttributes) & 8) ) | |
2580 { | |
322 | 2581 Actor::AggroSurroundingPeasants(uActorID, 1); |
0 | 2582 _steal_perma = 0; |
2583 v26 = (int)v31->pName; | |
2584 v25 = pGlobalTXT_LocalizationStrings[376]; | |
2585 } | |
2586 else | |
2587 { | |
2588 v11 = rand(); | |
2589 if ( v11 % 100 >= 40 ) | |
2590 { | |
2591 if ( v11 % 100 >= 70 ) | |
2592 { | |
2593 v19 = 0; | |
2594 if ( v7 > 0 ) | |
2595 { | |
2596 do | |
2597 { | |
2598 --v7; | |
2599 v19 += rand() % dword_4EDEC4[v28 / 4] + 1; | |
2600 } | |
2601 while ( v7 ); | |
2602 } | |
2603 if ( pItemsTable->pItems[v5->array_000234[3].uItemID].uEquipType != 18 ) | |
2604 return _steal_perma; | |
377 | 2605 v20 = (int)&v5->array_000234[3].uSpecEnchantmentType; |
2606 if ( (signed int)v19 > v5->array_000234[3].uSpecEnchantmentType ) | |
2607 v19 = v5->array_000234[3].uSpecEnchantmentType; | |
0 | 2608 v21 = *(int *)v20 == v19; |
2609 *(int *)v20 -= v19; | |
2610 if ( v21 ) | |
2611 v5->array_000234[3].uItemID = 0; | |
2612 if ( v19 ) | |
2613 { | |
2614 party_finds_gold(v19, 2); | |
2615 v22 = v19; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2616 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2617 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], v31->pName, v22); |
0 | 2618 LABEL_43: |
2619 ShowStatusBarString(v23, 2u); | |
2620 return _steal_perma; | |
2621 } | |
2622 } | |
2623 else | |
2624 { | |
2625 v27.Reset(); | |
2626 v12 = 0; | |
2627 v13 = 0; | |
2628 v14 = (int)v5->array_000234; | |
2629 while ( !*(int *)v14 || pItemsTable->pItems[*(int *)v14].uEquipType == 18 ) | |
2630 { | |
2631 ++v13; | |
2632 v14 += 36; | |
2633 if ( v13 >= 4 ) | |
2634 goto LABEL_21; | |
2635 } | |
2636 v12 = 1; | |
2637 LABEL_21: | |
2638 v15 = v5->uCarriedItemID; | |
2639 if ( v15 || v12 ) | |
2640 { | |
2641 v27.Reset(); | |
2642 if ( v15 ) | |
2643 { | |
2644 v16 = (signed __int16)v15; | |
2645 v5->uCarriedItemID = 0; | |
2646 v27.uItemID = (signed __int16)v15; | |
2647 v17 = (signed __int16)v15; | |
2648 if ( pItemsTable->pItems[v17].uEquipType == 12 ) | |
2649 v27.uNumCharges = rand() % 6 + pItemsTable->pItems[v17].uDamageMod + 1; | |
2650 if ( pItemsTable->pItems[v17].uEquipType == 14 ) | |
2651 { | |
2652 if ( v16 != 220 ) | |
570 | 2653 v27.uEnchantmentType = 2 * rand() % 4 + 2; |
0 | 2654 } |
2655 } | |
2656 else | |
2657 { | |
2658 v18 = &v5->array_000234[rand() % 4]; | |
2659 memcpy(&v27, v18, sizeof(v27)); | |
2660 ((ItemGen *)v18)->Reset(); | |
2661 v16 = v27.uItemID; | |
2662 } | |
2663 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2664 sprintf( | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2665 pTmpBuf2.data(), |
0 | 2666 pGlobalTXT_LocalizationStrings[304], |
2667 v31->pName, | |
2668 pItemsTable->pItems[v16].pUnidentifiedName); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2669 ShowStatusBarString(pTmpBuf2.data(), 2u); |
0 | 2670 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2671 memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem)); | |
2672 pMouse->SetCursorBitmapFromItemID(v16); | |
2673 return _steal_perma; | |
2674 } | |
2675 } | |
2676 } | |
2677 v26 = (int)v31->pName; | |
2678 v25 = pGlobalTXT_LocalizationStrings[377]; | |
2679 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2680 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2681 sprintfex(pTmpBuf2.data(), v25, v26); |
0 | 2682 goto LABEL_43; |
2683 } | |
2684 return 0; | |
2685 } | |
2686 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2687 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2688 // 4EDEC4: using guessed type int dword_4EDEC4[]; | |
2689 | |
2690 //----- (0048DBB9) -------------------------------------------------------- | |
2691 void Player::Heal(int amount) | |
2692 { | |
1010 | 2693 signed int max_health; // eax@3 |
2694 | |
2695 if ( !pConditions[Condition_Eradicated] && !pConditions[Condition_Dead] ) | |
2696 { | |
2697 max_health = GetMaxHealth(); | |
2698 if ( pConditions[Condition_Zombie] ) | |
2699 max_health /= 2; | |
2700 sHealth += amount; | |
2701 if ( sHealth > max_health ) | |
2702 sHealth = max_health; | |
2703 if ( pConditions[Condition_Unconcious] ) | |
2704 { | |
2705 if ( sHealth > 0 ) | |
2706 { | |
2707 pConditions[Condition_Unconcious] = 0i64; | |
0 | 2708 } |
2709 } | |
2710 } | |
2711 } | |
2712 | |
2713 //----- (0048DC1E) -------------------------------------------------------- | |
1036 | 2714 int Player::ReceiveDamage( signed int amount, DAMAGE_TYPE dmg_type ) |
2715 { | |
2716 signed int recieved_dmg; // eax@1 | |
2717 unsigned int armor_indx; // eax@8 | |
2718 bool broke_armor; | |
2719 | |
2720 pConditions[Condition_Sleep] = 0i64; | |
2721 recieved_dmg = CalculateIncommingDamage(dmg_type, amount); | |
2722 sHealth -= recieved_dmg; | |
2723 broke_armor = sHealth <= -10; | |
2724 if ( sHealth < 1 ) // | |
2725 { | |
2726 if ( (sHealth + uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE, 0) >= 1) | |
2727 || pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0i64 ) | |
0 | 2728 { |
1019 | 2729 SetCondition(Condition_Unconcious, 0); |
0 | 2730 } |
2731 else | |
2732 { | |
1019 | 2733 SetCondition(Condition_Dead, 0); |
1036 | 2734 //v6 = LODWORD(pParty->uTimePlayed); ???? if equals 0 do not broke armor? |
2735 if ( sHealth > 0 ) | |
2736 sHealth = 0; | |
2737 } | |
2738 if (broke_armor ) | |
2739 { | |
2740 armor_indx = pEquipment.uArmor; | |
2741 if ( armor_indx ) | |
0 | 2742 { |
1036 | 2743 if ( !pOwnItems[armor_indx-1].uAttributes & ITEM_ENCHANTED) |
0 | 2744 { |
1036 | 2745 pOwnItems[armor_indx-1].uAttributes|=ITEM_BROKEN; |
0 | 2746 } |
2747 } | |
2748 } | |
2749 } | |
1036 | 2750 if ( recieved_dmg && CanAct() ) |
187 | 2751 PlaySound(SPEECH_24, 0); |
1036 | 2752 return recieved_dmg; |
0 | 2753 } |
2754 | |
2755 //----- (0048DCF6) -------------------------------------------------------- | |
2756 int Player::_48DCF6(int a2, Actor *pActor) | |
2757 { | |
2758 signed int v3; // edi@1 | |
2759 signed int v4; // ebx@1 | |
2760 Player *v5; // esi@1 | |
2761 int v6; // eax@2 | |
2762 int v7; // eax@5 | |
2763 int v8; // eax@8 | |
2764 int v9; // ebx@8 | |
2765 int v10; // eax@8 | |
2766 int v11; // ebx@8 | |
2767 signed int v12; // edx@9 | |
2768 ItemGen *v13; // eax@9 | |
2769 int v14; // edx@16 | |
2770 unsigned int v15; // edx@17 | |
2771 int v16; // edx@26 | |
2772 unsigned int v17; // edx@27 | |
2773 signed int v19; // edx@38 | |
2774 int *v20; // ecx@38 | |
2775 signed int v21; // eax@40 | |
2776 int v22; // eax@49 | |
2777 signed int v23; // ebx@49 | |
2778 unsigned int v24; // eax@60 | |
2779 int v25; // ecx@61 | |
2780 int v26; // ebx@74 | |
2781 void *v27; // ecx@76 | |
2782 unsigned int v28; // ebx@78 | |
2783 signed int result; // eax@86 | |
2784 SoundID v30; // [sp-20h] [bp-C0h]@56 | |
2785 signed int v31; // [sp-1Ch] [bp-BCh]@56 | |
2786 unsigned int v32; // [sp-18h] [bp-B8h]@56 | |
2787 signed int v33; // [sp-14h] [bp-B4h]@56 | |
2788 signed int v34; // [sp-10h] [bp-B0h]@56 | |
2789 int v35; // [sp-Ch] [bp-ACh]@56 | |
2790 unsigned int v36; // [sp-8h] [bp-A8h]@51 | |
2791 unsigned int v37; // [sp-8h] [bp-A8h]@56 | |
2792 unsigned int v38; // [sp-8h] [bp-A8h]@57 | |
2793 unsigned int v39; // [sp-8h] [bp-A8h]@68 | |
2794 enum CHARACTER_ATTRIBUTE_TYPE v40; // [sp-4h] [bp-A4h]@4 | |
2795 int v41; // [sp-4h] [bp-A4h]@51 | |
2796 int v42; // [sp-4h] [bp-A4h]@56 | |
2797 int v43; // [sp-4h] [bp-A4h]@57 | |
2798 signed int v44; // [sp-4h] [bp-A4h]@59 | |
2799 int v45; // [sp-4h] [bp-A4h]@68 | |
2800 char v46[140]; // [sp+Ch] [bp-94h]@13 | |
2801 unsigned int v47; // [sp+98h] [bp-8h]@1 | |
2802 int v48; // [sp+9Ch] [bp-4h]@1 | |
2803 | |
2804 v3 = 0; | |
2805 v4 = 0; | |
2806 v5 = this; | |
2807 v47 = 0; | |
2808 v48 = 0; | |
2809 switch ( a2 ) | |
2810 { | |
2811 case 1: | |
2812 v6 = GetActualWillpower(); | |
2813 goto LABEL_46; | |
2814 case 2: | |
2815 case 3: | |
2816 case 4: | |
2817 case 9: | |
2818 case 10: | |
2819 case 11: | |
2820 case 13: | |
2821 case 21: | |
2822 v6 = GetActualEndurance(); | |
2823 goto LABEL_46; | |
2824 case 5: | |
2825 case 12: | |
2826 case 23: | |
2827 v40 = (CHARACTER_ATTRIBUTE_TYPE)14; | |
2828 goto LABEL_5; | |
2829 case 15: | |
2830 v40 = (CHARACTER_ATTRIBUTE_TYPE)13; | |
2831 goto LABEL_5; | |
2832 case 6: | |
2833 case 7: | |
2834 case 8: | |
2835 case 14: | |
2836 case 16: | |
2837 v40 = (CHARACTER_ATTRIBUTE_TYPE)15; | |
2838 LABEL_5: | |
2839 v7 = GetActualResistance(v40); | |
2840 goto LABEL_47; | |
2841 case 22: | |
2842 v8 = GetActualWillpower(); | |
1036 | 2843 v9 = GetParameterBonus(v8); |
0 | 2844 v10 = GetActualIntelligence(); |
1036 | 2845 v11 = (GetParameterBonus(v10) + v9) >> 1; |
0 | 2846 break; |
2847 case 17: | |
2848 v12 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2849 v13 = this->pInventoryItemList; |
0 | 2850 do |
2851 { | |
315 | 2852 if ( (signed int)v13->uItemID > 0 && (signed int)v13->uItemID <= 134 && !v13->Broken()) |
0 | 2853 v46[v4++] = v12; |
2854 ++v12; | |
2855 ++v13; | |
2856 } | |
2857 while ( v12 < 138 ); | |
2858 goto LABEL_36; | |
2859 case 18: | |
2860 v14 = 0; | |
2861 do | |
2862 { | |
2863 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) | |
2864 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2865 __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used |
816 | 2866 if ( v15 == EQUIP_ARMOUR ) |
898 | 2867 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; |
816 | 2868 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) |
898 | 2869 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1; |
0 | 2870 } |
2871 v14 = v15 + 1; | |
2872 } | |
2873 while ( v14 < 16 ); | |
2874 goto LABEL_36; | |
2875 case 19: | |
2876 v16 = 0; | |
2877 do | |
2878 { | |
2879 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) | |
2880 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2881 __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used |
0 | 2882 if ( v17 == 2 ) |
2883 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; | |
2884 if ( (!v17 || v17 == 1) | |
816 | 2885 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) |
898 | 2886 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1; |
0 | 2887 } |
2888 v16 = v17 + 1; | |
2889 } | |
2890 while ( v16 < 16 ); | |
2891 LABEL_36: | |
2892 if ( !v4 ) | |
2893 goto LABEL_87; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2894 v48 = (int)&v5->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; |
0 | 2895 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); |
2896 break; | |
2897 case 20: | |
2898 v19 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2899 v20 = this->pInventoryMatrix; |
0 | 2900 do |
2901 { | |
2902 if ( *v20 > 0 ) | |
2903 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2904 v21 = *(int *)&v5->pInventoryItemList[*v20-1]; |
0 | 2905 if ( v21 > 0 ) |
2906 { | |
2907 if ( v21 <= 134 ) | |
2908 v46[v4++] = v19; | |
2909 } | |
2910 } | |
2911 ++v19; | |
2912 ++v20; | |
2913 } | |
2914 while ( v19 < 126 ); | |
2915 if ( !v4 ) | |
2916 goto LABEL_87; | |
2917 v47 = (unsigned __int8)v46[rand() % v4]; | |
2918 v6 = GetActualAccuracy(); | |
2919 LABEL_46: | |
1036 | 2920 v7 = GetParameterBonus(v6); |
0 | 2921 LABEL_47: |
2922 v11 = v7; | |
2923 break; | |
2924 default: | |
2925 v11 = 0; | |
2926 break; | |
2927 } | |
2928 v22 = GetActualLuck(); | |
1036 | 2929 v23 = GetParameterBonus(v22) + v11 + 30; |
0 | 2930 if ( rand() % v23 >= 30 ) |
2931 { | |
2932 LABEL_87: | |
2933 result = 0; | |
2934 } | |
2935 else | |
2936 { | |
2937 switch ( a2 ) | |
2938 { | |
2939 case 1: | |
2940 v41 = 1; | |
2941 v36 = 0; | |
2942 goto LABEL_56; | |
2943 case 2: | |
2944 v41 = 1; | |
2945 v36 = 1; | |
2946 goto LABEL_56; | |
2947 case 3: | |
2948 v41 = 1; | |
2949 v36 = 2; | |
2950 goto LABEL_56; | |
2951 case 23: | |
2952 v41 = 1; | |
2953 v36 = 3; | |
2954 goto LABEL_56; | |
2955 case 4: | |
2956 v41 = 1; | |
2957 v36 = 4; | |
2958 LABEL_56: | |
2959 SetCondition(v36, v41); | |
2960 v42 = 0; | |
2961 v37 = 0; | |
2962 v35 = 0; | |
2963 v34 = 0; | |
2964 v33 = -1; | |
2965 v32 = 0; | |
2966 v31 = 0; | |
2967 v30 = (SoundID)221; | |
2968 goto LABEL_83; | |
2969 case 5: | |
2970 v43 = 1; | |
2971 v38 = 5; | |
2972 goto LABEL_70; | |
2973 case 6: | |
2974 case 7: | |
2975 case 8: | |
2976 if ( a2 == 6 ) | |
2977 { | |
2978 v44 = 6; | |
2979 goto LABEL_60; | |
2980 } | |
2981 v25 = 2 * (a2 != 8) + 8; | |
2982 goto LABEL_65; | |
2983 case 9: | |
2984 if ( a2 == 6 ) | |
2985 { | |
2986 v44 = 7; | |
2987 LABEL_60: | |
2988 v24 = v44; | |
2989 } | |
2990 else | |
2991 { | |
2992 v25 = 2 * (a2 != 8) + 9; | |
2993 LABEL_65: | |
2994 v24 = v25; | |
2995 } | |
2996 SetCondition(v24, 1); | |
2997 v42 = 0; | |
2998 v37 = 0; | |
2999 v35 = 0; | |
3000 v34 = 0; | |
3001 v33 = -1; | |
3002 v32 = 0; | |
3003 v31 = 0; | |
3004 v30 = (SoundID)222; | |
3005 LABEL_83: | |
3006 pAudioPlayer->PlaySound(v30, v31, v32, v33, v34, v35, v37, v42); | |
3007 do | |
3008 { | |
3009 LABEL_84: | |
3010 if ( v5 == pPlayers[v3 + 1] ) | |
3011 break; | |
3012 ++v3; | |
3013 } | |
3014 while ( v3 < 4 ); | |
3015 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); | |
3016 result = 1; | |
3017 break; | |
3018 case 12: | |
3019 v43 = 1; | |
3020 v38 = 12; | |
3021 goto LABEL_70; | |
3022 case 15: | |
3023 v45 = 1; | |
3024 v39 = 15; | |
3025 goto LABEL_73; | |
3026 case 13: | |
3027 v43 = 1; | |
3028 v38 = 13; | |
3029 LABEL_70: | |
3030 SetCondition(v38, v43); | |
3031 v42 = 0; | |
3032 v37 = 0; | |
3033 v35 = 0; | |
3034 v34 = 0; | |
3035 v33 = -1; | |
3036 v32 = 0; | |
3037 v31 = 0; | |
3038 v30 = (SoundID)224; | |
3039 goto LABEL_83; | |
3040 case 14: | |
3041 v45 = 1; | |
3042 v39 = 14; | |
3043 goto LABEL_73; | |
3044 case 16: | |
3045 v45 = 1; | |
3046 v39 = 16; | |
3047 LABEL_73: | |
3048 SetCondition(v39, v45); | |
3049 v42 = 0; | |
3050 v37 = 0; | |
3051 v35 = 0; | |
3052 v34 = 0; | |
3053 v33 = -1; | |
3054 v32 = 0; | |
3055 v31 = 0; | |
3056 v30 = (SoundID)225; | |
3057 goto LABEL_83; | |
3058 case 17: | |
3059 case 18: | |
3060 case 19: | |
3061 v26 = v48; | |
3062 if ( *(char *)(v48 + 21) & 2 ) | |
3063 goto LABEL_84; | |
187 | 3064 PlaySound(SPEECH_40, 0); |
0 | 3065 *(int *)(v26 + 20) |= 2u; |
3066 goto LABEL_79; | |
3067 case 20: | |
187 | 3068 PlaySound(SPEECH_40, 0); |
0 | 3069 v27 = pActor->array_000234; |
3070 if ( pActor->array_000234[0].uItemID ) | |
3071 { | |
3072 v27 = &pActor->array_000234[1]; | |
3073 if ( pActor->array_000234[1].uItemID ) | |
3074 goto LABEL_84; | |
3075 } | |
3076 v28 = v47; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3077 memcpy(v27, &v5->pInventoryItemList[v5->pInventoryMatrix[v47]-1], 0x24u); |
0 | 3078 RemoveItemAtInventoryIndex(v28); |
3079 LABEL_79: | |
3080 v42 = 0; | |
3081 v37 = 0; | |
3082 v35 = 0; | |
3083 v34 = 0; | |
3084 v33 = -1; | |
3085 v32 = 0; | |
3086 v31 = 0; | |
3087 v30 = (SoundID)47; | |
3088 goto LABEL_83; | |
3089 case 21: | |
187 | 3090 PlaySound(SPEECH_42, 0); |
0 | 3091 ++v5->sAgeModifier; |
3092 goto LABEL_82; | |
3093 case 22: | |
187 | 3094 PlaySound(SPEECH_41, 0); |
0 | 3095 v5->sMana = 0; |
3096 LABEL_82: | |
3097 v42 = 0; | |
3098 v37 = 0; | |
3099 v35 = 0; | |
3100 v34 = 0; | |
3101 v33 = -1; | |
3102 v32 = 0; | |
3103 v31 = 0; | |
3104 v30 = (SoundID)226; | |
3105 goto LABEL_83; | |
3106 default: | |
3107 goto LABEL_87; | |
3108 } | |
3109 } | |
3110 return result; | |
3111 } | |
324 | 3112 |
0 | 3113 // 48DCF6: using guessed type char var_94[140]; |
3114 | |
3115 //----- (0048E1A3) -------------------------------------------------------- | |
3116 unsigned int Player::GetSpellSchool(unsigned int uSpellID) | |
3117 { | |
1091 | 3118 return pSpellStats->pInfos[uSpellID].uSchool; |
0 | 3119 } |
3120 | |
3121 //----- (0048E1B5) -------------------------------------------------------- | |
816 | 3122 int Player::GetAttackRecoveryTime(bool bRangedAttack) |
3123 { | |
3124 ItemGen *weapon = nullptr; | |
3125 ItemDesc *weapon_desc = nullptr; | |
3126 uint weapon_recovery = base_recovery_times_per_weapon_type[0]; | |
3127 if (bRangedAttack) | |
0 | 3128 { |
3129 if ( !HasItemEquipped(EQUIP_BOW) ) | |
3130 goto LABEL_17; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3131 weapon = &pInventoryItemList[pEquipment.uBow - 1]; |
816 | 3132 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
3133 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; | |
3134 goto LABEL_17; | |
3135 } | |
3136 else if ( IsUnarmed() == 1 ) | |
3137 { | |
3138 if (GetActualSkillLevel(PLAYER_SKILL_UNARMED)) | |
3139 { | |
3140 weapon_recovery = base_recovery_times_per_weapon_type[1]; | |
0 | 3141 goto LABEL_17; |
3142 } | |
3143 } | |
816 | 3144 |
3145 if ( HasItemEquipped(EQUIP_MAIN_HAND) ) | |
3146 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3147 weapon = &pInventoryItemList[pEquipment.uMainHand - 1]; |
816 | 3148 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
3149 if (weapon_desc->uEquipType == EQUIP_WAND) | |
3150 { | |
3151 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
3152 __debugbreak(); // looks like wands were two-handed weapons once, or supposed to be. should not get here now | |
3153 weapon_recovery = pSpellDatas[wand_spell_ids[weapon->uItemID - ITEM_WAND_FIRE]].uExpertLevelRecovery; | |
3154 } | |
0 | 3155 else |
816 | 3156 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; |
3157 } | |
1010 | 3158 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD) |
3159 // ADD: shield check because shield recovery is added later and can be accidentally doubled | |
816 | 3160 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3161 auto v12 = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 3162 auto v12_desc = &pItemsTable->pItems[v12->uItemID]; |
3163 if (base_recovery_times_per_weapon_type[v12_desc->uSkillType] > weapon_recovery) | |
3164 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3165 weapon = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 3166 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
3167 weapon_recovery = base_recovery_times_per_weapon_type[pItemsTable->pItems[weapon->uItemID].uSkillType]; | |
3168 } | |
3169 } | |
3170 | |
0 | 3171 LABEL_17: |
816 | 3172 uint armour_recovery = 0; |
0 | 3173 if ( HasItemEquipped(EQUIP_ARMOUR) ) |
3174 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3175 auto armour_skill_type = pItemsTable->pItems[pInventoryItemList[pEquipment.uArmor - 1].uItemID].uSkillType; |
816 | 3176 uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type]; |
3177 | |
3178 float armour_recovery_multipliers[4]; | |
3179 if (armour_skill_type == PLAYER_SKILL_LEATHER) | |
3180 { | |
3181 armour_recovery_multipliers[0] = 1.0f; | |
3182 armour_recovery_multipliers[1] = 0; | |
3183 armour_recovery_multipliers[2] = 0; | |
3184 armour_recovery_multipliers[3] = 0; | |
3185 } | |
3186 else if (armour_skill_type == PLAYER_SKILL_CHAIN) | |
3187 { | |
3188 armour_recovery_multipliers[0] = 1.0f; | |
3189 armour_recovery_multipliers[1] = 0.5f; | |
3190 armour_recovery_multipliers[2] = 0; | |
3191 armour_recovery_multipliers[3] = 0; | |
3192 } | |
3193 else if (armour_skill_type == PLAYER_SKILL_PLATE) | |
3194 { | |
3195 armour_recovery_multipliers[0] = 1.0f; | |
3196 armour_recovery_multipliers[1] = 0.5f; | |
3197 armour_recovery_multipliers[2] = 0.5f; | |
3198 armour_recovery_multipliers[3] = 0; | |
0 | 3199 } |
3200 else | |
3201 { | |
816 | 3202 assert(false && "Unknown armour type"); // what kind of armour is that? |
3203 armour_recovery_multipliers[0] = 1.0f; | |
3204 armour_recovery_multipliers[1] = 1.0f; | |
3205 armour_recovery_multipliers[2] = 1.0f; | |
3206 armour_recovery_multipliers[3] = 1.0f; | |
3207 } | |
3208 | |
3209 uint skill_mastery = SkillToMastery(pActiveSkills[armour_skill_type]); | |
3210 armour_recovery = base_armour_recovery * armour_recovery_multipliers[skill_mastery - 1]; | |
3211 } | |
3212 | |
3213 uint shield_recovery = 0; | |
3214 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD) | |
3215 { | |
3216 float shield_recovery_multipliers[4] = {1, 0, 0, 0}; | |
3217 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3218 auto shield = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 3219 auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType; |
3220 | |
3221 uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type]; | |
3222 shield_recovery = shield_base_recovery * SkillToMastery(pActiveSkills[skill_type]); | |
3223 } | |
3224 | |
1036 | 3225 uint player_speed_recovery_reduction = GetParameterBonus(GetActualSpeed()), |
816 | 3226 sword_axe_bow_recovery_reduction = 0; |
3227 bool shooting_laser = false; | |
3228 if (weapon_desc) | |
3229 { | |
3230 if (GetActualSkillLevel((PLAYER_SKILL_TYPE)weapon_desc->uSkillType) && | |
3231 (weapon_desc->uSkillType == PLAYER_SKILL_SWORD || weapon_desc->uSkillType == PLAYER_SKILL_AXE || weapon_desc->uSkillType == PLAYER_SKILL_BOW) ) | |
3232 { | |
3233 if (SkillToMastery(pActiveSkills[weapon_desc->uSkillType]) >= 2 ) // Expert Sword, Axe & Bow reduce recovery | |
3234 sword_axe_bow_recovery_reduction = pActiveSkills[weapon_desc->uSkillType] & 0x3F; | |
3235 } | |
3236 if (weapon_desc->uSkillType == PLAYER_SKILL_BLASTER) | |
3237 shooting_laser = true; | |
3238 } | |
3239 | |
3240 uint armsmaster_recovery_reduction = 0; | |
3241 if (!bRangedAttack && !shooting_laser) | |
3242 { | |
3243 if (uint armsmaster_level = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER)) | |
3244 { | |
3245 armsmaster_recovery_reduction = armsmaster_level & 0x3F; | |
3246 if (SkillToMastery(armsmaster_level) >= 4) | |
3247 armsmaster_recovery_reduction *= 2; | |
3248 } | |
3249 } | |
3250 | |
3251 uint v41 = 0; | |
3252 if (pPlayerBuffs[PLAYER_BUFF_7].uExpireTime > 0) | |
0 | 3253 v41 = 25; |
816 | 3254 |
3255 uint weapon_enchantment_recovery_reduction = 0; | |
3256 if ( weapon ) | |
3257 { | |
3258 if (weapon->uSpecEnchantmentType == 59 || | |
3259 weapon->uSpecEnchantmentType == 41 || | |
3260 weapon->uSpecEnchantmentType == 500) | |
3261 weapon_enchantment_recovery_reduction = 20; | |
3262 } | |
3263 | |
3264 | |
3265 int recovery = weapon_recovery + | |
3266 armour_recovery + | |
3267 shield_recovery | |
3268 - armsmaster_recovery_reduction | |
3269 - weapon_enchantment_recovery_reduction | |
3270 - v41 | |
3271 - sword_axe_bow_recovery_reduction | |
3272 - player_speed_recovery_reduction; | |
3273 | |
3274 if (recovery < 0) | |
3275 recovery = 0; | |
3276 return recovery; | |
0 | 3277 } |
3278 | |
3279 //----- (0048E4F8) -------------------------------------------------------- | |
3280 int Player::GetMaxHealth() | |
3281 { | |
3282 int v3; // esi@1 | |
3283 int v4; // esi@1 | |
3284 int v6; // esi@1 | |
3285 | |
1036 | 3286 v3 = GetParameterBonus(GetActualEndurance()); |
135 | 3287 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); |
0 | 3288 v6 = uFullHealthBonus |
135 | 3289 + pBaseHealthByClass[classType / 4] |
0 | 3290 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) |
3291 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH, 0) + v4; | |
3292 if (v6 <= 0) | |
3293 return 1; | |
3294 return v6; | |
3295 } | |
3296 | |
3297 //----- (0048E565) -------------------------------------------------------- | |
3298 int Player::GetMaxMana() | |
3299 { | |
3300 int v2; // eax@2 | |
3301 int v3; // esi@4 | |
3302 int v4; // eax@5 | |
3303 int v5; // esi@5 | |
3304 int v6; // eax@5 | |
3305 int v7; // esi@6 | |
3306 int v8; // esi@6 | |
3307 int v9; // esi@6 | |
3308 int result; // eax@7 | |
1116 | 3309 |
135 | 3310 switch (classType) |
0 | 3311 { |
1116 | 3312 case PLAYER_CLASS_ROGUE: |
3313 case PLAYER_CLASS_SPY: | |
3314 case PLAYER_CLASS_ASSASSIN: | |
3315 case PLAYER_CLASS_ARCHER: | |
3316 case PLAYER_CLASS_WARRIOR_MAGE: | |
3317 case PLAYER_CLASS_MASTER_ARCHER: | |
3318 case PLAYER_CLASS_SNIPER: | |
3319 case PLAYER_CLASS_SORCERER: | |
3320 case PLAYER_CLASS_WIZARD: | |
3321 case PLAYER_CLASS_ARCHMAGE: | |
3322 case PLAYER_CLASS_LICH: | |
0 | 3323 v2 = GetActualIntelligence(); |
1036 | 3324 v3 = GetParameterBonus(v2); |
1116 | 3325 break; |
3326 case PLAYER_CLASS_INITIATE: | |
3327 case PLAYER_CLASS_MASTER: | |
3328 case PLAYER_CLASS_NINJA: | |
3329 case PLAYER_CLASS_PALADIN: | |
3330 case PLAYER_CLASS_CRUSADER: | |
3331 case PLAYER_CLASS_HERO: | |
3332 case PLAYER_CLASS_VILLIAN: | |
3333 case PLAYER_CLASS_CLERIC: | |
3334 case PLAYER_CLASS_PRIEST: | |
3335 case PLAYER_CLASS_PRIEST_OF_SUN: | |
3336 case PLAYER_CLASS_PRIEST_OF_MOON: | |
0 | 3337 v2 = GetActualWillpower(); |
1036 | 3338 v3 = GetParameterBonus(v2); |
1116 | 3339 break; |
3340 case PLAYER_CLASS_HUNTER: | |
3341 case PLAYER_CLASS_RANGER_LORD: | |
3342 case PLAYER_CLASS_BOUNTY_HUNTER: | |
3343 case PLAYER_CLASS_DRUID: | |
3344 case PLAYER_CLASS_GREAT_DRUID: | |
3345 case PLAYER_CLASS_ARCH_DRUID: | |
3346 case PLAYER_CLASS_WARLOCK: | |
0 | 3347 v4 = GetActualWillpower(); |
1036 | 3348 v5 = GetParameterBonus(v4); |
0 | 3349 v6 = GetActualIntelligence(); |
1036 | 3350 v3 = GetParameterBonus(v6) + v5; |
0 | 3351 break; |
3352 default: | |
1116 | 3353 return 0; |
0 | 3354 break; |
3355 } | |
1116 | 3356 v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3); |
3357 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA, 0) + v7; | |
3358 v9 = uFullManaBonus | |
3359 + pBaseManaByClass[classType / 4] | |
3360 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) | |
3361 + v8; | |
3362 return max(0,v9); | |
0 | 3363 } |
3364 | |
3365 //----- (0048E656) -------------------------------------------------------- | |
3366 int Player::GetBaseAC() | |
3367 { | |
3368 Player *v1; // edi@1 | |
3369 int v2; // eax@1 | |
3370 int v3; // esi@1 | |
3371 int v4; // esi@1 | |
3372 int v5; // esi@1 | |
3373 int result; // eax@2 | |
3374 | |
3375 v1 = this; | |
3376 v2 = GetActualSpeed(); | |
1036 | 3377 v3 = GetParameterBonus(v2); |
0 | 3378 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; |
3379 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; | |
3380 if ( v5 >= 1 ) | |
3381 result = v5; | |
3382 else | |
3383 result = 0; | |
3384 return result; | |
3385 } | |
3386 | |
3387 //----- (0048E68F) -------------------------------------------------------- | |
3388 int Player::GetActualAC() | |
3389 { | |
3390 Player *v1; // edi@1 | |
3391 int v2; // eax@1 | |
3392 int v3; // esi@1 | |
3393 int v4; // esi@1 | |
3394 int v5; // esi@1 | |
3395 int v6; // esi@1 | |
3396 int result; // eax@2 | |
3397 | |
3398 v1 = this; | |
3399 v2 = GetActualSpeed(); | |
1036 | 3400 v3 = GetParameterBonus(v2); |
0 | 3401 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS, 0) + v3; |
3402 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; | |
3403 v6 = v1->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5; | |
3404 if ( v6 >= 1 ) | |
3405 result = v6; | |
3406 else | |
3407 result = 0; | |
3408 return result; | |
3409 } | |
3410 | |
3411 //----- (0048E6DC) -------------------------------------------------------- | |
3412 unsigned int Player::GetBaseAge() | |
3413 { | |
352 | 3414 return ((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year; |
0 | 3415 } |
3416 | |
3417 //----- (0048E72C) -------------------------------------------------------- | |
3418 unsigned int Player::GetActualAge() | |
3419 { | |
3420 return this->sAgeModifier + GetBaseAge(); | |
3421 } | |
3422 | |
3423 //----- (0048E73F) -------------------------------------------------------- | |
3424 int Player::GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3425 { | |
3426 Player *v2; // ebx@1 | |
3427 signed int v3; // esi@1 | |
3428 enum CHARACTER_RACE v4; // eax@1 | |
3429 signed int v5; // edi@8 | |
3430 char v6; // zf@9 | |
3431 int v7; // esi@20 | |
3432 int result; // eax@21 | |
3433 signed int v9; // [sp-4h] [bp-10h]@11 | |
3434 | |
3435 v2 = this; | |
3436 v3 = 0; | |
3437 v4 = GetRace(); | |
3438 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE ) | |
3439 { | |
3440 v5 = 0; | |
3441 goto LABEL_16; | |
3442 } | |
3443 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR ) | |
3444 { | |
3445 v5 = 1; | |
3446 LABEL_16: | |
3447 v6 = v4 == 2; | |
3448 goto LABEL_17; | |
3449 } | |
3450 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER ) | |
3451 { | |
3452 v6 = v4 == 3; | |
3453 v5 = 2; | |
3454 goto LABEL_17; | |
3455 } | |
3456 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH ) | |
3457 { | |
3458 v5 = 3; | |
3459 v6 = v4 == 3; | |
3460 goto LABEL_17; | |
3461 } | |
3462 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_MIND ) | |
3463 { | |
3464 v5 = 7; | |
3465 if ( v4 != 1 ) | |
3466 goto LABEL_20; | |
3467 v9 = 10; | |
3468 LABEL_19: | |
3469 v3 = v9; | |
3470 goto LABEL_20; | |
3471 } | |
3472 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_BODY || a2 == 33 ) | |
3473 { | |
3474 v5 = 8; | |
3475 v6 = v4 == 0; | |
3476 LABEL_17: | |
3477 if ( !v6 ) | |
3478 goto LABEL_20; | |
3479 v9 = 5; | |
3480 goto LABEL_19; | |
3481 } | |
3482 v5 = 0; | |
3483 LABEL_20: | |
3484 v7 = GetItemsBonus(a2, 0) + v3; | |
135 | 3485 if ( v2->classType != PLAYER_CLASS_LICH || (result = 200, v7 + *(&v2->sResFireBase + v5) <= 200) ) |
0 | 3486 result = v7 + *(&v2->sResFireBase + v5); |
3487 return result; | |
3488 } | |
3489 | |
3490 //----- (0048E7D0) -------------------------------------------------------- | |
3491 int Player::GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3492 { | |
3493 signed int v2; // edi@1 | |
3494 Player *v3; // esi@1 | |
3495 enum CHARACTER_RACE v4; // ebx@1 | |
3496 char v6; // zf@18 | |
3497 int v7; // ebx@28 | |
3498 int result; // eax@28 | |
3499 signed int v9; // [sp+10h] [bp-8h]@1 | |
3500 signed int v10; // [sp+14h] [bp-4h]@1 | |
3501 | |
3502 v2 = 0; | |
3503 v3 = this; | |
3504 v10 = 0; | |
3505 v9 = 0; | |
3506 v4 = GetRace(); | |
652 | 3507 if ( CheckHiredNPCSpeciality(Enchanter) ) |
0 | 3508 v10 = 20; |
3509 if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE | |
3510 || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR | |
3511 || a2 == CHARACTER_ATTRIBUTE_RESIST_WATER | |
3512 || a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH) | |
3513 && SkillToMastery(v3->pActiveSkills[9]) == 4 | |
3514 && HasItemEquipped(EQUIP_ARMOUR) | |
3515 && GetEquippedItemSkillType(EQUIP_ARMOUR) == PLAYER_SKILL_LEATHER ) | |
3516 v10 += v3->pActiveSkills[9] & 0x3F; | |
3517 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE ) | |
3518 goto LABEL_25; | |
3519 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_AIR ) | |
3520 { | |
3521 v2 = 1; | |
3522 LABEL_25: | |
3523 v6 = v4 == 2; | |
3524 LABEL_26: | |
3525 if ( v6 ) | |
3526 v9 = 5; | |
3527 goto LABEL_28; | |
3528 } | |
3529 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_WATER ) | |
3530 { | |
3531 v6 = v4 == 3; | |
3532 v2 = 2; | |
3533 goto LABEL_26; | |
3534 } | |
3535 if ( a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH ) | |
3536 { | |
3537 v2 = 3; | |
3538 if ( v4 == 3 ) | |
3539 v10 += 5; | |
3540 } | |
3541 else | |
3542 { | |
3543 if ( a2 != CHARACTER_ATTRIBUTE_RESIST_MIND ) | |
3544 { | |
3545 if ( a2 != CHARACTER_ATTRIBUTE_RESIST_BODY && a2 != 33 ) | |
3546 goto LABEL_28; | |
3547 v2 = 8; | |
3548 v6 = v4 == 0; | |
3549 goto LABEL_26; | |
3550 } | |
3551 v2 = 7; | |
3552 if ( v4 == 1 ) | |
3553 v9 = 10; | |
3554 } | |
3555 LABEL_28: | |
3556 v7 = GetItemsBonus(a2, 0); | |
3557 result = v10 + GetMagicalBonus(a2) + v7 + v9 + *(&v3->sResFireBonus + v2) + *(&v3->sResFireBase + v2); | |
135 | 3558 if ( v3->classType == PLAYER_CLASS_LICH ) |
0 | 3559 { |
3560 if ( result > 200 ) | |
3561 result = 200; | |
3562 } | |
3563 return result; | |
3564 } | |
3565 | |
3566 //----- (0048E8F5) -------------------------------------------------------- | |
816 | 3567 bool Player::Recover(int dt) |
3568 { | |
3569 //Player *v2; // esi@1 | |
0 | 3570 signed __int64 v3; // qax@1 |
816 | 3571 //bool result; // eax@4 |
3572 | |
3573 //v2 = this; | |
3574 v3 = (signed __int64)((double)(dt * _48EA46_calc_special_bonus_by_items(17)) * 0.01 + (double)dt); | |
3575 | |
3576 Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery); | |
3577 | |
3578 if (uTimeToRecovery > v3) | |
3579 { | |
3580 uTimeToRecovery -= v3; | |
3581 return true; | |
0 | 3582 } |
3583 else | |
3584 { | |
816 | 3585 uTimeToRecovery = 0; |
3586 viewparams->bRedrawGameUI = true; | |
3587 if (!uActiveCharacter) | |
0 | 3588 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3589 return false; |
3590 } | |
0 | 3591 } |
3592 | |
3593 //----- (0048E96A) -------------------------------------------------------- | |
816 | 3594 void Player::SetRecoveryTime(signed int rec) |
3595 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
821
diff
changeset
|
3596 assert(rec >= 0); |
816 | 3597 |
3598 if (rec > uTimeToRecovery) | |
3599 uTimeToRecovery = rec; | |
3600 | |
3601 if (pPlayers[uActiveCharacter] == this && !some_active_character) | |
0 | 3602 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3603 |
3604 viewparams->bRedrawGameUI = true; | |
0 | 3605 } |
3606 // 50C0C4: using guessed type int some_active_character; | |
3607 | |
3608 //----- (0048E9B7) -------------------------------------------------------- | |
3609 void Player::RandomizeName() | |
3610 { | |
3611 if (!uExpressionTimePassed) | |
3612 strcpy(pName, pNPCStats->pNPCNames[rand() % pNPCStats->uNumNPCNames[uSex]][uSex]); | |
3613 } | |
3614 | |
3615 //----- (0048E9F4) -------------------------------------------------------- | |
3616 unsigned int Player::GetMajorConditionIdx() | |
3617 { | |
3618 for (uint i = 0; i < 18; ++i) | |
3619 if (pConditions[pConditionImportancyTable[i]] != 0) | |
3620 return pConditionImportancyTable[i]; | |
3621 | |
3622 return 18; | |
3623 } | |
3624 | |
3625 //----- (0048EA1B) -------------------------------------------------------- | |
1036 | 3626 int Player::GetParameterBonus( int player_parameter ) |
3627 { | |
3628 int i; // eax@1 | |
3629 i = 0; | |
3630 while (param_to_bonus_table[i]) | |
3631 { | |
3632 if (player_parameter >= param_to_bonus_table[i]) | |
3633 break; | |
3634 ++i; | |
3635 } | |
3636 return parameter_to_bonus_value[i]; | |
0 | 3637 } |
3638 | |
3639 //----- (0048EA46) -------------------------------------------------------- | |
3640 int Player::_48EA46_calc_special_bonus_by_items(int a2) | |
3641 { | |
1032 | 3642 int inv_indx; // eax@3 |
3643 | |
3644 for (int i=EQUIP_OFF_HAND; i<EQUIP_BOOK; ++i ) | |
3645 { | |
3646 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3647 continue; | |
3648 inv_indx = pEquipment.pIndices[i] - 1; | |
3649 if (a2==17) | |
3650 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3651 if ((pInventoryItemList[inv_indx].uSpecEnchantmentType==17)||(pInventoryItemList[inv_indx].uItemID==533)) //Elven Chainmail+Increases rate of Recovery |
1032 | 3652 return 50; |
3653 } | |
3654 if (a2==24) | |
3655 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3656 if (pInventoryItemList[inv_indx].uSpecEnchantmentType==24) //Increased Knockback. |
1032 | 3657 return 5; |
3658 } | |
3659 } | |
3660 return 0; | |
0 | 3661 } |
3662 | |
3663 //----- (0048EAAE) -------------------------------------------------------- | |
3664 int Player::GetItemsBonus(CHARACTER_ATTRIBUTE_TYPE attr, int a3) | |
3665 { | |
3666 CHARACTER_ATTRIBUTE_TYPE v3; // esi@1 | |
1040 | 3667 // signed int v4; // eax@1 |
0 | 3668 int v5; // edi@1 |
3669 Player *v6; // ebx@1 | |
3670 Player *v8; // ecx@48 | |
3671 int v9; // eax@49 | |
3672 int v10; // edx@49 | |
3673 Player *v11; // ecx@55 | |
3674 int v12; // eax@56 | |
3675 int v13; // edx@56 | |
3676 int v14; // ecx@58 | |
3677 int v15; // eax@58 | |
3678 Player *v16; // ecx@61 | |
3679 int v17; // eax@62 | |
3680 Player *v18; // ecx@66 | |
3681 int v19; // eax@67 | |
3682 int v20; // eax@69 | |
3683 Player *v21; // ecx@75 | |
3684 int v22; // eax@76 | |
3685 int v23; // edx@76 | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
3686 //int v24; // eax@79 |
0 | 3687 int v25; // ecx@80 |
3688 int v26; // edi@80 | |
3689 Player *v27; // ecx@84 | |
3690 int v28; // eax@85 | |
3691 int v29; // edx@85 | |
3692 Player *v30; // ecx@96 | |
3693 int v31; // ebp@97 | |
3694 int v32; // eax@98 | |
3695 unsigned int v33; // eax@100 | |
3696 int v34; // eax@103 | |
3697 char v35; // zf@104 | |
3698 char v36; // zf@107 | |
3699 unsigned __int8 v37; // zf@119 | |
3700 char v38; // sf@119 | |
3701 unsigned __int8 v39; // of@119 | |
3702 char v40; // zf@122 | |
3703 char v41; // zf@145 | |
3704 char v42; // zf@164 | |
3705 char v43; // zf@173 | |
3706 char v44; // zf@189 | |
3707 char v45; // zf@198 | |
3708 char v46; // zf@239 | |
3709 int v47; // eax@268 | |
3710 int v48; // eax@269 | |
3711 int v49; // eax@291 | |
3712 char v50; // zf@295 | |
3713 int v51; // eax@306 | |
3714 int v52; // eax@307 | |
3715 char v53; // zf@312 | |
3716 char v54; // zf@336 | |
3717 char v55; // zf@348 | |
3718 int v56; // eax@365 | |
3719 int v57; // ebx@368 | |
3720 signed int v58; // [sp-4h] [bp-20h]@10 | |
3721 signed int v59; // [sp-4h] [bp-20h]@71 | |
3722 signed int v60; // [sp-4h] [bp-20h]@347 | |
3723 int v61; // [sp+10h] [bp-Ch]@1 | |
3724 int v62; // [sp+14h] [bp-8h]@1 | |
3725 int v63; // [sp+18h] [bp-4h]@101 | |
3726 ItemGen *attra; // [sp+20h] [bp+4h]@101 | |
3727 unsigned int v65; // [sp+24h] [bp+8h]@95 | |
1040 | 3728 bool no_skills; |
0 | 3729 |
3730 v3 = attr; | |
3731 v5 = 0; | |
3732 v6 = this; | |
3733 v62 = 0; | |
3734 v61 = 0; | |
3735 | |
1040 | 3736 |
3737 no_skills=false; | |
0 | 3738 switch (attr) |
3739 { | |
1040 | 3740 case CHARACTER_ATTRIBUTE_SKILL_ALCHEMY: v58 = PLAYER_SKILL_ALCHEMY; break; |
3741 case CHARACTER_ATTRIBUTE_SKILL_STEALING: v58 = PLAYER_SKILL_STEALING; break; | |
3742 case CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM: v58 = PLAYER_SKILL_TRAP_DISARM; break; | |
3743 case CHARACTER_ATTRIBUTE_SKILL_ITEM_ID: v58 = PLAYER_SKILL_ITEM_ID; break; | |
3744 case CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID: v58 = PLAYER_SKILL_MONSTER_ID; break; | |
3745 case CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER: v58 = PLAYER_SKILL_ARMSMASTER; break; | |
3746 case CHARACTER_ATTRIBUTE_SKILL_DODGE: v58 = PLAYER_SKILL_DODGE; break; | |
3747 case CHARACTER_ATTRIBUTE_SKILL_UNARMED: v58 = PLAYER_SKILL_UNARMED; break; | |
3748 case CHARACTER_ATTRIBUTE_SKILL_FIRE: v58 = PLAYER_SKILL_FIRE; break; | |
3749 case CHARACTER_ATTRIBUTE_SKILL_AIR: v58 = PLAYER_SKILL_AIR; break; | |
3750 case CHARACTER_ATTRIBUTE_SKILL_WATER: v58 = PLAYER_SKILL_WATER; break; | |
3751 case CHARACTER_ATTRIBUTE_SKILL_EARTH: v58 = PLAYER_SKILL_EARTH; break; | |
3752 case CHARACTER_ATTRIBUTE_SKILL_SPIRIT: v58 = PLAYER_SKILL_SPIRIT; break; | |
3753 case CHARACTER_ATTRIBUTE_SKILL_MIND: v58 = PLAYER_SKILL_MIND; break; | |
3754 case CHARACTER_ATTRIBUTE_SKILL_BODY: v58 = PLAYER_SKILL_BODY; break; | |
3755 case CHARACTER_ATTRIBUTE_SKILL_LIGHT: v58 = PLAYER_SKILL_LIGHT; break; | |
3756 case CHARACTER_ATTRIBUTE_SKILL_DARK: v58 = PLAYER_SKILL_DARK; break; | |
3757 case CHARACTER_ATTRIBUTE_SKILL_MEDITATION: v58 = PLAYER_SKILL_MEDITATION; break; | |
3758 case CHARACTER_ATTRIBUTE_SKILL_BOW: v58 = PLAYER_SKILL_BOW; break; | |
3759 case CHARACTER_ATTRIBUTE_SKILL_SHIELD: v58 = PLAYER_SKILL_SHIELD; break; | |
3760 case CHARACTER_ATTRIBUTE_SKILL_LEARNING: v58 = PLAYER_SKILL_LEARNING; break; | |
3761 default: | |
3762 no_skills=true; | |
0 | 3763 } |
1040 | 3764 if (!no_skills) |
0 | 3765 { |
1040 | 3766 if ( !this->pActiveSkills[v58] ) |
3767 return 0; | |
0 | 3768 } |
1040 | 3769 |
0 | 3770 if ( (signed int)attr > 28 ) |
3771 { | |
3772 if ( (signed int)attr < 29 ) | |
3773 return v5 + v62 + v61; | |
1040 | 3774 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS ) |
0 | 3775 { |
3776 if ( HasItemEquipped(EQUIP_BOW) ) | |
1040 | 3777 v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uBow-1].uItemID].uDamageMod; |
0 | 3778 return v5 + v62 + v61; |
3779 } | |
1040 | 3780 if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MIN ) |
0 | 3781 { |
3782 if ( !HasItemEquipped(EQUIP_BOW) ) | |
3783 return v5 + v62 + v61; | |
1040 | 3784 v57 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID; |
0 | 3785 v5 = pItemsTable->pItems[v57].uDamageMod; |
3786 v56 = pItemsTable->pItems[v57].uDamageDice; | |
1040 | 3787 v5 += v56; |
3788 return v5 + v62 + v61; | |
3789 } | |
3790 if ( attr == CHARACTER_ATTRIBUTE_RANGED_DMG_MAX ) | |
0 | 3791 { |
3792 if ( !HasItemEquipped(EQUIP_BOW) ) | |
3793 return v5 + v62 + v61; | |
1040 | 3794 v20 = v6->pOwnItems[v6->pEquipment.uBow-1].uItemID; |
0 | 3795 v5 = pItemsTable->pItems[v20].uDamageDice * pItemsTable->pItems[v20].uDamageRoll; |
3796 LABEL_365: | |
3797 v56 = pItemsTable->pItems[v20].uDamageMod; | |
3798 LABEL_366: | |
3799 v5 += v56; | |
3800 return v5 + v62 + v61; | |
3801 } | |
3802 if ( (signed int)attr <= 33 || (signed int)attr > 46 ) | |
3803 return v5 + v62 + v61; | |
3804 LABEL_95: | |
3805 v65 = 0; | |
3806 while ( 1 ) | |
3807 { | |
3808 if ( !HasItemEquipped((ITEM_EQUIP_TYPE)v65) ) | |
3809 goto LABEL_361; | |
898 | 3810 v31 = *(&v6->pEquipment.uShield + v65) - 1; |
0 | 3811 if ( v3 == 9 ) |
3812 { | |
816 | 3813 v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v65); |
0 | 3814 if ( v32 >= 3 ) |
3815 { | |
3816 if ( v32 <= 11 ) | |
3817 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
3818 v33 = v6->pInventoryItemList[v31].uItemID; |
0 | 3819 v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; |
3820 } | |
3821 } | |
3822 } | |
3823 v63 = (int)((char *)v6 + 36 * v31); | |
3824 attra = (ItemGen *)(v63 + 532); | |
377 | 3825 if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(v63 + 532)) == 1 |
3826 && !pItemsTable->IsMaterialSpecial(attra) ) | |
0 | 3827 { |
3828 v34 = attra->uItemID; | |
3829 switch ( attra->uItemID ) | |
3830 { | |
3831 case 0x1F4u: | |
3832 v35 = v3 == 5; | |
3833 goto LABEL_105; | |
3834 case 0x1F5u: | |
3835 v36 = v3 == 0; | |
3836 goto LABEL_108; | |
3837 case 0x1F6u: | |
3838 if ( v3 == 21 ) | |
3839 v61 += 10; | |
3840 v36 = v3 == 2; | |
3841 goto LABEL_108; | |
3842 case 0x1F7u: | |
3843 if ( v3 == 17 ) | |
3844 v61 += 5; | |
3845 if ( v3 == 18 ) | |
3846 v61 += 5; | |
3847 v36 = v3 == 6; | |
3848 goto LABEL_108; | |
3849 case 0x1F8u: | |
3850 goto LABEL_118; | |
3851 case 0x1F9u: | |
3852 v40 = v3 == 3; | |
3853 goto LABEL_123; | |
3854 case 0x1FAu: | |
3855 v35 = v3 == 10; | |
3856 goto LABEL_105; | |
3857 case 0x1FEu: | |
3858 v35 = v3 == 4; | |
3859 goto LABEL_105; | |
3860 case 0x1FFu: | |
3861 if ( v3 == 23 ) | |
3862 v61 += 10; | |
3863 if ( v3 == 22 ) | |
3864 v61 += 10; | |
3865 goto LABEL_361; | |
3866 case 0x200u: | |
3867 if ( v3 == 36 ) | |
3868 { | |
3869 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]); | |
3870 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3871 } | |
3872 v36 = v3 == 5; | |
3873 LABEL_108: | |
3874 if ( v36 ) | |
3875 v5 += 40; | |
3876 goto LABEL_361; | |
3877 case 0x201u: | |
3878 if ( v3 == 39 ) | |
3879 { | |
3880 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
3881 v34 = ((unsigned int)v34 >> 1) & 0x1F; | |
3882 v62 = v34; | |
3883 } | |
3884 goto LABEL_136; | |
3885 case 0x202u: | |
3886 if ( !v3 ) | |
3887 v5 += 150; | |
3888 if ( v3 == 1 ) | |
3889 v5 -= 40; | |
3890 if ( v3 == 2 ) | |
3891 v5 -= 40; | |
3892 goto LABEL_145; | |
3893 case 0x203u: | |
3894 if ( v3 == 42 ) | |
3895 { | |
3896 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); | |
3897 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3898 } | |
3899 if ( v3 == 43 ) | |
3900 v61 += 15; | |
3901 goto LABEL_361; | |
3902 case 0x204u: | |
3903 if ( v3 == 17 ) | |
3904 v61 += 5; | |
3905 if ( v3 == 18 ) | |
3906 v61 += 5; | |
3907 if ( v3 == 6 ) | |
3908 v5 += 50; | |
3909 if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 ) | |
3910 goto LABEL_166; | |
3911 v42 = v3 == 15; | |
3912 goto LABEL_165; | |
3913 case 0x205u: | |
3914 if ( v3 == 18 ) | |
3915 v61 += 5; | |
3916 goto LABEL_361; | |
3917 case 0x206u: | |
3918 if ( !v3 ) | |
3919 v5 += 100; | |
3920 if ( v3 == 3 ) | |
3921 v5 += 100; | |
3922 v43 = v3 == 9; | |
3923 goto LABEL_174; | |
3924 case 0x207u: | |
3925 if ( v3 == 45 ) | |
3926 v61 += 5; | |
3927 if ( v3 == 15 ) | |
3928 v5 -= 10; | |
3929 v42 = v3 == 14; | |
3930 LABEL_165: | |
3931 if ( v42 ) | |
3932 LABEL_166: | |
3933 v5 -= 10; | |
3934 goto LABEL_361; | |
3935 case 0x208u: | |
3936 v35 = v3 == 3; | |
3937 goto LABEL_105; | |
3938 case 0x209u: | |
3939 if ( v3 == 2 ) | |
3940 v5 += 15; | |
3941 if ( !v3 ) | |
3942 v5 += 15; | |
3943 v41 = v3 == 6; | |
3944 goto LABEL_146; | |
3945 case 0x20Au: | |
3946 if ( v3 == 46 ) | |
3947 v61 += 15; | |
3948 v44 = v3 == 3; | |
3949 goto LABEL_190; | |
3950 case 0x20Bu: | |
3951 if ( v3 == 34 ) | |
3952 { | |
3953 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); | |
3954 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3955 } | |
3956 if ( v3 == 12 ) | |
3957 v5 += 50; | |
3958 if ( v3 == 2 ) | |
3959 v5 += 30; | |
3960 v45 = v3 == 9; | |
3961 goto LABEL_199; | |
3962 case 0x20Cu: | |
3963 if ( !v3 ) | |
3964 v5 += 75; | |
3965 goto LABEL_145; | |
3966 case 0x20Du: | |
3967 if ( v3 == 5 ) | |
3968 v5 += 50; | |
3969 if ( v3 == 6 ) | |
3970 v5 += 50; | |
3971 if ( v3 == 11 || v3 == 10 || v3 == 12 || v3 == 13 || v3 == 33 || v3 == 14 ) | |
3972 goto LABEL_374; | |
3973 v43 = v3 == 15; | |
3974 LABEL_174: | |
3975 if ( v43 ) | |
3976 LABEL_374: | |
3977 v5 -= 15; | |
3978 goto LABEL_361; | |
3979 case 0x20Eu: | |
3980 if ( v3 == 4 ) | |
3981 v5 += 150; | |
3982 if ( v3 == 44 ) | |
3983 v61 += 5; | |
3984 if ( v3 == 9 ) | |
3985 v5 -= 25; | |
3986 goto LABEL_361; | |
3987 case 0x20Fu: | |
3988 if ( v3 == 39 ) | |
3989 { | |
3990 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
3991 v34 = ((unsigned int)v34 >> 1) & 0x1F; | |
3992 v62 = v34; | |
3993 } | |
3994 if ( v3 == 40 ) | |
3995 { | |
3996 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); | |
3997 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
3998 } | |
3999 LABEL_145: | |
4000 v41 = v3 == 5; | |
4001 LABEL_146: | |
4002 if ( v41 ) | |
4003 v5 -= 40; | |
4004 goto LABEL_361; | |
4005 case 0x210u: | |
4006 if ( v3 == 38 ) | |
4007 { | |
4008 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); | |
4009 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
4010 } | |
4011 if ( !v3 ) | |
4012 v5 += 75; | |
4013 v44 = v3 == 11; | |
4014 LABEL_190: | |
4015 if ( v44 ) | |
4016 v5 -= 50; | |
4017 goto LABEL_361; | |
4018 case 0x211u: | |
4019 if ( v3 == 5 ) | |
4020 v5 += 100; | |
4021 if ( v3 == 4 ) | |
4022 v5 += 50; | |
4023 v35 = v3 == 11; | |
4024 LABEL_105: | |
4025 if ( v35 ) | |
4026 v5 += 50; | |
4027 goto LABEL_361; | |
4028 case 0x212u: | |
4029 if ( v3 == 1 ) | |
4030 v5 -= 20; | |
4031 v45 = v3 == 2; | |
4032 LABEL_199: | |
4033 if ( v45 ) | |
4034 v5 -= 20; | |
4035 goto LABEL_361; | |
4036 case 0x214u: | |
4037 if ( v3 == 1 ) | |
4038 v5 += 15; | |
4039 v46 = v3 == 2; | |
4040 goto LABEL_240; | |
4041 case 0x215u: | |
4042 if ( v3 == 5 ) | |
4043 v5 += 15; | |
4044 v46 = v3 == 4; | |
4045 goto LABEL_240; | |
4046 case 0x216u: | |
4047 if ( v3 == 10 ) | |
4048 v5 += 30; | |
4049 if ( !v3 ) | |
4050 v5 += 15; | |
4051 goto LABEL_315; | |
4052 case 0x217u: | |
4053 if ( v3 == 21 ) | |
4054 v61 += 5; | |
4055 if ( !v3 ) | |
4056 v5 += 15; | |
4057 goto LABEL_253; | |
4058 case 0x218u: | |
4059 goto LABEL_253; | |
4060 default: | |
4061 goto LABEL_361; | |
4062 } | |
4063 goto LABEL_361; | |
4064 } | |
4065 if ( *(int *)(v63 + 536) == v3 + 1 ) | |
4066 { | |
4067 if ( (signed int)v3 >= 0 ) | |
4068 { | |
4069 if ( (signed int)v3 <= 15 ) | |
4070 { | |
4071 v5 += *((int *)v6->pConditions + 9 * v31 + 135); | |
4072 } | |
4073 else | |
4074 { | |
4075 if ( (signed int)v3 <= 23 && v5 < *((int *)v6->pConditions + 9 * v31 + 135) ) | |
4076 v5 = *((int *)v6->pConditions + 9 * v31 + 135); | |
4077 } | |
4078 } | |
4079 goto LABEL_361; | |
4080 } | |
4081 v34 = *(int *)(v63 + 544); | |
4082 if ( v34 > 48 ) | |
4083 { | |
4084 switch ( v34 ) | |
4085 { | |
4086 case 54: | |
4087 goto LABEL_315; | |
4088 case 49: | |
4089 if ( v3 == 6 ) | |
4090 goto LABEL_121; | |
4091 v50 = v3 == 1; | |
4092 goto LABEL_296; | |
4093 case 51: | |
4094 if ( v3 != 5 && v3 != 1 ) | |
4095 goto LABEL_309; | |
4096 goto LABEL_121; | |
4097 case 52: | |
4098 if ( v3 == 3 ) | |
4099 goto LABEL_121; | |
4100 v50 = v3 == 4; | |
4101 goto LABEL_296; | |
4102 case 53: | |
4103 if ( !v3 ) | |
4104 goto LABEL_121; | |
4105 v50 = v3 == 2; | |
4106 goto LABEL_296; | |
4107 case 55: | |
4108 v46 = v3 == 6; | |
4109 goto LABEL_240; | |
4110 case 56: | |
4111 if ( !v3 ) | |
4112 goto LABEL_351; | |
4113 v53 = v3 == 3; | |
4114 goto LABEL_350; | |
4115 case 57: | |
4116 if ( v3 == 1 ) | |
4117 goto LABEL_351; | |
4118 v53 = v3 == 2; | |
4119 goto LABEL_350; | |
4120 case 50: | |
4121 if ( v3 == 10 ) | |
4122 v5 += 30; | |
4123 goto LABEL_361; | |
4124 case 60: | |
4125 if ( v3 != 23 ) | |
4126 goto LABEL_336; | |
4127 if ( v5 >= 3 ) | |
4128 goto LABEL_361; | |
4129 v5 = 3; | |
4130 LABEL_336: | |
4131 v54 = v3 == 22; | |
4132 goto LABEL_345; | |
4133 case 61: | |
4134 if ( v3 != 17 ) | |
4135 goto LABEL_340; | |
4136 if ( v5 >= 3 ) | |
4137 goto LABEL_361; | |
4138 v5 = 3; | |
4139 LABEL_340: | |
4140 v54 = v3 == 18; | |
4141 goto LABEL_345; | |
4142 case 62: | |
4143 if ( v3 != 19 ) | |
4144 goto LABEL_344; | |
4145 if ( v5 >= 3 ) | |
4146 goto LABEL_361; | |
4147 v5 = 3; | |
4148 LABEL_344: | |
4149 v54 = v3 == 20; | |
4150 LABEL_345: | |
4151 if ( !v54 ) | |
4152 goto LABEL_361; | |
4153 if ( v5 >= 3 ) | |
4154 goto LABEL_361; | |
4155 v60 = 3; | |
4156 goto LABEL_360; | |
4157 case 67: | |
4158 v55 = v3 == 18; | |
4159 goto LABEL_357; | |
4160 case 68: | |
4161 v53 = v3 == 9; | |
4162 goto LABEL_350; | |
4163 case 69: | |
4164 if ( v3 == 11 ) | |
4165 v5 += 20; | |
4166 break; | |
4167 case 70: | |
4168 if ( v3 == 12 ) | |
4169 v5 += 10; | |
4170 v55 = v3 == 16; | |
4171 LABEL_357: | |
4172 if ( v55 && v5 < 2 ) | |
4173 { | |
4174 v60 = 2; | |
4175 LABEL_360: | |
4176 v5 = v60; | |
4177 } | |
4178 break; | |
4179 default: | |
4180 goto LABEL_361; | |
4181 } | |
4182 goto LABEL_361; | |
4183 } | |
4184 if ( v34 == 48 ) | |
4185 { | |
4186 if ( v3 == 9 ) | |
4187 v5 += 5; | |
4188 LABEL_315: | |
4189 v46 = v3 == 3; | |
4190 LABEL_240: | |
4191 if ( v46 ) | |
4192 v5 += 15; | |
4193 goto LABEL_361; | |
4194 } | |
4195 if ( v34 > 32 ) | |
4196 { | |
4197 if ( v34 > 44 ) | |
4198 { | |
4199 v51 = v34 - 45; | |
4200 if ( !v51 ) | |
4201 { | |
4202 if ( v3 == 5 ) | |
4203 goto LABEL_351; | |
4204 v53 = v3 == 4; | |
4205 LABEL_350: | |
4206 if ( v53 ) | |
4207 LABEL_351: | |
4208 v5 += 5; | |
4209 goto LABEL_361; | |
4210 } | |
4211 v52 = v51 - 1; | |
4212 if ( !v52 ) | |
4213 { | |
4214 v40 = v3 == 0; | |
4215 LABEL_123: | |
4216 if ( v40 ) | |
4217 v5 += 25; | |
4218 goto LABEL_361; | |
4219 } | |
4220 if ( v52 == 1 ) | |
4221 { | |
4222 LABEL_309: | |
4223 v50 = v3 == 8; | |
4224 goto LABEL_296; | |
4225 } | |
4226 } | |
4227 else | |
4228 { | |
4229 if ( v34 == 44 ) | |
4230 { | |
4231 v50 = v3 == 7; | |
4232 goto LABEL_296; | |
4233 } | |
4234 v34 -= 33; | |
4235 if ( !v34 ) | |
4236 { | |
4237 if ( v3 != 38 ) | |
4238 goto LABEL_361; | |
4239 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[16]); | |
4240 goto LABEL_138; | |
4241 } | |
4242 --v34; | |
4243 if ( !v34 ) | |
4244 { | |
4245 if ( v3 != 36 ) | |
4246 goto LABEL_361; | |
4247 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[14]); | |
4248 goto LABEL_138; | |
4249 } | |
4250 v49 = v34 - 8; | |
4251 if ( !v49 ) | |
4252 { | |
4253 if ( (signed int)v3 >= 0 && (signed int)v3 <= 15 ) | |
4254 ++v5; | |
4255 goto LABEL_361; | |
4256 } | |
4257 if ( v49 == 1 ) | |
4258 { | |
4259 if ( v3 != 3 && v3 != 7 ) | |
4260 { | |
4261 v50 = v3 == 9; | |
4262 LABEL_296: | |
4263 if ( !v50 ) | |
4264 goto LABEL_361; | |
4265 } | |
4266 LABEL_121: | |
4267 v5 += 10; | |
4268 goto LABEL_361; | |
4269 } | |
4270 } | |
4271 } | |
4272 else | |
4273 { | |
4274 if ( v34 == 32 ) | |
4275 { | |
4276 if ( v3 != 39 ) | |
4277 goto LABEL_361; | |
4278 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[17]); | |
4279 goto LABEL_138; | |
4280 } | |
4281 if ( v34 > 28 ) | |
4282 { | |
4283 v34 -= 29; | |
4284 if ( v34 ) | |
4285 { | |
4286 --v34; | |
4287 if ( v34 ) | |
4288 { | |
4289 --v34; | |
4290 if ( v34 || v3 != 41 ) | |
4291 goto LABEL_361; | |
4292 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[19]); | |
4293 } | |
4294 else | |
4295 { | |
4296 if ( v3 != 34 ) | |
4297 goto LABEL_361; | |
4298 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[12]); | |
4299 } | |
4300 } | |
4301 else | |
4302 { | |
4303 if ( v3 != 37 ) | |
4304 goto LABEL_361; | |
4305 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[15]); | |
4306 } | |
4307 goto LABEL_138; | |
4308 } | |
4309 if ( v34 == 28 ) | |
4310 { | |
4311 LABEL_136: | |
4312 if ( v3 == 42 ) | |
4313 { | |
4314 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[20]); | |
4315 LABEL_138: | |
4316 v62 = ((unsigned int)v34 >> 1) & 0x1F; | |
4317 goto LABEL_361; | |
4318 } | |
4319 } | |
4320 else | |
4321 { | |
4322 v47 = v34 - 1; | |
4323 if ( v47 ) | |
4324 { | |
4325 v48 = v47 - 1; | |
4326 if ( v48 ) | |
4327 { | |
4328 v34 = v48 - 24; | |
4329 if ( v34 ) | |
4330 { | |
4331 --v34; | |
4332 if ( v34 || v3 != 40 ) | |
4333 goto LABEL_361; | |
4334 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[18]); | |
4335 } | |
4336 else | |
4337 { | |
4338 if ( v3 != 35 ) | |
4339 goto LABEL_361; | |
4340 LOBYTE(v34) = LOBYTE(v6->pActiveSkills[13]); | |
4341 } | |
4342 goto LABEL_138; | |
4343 } | |
4344 LABEL_118: | |
4345 if ( (signed int)v3 < 0 ) | |
4346 goto LABEL_361; | |
4347 v39 = __OFSUB__((int)v3, 6); | |
4348 v37 = v3 == 6; | |
4349 v38 = v3 - 6 < 0; | |
4350 } | |
4351 else | |
4352 { | |
4353 LABEL_253: | |
4354 if ( (signed int)v3 < 10 ) | |
4355 goto LABEL_361; | |
4356 v39 = __OFSUB__((int)v3, 15); | |
4357 v37 = v3 == 15; | |
4358 v38 = v3 - 15 < 0; | |
4359 } | |
4360 if ( (unsigned __int8)(v38 ^ v39) | v37 ) | |
4361 goto LABEL_121; | |
4362 } | |
4363 } | |
4364 LABEL_361: | |
4365 ++v65; | |
4366 if ( (signed int)v65 >= 16 ) | |
4367 return v5 + v62 + v61; | |
4368 } | |
4369 } | |
1040 | 4370 if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MAX ) |
0 | 4371 { |
4372 if ( IsUnarmed() != 1 ) | |
4373 { | |
816 | 4374 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4375 { | |
4376 v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4377 if ( v22 >= 0 ) |
4378 { | |
4379 if ( v22 <= 2 ) | |
4380 { | |
1040 | 4381 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; |
898 | 4382 if ( v6->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) |
0 | 4383 { |
4384 v26 = pItemsTable->pItems[v23].uDamageRoll; | |
4385 v25 = pItemsTable->pItems[v23].uDamageDice; | |
4386 } | |
4387 else | |
4388 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4389 v25 = pItemsTable->pItems[v23].uDamageRoll; |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4390 v26 = pItemsTable->pItems[v23].uDamageDice + 1; |
0 | 4391 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4392 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26; |
0 | 4393 } |
4394 } | |
4395 } | |
1040 | 4396 |
4397 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) ) | |
4398 { | |
4399 | |
4400 v28 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); | |
4401 if ((v28 < 0) || v28 > 2 ) | |
4402 return v5 + v62 + v61; | |
4403 } | |
1062 | 4404 v15 = pItemsTable->pItems[v23].uDamageMod; |
4405 v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll; | |
1040 | 4406 v5 += v15 + v14; |
1049 | 4407 return v5 + v62 + v61; |
0 | 4408 } |
4409 v59 = 3; | |
4410 LABEL_74: | |
4411 v5 = v59; | |
4412 return v5 + v62 + v61; | |
4413 } | |
4414 if ( (signed int)attr < 0 ) | |
4415 return v5 + v62 + v61; | |
1040 | 4416 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_SKILL_UNARMED ) |
0 | 4417 goto LABEL_95; |
1040 | 4418 if ( attr == CHARACTER_ATTRIBUTE_LEVEL ) |
4419 { | |
4420 if ( !Player::HasEnchantedItemEquipped(25) ) | |
4421 return v5 + v62 + v61; | |
4422 v5 = 5; | |
4423 return v5 + v62 + v61; | |
4424 } | |
4425 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_LEVEL ) | |
0 | 4426 return v5 + v62 + v61; |
1040 | 4427 if ( (signed int)attr <= CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) |
0 | 4428 { |
4429 if ( IsUnarmed() == 1 ) | |
4430 { | |
4431 v5 = 0; | |
4432 return v5 + v62 + v61; | |
4433 } | |
816 | 4434 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4435 { | |
4436 v17 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4437 if ( v17 >= 0 ) |
4438 { | |
4439 if ( v17 <= 2 ) | |
1040 | 4440 v5 = pItemsTable->pItems[v6->pOwnItems[v6->pEquipment.uMainHand-1].uItemID].uDamageMod; |
0 | 4441 } |
4442 } | |
865 | 4443 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND) || (v19 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND), v19 < 0) || v19 > 2 ) |
0 | 4444 return v5 + v62 + v61; |
1040 | 4445 v20 = v6->pOwnItems[v6->pEquipment.uShield - 1].uItemID; |
4446 v56 = pItemsTable->pItems[v20].uDamageMod; | |
4447 v5 += v56; | |
4448 return v5 + v62 + v61; | |
4449 } | |
4450 if ( attr == CHARACTER_ATTRIBUTE_MELEE_DMG_MIN ) | |
0 | 4451 { |
4452 if ( IsUnarmed() == 1 ) | |
4453 { | |
4454 v5 = 1; | |
4455 return v5 + v62 + v61; | |
4456 } | |
816 | 4457 if ( v6->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4458 { | |
4459 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); | |
0 | 4460 if ( v9 >= 0 ) |
4461 { | |
4462 if ( v9 <= 2 ) | |
4463 { | |
1040 | 4464 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice + |
4465 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod; | |
898 | 4466 if ( !v6->pEquipment.uShield ) |
0 | 4467 { |
1040 | 4468 if ( pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4 ) |
0 | 4469 ++v5; |
4470 } | |
4471 } | |
4472 } | |
4473 } | |
1040 | 4474 |
4475 if ( a3 || !v6->HasItemEquipped(EQUIP_OFF_HAND)) | |
4476 { | |
4477 v12 = v6->GetEquippedItemEquipType(EQUIP_OFF_HAND); | |
4478 if ((v12 < 0) || v12 > 2 ) | |
4479 return v5 + v62 + v61; | |
4480 } | |
4481 v14 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageMod; | |
4482 v15 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageDice; | |
0 | 4483 LABEL_88: |
4484 v5 += v15 + v14; | |
4485 } | |
4486 return v5 + v62 + v61; | |
4487 } | |
4488 | |
4489 //----- (0048F73C) -------------------------------------------------------- | |
4490 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
4491 { | |
4492 int result; // eax@1 | |
4493 int v3; // eax@4 | |
4494 int v4; // ecx@5 | |
4495 | |
4496 switch (a2) | |
4497 { | |
4498 case CHARACTER_ATTRIBUTE_LEVEL: return 0; | |
4499 } | |
4500 | |
4501 result = 0; | |
4502 if ( (signed int)a2 > 10 ) | |
4503 { | |
4504 if ( (signed int)a2 <= 15 ) | |
4505 { | |
4506 switch ( a2 ) | |
4507 { | |
4508 case CHARACTER_ATTRIBUTE_RESIST_BODY: | |
4509 v3 = this->pPlayerBuffs[2].uPower; | |
1167 | 4510 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower; |
0 | 4511 break; |
4512 case CHARACTER_ATTRIBUTE_RESIST_AIR: | |
4513 v3 = this->pPlayerBuffs[0].uPower; | |
1167 | 4514 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower; |
0 | 4515 break; |
4516 case CHARACTER_ATTRIBUTE_RESIST_WATER: | |
4517 v3 = this->pPlayerBuffs[22].uPower; | |
1167 | 4518 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower; |
0 | 4519 break; |
4520 case CHARACTER_ATTRIBUTE_RESIST_EARTH: | |
4521 v3 = this->pPlayerBuffs[3].uPower; | |
1167 | 4522 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower; |
0 | 4523 break; |
4524 default: | |
4525 if ( a2 != 14 ) | |
4526 return result; | |
4527 v3 = this->pPlayerBuffs[9].uPower; | |
1167 | 4528 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower; |
0 | 4529 break; |
4530 } | |
4531 return v4 + v3; | |
4532 } | |
4533 if ( a2 != CHARACTER_ATTRIBUTE_ATTACK ) | |
4534 { | |
4535 if ( a2 == CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS ) | |
4536 { | |
4537 v3 = this->pPlayerBuffs[8].uPower; | |
1167 | 4538 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower; |
0 | 4539 return v4 + v3; |
4540 } | |
4541 if ( a2 != CHARACTER_ATTRIBUTE_RANGED_ATTACK ) | |
4542 return result; | |
4543 } | |
4544 return this->pPlayerBuffs[1].uPower; | |
4545 } | |
4546 if ( a2 == 10 ) | |
4547 { | |
4548 v3 = this->pPlayerBuffs[5].uPower; | |
1167 | 4549 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower; |
0 | 4550 return v4 + v3; |
4551 } | |
4552 switch ( a2 ) | |
4553 { | |
4554 case CHARACTER_ATTRIBUTE_STRENGTH: | |
4555 v3 = pPlayerBuffs[19].uPower; | |
4556 goto LABEL_5; | |
4557 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
4558 v3 = pPlayerBuffs[17].uPower; | |
4559 goto LABEL_5; | |
4560 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
4561 v3 = pPlayerBuffs[20].uPower; | |
4562 goto LABEL_5; | |
4563 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
4564 v3 = pPlayerBuffs[16].uPower; | |
4565 goto LABEL_5; | |
4566 case CHARACTER_ATTRIBUTE_ACCURACY: | |
4567 v3 = pPlayerBuffs[15].uPower; | |
4568 goto LABEL_5; | |
4569 case CHARACTER_ATTRIBUTE_SPEED: | |
4570 v3 = pPlayerBuffs[21].uPower; | |
4571 goto LABEL_5; | |
4572 case CHARACTER_ATTRIBUTE_LUCK: | |
4573 v3 = pPlayerBuffs[18].uPower; | |
4574 LABEL_5: | |
1167 | 4575 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
0 | 4576 return v4 + v3; |
4577 case CHARACTER_ATTRIBUTE_AC_BONUS: | |
4578 v3 = this->pPlayerBuffs[14].uPower; | |
1167 | 4579 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower; |
0 | 4580 return v4 + v3; |
4581 default: | |
4582 return result; | |
4583 } | |
4584 return result; | |
4585 } | |
4586 | |
4587 //----- (0048F882) -------------------------------------------------------- | |
1008 | 4588 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) |
4589 { | |
1064 | 4590 signed int bonus_value; // esi@1 |
4591 unsigned __int16 skill_value; // ax@126 | |
4592 int result; // al@127 | |
353 | 4593 |
1064 | 4594 bonus_value = 0; |
353 | 4595 switch (uSkillType) |
4596 { | |
4597 case PLAYER_SKILL_MONSTER_ID: | |
4598 { | |
652 | 4599 if ( CheckHiredNPCSpeciality(Hunter) ) |
1064 | 4600 bonus_value = 6; |
652 | 4601 if ( CheckHiredNPCSpeciality(Sage) ) |
1064 | 4602 bonus_value += 6; |
4603 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID, 0); | |
353 | 4604 } |
4605 break; | |
4606 | |
4607 case PLAYER_SKILL_ARMSMASTER: | |
4608 { | |
652 | 4609 if ( CheckHiredNPCSpeciality(Armsmaster) ) |
1064 | 4610 bonus_value = 2; |
652 | 4611 if ( CheckHiredNPCSpeciality(Weaponsmaster) ) |
1064 | 4612 bonus_value += 3; |
4613 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER, 0); | |
353 | 4614 } |
4615 break; | |
4616 | |
4617 case PLAYER_SKILL_STEALING: | |
4618 { | |
652 | 4619 if (CheckHiredNPCSpeciality(Burglar)) |
1064 | 4620 bonus_value = 8; |
4621 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING, 0); | |
353 | 4622 } |
4623 break; | |
4624 | |
4625 | |
4626 case PLAYER_SKILL_ALCHEMY: | |
4627 { | |
652 | 4628 if ( CheckHiredNPCSpeciality(Herbalist) ) |
1064 | 4629 bonus_value = 4; |
652 | 4630 if ( CheckHiredNPCSpeciality(Apothecary) ) |
1064 | 4631 bonus_value += 8; |
4632 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY, 0); | |
353 | 4633 } |
4634 break; | |
4635 | |
4636 case PLAYER_SKILL_LEARNING: | |
4637 { | |
652 | 4638 if ( CheckHiredNPCSpeciality(Teacher) ) |
1064 | 4639 bonus_value = 10; |
652 | 4640 if ( CheckHiredNPCSpeciality(Instructor) ) |
1064 | 4641 bonus_value += 15; |
652 | 4642 if ( CheckHiredNPCSpeciality(Scholar) ) |
1064 | 4643 bonus_value += 5; |
4644 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING, 0); | |
353 | 4645 } |
4646 break; | |
4647 | |
4648 case PLAYER_SKILL_UNARMED: | |
4649 { | |
652 | 4650 if (CheckHiredNPCSpeciality(Monk) ) |
1064 | 4651 bonus_value = 2; |
4652 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED, 0); | |
353 | 4653 } |
4654 break; | |
4655 | |
4656 case PLAYER_SKILL_DODGE: | |
4657 { | |
652 | 4658 if ( CheckHiredNPCSpeciality(Monk) ) |
1064 | 4659 bonus_value = 2; |
4660 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE, 0); | |
353 | 4661 } |
4662 break; | |
4663 | |
4664 case PLAYER_SKILL_BOW: | |
1064 | 4665 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW, 0); |
353 | 4666 break; |
4667 case PLAYER_SKILL_SHIELD: | |
1064 | 4668 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD, 0); |
353 | 4669 break; |
4670 | |
4671 case PLAYER_SKILL_EARTH: | |
652 | 4672 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4673 bonus_value = 2; |
652 | 4674 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4675 bonus_value += 3; |
652 | 4676 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4677 bonus_value += 4; |
353 | 4678 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4679 bonus_value += 3; |
4680 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH, 0); | |
353 | 4681 break; |
4682 case PLAYER_SKILL_FIRE: | |
652 | 4683 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4684 bonus_value = 2; |
652 | 4685 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4686 bonus_value += 3; |
652 | 4687 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4688 bonus_value += 4; |
353 | 4689 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4690 bonus_value += 3; |
4691 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE, 0); | |
353 | 4692 break; |
4693 case PLAYER_SKILL_AIR: | |
652 | 4694 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4695 bonus_value = 2; |
652 | 4696 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4697 bonus_value += 3; |
652 | 4698 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4699 bonus_value += 4; |
353 | 4700 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4701 bonus_value += 3; |
4702 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR, 0); | |
353 | 4703 break; |
4704 case PLAYER_SKILL_WATER: | |
652 | 4705 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 4706 bonus_value = 2; |
652 | 4707 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 4708 bonus_value += 3; |
652 | 4709 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 4710 bonus_value += 4; |
353 | 4711 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 4712 bonus_value += 3; |
4713 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER, 0); | |
353 | 4714 break; |
4715 case PLAYER_SKILL_SPIRIT: | |
652 | 4716 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4717 bonus_value = 2; |
652 | 4718 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4719 bonus_value += 3; |
652 | 4720 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4721 bonus_value += 4; |
4722 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT, 0); | |
353 | 4723 break; |
4724 case PLAYER_SKILL_MIND: | |
652 | 4725 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4726 bonus_value = 2; |
652 | 4727 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4728 bonus_value += 3; |
652 | 4729 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4730 bonus_value += 4; |
4731 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND, 0); | |
353 | 4732 break; |
4733 case PLAYER_SKILL_BODY: | |
652 | 4734 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 4735 bonus_value = 2; |
652 | 4736 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 4737 bonus_value += 3; |
652 | 4738 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 4739 bonus_value += 4; |
4740 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY, 0); | |
353 | 4741 break; |
4742 case PLAYER_SKILL_LIGHT: | |
1064 | 4743 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT, 0); |
353 | 4744 break; |
4745 case PLAYER_SKILL_DARK: | |
4746 { | |
1064 | 4747 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK, 0); |
353 | 4748 } |
4749 break; | |
4750 | |
4751 case PLAYER_SKILL_MERCHANT: | |
4752 { | |
652 | 4753 if ( CheckHiredNPCSpeciality(Trader) ) |
1064 | 4754 bonus_value = 4; |
652 | 4755 if ( CheckHiredNPCSpeciality(Merchant) ) |
1064 | 4756 bonus_value += 6; |
652 | 4757 if ( CheckHiredNPCSpeciality(Gypsy) ) |
1064 | 4758 bonus_value += 3; |
652 | 4759 if ( CheckHiredNPCSpeciality(Duper) ) |
1064 | 4760 bonus_value += 8; |
353 | 4761 } |
4762 break; | |
4763 | |
4764 case PLAYER_SKILL_PERCEPTION: | |
4765 { | |
652 | 4766 if ( CheckHiredNPCSpeciality(Scout) ) |
1064 | 4767 bonus_value = 6; |
652 | 4768 if ( CheckHiredNPCSpeciality(Psychic) ) |
1064 | 4769 bonus_value += 5; |
353 | 4770 } |
4771 break; | |
4772 | |
0 | 4773 case PLAYER_SKILL_ITEM_ID: |
1064 | 4774 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID, 0); |
0 | 4775 break; |
4776 case PLAYER_SKILL_MEDITATION: | |
1064 | 4777 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION, 0); |
353 | 4778 break; |
0 | 4779 case PLAYER_SKILL_TRAP_DISARM: |
353 | 4780 { |
652 | 4781 if ( CheckHiredNPCSpeciality(Tinker) ) |
1064 | 4782 bonus_value = 4; |
652 | 4783 if ( CheckHiredNPCSpeciality(Locksmith) ) |
1064 | 4784 bonus_value += 6; |
652 | 4785 if ( CheckHiredNPCSpeciality(Burglar) ) |
1064 | 4786 bonus_value += 8; |
4787 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM, 0); | |
353 | 4788 } |
4789 break; | |
4790 } | |
4791 | |
1064 | 4792 skill_value = pActiveSkills[uSkillType]; |
4793 if ( bonus_value + (skill_value & 0x3F) < 60 ) | |
4794 result = bonus_value + skill_value; | |
0 | 4795 else |
1064 | 4796 result = skill_value & 0xFFFC | 0x3C; //al |
0 | 4797 return result; |
4798 } | |
4799 | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4800 |
0 | 4801 //----- (0048FC00) -------------------------------------------------------- |
1538 | 4802 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
|
4803 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4804 int armsMasterBonus; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4805 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4806 armsMasterBonus = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4807 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
|
4808 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
|
4809 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4810 int multiplier = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4811 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
|
4812 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4813 multiplier = GetMultiplierForMastery(armmaster_skill, 0, 0, 1, 2); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4814 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4815 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
|
4816 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4817 multiplier = GetMultiplierForMastery(armmaster_skill, 0, 1, 1, 2); |
1064 | 4818 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4819 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
|
4820 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4821 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4822 switch(inSkill) |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4823 { |
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
|
4824 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
|
4825 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
|
4826 { |
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
|
4827 int bowSkillLevel = 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
|
4828 int multiplier = GetMultiplierForMastery(bowSkillLevel, 0, 0, 0, 1); |
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
|
4829 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
|
4830 } |
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
|
4831 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
|
4832 break; |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4833 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
|
4834 { |
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
|
4835 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
|
4836 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
|
4837 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
|
4838 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4839 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4840 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
|
4841 { |
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
|
4842 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
|
4843 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
|
4844 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
|
4845 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4846 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4847 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
|
4848 { |
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
|
4849 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
|
4850 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
|
4851 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
|
4852 |
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
|
4853 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
|
4854 { |
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
|
4855 if (pEquipment.pIndices[j] && (!pOwnItems[pEquipment.pIndices[j]].Broken())) |
1538 | 4856 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4857 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
|
4858 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
|
4859 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
|
4860 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
|
4861 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
|
4862 { |
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
|
4863 case PLAYER_SKILL_STAFF: |
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
|
4864 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 0, 1, 1, 1); |
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
|
4865 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
|
4866 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
|
4867 case PLAYER_SKILL_SPEAR: |
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
|
4868 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 0, 0, 0, 1); |
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
|
4869 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
|
4870 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
|
4871 wearingArmor = true; |
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
|
4872 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 1, 1, 2, 2); |
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
|
4873 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
|
4874 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
|
4875 wearingLeather = true; |
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
|
4876 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 1, 1, 2, 2); |
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
|
4877 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
|
4878 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
|
4879 wearingArmor = true; |
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
|
4880 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 1, 1, 1, 1); |
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
|
4881 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
|
4882 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
|
4883 wearingArmor = true; |
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
|
4884 multiplier = GetMultiplierForMastery(currArmorSkillLevel, 1, 1, 1, 1); |
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
|
4885 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
|
4886 } |
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
|
4887 ACSum += multiplier * (currArmorSkillLevel & 0x3F); |
1538 | 4888 } |
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
|
4889 } |
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
|
4890 |
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
|
4891 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
|
4892 int dodgeMastery = SkillToMastery(dodgeSkillLevel); |
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
|
4893 int multiplier = GetMultiplierForMastery(dodgeSkillLevel, 1, 2, 3, 3); |
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
|
4894 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
|
4895 { |
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
|
4896 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
|
4897 } |
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
|
4898 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
|
4899 } |
1538 | 4900 break; |
4901 case CHARACTER_ATTRIBUTE_ATTACK: | |
4902 if ( this->IsUnarmed() ) | |
4903 { | |
4904 int unarmedSkill = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
4905 if (!unarmedSkill) | |
4906 { | |
4907 return 0; | |
4908 } | |
4909 int multiplier = GetMultiplierForMastery(unarmedSkill, 0, 1, 2, 2); | |
4910 return armsMasterBonus + multiplier * (unarmedSkill & 0x3F); | |
4911 } | |
4912 for (int i = 0; i < 16; ++i) | |
4913 { | |
4914 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4915 { | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4916 ItemDesc currItem = pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID]; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4917 if ( currItem.uEquipType <= EQUIP_MAIN_HAND) |
1533 | 4918 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4919 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItem.uSkillType; |
1538 | 4920 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
4921 if (currItemSkillType == PLAYER_SKILL_BLASTER) | |
4922 { | |
4923 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); | |
4924 return multiplier * (currentItemSkillLevel & 0x3F); | |
4925 } | |
4926 else if (currItemSkillType == PLAYER_SKILL_STAFF && this->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) | |
4927 { | |
4928 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
4929 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 1, 2, 2); | |
4930 return multiplier * (unarmedSkillLevel & 0x3F) + armsMasterBonus + (currentItemSkillLevel & 0x3F); | |
4931 } | |
4932 else | |
4933 { | |
4934 return armsMasterBonus + (currentItemSkillLevel & 0x3F); | |
4935 } | |
4936 } | |
4937 } | |
4938 } | |
4939 return 0; | |
4940 break; | |
4941 | |
4942 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: | |
4943 for (int i = 0; i < 16; i++) | |
4944 { | |
4945 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4946 { | |
4947 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID].uSkillType; | |
4948 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); | |
4949 if ( currentItemSkillType == PLAYER_SKILL_BOW ) | |
4950 { | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
4951 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 1, 1, 1); |
1538 | 4952 return multiplier * (currentItemSkillLevel & 0x3F); |
4953 } | |
4954 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) | |
4955 { | |
4956 int multiplier = GetMultiplierForMastery(currentItemSkillLevel, 1, 2, 3, 5); | |
4957 return multiplier * (currentItemSkillLevel & 0x3F); | |
4958 } | |
4959 } | |
4960 } | |
4961 return 0; | |
4962 break; | |
4963 | |
4964 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: | |
4965 if ( this->IsUnarmed() ) | |
4966 { | |
4967 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
4968 if ( !unarmedSkillLevel ) | |
4969 { | |
4970 return 0; | |
4971 } | |
4972 int multiplier = GetMultiplierForMastery(unarmedSkillLevel, 0, 1, 2, 2); | |
4973 return multiplier * (unarmedSkillLevel & 0x3F); | |
4974 } | |
4975 for (int i = 0; i < 16; i++) | |
4976 { | |
4977 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
4978 { | |
4979 int currItemId = this->pInventoryItemList[this->pEquipment.pIndices[i]].uItemID; | |
4980 if ( pItemsTable->pItems[currItemId].uEquipType == EQUIP_MAIN_HAND || pItemsTable->pItems[currItemId].uEquipType == EQUIP_OFF_HAND ) | |
4981 { | |
4982 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemId].uSkillType; | |
4983 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); | |
4984 int baseSkillBonus; | |
4985 int multiplier; | |
4986 switch (currItemSkillType) | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4987 { |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
4988 case PLAYER_SKILL_STAFF: |
1538 | 4989 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
|
4990 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4991 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
1538 | 4992 int multiplier = GetMultiplierForMastery(unarmedSkillLevel, 0, 1, 2, 2); |
4993 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
|
4994 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4995 else |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4996 { |
1538 | 4997 return armsMasterBonus; |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
4998 } |
1538 | 4999 break; |
5000 | |
5001 case PLAYER_SKILL_DAGGER: | |
5002 multiplier = GetMultiplierForMastery(currItemSkillLevel, 0, 0, 0, 1); | |
5003 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); | |
5004 return armsMasterBonus + baseSkillBonus; | |
5005 break; | |
5006 case PLAYER_SKILL_SWORD: | |
5007 multiplier = GetMultiplierForMastery(currItemSkillLevel, 0, 0, 0, 0); | |
5008 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); | |
5009 return armsMasterBonus + baseSkillBonus; | |
5010 break; | |
5011 case PLAYER_SKILL_MACE: | |
5012 case PLAYER_SKILL_SPEAR: | |
5013 multiplier = GetMultiplierForMastery(currItemSkillLevel, 0, 1, 1, 1); | |
5014 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); | |
5015 return armsMasterBonus + baseSkillBonus; | |
5016 break; | |
5017 case PLAYER_SKILL_AXE: | |
5018 multiplier = GetMultiplierForMastery(currItemSkillLevel, 0, 0, 1, 1); | |
5019 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); | |
5020 return armsMasterBonus + baseSkillBonus; | |
5021 break; | |
1535 | 5022 } |
1533 | 5023 } |
1535 | 5024 } |
1538 | 5025 } |
5026 return 0; | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
5027 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
5028 default: |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
5029 return 0; |
1533 | 5030 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5031 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5032 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5033 unsigned int Player::GetMultiplierForMastery(unsigned int skillValue, int mult1, int mult2, int mult3, int mult4) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5034 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5035 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
|
5036 switch (masteryLvl) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5037 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5038 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
|
5039 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
|
5040 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
|
5041 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
|
5042 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5043 assert(false); |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5044 return 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
5045 } |
0 | 5046 //----- (00490109) -------------------------------------------------------- |
5047 // faces are: 0 1 2 3 human males | |
5048 // 4 5 6 7 human females | |
5049 // 8 9 elf males | |
5050 // 10 11 elf females | |
5051 // 12 13 dwarf males | |
5052 // 14 15 dwarf females | |
5053 // 16 17 goblin males | |
5054 // 18 19 goblin females | |
5055 // 20 lich male | |
5056 // 21 lich female | |
5057 // 22 underwater suits (unused) | |
5058 // 23 zombie male | |
5059 // 24 zombie female | |
5060 enum CHARACTER_RACE Player::GetRace() | |
5061 { | |
1014 | 5062 if ( uCurrentFace > 15 ) |
5063 { | |
5064 if ( uCurrentFace >= 16 && uCurrentFace <= 19 ) | |
0 | 5065 return CHARACTER_RACE_GOBLIN; |
5066 } | |
5067 else | |
5068 { | |
1014 | 5069 if ( uCurrentFace >= 12 ) |
0 | 5070 { |
5071 return CHARACTER_RACE_DWARF; | |
5072 } | |
5073 else | |
5074 { | |
1014 | 5075 |
5076 if ( uCurrentFace <= 7 ) | |
0 | 5077 { |
5078 return CHARACTER_RACE_HUMAN; | |
5079 } | |
5080 else | |
5081 { | |
1014 | 5082 if ( uCurrentFace <= 11 ) |
0 | 5083 return CHARACTER_RACE_ELF; |
5084 } | |
5085 } | |
5086 } | |
5087 return CHARACTER_RACE_HUMAN; | |
5088 } | |
5089 | |
5090 //----- (00490141) -------------------------------------------------------- | |
187 | 5091 PLAYER_SEX Player::GetSexByVoice() |
0 | 5092 { |
5093 signed int result; // eax@1 | |
5094 | |
5095 result = 0; | |
5096 switch ( this->uVoiceID ) | |
5097 { | |
5098 case 0u: | |
5099 case 1u: | |
5100 case 2u: | |
5101 case 3u: | |
5102 case 8u: | |
5103 case 9u: | |
5104 case 0xCu: | |
5105 case 0xDu: | |
5106 case 0x10u: | |
5107 case 0x11u: | |
5108 case 0x14u: | |
5109 case 0x17u: | |
187 | 5110 return SEX_MALE; |
5111 | |
0 | 5112 case 4u: |
5113 case 5u: | |
5114 case 6u: | |
5115 case 7u: | |
5116 case 0xAu: | |
5117 case 0xBu: | |
5118 case 0xEu: | |
5119 case 0xFu: | |
5120 case 0x12u: | |
5121 case 0x13u: | |
5122 case 0x15u: | |
5123 case 0x18u: | |
187 | 5124 return SEX_FEMALE; |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5125 } |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5126 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5127 return SEX_MALE; |
0 | 5128 } |
5129 | |
5130 //----- (00490188) -------------------------------------------------------- | |
5131 void Player::SetInitialStats() | |
5132 { | |
5133 auto v1 = GetRace(); | |
290 | 5134 uMight = StatTable[v1][0].uBaseValue; |
5135 uIntelligence = StatTable[v1][1].uBaseValue; | |
5136 uWillpower = StatTable[v1][2].uBaseValue; | |
5137 uEndurance = StatTable[v1][3].uBaseValue; | |
5138 uAccuracy = StatTable[v1][4].uBaseValue; | |
5139 uSpeed = StatTable[v1][5].uBaseValue; | |
5140 uLuck = StatTable[v1][6].uBaseValue; | |
0 | 5141 } |
5142 | |
5143 //----- (004901FC) -------------------------------------------------------- | |
1021 | 5144 void Player::SetSexByVoice() |
5145 { | |
5146 switch ( this->uVoiceID) | |
0 | 5147 { |
5148 case 0: | |
5149 case 1: | |
5150 case 2: | |
5151 case 3: | |
5152 case 8: | |
5153 case 9: | |
5154 case 0xC: | |
5155 case 0xD: | |
5156 case 0x10: | |
5157 case 0x11: | |
5158 case 0x14: | |
5159 case 0x17: | |
1021 | 5160 this->uSex = SEX_MALE; |
0 | 5161 break; |
5162 case 4: | |
5163 case 5: | |
5164 case 6: | |
5165 case 7: | |
5166 case 0xA: | |
5167 case 0xB: | |
5168 case 0xE: | |
5169 case 0xF: | |
5170 case 0x12: | |
5171 case 0x13: | |
5172 case 0x15: | |
5173 case 0x18: | |
1021 | 5174 this->uSex = SEX_FEMALE; |
0 | 5175 break; |
5176 default: | |
5177 break; | |
5178 } | |
1021 | 5179 |
0 | 5180 } |
5181 | |
5182 //----- (0049024A) -------------------------------------------------------- | |
135 | 5183 void Player::Reset(PLAYER_CLASS_TYPE cls) |
0 | 5184 { |
5185 sLevelModifier = 0; | |
5186 sAgeModifier = 0; | |
5187 | |
135 | 5188 classType = cls; |
0 | 5189 uLuckBonus = 0; |
5190 uSpeedBonus = 0; | |
5191 uAccuracyBonus = 0; | |
5192 uEnduranceBonus = 0; | |
5193 uWillpowerBonus = 0; | |
5194 uIntelligenceBonus = 0; | |
5195 uMightBonus = 0; | |
5196 uLevel = 1; | |
5197 uExperience = 251 + rand() % 100; | |
5198 uBirthYear = 1147 - rand() % 6; | |
5199 memset(pActiveSkills, 0, sizeof(pActiveSkills)); | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
5200 memset(_achieved_awards_bits, 0, 64); |
0 | 5201 memset(&spellbook, 0, sizeof(PlayerSpells)); |
5202 | |
5203 for (uint i = 0; i < 37; ++i) | |
5204 { | |
135 | 5205 if (pSkillAvailabilityPerClass[classType / 4][i] != 2) |
0 | 5206 continue; |
5207 | |
5208 pActiveSkills[i] = 1; | |
5209 | |
5210 switch (i) | |
5211 { | |
886 | 5212 case PLAYER_SKILL_FIRE: |
5213 spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;//its temporary, for test spells | |
894 | 5214 |
5215 extern bool all_magic; | |
5216 if ( all_magic == true ) | |
5217 { | |
5218 pActiveSkills[PLAYER_SKILL_AIR] = 1; | |
5219 pActiveSkills[PLAYER_SKILL_WATER] = 1; | |
5220 pActiveSkills[PLAYER_SKILL_EARTH] = 1; | |
5221 spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; | |
5222 spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; | |
5223 spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; | |
5224 spellbook.pFireSpellbook.bIsSpellAvailable[4] = true; | |
5225 spellbook.pFireSpellbook.bIsSpellAvailable[5] = true; | |
5226 spellbook.pFireSpellbook.bIsSpellAvailable[6] = true; | |
5227 spellbook.pFireSpellbook.bIsSpellAvailable[7] = true; | |
5228 spellbook.pFireSpellbook.bIsSpellAvailable[8] = true; | |
5229 spellbook.pFireSpellbook.bIsSpellAvailable[9] = true; | |
5230 spellbook.pFireSpellbook.bIsSpellAvailable[10] = true; | |
886 | 5231 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; |
569 | 5232 spellbook.pAirSpellbook.bIsSpellAvailable[1] = true; |
5233 spellbook.pAirSpellbook.bIsSpellAvailable[2] = true; | |
5234 spellbook.pAirSpellbook.bIsSpellAvailable[3] = true; | |
5235 spellbook.pAirSpellbook.bIsSpellAvailable[4] = true; | |
5236 spellbook.pAirSpellbook.bIsSpellAvailable[5] = true; | |
5237 spellbook.pAirSpellbook.bIsSpellAvailable[6] = true; | |
5238 spellbook.pAirSpellbook.bIsSpellAvailable[7] = true; | |
5239 spellbook.pAirSpellbook.bIsSpellAvailable[8] = true; | |
5240 spellbook.pAirSpellbook.bIsSpellAvailable[9] = true; | |
5241 spellbook.pAirSpellbook.bIsSpellAvailable[10] = true; | |
5242 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
5243 spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true; | |
5244 spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true; | |
5245 spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true; | |
5246 spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true; | |
5247 spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true; | |
710 | 5248 spellbook.pWaterSpellbook.bIsSpellAvailable[6] = true; |
5249 spellbook.pWaterSpellbook.bIsSpellAvailable[7] = true; | |
5250 spellbook.pWaterSpellbook.bIsSpellAvailable[8] = true; | |
886 | 5251 spellbook.pWaterSpellbook.bIsSpellAvailable[9] = true; |
5252 spellbook.pWaterSpellbook.bIsSpellAvailable[10] = true; | |
894 | 5253 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; |
5254 spellbook.pEarthSpellbook.bIsSpellAvailable[1] = true; | |
5255 spellbook.pEarthSpellbook.bIsSpellAvailable[2] = true; | |
5256 spellbook.pEarthSpellbook.bIsSpellAvailable[3] = true; | |
5257 spellbook.pEarthSpellbook.bIsSpellAvailable[4] = true; | |
5258 spellbook.pEarthSpellbook.bIsSpellAvailable[5] = true; | |
5259 spellbook.pEarthSpellbook.bIsSpellAvailable[6] = true; | |
5260 spellbook.pEarthSpellbook.bIsSpellAvailable[7] = true; | |
5261 spellbook.pEarthSpellbook.bIsSpellAvailable[8] = true; | |
5262 spellbook.pEarthSpellbook.bIsSpellAvailable[9] = true; | |
5263 spellbook.pEarthSpellbook.bIsSpellAvailable[10] = true; | |
5264 } | |
486 | 5265 break; |
886 | 5266 case PLAYER_SKILL_AIR: |
5267 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; | |
5268 break; | |
5269 case PLAYER_SKILL_WATER: | |
5270 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
5271 break; | |
5272 case PLAYER_SKILL_EARTH: | |
5273 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; | |
5274 break; | |
5275 case PLAYER_SKILL_SPIRIT: | |
5276 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; | |
5277 break; | |
5278 case PLAYER_SKILL_MIND: | |
5279 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; | |
5280 break; | |
5281 case PLAYER_SKILL_BODY: | |
5282 spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; | |
894 | 5283 |
5284 if ( all_magic == true ) | |
5285 { | |
5286 pActiveSkills[PLAYER_SKILL_MIND] = 1; | |
5287 pActiveSkills[PLAYER_SKILL_SPIRIT] = 1; | |
5288 spellbook.pBodySpellbook.bIsSpellAvailable[1] = true; | |
5289 spellbook.pBodySpellbook.bIsSpellAvailable[2] = true; | |
5290 spellbook.pBodySpellbook.bIsSpellAvailable[3] = true; | |
5291 spellbook.pBodySpellbook.bIsSpellAvailable[4] = true; | |
5292 spellbook.pBodySpellbook.bIsSpellAvailable[5] = true; | |
5293 spellbook.pBodySpellbook.bIsSpellAvailable[6] = true; | |
5294 spellbook.pBodySpellbook.bIsSpellAvailable[7] = true; | |
5295 spellbook.pBodySpellbook.bIsSpellAvailable[8] = true; | |
5296 spellbook.pBodySpellbook.bIsSpellAvailable[9] = true; | |
5297 spellbook.pBodySpellbook.bIsSpellAvailable[10] = true; | |
924 | 5298 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; |
894 | 5299 spellbook.pMindSpellbook.bIsSpellAvailable[1] = true; |
5300 spellbook.pMindSpellbook.bIsSpellAvailable[2] = true; | |
5301 spellbook.pMindSpellbook.bIsSpellAvailable[3] = true; | |
5302 spellbook.pMindSpellbook.bIsSpellAvailable[4] = true; | |
5303 spellbook.pMindSpellbook.bIsSpellAvailable[5] = true; | |
5304 spellbook.pMindSpellbook.bIsSpellAvailable[6] = true; | |
5305 spellbook.pMindSpellbook.bIsSpellAvailable[7] = true; | |
5306 spellbook.pMindSpellbook.bIsSpellAvailable[8] = true; | |
5307 spellbook.pMindSpellbook.bIsSpellAvailable[9] = true; | |
5308 spellbook.pMindSpellbook.bIsSpellAvailable[10] = true; | |
924 | 5309 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; |
894 | 5310 spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true; |
5311 spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true; | |
5312 spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true; | |
5313 spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true; | |
5314 spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true; | |
5315 spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true; | |
5316 spellbook.pSpiritSpellbook.bIsSpellAvailable[7] = true; | |
5317 spellbook.pSpiritSpellbook.bIsSpellAvailable[8] = true; | |
5318 spellbook.pSpiritSpellbook.bIsSpellAvailable[9] = true; | |
5319 spellbook.pSpiritSpellbook.bIsSpellAvailable[10] = true; | |
5320 } | |
569 | 5321 break; |
886 | 5322 case PLAYER_SKILL_LIGHT: |
5323 spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; | |
5324 break; | |
5325 case PLAYER_SKILL_DARK: | |
5326 spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; | |
5327 break; | |
0 | 5328 } |
5329 } | |
5330 | |
5331 sHealth = GetMaxHealth(); | |
5332 sMana = GetMaxMana(); | |
5333 } | |
5334 | |
5335 //----- (004903C9) -------------------------------------------------------- | |
821 | 5336 PLAYER_SKILL_TYPE Player::GetSkillIdxByOrder(signed int order) |
5337 { | |
1271
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5338 int counter; // edx@5 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5339 bool canBeInactive; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5340 unsigned char requiredValue; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5341 signed int offset; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5342 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5343 if ( order <= 1 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5344 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5345 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5346 requiredValue = 2; // 2 - primary skill |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5347 offset = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5348 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5349 else if ( order <= 3 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5350 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5351 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5352 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5353 offset = 2; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5354 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5355 else if ( order <= 12 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5356 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5357 canBeInactive = true; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5358 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5359 offset = 4; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5360 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5361 else |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5362 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5363 return (PLAYER_SKILL_TYPE)37; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5364 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5365 counter = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5366 for (int i = 0; i < 37; i++) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5367 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5368 if ( (this->pActiveSkills[i] || canBeInactive) && pSkillAvailabilityPerClass[classType / 4][i] == requiredValue ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5369 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5370 if ( counter == order - offset ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5371 return (PLAYER_SKILL_TYPE)i; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5372 ++counter; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5373 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
5374 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5375 |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
5376 assert(false); |
0 | 5377 } |
5378 | |
5379 | |
5380 | |
5381 //----- (0049048D) -------------------------------------------------------- | |
5382 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) | |
5383 void Player::DecreaseAttribute(int eAttribute) | |
5384 { | |
5385 int v2; // eax@1 | |
5386 int pBaseValue; // ecx@1 | |
5387 int pDroppedStep; // ebx@1 | |
5388 int pStep; // esi@1 | |
5389 unsigned __int16 result; // ax@7 | |
5390 int uMinValue; // [sp+Ch] [bp-4h]@1 | |
5391 | |
5392 v2 = eAttribute + 7 * GetRace(); | |
290 | 5393 pBaseValue = StatTable[0][v2].uBaseValue; |
5394 pDroppedStep = StatTable[0][v2].uDroppedStep; | |
0 | 5395 uMinValue = pBaseValue - 2; |
290 | 5396 pStep = StatTable[0][v2].uBaseStep; |
1272 | 5397 unsigned short* AttrToChange = nullptr; |
5398 switch ( eAttribute ) | |
5399 { | |
5400 case CHARACTER_ATTRIBUTE_STRENGTH: | |
5401 AttrToChange = &this->uMight; | |
5402 break; | |
5403 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
5404 AttrToChange = &this->uIntelligence; | |
5405 break; | |
5406 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
5407 AttrToChange = &this->uWillpower; | |
5408 break; | |
5409 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
5410 AttrToChange = &this->uEndurance; | |
5411 break; | |
5412 case CHARACTER_ATTRIBUTE_ACCURACY: | |
5413 AttrToChange = &this->uAccuracy; | |
5414 break; | |
5415 case CHARACTER_ATTRIBUTE_SPEED: | |
5416 AttrToChange = &this->uSpeed; | |
5417 break; | |
5418 case CHARACTER_ATTRIBUTE_LUCK: | |
5419 AttrToChange = &this->uLuck; | |
5420 break; | |
5421 } | |
5422 if ( *AttrToChange <= pBaseValue ) | |
5423 pStep = pDroppedStep; | |
5424 if ( *AttrToChange - pStep >= uMinValue ) | |
5425 *AttrToChange -= pStep; | |
0 | 5426 } |
5427 | |
5428 //----- (004905F5) -------------------------------------------------------- | |
1458 | 5429 //signed int PartyCreation_BtnPlusClick(Player *this, int eAttribute) |
1273 | 5430 void Player::IncreaseAttribute( int eAttribute ) |
5431 { | |
5432 int raceId; // eax@1 | |
5433 int maxValue; // ebx@1 | |
5434 signed int baseStep; // edi@1 | |
5435 signed int tmp; // eax@17 | |
0 | 5436 signed int result; // eax@18 |
1273 | 5437 int baseValue; // [sp+Ch] [bp-8h]@1 |
5438 signed int droppedStep; // [sp+10h] [bp-4h]@1 | |
5439 unsigned short* statToChange; | |
5440 | |
5441 raceId = GetRace(); | |
5442 maxValue = StatTable[raceId][eAttribute].uMaxValue; | |
5443 baseStep = StatTable[raceId][eAttribute].uBaseStep; | |
5444 baseValue = StatTable[raceId][eAttribute].uBaseValue; | |
5445 droppedStep = StatTable[raceId][eAttribute].uDroppedStep; | |
5446 PlayerCreation_GetUnspentAttributePointCount(); | |
5447 switch ( eAttribute ) | |
5448 { | |
5449 case 0: | |
5450 statToChange = &this->uMight; | |
5451 break; | |
5452 case 1: | |
5453 statToChange = &this->uIntelligence; | |
5454 break; | |
5455 case 2: | |
5456 statToChange = &this->uWillpower; | |
5457 break; | |
5458 case 3: | |
5459 statToChange = &this->uEndurance; | |
5460 break; | |
5461 case 4: | |
5462 statToChange = &this->uAccuracy; | |
5463 break; | |
5464 case 5: | |
5465 statToChange = &this->uSpeed; | |
5466 break; | |
5467 case 6: | |
5468 statToChange = &this->uLuck; | |
5469 default: | |
5470 assert(false); | |
5471 return; | |
5472 break; | |
5473 } | |
5474 if ( *statToChange < baseValue ) | |
5475 { | |
5476 tmp = baseStep; | |
5477 baseStep = droppedStep; | |
5478 droppedStep = tmp; | |
5479 } | |
5480 result = PlayerCreation_GetUnspentAttributePointCount(); | |
5481 if ( result >= droppedStep ) | |
5482 { | |
5483 if ( baseStep + *statToChange <= maxValue ) | |
5484 *statToChange += baseStep; | |
5485 } | |
0 | 5486 } |
5487 | |
5488 //----- (0049070F) -------------------------------------------------------- | |
5489 void Player::Zero() | |
5490 { | |
5491 this->sLevelModifier = 0; | |
5492 this->sACModifier = 0; | |
5493 this->uLuckBonus = 0; | |
5494 this->uAccuracyBonus = 0; | |
5495 this->uSpeedBonus = 0; | |
5496 this->uEnduranceBonus = 0; | |
5497 this->uWillpowerBonus = 0; | |
5498 this->uIntelligenceBonus = 0; | |
5499 this->uMightBonus = 0; | |
5500 this->field_100 = 0; | |
5501 this->field_FC = 0; | |
5502 this->field_F8 = 0; | |
5503 this->field_F4 = 0; | |
5504 this->field_F0 = 0; | |
5505 this->field_EC = 0; | |
5506 this->field_E8 = 0; | |
5507 this->field_E4 = 0; | |
5508 this->field_E0 = 0; | |
766 | 5509 memset(&this->sResFireBonus, 0, 0x16u); |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5510 this->field_1A97 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5511 this->_ranged_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5512 this->field_1A95 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5513 this->_ranged_atk_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5514 this->field_1A93 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5515 this->_melee_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5516 this->field_1A91 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5517 this->_some_attack_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5518 this->_mana_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5519 this->uFullManaBonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5520 this->_health_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
5521 this->uFullHealthBonus = 0; |
0 | 5522 } |
5523 | |
5524 //----- (004907E7) -------------------------------------------------------- | |
299 | 5525 unsigned int Player::GetStatColor(int uStat) |
0 | 5526 { |
290 | 5527 int attribute_value; // edx@1 |
1393 | 5528 |
5529 int base_attribute_value = StatTable[GetRace()][uStat].uBaseValue; | |
0 | 5530 switch (uStat) |
5531 { | |
5532 case 0: attribute_value = uMight; break; | |
5533 case 1: attribute_value = uIntelligence; break; | |
5534 case 2: attribute_value = uWillpower; break; | |
5535 case 3: attribute_value = uEndurance; break; | |
290 | 5536 case 4: attribute_value = uAccuracy; break; |
5537 case 5: attribute_value = uSpeed; break; | |
0 | 5538 case 6: attribute_value = uLuck; break; |
5539 }; | |
5540 | |
1393 | 5541 if (attribute_value == base_attribute_value) |
5542 return ui_character_stat_default_color; | |
5543 else if (attribute_value > base_attribute_value) | |
5544 return ui_character_stat_buffed_color; | |
0 | 5545 else |
1393 | 5546 return ui_character_stat_debuffed_color; |
0 | 5547 } |
5548 | |
5549 //----- (004908A8) -------------------------------------------------------- | |
5550 bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime) | |
5551 { | |
1014 | 5552 if ( pConditions[uCondition] && (uTime < pConditions[uCondition]) ) |
5553 { | |
1393 | 5554 pConditions[uCondition] = 0i64; |
1014 | 5555 return true; |
0 | 5556 } |
5557 else | |
1014 | 5558 return false; |
0 | 5559 } |
5560 | |
5561 //----- (004680ED) -------------------------------------------------------- | |
1019 | 5562 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) |
1021 | 5563 { |
5564 Player *v3; // esi@1 | |
5565 signed int v5; // eax@17 | |
5566 int v8; // edx@39 | |
5567 char *v13; // eax@45 | |
5568 signed int v15; // edi@68 | |
5569 int v16; // edx@73 | |
5570 unsigned __int16 v17; // edi@73 | |
5571 unsigned int v18; // eax@73 | |
5572 const char *v22; // eax@84 | |
5573 int scroll_id; // esi@96 | |
5574 int v25; // eax@109 | |
5575 int v26; // eax@113 | |
5576 int new_mana_val; // edi@114 | |
5577 signed __int64 v28; // qax@120 | |
5578 __int64 v30; // edi@137 | |
5579 __int64 v32; // ST3C_4@137 | |
5580 __int64 v34; // ST34_4@137 | |
5581 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 | |
5582 const char *v66; // [sp-4h] [bp-30h]@69 | |
5583 signed int v67; // [sp-4h] [bp-30h]@77 | |
5584 const char *v68; // [sp-4h] [bp-30h]@89 | |
5585 char v72; // [sp+20h] [bp-Ch]@68 | |
5586 signed int v73; // [sp+24h] [bp-8h]@1 | |
1032 | 5587 char* v74; // [sp+24h] [bp-8h]@23 |
1021 | 5588 Player *thisb; // [sp+28h] [bp-4h]@1 |
5589 unsigned int thisa; // [sp+28h] [bp-4h]@22 | |
5590 | |
5591 thisb = this; | |
5592 v3 = &pParty->pPlayers[player_num-1]; | |
5593 v73 = 1; | |
1340 | 5594 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3) ) |
1021 | 5595 return; |
5596 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) | |
0 | 5597 { |
1021 | 5598 if ( pParty->pPickedItem.uItemID == 160 ) |
5599 { | |
5600 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); | |
5601 } | |
5602 else if ( pParty->pPickedItem.uItemID == 161 ) | |
1019 | 5603 { |
1021 | 5604 new_mana_val = v3->sMana; |
5605 new_mana_val += 2; | |
5606 if ( new_mana_val > v3->GetMaxMana() ) | |
5607 new_mana_val = v3->GetMaxMana(); | |
5608 v3->PlaySound(SPEECH_36, 0); | |
5609 } | |
5610 else if ( pParty->pPickedItem.uItemID == 162 ) | |
5611 { | |
5612 pParty->pPlayers[player_num-1].Heal(2); | |
1019 | 5613 v3->PlaySound(SPEECH_36, 0); |
1021 | 5614 |
5615 } | |
5616 else | |
5617 { | |
5618 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5619 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
|
5620 ShowStatusBarString(pTmpBuf.data(), 2); |
1021 | 5621 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
5622 return; | |
1019 | 5623 } |
1032 | 5624 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0); |
5625 | |
5626 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
5627 { | |
5628 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
5629 } | |
5630 if ( v73 ) | |
5631 { | |
5632 if ( pParty->bTurnBasedModeOn ) | |
5633 { | |
5634 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
5635 thisb->SetRecoveryTime(100); | |
1448 | 5636 pTurnEngine->ApplyPlayerAction(); |
1032 | 5637 } |
5638 else | |
5639 { | |
5640 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
5641 } | |
5642 } | |
5643 pMouse->RemoveHoldingItem(); | |
5644 return; | |
5645 | |
1021 | 5646 |
5647 } | |
5648 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) | |
0 | 5649 { |
1021 | 5650 switch ( pParty->pPickedItem.uItemID ) |
5651 { | |
5652 case 221: //Catalyst | |
5653 pParty->pPlayers[player_num-1].SetCondition(Condition_Poison1, 1); | |
5654 break; | |
5655 case 222: //Cure Wounds | |
5656 v25 = pParty->pPickedItem.uEnchantmentType + 10; | |
5657 pParty->pPlayers[player_num-1].Heal(v25); | |
5658 v3->PlaySound(SPEECH_36, 0); | |
5659 break; | |
5660 case 223: //Magic Potion | |
5661 v26 = pParty->pPickedItem.uEnchantmentType + 10; | |
5662 new_mana_val = v3->sMana; | |
5663 new_mana_val += v26; | |
5664 if ( new_mana_val > v3->GetMaxMana() ) | |
5665 new_mana_val = v3->GetMaxMana(); | |
5666 v3->PlaySound(SPEECH_36, 0); | |
5667 break; | |
5668 case 224: //Cure Weakness | |
5669 v3->pConditions[Condition_Weak] = 0i64; | |
5670 v3->PlaySound(SPEECH_36, 0); | |
5671 break; | |
5672 case 225: //Cure Disease | |
5673 v3->pConditions[Condition_Disease3] = 0i64; | |
5674 v3->pConditions[Condition_Disease2] = 0i64; | |
5675 v3->pConditions[Condition_Disease1] = 0i64; | |
5676 v3->PlaySound(SPEECH_36, 0); | |
5677 break; | |
5678 case 226: //Cure Poison | |
5679 v3->pConditions[Condition_Poison3] = 0i64; | |
5680 v3->pConditions[Condition_Poison2] = 0i64; | |
5681 v3->pConditions[Condition_Poison1] = 0i64; | |
5682 v3->PlaySound(SPEECH_36, 0); | |
5683 break; | |
5684 case 227: //Awaken | |
5685 v3->pConditions[Condition_Sleep] = 0i64; | |
5686 v3->PlaySound(SPEECH_36, 0); | |
5687 break; | |
5688 case 228: //Haste | |
5689 if ( !v3->pConditions[Condition_Weak] ) | |
5690 { | |
5691 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5692 v3->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5693 v3->PlaySound(SPEECH_36, 0); | |
5694 } | |
5695 break; | |
5696 case 229: //Heroism | |
5697 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5698 v3->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5699 v3->PlaySound(SPEECH_36, 0); | |
5700 break; | |
5701 case 230: //Bless | |
5702 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5703 v3->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5704 v3->PlaySound(SPEECH_36, 0); | |
5705 break; | |
5706 case 231: //Preservation | |
1032 | 5707 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5708 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5709 v3->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5710 v3->PlaySound(SPEECH_36, 0); | |
5711 break; | |
5712 case 232: //Shield | |
1032 | 5713 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5714 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5715 v3->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5716 v3->PlaySound(SPEECH_36, 0); | |
5717 break; | |
5718 case 234: //Stoneskin | |
5719 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); | |
5720 v3->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); | |
5721 v3->PlaySound(SPEECH_36, 0); | |
5722 break; | |
5723 case 235: //Water Breathing | |
5724 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), | |
5725 v3->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); | |
5726 break; | |
5727 case 237: //Remove Fear | |
5728 v3->pConditions[Condition_Fear] = 0i64; | |
5729 v3->PlaySound(SPEECH_36, 0); | |
5730 break; | |
5731 case 238: //Remove Curse | |
5732 v3->pConditions[Condition_Cursed] = 0i64; | |
5733 v3->PlaySound(SPEECH_36, 0); | |
5734 break; | |
5735 case 239: //Cure Insanity | |
5736 v3->pConditions[Condition_Insane] = 0i64; | |
5737 v3->PlaySound(SPEECH_36, 0); | |
5738 break; | |
5739 case 240: //Might Boost | |
1032 | 5740 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5741 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5742 v3->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5743 v3->PlaySound(SPEECH_36, 0); | |
5744 break; | |
5745 case 241: //Intellect Boost | |
1032 | 5746 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5747 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5748 v3->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5749 v3->PlaySound(SPEECH_36, 0); | |
5750 break; | |
5751 case 242: //Personality Boost | |
1032 | 5752 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5753 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5754 v3->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5755 v3->PlaySound(SPEECH_36, 0); | |
5756 break; | |
5757 case 243://Endurance Boost | |
1032 | 5758 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5759 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5760 v3->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5761 v3->PlaySound(SPEECH_36, 0); | |
5762 break; | |
5763 case 244: //Speed Boost | |
1032 | 5764 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5765 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5766 v3->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5767 v3->PlaySound(SPEECH_36, 0); | |
5768 break; | |
5769 case 245: //Accuracy Boost | |
1032 | 5770 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5771 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5772 v3->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5773 v3->PlaySound(SPEECH_36, 0); | |
5774 break; | |
5775 case 251: //Cure Paralysis | |
5776 v3->pConditions[Condition_Paralyzed] = 0i64; | |
5777 v3->PlaySound(SPEECH_36, 0); | |
5778 break; | |
5779 case 252://Divine Restoration | |
5780 v30 = v3->pConditions[Condition_Dead]; | |
5781 v32 = v3->pConditions[Condition_Pertified]; | |
5782 v34 = v3->pConditions[Condition_Eradicated]; | |
5783 memset(&pParty->pPlayers[player_num-1].pConditions,0,sizeof(pConditions)); | |
5784 v3->pConditions[Condition_Dead] = v30; | |
5785 v3->pConditions[Condition_Pertified] = v32; | |
5786 v3->pConditions[Condition_Eradicated] = v34; | |
5787 v3->PlaySound(SPEECH_36, 0); | |
5788 break; | |
5789 case 253: //Divine Cure | |
5790 v25 = 5 * pParty->pPickedItem.uEnchantmentType; | |
5791 pParty->pPlayers[player_num-1].Heal(v25); | |
5792 v3->PlaySound(SPEECH_36, 0); | |
5793 break; | |
5794 case 254: //Divine Power | |
5795 v26 = 5 * pParty->pPickedItem.uEnchantmentType; | |
5796 new_mana_val = v3->sMana; | |
5797 new_mana_val += v26; | |
5798 if ( new_mana_val > v3->GetMaxMana() ) | |
5799 new_mana_val = v3->GetMaxMana(); | |
5800 v3->PlaySound(SPEECH_36, 0); | |
5801 break; | |
5802 case 255: //Luck Boost | |
1032 | 5803 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5804 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5805 v3->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5806 v3->PlaySound(SPEECH_36, 0); | |
5807 break; | |
5808 case 256: //Fire Resistance | |
1032 | 5809 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5810 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5811 v3->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5812 v3->PlaySound(SPEECH_36, 0); | |
1032 | 5813 break; |
1021 | 5814 case 257: //Air Resistance |
1032 | 5815 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5816 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5817 v3->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5818 v3->PlaySound(SPEECH_36, 0); | |
5819 break; | |
5820 case 258: //Water Resistance | |
1032 | 5821 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5822 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5823 v3->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5824 v3->PlaySound(SPEECH_36, 0); | |
5825 break; | |
5826 case 259: //Earth Resistance | |
1032 | 5827 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5828 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5829 v3->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5830 v3->PlaySound(SPEECH_36, 0); | |
5831 break; | |
5832 case 260: //Mind Resistance | |
1032 | 5833 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5834 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5835 v3->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5836 v3->PlaySound(SPEECH_36, 0); | |
5837 break; | |
5838 case 261: //Body Resistance | |
1032 | 5839 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
1021 | 5840 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
5841 v3->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); | |
5842 v3->PlaySound(SPEECH_36, 0); | |
5843 break; | |
5844 case 262: //Stone to Flesh | |
5845 v3->pConditions[Condition_Pertified] = 0i64; | |
5846 v3->PlaySound(SPEECH_36, 0); | |
5847 break; | |
5848 case 264: //Pure Luck | |
5849 if ( !v3->pure_luck_used ) | |
5850 { | |
5851 v3->uLuck += 50; | |
5852 v3->pure_luck_used = 1; | |
5853 } | |
5854 v3->PlaySound(SPEECH_36, 0); | |
5855 break; | |
5856 case 265: //Pure Speed | |
5857 if ( !v3->pure_speed_used ) | |
5858 { | |
5859 v3->uSpeed += 50; | |
5860 v3->pure_speed_used = 1; | |
5861 } | |
5862 v3->PlaySound(SPEECH_36, 0); | |
5863 break; | |
5864 case 266: //Pure Intellect | |
5865 if ( !v3->pure_intellect_used ) | |
5866 { | |
5867 v3->uIntelligence += 50; | |
5868 v3->pure_intellect_used = 1; | |
5869 } | |
5870 v3->PlaySound(SPEECH_36, 0); | |
5871 break; | |
5872 case 267: //Pure Endurance | |
5873 if ( !v3->pure_endurance_used ) | |
5874 { | |
5875 v3->uEndurance += 50; | |
5876 v3->pure_endurance_used = 1; | |
5877 } | |
5878 v3->PlaySound(SPEECH_36, 0); | |
5879 break; | |
5880 case 268: //Pure Personality | |
5881 if ( !v3->pure_willpower_used ) | |
5882 { | |
5883 v3->uWillpower += 50; | |
5884 v3->pure_willpower_used = 1; | |
5885 } | |
5886 v3->PlaySound(SPEECH_36, 0); | |
5887 break; | |
5888 case 269: //Pure Accuracy | |
5889 if ( !v3->pure_accuracy_used ) | |
5890 { | |
5891 v3->uAccuracy += 50; | |
5892 v3->pure_accuracy_used = 1; | |
5893 } | |
5894 v3->PlaySound(SPEECH_36, 0); | |
5895 break; | |
5896 case 270: //Pure Might | |
5897 if ( !v3->pure_might_used ) | |
5898 { | |
5899 v3->uMight += 50; | |
5900 v3->pure_might_used = 1; | |
5901 } | |
5902 v3->PlaySound(SPEECH_36, 0); | |
5903 break; | |
5904 case 271: //Rejuvenation | |
5905 v3->sAgeModifier = 0; | |
5906 v3->PlaySound(SPEECH_36, 0); | |
5907 break; | |
5908 | |
5909 default: | |
5910 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5911 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
|
5912 ShowStatusBarString(pTmpBuf.data(), 2u); |
1021 | 5913 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
5914 return; | |
1032 | 5915 } |
5916 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0); | |
5917 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
5918 { | |
5919 if ( !v73 ) | |
5920 { | |
5921 pMouse->RemoveHoldingItem(); | |
5922 return; | |
5923 } | |
5924 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
1021 | 5925 } |
1032 | 5926 if ( v73 ) |
5927 { | |
5928 if ( pParty->bTurnBasedModeOn ) | |
5929 { | |
5930 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
5931 thisb->SetRecoveryTime(100); | |
1448 | 5932 pTurnEngine->ApplyPlayerAction(); |
1032 | 5933 } |
5934 else | |
5935 { | |
5936 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); | |
5937 } | |
5938 } | |
5939 pMouse->RemoveHoldingItem(); | |
5940 return; | |
5941 | |
1021 | 5942 } |
5943 | |
5944 | |
5945 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL ) | |
5946 { | |
5947 | |
5948 | |
5949 if ( pCurrentScreen == SCREEN_CASTING ) | |
5950 return; | |
5951 if ( !pParty->pPlayers[player_num-1].CanAct() ) | |
5952 { | |
5953 | |
5954 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5955 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5956 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5957 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5958 return; |
5959 } | |
5960 if ( bUnderwater == 1 ) | |
5961 { | |
1032 | 5962 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2u);//"You can not do that while you are underwater!" |
5963 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); | |
1021 | 5964 return; |
5965 } | |
5966 dword_50C9AC = 1; | |
5967 scroll_id = pParty->pPickedItem.uItemID - 299; | |
5968 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura | |
5969 { | |
5970 pMouse->RemoveHoldingItem(); | |
5971 pGUIWindow_CurrentMenu->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
5972 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
1021 | 5973 pCurrentScreen = SCREEN_GAME; |
5974 viewparams->bRedrawGameUI = 1; | |
5975 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0); | |
5976 } | |
5977 else | |
5978 { | |
5979 _720984_unused = pParty->pPickedItem.uItemID; | |
5980 pMouse->RemoveHoldingItem(); | |
5981 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); | |
5982 if ( pCurrentScreen && pGUIWindow_CurrentMenu | |
5983 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)) | |
5984 { | |
5985 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
5986 } | |
5987 } | |
5988 return; | |
5989 } | |
5990 | |
5991 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_BOOK ) | |
5992 | |
5993 { | |
5994 v15 = pParty->pPickedItem.uItemID - 400; | |
5995 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; | |
5996 if ( v72 ) | |
5997 { | |
5998 v66 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5999 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
|
6000 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 6001 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6002 return; |
6003 } | |
6004 if ( !pParty->pPlayers[player_num-1].CanAct() ) | |
6005 { | |
6006 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6007 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
|
6008 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 6009 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6010 return; |
6011 } | |
6012 v16 = v15 % 11 + 1; | |
6013 v17 = v3->pActiveSkills[v15 / 11 + 12]; | |
6014 v18 = SkillToMastery(v17) - 1; | |
1032 | 6015 switch (v18) |
6016 { | |
6017 case 0: v67 = 4; break; | |
6018 case 1: v67 = 7; break; | |
6019 case 2: v67 = 10; break; | |
6020 case 3: v67 = 11; break; | |
6021 default: | |
6022 v67 = player_num; | |
6023 } | |
6024 | |
6025 if ( v16 > v67 || !v17 ) | |
1021 | 6026 { |
1032 | 6027 v22 = pParty->pPickedItem.GetDisplayName(); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6028 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
|
6029 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 6030 v3->PlaySound((PlayerSpeech)20, 0); |
6031 return; | |
6032 } | |
6033 // v72 = 1; | |
6034 v3->PlaySound(SPEECH_21, 0); | |
6035 v73 = 0; | |
6036 | |
6037 | |
6038 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) | |
6039 { | |
6040 if ( !v73 ) | |
1021 | 6041 { |
1032 | 6042 pMouse->RemoveHoldingItem(); |
6043 return; | |
6044 } | |
6045 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
6046 } | |
6047 if ( v73 ) | |
6048 { | |
6049 if ( pParty->bTurnBasedModeOn ) | |
6050 { | |
6051 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; | |
6052 thisb->SetRecoveryTime(100); | |
1448 | 6053 pTurnEngine->ApplyPlayerAction(); |
1021 | 6054 } |
6055 else | |
6056 { | |
1032 | 6057 thisb->SetRecoveryTime((signed __int64)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
1021 | 6058 } |
6059 } | |
1032 | 6060 pMouse->RemoveHoldingItem(); |
6061 return; | |
6062 | |
1021 | 6063 } |
6064 | |
6065 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL ) | |
6066 | |
6067 { | |
6068 if ( pParty->pPlayers[player_num-1].CanAct() ) | |
6069 { | |
6070 CreateMsgScrollWindow(pParty->pPickedItem.uItemID); | |
1032 | 6071 v3->PlaySound(SPEECH_37, 0); |
1021 | 6072 return; |
6073 } | |
6074 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6075 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6076 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 6077 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6078 return; |
6079 } | |
6080 else | |
1459 | 6081 { |
6082 if (pParty->pPickedItem.uItemID == 616) //Genie Lamp | |
6083 { | |
1021 | 6084 thisa = pParty->uCurrentMonthWeek + 1; |
6085 if ( pParty->uCurrentMonth >= 7 ) | |
1032 | 6086 v74 = NULL; |
1021 | 6087 else |
6088 v74 = aAttributeNames[pParty->uCurrentMonth]; | |
6089 switch ( pParty->uCurrentMonth ) | |
6090 { | |
1019 | 6091 case 0: |
1021 | 6092 v3->uMight += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6093 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6094 break; |
1019 | 6095 case 1: |
1021 | 6096 v3->uIntelligence += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6097 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6098 break; |
1019 | 6099 case 2: |
1021 | 6100 v3->uWillpower += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6101 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6102 break; |
1019 | 6103 case 3: |
1021 | 6104 v3->uEndurance += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6105 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6106 break; |
1019 | 6107 case 4: |
1021 | 6108 v3->uAccuracy += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6109 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6110 break; |
1019 | 6111 case 5: |
1021 | 6112 v3->uSpeed += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6113 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6114 break; |
1019 | 6115 case 6: |
1021 | 6116 v3->uLuck += thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6117 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
1021 | 6118 break; |
1019 | 6119 case 7: |
1021 | 6120 party_finds_gold(1000 * thisa, 0); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6121 sprintf(pTmpBuf.data(), "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold" |
1021 | 6122 break; |
1019 | 6123 case 8: |
1021 | 6124 Party::GiveFood(5 * thisa); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6125 sprintf(pTmpBuf.data(), "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food" |
1021 | 6126 break; |
0 | 6127 case 9u: |
1021 | 6128 v3->uSkillPoints += 2 * thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6129 sprintf(pTmpBuf.data(), "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]); |
1021 | 6130 break; |
1019 | 6131 case 10: |
1021 | 6132 v3->uExperience += 2500 * thisa; |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6133 sprintf(pTmpBuf.data(), "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]); |
1021 | 6134 break; |
1019 | 6135 case 11: |
1021 | 6136 v8 = rand() % 6; |
6137 switch (v8) | |
6138 { | |
6139 case 0: | |
6140 v3->sResFireBase += thisa; | |
6141 v13 = pGlobalTXT_LocalizationStrings[87]; | |
6142 break; | |
6143 case 1: | |
6144 v3->sResAirBase += thisa; | |
6145 v13 = pGlobalTXT_LocalizationStrings[6]; | |
6146 break; | |
6147 case 2: | |
6148 v3->sResWaterBase += thisa; | |
6149 v13 = pGlobalTXT_LocalizationStrings[240]; | |
6150 break; | |
6151 case 3: | |
6152 v3->sResEarthBase += thisa; | |
6153 v13 = pGlobalTXT_LocalizationStrings[70]; | |
6154 break; | |
6155 case 4: | |
6156 v3->sResMindBase += thisa; | |
6157 v13 = pGlobalTXT_LocalizationStrings[142]; | |
6158 break; | |
6159 case 5: | |
6160 v3->sResBodyBase += thisa; | |
6161 v13 = pGlobalTXT_LocalizationStrings[29]; | |
1019 | 6162 break; |
1021 | 6163 } |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6164 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]); |
1021 | 6165 break; |
6166 | |
6167 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6168 ShowStatusBarString(pTmpBuf.data(), 2u); |
1021 | 6169 pMouse->RemoveHoldingItem(); |
1459 | 6170 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); |
1021 | 6171 v3->PlaySound(SPEECH_93, 0); |
1032 | 6172 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6173 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) |
0 | 6174 { |
1021 | 6175 v3->SetCondition(Condition_Eradicated, 0); |
6176 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
0 | 6177 } |
1021 | 6178 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) |
6179 { | |
6180 v3->SetCondition(Condition_Dead, 0); | |
6181 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
6182 } | |
6183 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) | |
6184 { | |
6185 v3->SetCondition(Condition_Pertified, 0); | |
6186 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); | |
6187 } | |
1019 | 6188 return; |
1021 | 6189 } |
6190 else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple | |
1459 | 6191 { |
1021 | 6192 Party::GiveFood(1u); |
1459 | 6193 pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0); |
6194 } | |
1021 | 6195 else if ( pParty->pPickedItem.uItemID == 632 ) //Lute |
6196 { | |
1459 | 6197 pAudioPlayer->PlaySound(SOUND_PlayLute, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6198 return; |
6199 } | |
6200 else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes | |
6201 { | |
1459 | 6202 pAudioPlayer->PlaySound(SOUND_PlayFaeriePipes, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6203 return; |
6204 } | |
6205 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet | |
6206 { | |
1459 | 6207 pAudioPlayer->PlaySound(SOUND_PlayGryphonheartsTrumpet, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6208 return; |
6209 } | |
1032 | 6210 else if ( pParty->pPickedItem.uItemID == 646 ) //Horseshoe |
1459 | 6211 { |
6212 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); | |
6213 v5 = PID(OBJECT_Player, player_num + 49); | |
1021 | 6214 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); |
6215 v3->AddVariable(VAR_NumSkillPoints, 2); | |
6216 } | |
6217 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle | |
6218 { | |
1459 | 6219 TeleportToNWCDungeon(); |
1021 | 6220 return; |
6221 } | |
0 | 6222 else |
1021 | 6223 { |
6224 | |
6225 v68 = pParty->pPickedItem.GetDisplayName(); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6226 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
|
6227 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 6228 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 6229 return; |
6230 } | |
1032 | 6231 |
0 | 6232 pMouse->RemoveHoldingItem(); |
6233 return; | |
6234 } | |
1021 | 6235 |
6236 } | |
0 | 6237 |
6238 //----- (00449BB4) -------------------------------------------------------- | |
484 | 6239 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue ) |
1033 | 6240 { |
0 | 6241 Player *v3; // esi@1 |
6242 signed int v4; // edi@1 | |
6243 unsigned int v5; // eax@8 | |
6244 int v6; // eax@9 | |
6245 enum CHARACTER_RACE v7; // eax@11 | |
6246 signed int v8; // eax@17 | |
6247 unsigned __int8 v9; // sf@17 | |
6248 unsigned __int8 v10; // of@17 | |
6249 int v11; // eax@19 | |
6250 unsigned int v12; // eax@20 | |
484 | 6251 unsigned int test_bit_value; // eax@25 |
6252 unsigned __int8 our_bit_value; // cl@25 | |
0 | 6253 signed int v15; // ecx@28 |
6254 ItemGen *v16; // eax@28 | |
6255 char v17; // zf@31 | |
6256 int v18; // edi@90 | |
6257 DDM_DLV_Header *v19; // eax@122 | |
6258 char v20; // cl@124 | |
6259 DDM_DLV_Header *v21; // eax@126 | |
6260 unsigned int v22; // edi@129 | |
100 | 6261 Player *v23; // esi@134 |
0 | 6262 ItemGen *v24; // ecx@135 |
6263 signed int v25; // edx@135 | |
6264 ITEM_EQUIP_TYPE v26; // ebx@155 | |
6265 char *v27; // edi@155 | |
6266 int v28; // ebx@161 | |
6267 int v29; // eax@161 | |
6268 | |
469 | 6269 v6 = 0; |
0 | 6270 v3 = this; |
6271 v4 = -1; | |
469 | 6272 if ( VarNum > VAR_AutoNotes ) |
6273 { | |
6274 switch ( VarNum ) | |
0 | 6275 { |
6276 case VAR_Invisible: | |
1167 | 6277 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 ) |
469 | 6278 return true; |
484 | 6279 return false; |
0 | 6280 case VAR_NumDeaths: |
6281 v4 = pParty->uNumDeaths; | |
469 | 6282 return v4 >= pValue; |
0 | 6283 case VAR_NumBounties: |
6284 v4 = pParty->uNumBountiesCollected; | |
469 | 6285 return v4 >= pValue; |
0 | 6286 case VAR_PrisonTerms: |
6287 v4 = pParty->uNumPrisonTerms; | |
469 | 6288 return v4 >= pValue; |
0 | 6289 case VAR_ArenaWinsPage: |
6290 v4 = (unsigned __int8)pParty->uNumArenaPageWins; | |
469 | 6291 return v4 >= pValue; |
0 | 6292 case VAR_ArenaWinsSquire: |
6293 v4 = (unsigned __int8)pParty->uNumArenaSquireWins; | |
469 | 6294 return v4 >= pValue; |
0 | 6295 case VAR_ArenaWinsKnight: |
6296 v4 = (unsigned __int8)pParty->uNumArenaKnightWins; | |
469 | 6297 return v4 >= pValue; |
0 | 6298 case VAR_ArenaWinsLord: |
6299 v4 = (unsigned __int8)pParty->uNumArenaLordWins; | |
469 | 6300 return v4 >= pValue; |
0 | 6301 case VAR_ReputationInCurrentLocation: |
6302 v19 = &pOutdoor->ddm; | |
6303 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6304 v19 = &pIndoor->dlv; | |
469 | 6305 v6 = v19->uReputation >= pValue; |
6306 return v6; | |
0 | 6307 case VAR_History_28|VAR_Sex: |
6308 v21 = &pOutdoor->ddm; | |
6309 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6310 v21 = &pIndoor->dlv; | |
469 | 6311 v6 = v21->field_C_alert == pValue; |
0 | 6312 return v6; |
6313 case VAR_MonthEquals2|VAR_Sex: | |
6314 case VAR_MonthEquals2|VAR_Class: | |
6315 case VAR_Counter1: | |
6316 case VAR_Counter2: | |
6317 case VAR_Counter3: | |
6318 case VAR_Counter4: | |
6319 case VAR_Counter5: | |
6320 case VAR_Counter6: | |
6321 case VAR_Counter7: | |
6322 case VAR_Counter8: | |
469 | 6323 v22 = *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304]; |
6324 if ( v22 | *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300] | |
6325 && (signed __int64)(__PAIR__(v22, *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]) | |
6326 + (signed __int64)((double)(460800 * pValue) * 0.033333335)) <= (signed __int64)pParty->uTimePlayed ) | |
6327 return true; | |
6328 return false; | |
0 | 6329 case VAR_NumSkillPoints: |
6330 v4 = this->uSkillPoints; | |
469 | 6331 return v4 >= pValue; |
0 | 6332 case VAR_CircusPrises: |
6333 v4 = 0; | |
100 | 6334 v23 = pParty->pPlayers;//[0].pInventoryItems; |
0 | 6335 do |
6336 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6337 v24 = v23->pInventoryItemList; |
0 | 6338 v25 = 138; |
6339 do | |
6340 { | |
6341 switch ( v24->uItemID ) | |
6342 { | |
6343 case 0x1D6u: | |
6344 ++v4; | |
6345 break; | |
6346 case 0x1D7u: | |
6347 v4 += 3; | |
6348 break; | |
6349 case 0x1DDu: | |
6350 v4 += 5; | |
6351 break; | |
6352 } | |
6353 ++v24; | |
6354 --v25; | |
6355 } | |
6356 while ( v25 ); | |
100 | 6357 ++v23; |
0 | 6358 } |
100 | 6359 while ( v23 <= &pParty->pPlayers[3] ); |
469 | 6360 return v4 >= pValue; |
0 | 6361 case VAR_MonthEquals2: |
469 | 6362 v6 = pParty->uCurrentMonth == pValue; |
6363 return v6; | |
0 | 6364 case VAR_IsFlying: |
6365 if ( pParty->bFlying | |
1167 | 6366 && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) ) |
469 | 6367 return true; |
6368 return false; | |
0 | 6369 case VAR_HiredNPCHasSpeciality: |
469 | 6370 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue); |
0 | 6371 return v6; |
6372 case VAR_NPCs2: | |
469 | 6373 return pNPCStats->pNewNPCData[pValue].Hired(); |
0 | 6374 case VAR_MonthEquals|VAR_CurrentSP: |
1033 | 6375 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
6376 our_bit_value = this->field_1A50[((signed __int16)pValue - 1)/8]; | |
484 | 6377 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
469 | 6378 return v4 >= pValue; |
6379 v4 = pValue; | |
6380 return v4 >= pValue; | |
0 | 6381 case VAR_ItemEquipped: |
6382 v26 = (ITEM_EQUIP_TYPE)0; | |
6383 v27 = (char *)&this->pEquipment; | |
6384 break; | |
6385 case VAR_GoldInBank: | |
6386 v4 = pParty->uNumGoldInBank; | |
469 | 6387 return v4 >= pValue; |
0 | 6388 case VAR_ThieverySkill|0x80: |
6389 v28 = GetActualMight(); | |
6390 v29 = v3->GetBaseStrength(); | |
6391 goto LABEL_168; | |
6392 case VAR_DisarmTrapSkill|0x80: | |
6393 v28 = GetActualIntelligence(); | |
6394 v29 = v3->GetBaseIntelligence(); | |
6395 goto LABEL_168; | |
6396 case VAR_MonthEquals: | |
6397 v28 = GetActualWillpower(); | |
6398 v29 = v3->GetBaseWillpower(); | |
6399 goto LABEL_168; | |
6400 case VAR_MonthEquals|VAR_Sex: | |
6401 v28 = GetActualEndurance(); | |
6402 v29 = v3->GetBaseEndurance(); | |
6403 goto LABEL_168; | |
6404 case VAR_IdentifyMonsterSkill|0x80: | |
6405 v28 = GetActualSpeed(); | |
6406 v29 = v3->GetBaseSpeed(); | |
6407 goto LABEL_168; | |
6408 case VAR_ArmsmasterSkill|0x80: | |
6409 v28 = GetActualAccuracy(); | |
6410 v29 = v3->GetBaseAccuracy(); | |
6411 goto LABEL_168; | |
6412 case VAR_MonthEquals|VAR_MaxHP: | |
6413 v28 = GetActualLuck(); | |
6414 v29 = v3->GetBaseLuck(); | |
6415 LABEL_168: | |
6416 v10 = __OFSUB__(v28, v29); | |
6417 v9 = v28 - v29 < 0; | |
6418 LABEL_169: | |
6419 if ( v9 ^ v10 ) | |
469 | 6420 return v4 >= pValue; |
6421 return true; | |
0 | 6422 default: |
469 | 6423 return v4 >= pValue; |
0 | 6424 } |
6425 while ( !v3->HasItemEquipped(v26) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6426 || *(int *)&v3->pInventoryItemList[*(int *)v27-1] != pValue ) |
0 | 6427 { |
6428 v26 = (ITEM_EQUIP_TYPE)((int)v26 + 1); | |
6429 v27 += 4; | |
6430 if ( (signed int)v26 >= 16 ) | |
469 | 6431 return false; |
6432 } | |
6433 return true; | |
6434 } | |
6435 if ( VarNum == VAR_AutoNotes ) | |
0 | 6436 { |
1033 | 6437 test_bit_value = 0x80u >> ((signed __int16)(pValue - 1) - 1) % 8; |
6438 our_bit_value = pParty->_autonote_bits[((signed __int16)(pValue - 1) - 1) /8]; | |
484 | 6439 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
6440 return false; | |
6441 return true; | |
469 | 6442 } |
6443 if ( VarNum <= VAR_BaseLuck ) | |
6444 { | |
6445 if ( VarNum != VAR_BaseLuck ) | |
6446 { | |
6447 switch ( VarNum ) | |
0 | 6448 { |
6449 case VAR_Hour: | |
469 | 6450 if ( (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == pValue ) |
6451 return true; | |
6452 return false; | |
0 | 6453 case VAR_DayOfYear: |
469 | 6454 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 0x150 + 1; |
6455 v6 = v5 == pValue; | |
6456 return v6; | |
0 | 6457 case VAR_DayOfWeek: |
469 | 6458 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 7; |
6459 v6 = v5 == pValue; | |
0 | 6460 return v6; |
6461 case VAR_Sex: | |
469 | 6462 if ( pValue == (CHARACTER_RACE)this->uSex ) |
6463 return true; | |
6464 return v4 >= pValue; | |
0 | 6465 case VAR_Class: |
135 | 6466 v7 = (CHARACTER_RACE)this->classType; |
469 | 6467 if ( pValue == v7 ) |
6468 return true; | |
6469 return v4 >= pValue; | |
0 | 6470 case VAR_Race: |
6471 v7 = GetRace(); | |
469 | 6472 if ( pValue == v7 ) |
6473 return true; | |
6474 return v4 >= pValue; | |
0 | 6475 case VAR_CurrentHP: |
6476 v4 = this->sHealth; | |
469 | 6477 return v4 >= pValue; |
0 | 6478 case VAR_MaxHP: |
6479 v8 = GetMaxHealth(); | |
6480 v10 = __OFSUB__(v3->sHealth, v8); | |
6481 v9 = v3->sHealth - v8 < 0; | |
6482 goto LABEL_169; | |
6483 case VAR_CurrentSP: | |
6484 v4 = this->sMana; | |
469 | 6485 return v4 >= pValue; |
0 | 6486 case VAR_MaxSP: |
6487 v11 = GetMaxMana(); | |
6488 v10 = __OFSUB__(v3->sMana, v11); | |
6489 v9 = v3->sMana - v11 < 0; | |
6490 goto LABEL_169; | |
6491 case VAR_ActualAC: | |
6492 v12 = GetActualAC(); | |
6493 goto _j_cmp_against_arg; | |
6494 case VAR_ACModifier: | |
6495 v4 = this->sACModifier; | |
469 | 6496 return v4 >= pValue; |
0 | 6497 case VAR_BaseLevel: |
6498 v4 = this->uLevel; | |
469 | 6499 return v4 >= pValue; |
0 | 6500 case VAR_LevelModifier: |
6501 v4 = this->sLevelModifier; | |
469 | 6502 return v4 >= pValue; |
0 | 6503 case VAR_Age: |
6504 v12 = GetActualAge(); | |
6505 goto _j_cmp_against_arg; | |
6506 case VAR_Award: | |
1033 | 6507 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6508 our_bit_value = this->_achieved_awards_bits[((signed __int16)pValue - 1) /8]; |
484 | 6509 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
6510 return true; | |
6511 return false; | |
0 | 6512 case VAR_Experience: |
6513 v4 = LODWORD(this->uExperience); | |
469 | 6514 return v4 >= pValue; |
0 | 6515 case VAR_QBits_QuestsDone: |
484 | 6516 test_bit_value = 0x80u >> (pValue - 1) % 8; |
6517 our_bit_value = pParty->_quest_bits[(pValue - 1)/8]; | |
6518 if ( test_bit_value & our_bit_value ) | |
478 | 6519 return true; |
6520 return false; | |
0 | 6521 case VAR_PlayerItemInHands: |
6522 v15 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6523 v16 = v3->pInventoryItemList; |
0 | 6524 break; |
6525 case VAR_FixedGold: | |
6526 v4 = pParty->uNumGold; | |
469 | 6527 return v4 >= pValue; |
0 | 6528 case VAR_MightBonus: |
6529 v4 = this->uMightBonus; | |
469 | 6530 return v4 >= pValue; |
0 | 6531 case VAR_IntellectBonus: |
6532 v4 = this->uIntelligenceBonus; | |
469 | 6533 return v4 >= pValue; |
0 | 6534 case VAR_PersonalityBonus: |
6535 v4 = this->uWillpowerBonus; | |
469 | 6536 return v4 >= pValue; |
0 | 6537 case VAR_EnduranceBonus: |
6538 v4 = this->uEnduranceBonus; | |
469 | 6539 return v4 >= pValue; |
0 | 6540 case VAR_SpeedBonus: |
6541 v4 = this->uSpeedBonus; | |
469 | 6542 return v4 >= pValue; |
0 | 6543 case VAR_AccuracyBonus: |
6544 v4 = this->uAccuracyBonus; | |
469 | 6545 return v4 >= pValue; |
0 | 6546 case VAR_LuckBonus: |
6547 v4 = this->uLuckBonus; | |
469 | 6548 return v4 >= pValue; |
0 | 6549 case VAR_BaseMight: |
6550 v4 = this->uMight; | |
469 | 6551 return v4 >= pValue; |
0 | 6552 case VAR_BaseIntellect: |
6553 v4 = this->uIntelligence; | |
469 | 6554 return v4 >= pValue; |
0 | 6555 case VAR_BasePersonality: |
6556 v4 = this->uWillpower; | |
469 | 6557 return v4 >= pValue; |
0 | 6558 case VAR_BaseEndurance: |
6559 v4 = this->uEndurance; | |
469 | 6560 return v4 >= pValue; |
0 | 6561 case VAR_BaseSpeed: |
6562 v4 = this->uSpeed; | |
469 | 6563 return v4 >= pValue; |
0 | 6564 case VAR_BaseAccuracy: |
6565 v4 = this->uAccuracy; | |
469 | 6566 return v4 >= pValue; |
0 | 6567 case VAR_FixedFood: |
6568 v4 = pParty->uNumFoodRations; | |
469 | 6569 return v4 >= pValue; |
0 | 6570 default: |
469 | 6571 return v4 >= pValue; |
6572 } | |
6573 while ( v16->uItemID != pValue ) | |
0 | 6574 { |
6575 ++v15; | |
6576 ++v16; | |
6577 if ( v15 >= 138 ) | |
6578 { | |
469 | 6579 v6 = pParty->pPickedItem.uItemID == pValue; |
0 | 6580 return v6; |
6581 } | |
6582 } | |
469 | 6583 return true; |
0 | 6584 } |
6585 v4 = this->uLuck; | |
469 | 6586 return v4 >= pValue; |
6587 } | |
6588 if ( VarNum <= VAR_MagicResistance ) | |
6589 { | |
6590 if ( VarNum == VAR_MagicResistance ) | |
0 | 6591 { |
6592 v4 = this->sResMagicBase; | |
6593 } | |
6594 else | |
6595 { | |
469 | 6596 switch ( VarNum ) |
0 | 6597 { |
6598 case VAR_FireResistance: | |
6599 v4 = this->sResFireBase; | |
469 | 6600 return v4 >= pValue; |
0 | 6601 case VAR_AirResistance: |
6602 v4 = this->sResAirBase; | |
469 | 6603 return v4 >= pValue; |
0 | 6604 case VAR_WaterResistance: |
6605 v4 = this->sResWaterBase; | |
469 | 6606 return v4 >= pValue; |
0 | 6607 case VAR_EarthResistance: |
6608 v4 = this->sResEarthBase; | |
469 | 6609 return v4 >= pValue; |
0 | 6610 case VAR_SpiritResistance: |
6611 v4 = this->sResSpiritBase; | |
469 | 6612 return v4 >= pValue; |
0 | 6613 case VAR_MindResistance: |
6614 v4 = this->sResMindBase; | |
469 | 6615 return v4 >= pValue; |
0 | 6616 case VAR_BodyResistance: |
6617 v4 = this->sResBodyBase; | |
469 | 6618 return v4 >= pValue; |
0 | 6619 case VAR_LightResistance: |
6620 v4 = this->sResLightBase; | |
469 | 6621 return v4 >= pValue; |
0 | 6622 case VAR_DarkResistance: |
6623 v4 = this->sResDarkBase; | |
469 | 6624 return v4 >= pValue; |
0 | 6625 case VAR_ActualMight: |
6626 v12 = GetActualMight(); | |
6627 goto _j_cmp_against_arg; | |
6628 case VAR_ActualIntellect: | |
6629 v12 = GetActualIntelligence(); | |
6630 goto _j_cmp_against_arg; | |
6631 case VAR_ActualPersonality: | |
6632 v12 = GetActualWillpower(); | |
6633 goto _j_cmp_against_arg; | |
6634 case VAR_ActualEndurance: | |
6635 v12 = GetActualEndurance(); | |
6636 goto _j_cmp_against_arg; | |
6637 case VAR_ActualSpeed: | |
6638 v12 = GetActualSpeed(); | |
6639 goto _j_cmp_against_arg; | |
6640 case VAR_ActualAccuracy: | |
6641 v12 = GetActualAccuracy(); | |
6642 goto _j_cmp_against_arg; | |
6643 case VAR_ActualLuck: | |
6644 v12 = GetActualLuck(); | |
6645 _j_cmp_against_arg: | |
6646 v4 = v12; | |
6647 break; | |
6648 default: | |
469 | 6649 return v4 >= pValue; |
6650 } | |
6651 } | |
6652 return v4 >= pValue; | |
6653 } | |
6654 if ( VarNum <= VAR_DisarmTrapSkill ) | |
6655 { | |
6656 if ( VarNum != VAR_DisarmTrapSkill ) | |
6657 { | |
6658 if ( VarNum <= VAR_MindResistanceBonus ) | |
6659 { | |
6660 switch ( VarNum ) | |
0 | 6661 { |
6662 case VAR_MindResistanceBonus: | |
6663 v4 = this->sResMindBonus; | |
6664 break; | |
6665 case VAR_FireResistanceBonus: | |
6666 v4 = this->sResFireBonus; | |
6667 break; | |
6668 case VAR_AirResistanceBonus: | |
6669 v4 = this->sResAirBonus; | |
6670 break; | |
6671 case VAR_WaterResistanceBonus: | |
6672 v4 = this->sResWaterBonus; | |
6673 break; | |
6674 case VAR_EarthResistanceBonus: | |
6675 v4 = this->sResEarthBonus; | |
6676 break; | |
6677 case VAR_SpiritResistanceBonus: | |
6678 v4 = this->sResSpiritBonus; | |
6679 break; | |
6680 } | |
469 | 6681 return v4 >= pValue; |
6682 } | |
6683 if ( VarNum == VAR_BodyResistanceBonus ) | |
0 | 6684 { |
6685 v4 = this->sResBodyBonus; | |
469 | 6686 return v4 >= pValue; |
6687 } | |
6688 if ( VarNum == VAR_LightResistanceBonus ) | |
0 | 6689 { |
6690 v4 = this->sResLightBonus; | |
469 | 6691 return v4 >= pValue; |
6692 } | |
6693 if ( VarNum == VAR_DarkResistanceBonus ) | |
0 | 6694 { |
6695 v4 = this->sResDarkBonus; | |
469 | 6696 return v4 >= pValue; |
6697 } | |
6698 if ( VarNum == VAR_MagicResistanceBonus ) | |
0 | 6699 { |
6700 v4 = this->sResMagicBonus; | |
469 | 6701 return v4 >= pValue; |
6702 } | |
6703 if ( VarNum <= VAR_MagicResistanceBonus || VarNum > VAR_DiplomacySkill ) | |
6704 return v4 >= pValue; | |
0 | 6705 } |
6706 LABEL_90: | |
469 | 6707 v18 = *((short *)&this->pConditions[16] + VarNum); |
6708 if ( pValue <= 63 ) | |
0 | 6709 v4 = v18 & 0x3F; |
6710 else | |
469 | 6711 v4 = pValue & v18; |
6712 return v4 >= pValue; | |
6713 } | |
6714 if ( VarNum == 104 ) | |
0 | 6715 goto LABEL_90; |
469 | 6716 if ( (signed int)VarNum <= 104 ) |
6717 return v4 >= pValue; | |
6718 if ( (signed int)VarNum > 0x79 ) | |
6719 { | |
6720 if ( VarNum != 122 ) | |
6721 { | |
6722 if ( (signed int)VarNum > 122 && VarNum <= VAR_ActiveSpells ) | |
6723 v4 = (unsigned __int8)byte_5E4C15[VarNum]; | |
6724 return v4 >= pValue; | |
0 | 6725 } |
6726 v4 = GetMajorConditionIdx(); | |
6727 if ( v4 != 18 ) | |
6728 { | |
469 | 6729 return v4 >= pValue; |
6730 } | |
6731 v4 = pValue; | |
6732 return v4 >= pValue; | |
6733 } | |
1072 | 6734 return &LODWORD(this->pConditions[VarNum]);// *((int *)this + 2 * VarNum - 210); |
0 | 6735 } |
6736 | |
6737 | |
6738 //----- (0044A5CB) -------------------------------------------------------- | |
492 | 6739 void Player::SetVariable(enum VariableType var_type, signed int var_value) |
6740 { | |
6741 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
|
6742 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
|
6743 unsigned int v5_unused; // edi@1 |
0 | 6744 unsigned int v6; // esi@13 |
6745 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
|
6746 signed int v8_unused; // eax@17 |
0 | 6747 ItemGen *v9; // ecx@17 |
6748 int v10; // eax@21 | |
6749 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
|
6750 Player *unused12; // ecx@44 |
0 | 6751 char *v13; // ecx@45 |
6752 Player *v14; // ecx@49 | |
6753 int v15; // ecx@86 | |
6754 int v16; // esi@106 | |
6755 char v17; // al@106 | |
6756 int v18; // eax@107 | |
6757 Player *v19; // ecx@112 | |
6758 Player *v20; // ecx@127 | |
6759 int v21; // eax@127 | |
6760 int v22; // eax@145 | |
6761 char v23; // zf@146 | |
6762 DDM_DLV_Header *v24; // ecx@148 | |
6763 signed int v25; // eax@172 | |
6764 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
|
6765 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
|
6766 int v28_unused; // [sp-4h] [bp-38h]@84 |
0 | 6767 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
|
6768 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
|
6769 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
|
6770 |
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
|
6771 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
|
6772 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
|
6773 { |
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
|
6774 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
|
6775 { |
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
|
6776 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
|
6777 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
|
6778 } |
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
|
6779 } |
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
|
6780 assert(currPlayerId != -1); |
492 | 6781 if ( var_type > VAR_AutoNotes ) |
6782 { | |
6783 if ( var_type <= VAR_GoldInBank ) | |
6784 { | |
6785 if ( var_type == VAR_GoldInBank ) | |
6786 { | |
6787 pParty->uNumGoldInBank = var_value; | |
0 | 6788 return; |
6789 } | |
492 | 6790 if ( var_type <= VAR_Counter8 ) |
6791 { | |
6792 if ( (signed int)var_type >= 0xF5 ) | |
0 | 6793 { |
492 | 6794 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); |
6795 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 6796 } |
6797 else | |
6798 { | |
492 | 6799 switch ( var_type ) |
0 | 6800 { |
6801 case VAR_MonthEquals|VAR_CurrentSP: | |
492 | 6802 _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u); |
0 | 6803 break; |
6804 case VAR_NPCs2: | |
6805 pParty->field_709 = 0; | |
492 | 6806 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; |
1035 | 6807 pParty->CountHirelings(); |
6808 viewparams->bRedrawGameUI = true; | |
0 | 6809 break; |
6810 case VAR_NumSkillPoints: | |
492 | 6811 this->uSkillPoints = var_value; |
0 | 6812 break; |
6813 } | |
6814 } | |
6815 return; | |
6816 } | |
492 | 6817 if ( var_type < VAR_Counter9 ) |
0 | 6818 return; |
492 | 6819 if ( (signed int)var_type <= 0x112 ) |
6820 { | |
6821 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); | |
6822 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 6823 } |
6824 else | |
6825 { | |
492 | 6826 if ( var_type == VAR_ReputationInCurrentLocation ) |
0 | 6827 { |
6828 v24 = &pOutdoor->ddm; | |
6829 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6830 v24 = &pIndoor->dlv; | |
492 | 6831 v24->uReputation = var_value; |
6832 if ( var_value > 10000 ) | |
0 | 6833 v24->uReputation = 10000; |
6834 return; | |
6835 } | |
492 | 6836 if ( var_type <= VAR_ReputationInCurrentLocation |
6837 || var_type > VAR_History_28 | |
6838 || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) | |
6839 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
1455 | 6840 v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0, |
492 | 6841 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 6842 v23) ) |
6843 return; | |
6844 bFlashHistoryBook = 1; | |
6845 } | |
492 | 6846 v25 = 8 * currPlayerId + 400; |
862 | 6847 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
|
6848 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); |
0 | 6849 return; |
6850 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6851 switch ( var_type ) |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6852 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6853 case VAR_NumDeaths: |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6854 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
|
6855 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6856 case VAR_NumBounties: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6857 pParty->uNumBountiesCollected = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6858 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6859 case VAR_PrisonTerms: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6860 pParty->uNumPrisonTerms = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6861 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6862 case VAR_ArenaWinsPage: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6863 pParty->uNumArenaPageWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6864 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6865 case VAR_ArenaWinsSquire: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6866 pParty->uNumArenaSquireWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6867 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6868 case VAR_ArenaWinsKnight: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6869 pParty->uNumArenaKnightWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6870 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6871 case VAR_ArenaWinsLord: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6872 pParty->uNumArenaLordWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6873 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6874 } |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6875 return; |
0 | 6876 } |
492 | 6877 if ( var_type == VAR_AutoNotes ) |
6878 { | |
6879 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
|
6880 //&& (&dword_723718_autonote_related)[8 * a3] ) |
1310 | 6881 && pAutonoteTxt[var_value].pText ) |
492 | 6882 { |
6883 v20 = pPlayers[currPlayerId + 1]; | |
187 | 6884 v20->PlaySound(SPEECH_96, 0); |
1453 | 6885 //v21 = pAutonoteTxt[var_value].eType;// dword_72371C[2 * a3]; |
0 | 6886 bFlashAutonotesBook = 1; |
1453 | 6887 _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
|
6888 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
0 | 6889 } |
1453 | 6890 _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
|
6891 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6892 return; |
0 | 6893 } |
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
|
6894 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
|
6895 { |
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
|
6896 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
|
6897 { |
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
|
6898 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
|
6899 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
|
6900 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
|
6901 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
|
6902 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
|
6903 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
|
6904 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6905 v9 = NULL; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6906 for (int i = 0; i < 138; i++) |
0 | 6907 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6908 v9 = &this->pInventoryItemList[i]; |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
6909 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
|
6910 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
|
6911 } |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
6912 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
|
6913 { |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6914 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
|
6915 *(int *)(v10 + 532) = 601; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6916 *(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
|
6917 } |
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
|
6918 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
|
6919 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
|
6920 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
|
6921 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
|
6922 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
|
6923 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
|
6924 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
|
6925 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
|
6926 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
|
6927 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
|
6928 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
|
6929 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
|
6930 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
|
6931 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
|
6932 { |
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
|
6933 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
|
6934 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
|
6935 } |
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
|
6936 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
|
6937 { |
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
|
6938 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
|
6939 this->uVoiceID = 20; |
0 | 6940 } |
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
|
6941 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
|
6942 } |
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
|
6943 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
|
6944 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
|
6945 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
|
6946 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
|
6947 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
|
6948 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
|
6949 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
|
6950 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
|
6951 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
|
6952 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
|
6953 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
|
6954 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
|
6955 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
|
6956 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
|
6957 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
|
6958 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
|
6959 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
|
6960 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
|
6961 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
|
6962 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
|
6963 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
|
6964 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
|
6965 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
|
6966 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
|
6967 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
|
6968 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
|
6969 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
|
6970 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
|
6971 //&& 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
|
6972 && 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
|
6973 { |
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
|
6974 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
|
6975 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6976 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
|
6977 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6978 _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
|
6979 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
|
6980 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
|
6981 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
|
6982 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
|
6983 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
|
6984 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
|
6985 // && (&dword_722F10)[4 * a3] ) |
1310 | 6986 && pQuestTable[var_value] ) |
0 | 6987 { |
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
|
6988 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
|
6989 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
|
6990 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
|
6991 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6992 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
|
6993 } |
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
|
6994 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
|
6995 _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
|
6996 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
|
6997 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
|
6998 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
|
6999 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
|
7000 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
|
7001 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
|
7002 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
|
7003 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
|
7004 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
|
7005 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
|
7006 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
|
7007 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
|
7008 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
|
7009 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
|
7010 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
|
7011 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
|
7012 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
|
7013 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
|
7014 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
|
7015 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
|
7016 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
|
7017 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
|
7018 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
|
7019 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
|
7020 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
|
7021 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
|
7022 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
|
7023 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
|
7024 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
|
7025 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
|
7026 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
|
7027 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
|
7028 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
|
7029 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
|
7030 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
|
7031 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
|
7032 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
|
7033 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
|
7034 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
|
7035 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
|
7036 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
|
7037 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
|
7038 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
|
7039 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
|
7040 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
|
7041 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
|
7042 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7043 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
|
7044 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
|
7045 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
|
7046 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7047 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
|
7048 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
|
7049 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
|
7050 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7051 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
|
7052 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
|
7053 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
|
7054 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7055 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
|
7056 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
|
7057 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
|
7058 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7059 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
|
7060 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
|
7061 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
|
7062 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7063 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
|
7064 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
|
7065 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
|
7066 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7067 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
|
7068 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
|
7069 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
|
7070 } |
0 | 7071 LABEL_111: |
187 | 7072 v26 = SPEECH_91; |
0 | 7073 LABEL_112: |
492 | 7074 v19 = pPlayers[currPlayerId + 1]; |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7075 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
|
7076 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7077 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7078 return; |
0 | 7079 } |
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
|
7080 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
|
7081 { |
492 | 7082 switch ( var_type ) |
0 | 7083 { |
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
|
7084 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
|
7085 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
|
7086 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
|
7087 goto LABEL_111; |
0 | 7088 case VAR_ActualIntellect: |
7089 LABEL_68: | |
492 | 7090 this->uIntelligenceBonus = (unsigned __int8)var_value; |
0 | 7091 goto LABEL_111; |
7092 case VAR_ActualPersonality: | |
7093 LABEL_69: | |
492 | 7094 this->uWillpowerBonus = (unsigned __int8)var_value; |
0 | 7095 goto LABEL_111; |
7096 case VAR_ActualEndurance: | |
7097 LABEL_70: | |
492 | 7098 this->uEnduranceBonus = (unsigned __int8)var_value; |
0 | 7099 goto LABEL_111; |
7100 case VAR_ActualSpeed: | |
7101 LABEL_71: | |
492 | 7102 this->uSpeedBonus = (unsigned __int8)var_value; |
0 | 7103 goto LABEL_111; |
7104 case VAR_ActualAccuracy: | |
7105 LABEL_72: | |
492 | 7106 this->uAccuracyBonus = (unsigned __int8)var_value; |
0 | 7107 goto LABEL_111; |
7108 case VAR_ActualLuck: | |
7109 LABEL_73: | |
492 | 7110 this->uLuckBonus = (unsigned __int8)var_value; |
0 | 7111 goto LABEL_111; |
7112 case VAR_FireResistance: | |
492 | 7113 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
|
7114 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7115 goto LABEL_112; |
0 | 7116 case VAR_AirResistance: |
492 | 7117 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
|
7118 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7119 goto LABEL_112; |
0 | 7120 case VAR_WaterResistance: |
492 | 7121 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
|
7122 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7123 goto LABEL_112; |
0 | 7124 case VAR_EarthResistance: |
492 | 7125 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
|
7126 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7127 goto LABEL_112; |
0 | 7128 case VAR_SpiritResistance: |
492 | 7129 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
|
7130 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7131 goto LABEL_112; |
0 | 7132 case VAR_MindResistance: |
492 | 7133 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
|
7134 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7135 goto LABEL_112; |
0 | 7136 case VAR_BodyResistance: |
492 | 7137 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
|
7138 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7139 goto LABEL_112; |
0 | 7140 case VAR_LightResistance: |
492 | 7141 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
|
7142 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7143 goto LABEL_112; |
0 | 7144 case VAR_DarkResistance: |
492 | 7145 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
|
7146 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7147 goto LABEL_112; |
0 | 7148 case VAR_MagicResistance: |
492 | 7149 this->sResMagicBase = (unsigned __int8)var_value; |
0 | 7150 v26 = 92; |
7151 goto LABEL_112; | |
7152 default: | |
7153 return; | |
7154 } | |
7155 return; | |
7156 } | |
7157 HIWORD(v15) = 0; | |
492 | 7158 if ( var_type > VAR_DisarmTrapSkill ) |
7159 { | |
7160 if ( var_type != VAR_LearningSkill ) | |
7161 { | |
7162 if ( var_type <= VAR_LearningSkill ) | |
0 | 7163 return; |
492 | 7164 if ( var_type <= VAR_Eradicated ) |
7165 { | |
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
|
7166 this->SetCondition(var_type - 105, 1); |
0 | 7167 } |
7168 else | |
7169 { | |
492 | 7170 if ( var_type != VAR_MajorCondition ) |
0 | 7171 { |
492 | 7172 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
7173 byte_5E4C15[var_type] = var_value; | |
0 | 7174 return; |
7175 } | |
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
|
7176 memset(this, 0, 0xA0u); |
0 | 7177 } |
7178 } | |
7179 else | |
7180 { | |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7181 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
|
7182 v17 = *(char *)v16; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7183 if ( var_value <= VAR_BodyResistanceBonus ) |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7184 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7185 LOWORD(v15) = (unsigned __int8)var_value; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7186 v18 = v15 | v17 & VAR_BodyResistanceBonus; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7187 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7188 else |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7189 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7190 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
|
7191 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7192 *(short *)v16 = v18; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7193 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7194 LABEL_124: |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7195 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7196 PlaySoundBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
7197 return; |
0 | 7198 } |
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
|
7199 if ( var_type <= VAR_MagicResistanceBonus ) |
492 | 7200 { |
7201 switch ( var_type ) | |
0 | 7202 { |
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
|
7203 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
|
7204 this->sResFireBonus = (unsigned __int8)var_value; |
0 | 7205 break; |
7206 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
|
7207 this->sResAirBonus = (unsigned __int8)var_value; |
0 | 7208 break; |
7209 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
|
7210 this->sResWaterBonus = (unsigned __int8)var_value; |
0 | 7211 break; |
7212 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
|
7213 this->sResEarthBonus = (unsigned __int8)var_value; |
0 | 7214 break; |
7215 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
|
7216 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
|
7217 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
|
7218 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
|
7219 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
|
7220 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
|
7221 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
|
7222 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
|
7223 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
|
7224 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
|
7225 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
|
7226 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
|
7227 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
|
7228 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
|
7229 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
|
7230 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
|
7231 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
|
7232 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
|
7233 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
|
7234 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
|
7235 this->sResMagicBonus = (unsigned __int8)var_value; |
0 | 7236 break; |
7237 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
|
7238 assert("Unexpected var_type" && false); |
0 | 7239 return; |
7240 break; | |
7241 } | |
7242 goto LABEL_111; | |
7243 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7244 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
|
7245 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7246 return; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7247 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7248 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7249 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7250 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7251 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7252 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
|
7253 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7254 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
|
7255 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
|
7256 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
|
7257 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7258 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
7259 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7260 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
|
7261 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
7262 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
|
7263 } |
0 | 7264 |
7265 //----- (0044AFFB) -------------------------------------------------------- | |
310 | 7266 void Player::AddVariable(enum VariableType var_type, signed int val) |
0 | 7267 { |
7268 char v3; // bl@1 | |
7269 Player *v4; // esi@1 | |
7270 signed int uPlayerIdx; // edi@1 | |
7271 int v6; // eax@15 | |
7272 unsigned int v7; // esi@18 | |
7273 int *v8; // ebx@21 | |
7274 int v9; // eax@22 | |
7275 signed int v10; // eax@24 | |
7276 int v11; // eax@27 | |
7277 __int16 *v12; // esi@28 | |
7278 Player *v13; // ecx@34 | |
7279 Player *v14; // ecx@36 | |
7280 char *v15; // ecx@37 | |
7281 unsigned __int8 v16; // cf@38 | |
7282 Player *v17; // ecx@42 | |
7283 __int16 *v18; // esi@53 | |
7284 __int16 *v19; // esi@62 | |
7285 char *v20; // esi@107 | |
7286 __int16 v21; // dx@107 | |
7287 int v22; // ecx@107 | |
7288 Player *v23; // ecx@132 | |
7289 int v24; // eax@132 | |
7290 int v25; // eax@150 | |
7291 char v26; // zf@151 | |
7292 DDM_DLV_Header *v27; // eax@153 | |
7293 signed int v28; // eax@176 | |
7294 int v29; // [sp-8h] [bp-40h]@84 | |
310 | 7295 // signed int v30; // [sp-4h] [bp-3Ch]@4 |
0 | 7296 int v31; // [sp-4h] [bp-3Ch]@84 |
7297 ItemGen item; // [sp+Ch] [bp-2Ch]@45 | |
7298 unsigned int v33; // [sp+30h] [bp-8h]@34 | |
7299 char v34; // [sp+37h] [bp-1h]@1 | |
7300 | |
7301 auto Dst = this; | |
7302 v3 = 0; | |
7303 v34 = 0; | |
7304 v4 = Dst; | |
7305 uPlayerIdx = 0; | |
7306 if ( Dst == pPlayers[2] ) | |
7307 uPlayerIdx = 1; | |
310 | 7308 else if ( Dst == pPlayers[3] ) |
7309 uPlayerIdx = 2; | |
7310 else if ( Dst == pPlayers[4] ) | |
7311 uPlayerIdx = 3; | |
7312 | |
7313 if ( var_type <= VAR_AutoNotes ) | |
7314 { | |
7315 if ( var_type != VAR_AutoNotes ) | |
7316 { | |
7317 if ( var_type <= VAR_ActualMight ) | |
7318 { | |
7319 if ( var_type != VAR_ActualMight ) | |
0 | 7320 { |
310 | 7321 switch ( var_type ) |
0 | 7322 { |
7323 case VAR_RandomGold: | |
7324 if ( !val ) | |
7325 val = 1; | |
7326 v6 = rand(); | |
7327 party_finds_gold(v6 % val + 1, 1); | |
7328 GameUI_DrawFoodAndGold(); | |
7329 return; | |
7330 case VAR_RandomFood: | |
7331 if ( !val ) | |
7332 val = 1; | |
7333 v7 = rand() % val + 1; | |
7334 Party::GiveFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7335 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
|
7336 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 7337 GameUI_DrawFoodAndGold(); |
7338 goto _play_sound; | |
7339 case VAR_Sex: | |
7340 Dst->uSex = (PLAYER_SEX)val; | |
1507 | 7341 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7342 goto _play_sound; | |
0 | 7343 case VAR_Class: |
135 | 7344 Dst->classType = (PLAYER_CLASS_TYPE)val; |
1507 | 7345 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7346 goto _play_sound; | |
0 | 7347 case VAR_CurrentHP: |
7348 v8 = &Dst->sHealth; | |
7349 *v8 += val; | |
7350 if ( Dst->sHealth <= Dst->GetMaxHealth() ) | |
1507 | 7351 { |
7352 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7353 goto _play_sound; | |
7354 } | |
0 | 7355 v9 = v4->GetMaxHealth(); |
7356 goto LABEL_23; | |
7357 case VAR_MaxHP: | |
7358 v10 = Dst->GetMaxHealth(); | |
7359 v4->_health_related = 0; | |
7360 v4->uFullHealthBonus = 0; | |
7361 v4->sHealth = v10; | |
7362 return; | |
7363 case VAR_CurrentSP: | |
7364 v8 = &Dst->sMana; | |
7365 *v8 += val; | |
7366 if ( Dst->sMana > GetMaxMana() ) | |
7367 { | |
7368 v9 = v4->GetMaxMana(); | |
7369 LABEL_23: | |
7370 *v8 = v9; | |
7371 } | |
1507 | 7372 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7373 goto _play_sound; | |
0 | 7374 case VAR_MaxSP: |
7375 v11 = GetMaxMana(); | |
7376 v4->_mana_related = 0; | |
7377 v4->uFullManaBonus = 0; | |
7378 v4->sMana = v11; | |
7379 return; | |
7380 case VAR_ACModifier: | |
7381 v12 = &Dst->sACModifier; | |
7382 goto LABEL_29; | |
7383 case VAR_BaseLevel: | |
7384 v12 = (__int16 *)&Dst->uLevel; | |
7385 goto LABEL_29; | |
7386 case VAR_LevelModifier: | |
7387 v12 = &Dst->sLevelModifier; | |
7388 LABEL_29: | |
7389 *v12 += val; | |
7390 if ( *v12 > 255 ) | |
7391 *v12 = 255; | |
1507 | 7392 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7393 goto _play_sound; | |
0 | 7394 case VAR_Age: |
7395 Dst->sAgeModifier += val; | |
7396 return; | |
7397 case VAR_Award: | |
7398 v13 = pPlayers[uPlayerIdx + 1]; | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
7399 if (_449B57_test_bit((unsigned __int8 *)pPlayers[uPlayerIdx + 1]->_achieved_awards_bits, val) |
521 | 7400 |
492 | 7401 && pAwards[val].pText ) |
0 | 7402 { |
7403 v14 = pPlayers[uPlayerIdx + 1]; | |
7404 v34 = 1; | |
7405 v3 = 1; | |
187 | 7406 v14->PlaySound(SPEECH_96, 0); |
0 | 7407 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
7408 v15 = (char *)v4->_achieved_awards_bits; |
1507 | 7409 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
7410 if ( v34 != 1 ) | |
7411 { | |
7412 if ( v3 != 1 ) | |
7413 return; | |
7414 goto _play_sound; | |
7415 } | |
7416 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7417 if ( v3 != 1 ) | |
7418 return; | |
7419 goto _play_sound; | |
0 | 7420 case VAR_Experience: |
7421 v16 = __CFADD__(val, LODWORD(Dst->uExperience)); | |
7422 LODWORD(Dst->uExperience) += val; | |
7423 HIDWORD(Dst->uExperience) += ((unsigned __int64)val >> 32) + v16; | |
7424 if ( (signed __int64)Dst->uExperience > 4000000000i64 ) | |
7425 Dst->uExperience = 4000000000i64; | |
1507 | 7426 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7427 goto _play_sound; | |
0 | 7428 case VAR_QBits_QuestsDone: |
484 | 7429 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
|
7430 //&& (&dword_722F10)[4 * val] ) |
1310 | 7431 && pQuestTable[val] ) |
0 | 7432 { |
501 | 7433 //v17 = pPlayers[uPlayerIdx + 1]; |
0 | 7434 bFlashQuestBook = 1; |
7435 v34 = 1; | |
7436 v3 = 1; | |
501 | 7437 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0); |
0 | 7438 } |
484 | 7439 v15 = (char *)pParty->_quest_bits; |
1507 | 7440 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
7441 if ( v34 != 1 ) | |
7442 { | |
7443 if ( v3 != 1 ) | |
7444 return; | |
7445 goto _play_sound; | |
7446 } | |
7447 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7448 if ( v3 != 1 ) | |
7449 return; | |
7450 goto _play_sound; | |
0 | 7451 case VAR_PlayerItemInHands: |
7452 item.Reset(); | |
7453 item.Reset(); | |
7454 item.uAttributes = 1; | |
7455 item.uItemID = val; | |
7456 if ( val >= ITEM_ARTIFACT_PUCK && val <= ITEM_RELIC_MEKORIGS_HAMMER ) | |
484 | 7457 pParty->pIsArtifactFound[val-500] = 1; |
0 | 7458 if ( val >= ITEM_WAND_FIRE && val <= ITEM_WAND_INCENERATION ) |
7459 { | |
7460 item.uNumCharges = rand() % 6 + pItemsTable->pItems[item.uItemID].uDamageMod + 1; | |
7461 item.uMaxCharges = LOBYTE(item.uNumCharges); | |
7462 } | |
7463 pParty->SetHoldingItem(&item); | |
7464 return; | |
7465 case VAR_FixedGold: | |
7466 party_finds_gold(val, 1); | |
7467 return; | |
7468 case VAR_BaseMight: | |
7469 v18 = (__int16 *)&Dst->uMight; | |
7470 goto LABEL_82; | |
7471 case VAR_BaseIntellect: | |
7472 v18 = (__int16 *)&Dst->uIntelligence; | |
7473 goto LABEL_82; | |
7474 case VAR_BasePersonality: | |
7475 v18 = (__int16 *)&Dst->uWillpower; | |
7476 goto LABEL_82; | |
7477 case VAR_BaseEndurance: | |
7478 v18 = (__int16 *)&Dst->uEndurance; | |
7479 goto LABEL_82; | |
7480 case VAR_BaseSpeed: | |
7481 v18 = (__int16 *)&Dst->uSpeed; | |
7482 goto LABEL_82; | |
7483 case VAR_BaseAccuracy: | |
7484 v18 = (__int16 *)&Dst->uAccuracy; | |
7485 goto LABEL_82; | |
7486 case VAR_BaseLuck: | |
7487 v18 = (__int16 *)&Dst->uLuck; | |
7488 goto LABEL_82; | |
7489 case VAR_FixedFood: | |
7490 Party::GiveFood(val); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7491 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
7492 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 7493 if ( pParty->uNumFoodRations > 0xFFFF ) |
7494 Party::SetFood(0xFFFFu); | |
7495 goto _play_sound; | |
7496 case VAR_MightBonus: | |
7497 goto LABEL_62; | |
7498 case VAR_IntellectBonus: | |
7499 goto LABEL_66; | |
7500 case VAR_PersonalityBonus: | |
7501 goto LABEL_67; | |
7502 case VAR_EnduranceBonus: | |
7503 goto LABEL_68; | |
7504 case VAR_SpeedBonus: | |
7505 goto LABEL_69; | |
7506 case VAR_AccuracyBonus: | |
7507 goto LABEL_70; | |
7508 case VAR_LuckBonus: | |
7509 goto LABEL_71; | |
7510 default: | |
7511 return; | |
7512 } | |
7513 return; | |
7514 } | |
7515 LABEL_62: | |
7516 v19 = (__int16 *)&Dst->uMightBonus; | |
7517 goto LABEL_113; | |
7518 } | |
310 | 7519 if ( var_type <= VAR_FireResistanceBonus ) |
7520 { | |
7521 if ( var_type != VAR_FireResistanceBonus ) | |
0 | 7522 { |
310 | 7523 switch ( var_type ) |
0 | 7524 { |
7525 case VAR_ActualIntellect: | |
7526 LABEL_66: | |
7527 v19 = (__int16 *)&Dst->uIntelligenceBonus; | |
7528 goto LABEL_113; | |
7529 case VAR_ActualPersonality: | |
7530 LABEL_67: | |
7531 v19 = (__int16 *)&Dst->uWillpowerBonus; | |
7532 goto LABEL_113; | |
7533 case VAR_ActualEndurance: | |
7534 LABEL_68: | |
7535 v19 = (__int16 *)&Dst->uEnduranceBonus; | |
7536 goto LABEL_113; | |
7537 case VAR_ActualSpeed: | |
7538 LABEL_69: | |
7539 v19 = (__int16 *)&Dst->uSpeedBonus; | |
7540 goto LABEL_113; | |
7541 case VAR_ActualAccuracy: | |
7542 LABEL_70: | |
7543 v19 = (__int16 *)&Dst->uAccuracyBonus; | |
7544 goto LABEL_113; | |
7545 case VAR_ActualLuck: | |
7546 LABEL_71: | |
7547 v19 = (__int16 *)&Dst->uLuckBonus; | |
7548 goto LABEL_113; | |
7549 case VAR_FireResistance: | |
7550 v18 = &Dst->sResFireBase; | |
7551 goto LABEL_82; | |
7552 case VAR_AirResistance: | |
7553 v18 = &Dst->sResAirBase; | |
7554 goto LABEL_82; | |
7555 case VAR_WaterResistance: | |
7556 v18 = &Dst->sResWaterBase; | |
7557 goto LABEL_82; | |
7558 case VAR_EarthResistance: | |
7559 v18 = &Dst->sResEarthBase; | |
7560 goto LABEL_82; | |
7561 case VAR_SpiritResistance: | |
7562 v18 = &Dst->sResSpiritBase; | |
7563 goto LABEL_82; | |
7564 case VAR_MindResistance: | |
7565 v18 = &Dst->sResMindBase; | |
7566 goto LABEL_82; | |
7567 case VAR_BodyResistance: | |
7568 v18 = &Dst->sResBodyBase; | |
7569 goto LABEL_82; | |
7570 case VAR_LightResistance: | |
7571 v18 = &Dst->sResLightBase; | |
7572 goto LABEL_82; | |
7573 case VAR_DarkResistance: | |
7574 v18 = &Dst->sResDarkBase; | |
7575 goto LABEL_82; | |
7576 case VAR_MagicResistance: | |
7577 v18 = &Dst->sResMagicBase; | |
7578 LABEL_82: | |
7579 *v18 += val; | |
7580 if ( *v18 > 255 ) | |
7581 *v18 = 255; | |
1507 | 7582 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_92, 0); |
7583 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7584 goto _play_sound; | |
0 | 7585 default: |
7586 return; | |
7587 } | |
7588 return; | |
7589 } | |
7590 v19 = &Dst->sResFireBonus; | |
7591 LABEL_113: | |
7592 *v19 += val; | |
7593 if ( *v19 > 255 ) | |
7594 *v19 = 255; | |
7595 v31 = 0; | |
187 | 7596 v29 = SPEECH_91; |
7597 pPlayers[uPlayerIdx + 1]->PlaySound((PlayerSpeech)v29, v31); | |
1507 | 7598 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7599 goto _play_sound; | |
0 | 7600 } |
310 | 7601 if ( var_type <= VAR_DisarmTrapSkill ) |
7602 { | |
7603 if ( var_type != VAR_DisarmTrapSkill ) | |
0 | 7604 { |
310 | 7605 if ( var_type <= VAR_BodyResistanceBonus ) |
0 | 7606 { |
310 | 7607 switch ( var_type ) |
0 | 7608 { |
7609 case VAR_BodyResistanceBonus: | |
7610 v19 = &Dst->sResBodyBonus; | |
7611 break; | |
7612 case VAR_AirResistanceBonus: | |
7613 v19 = &Dst->sResAirBonus; | |
7614 break; | |
7615 case VAR_WaterResistanceBonus: | |
7616 v19 = &Dst->sResWaterBonus; | |
7617 break; | |
7618 case VAR_EarthResistanceBonus: | |
7619 v19 = &Dst->sResEarthBonus; | |
7620 break; | |
7621 case VAR_SpiritResistanceBonus: | |
7622 v19 = &Dst->sResSpiritBonus; | |
7623 break; | |
7624 default: | |
310 | 7625 if ( var_type != 62 ) |
0 | 7626 return; |
7627 v19 = &Dst->sResMindBonus; | |
7628 break; | |
7629 } | |
7630 goto LABEL_113; | |
7631 } | |
310 | 7632 if ( var_type == VAR_LightResistanceBonus ) |
0 | 7633 { |
7634 v19 = &Dst->sResLightBonus; | |
7635 goto LABEL_113; | |
7636 } | |
310 | 7637 if ( var_type == VAR_DarkResistanceBonus ) |
0 | 7638 { |
7639 v19 = &Dst->sResDarkBonus; | |
7640 goto LABEL_113; | |
7641 } | |
310 | 7642 if ( var_type == VAR_MagicResistanceBonus ) |
0 | 7643 { |
7644 v19 = &Dst->sResMagicBonus; | |
7645 goto LABEL_113; | |
7646 } | |
310 | 7647 if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill ) |
0 | 7648 return; |
7649 } | |
7650 goto LABEL_106; | |
7651 } | |
310 | 7652 if ( var_type == VAR_LearningSkill ) |
0 | 7653 { |
7654 LABEL_106: | |
7655 if ( val <= VAR_BodyResistanceBonus ) | |
7656 { | |
310 | 7657 *((short *)&Dst->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&Dst->pConditions[16] + 2 * var_type) & VAR_BodyResistanceBonus; |
0 | 7658 } |
7659 else | |
7660 { | |
310 | 7661 v20 = (char *)&Dst->pConditions[16] + 2 * var_type; |
0 | 7662 v21 = *(short *)v20; |
7663 v22 = (unsigned __int8)val + (v21 & VAR_BodyResistanceBonus); | |
7664 if ( v22 > 60 ) | |
7665 LOWORD(v22) = 60; | |
7666 LOBYTE(v21) = v21 & 0xC0; | |
7667 *(short *)v20 = v22 | v21; | |
7668 } | |
1507 | 7669 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
7670 goto _play_sound; | |
0 | 7671 } |
310 | 7672 if ( var_type <= VAR_LearningSkill ) |
0 | 7673 return; |
310 | 7674 if ( var_type <= VAR_Eradicated ) |
7675 { | |
7676 Dst->SetCondition(var_type - 105, 0); | |
0 | 7677 } |
7678 else | |
7679 { | |
310 | 7680 if ( var_type != VAR_MajorCondition ) |
0 | 7681 { |
310 | 7682 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
0 | 7683 { |
310 | 7684 if ( (unsigned __int8)val + (unsigned __int8)byte_5E4C15[var_type] <= 255 ) |
7685 byte_5E4C15[var_type] += val; | |
0 | 7686 else |
310 | 7687 byte_5E4C15[var_type] = -1; |
0 | 7688 } |
7689 return; | |
7690 } | |
7691 memset(Dst, 0, 0xA0u); | |
7692 } | |
7693 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7694 goto _play_sound; | |
7695 } | |
7696 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
|
7697 //&& (&dword_723718_autonote_related)[8 * val] ) |
1310 | 7698 && pAutonoteTxt[val].pText ) |
0 | 7699 { |
7700 v23 = pPlayers[uPlayerIdx + 1]; | |
7701 v34 = 1; | |
187 | 7702 v23->PlaySound(SPEECH_96, 0); |
1453 | 7703 //v24 = pAutonoteTxt[val].eType;//dword_72371C[2 * val]; |
0 | 7704 bFlashAutonotesBook = 1; |
1453 | 7705 _506568_autonote_type = pAutonoteTxt[val].eType; |
7706 } | |
7707 _449B7E_toggle_bit(pParty->_autonote_bits, val, 1); | |
0 | 7708 v3 = 1; |
7709 if ( v34 != 1 ) | |
1507 | 7710 { |
7711 if ( v3 != 1 ) | |
7712 return; | |
7713 goto _play_sound; | |
7714 } | |
7715 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7716 if ( v3 != 1 ) | |
7717 return; | |
7718 goto _play_sound; | |
0 | 7719 } |
310 | 7720 if ( var_type > VAR_GoldInBank ) |
7721 { | |
7722 if ( var_type == 307 ) | |
0 | 7723 { |
7724 pParty->uNumDeaths += val; | |
1507 | 7725 if ( v34 != 1 ) |
7726 { | |
7727 if ( v3 != 1 ) | |
7728 return; | |
7729 goto _play_sound; | |
7730 } | |
7731 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
7732 if ( v3 != 1 ) | |
7733 return; | |
7734 goto _play_sound; | |
0 | 7735 } |
310 | 7736 switch ( var_type ) |
0 | 7737 { |
7738 case 308: | |
7739 pParty->uNumBountiesCollected += val; | |
7740 break; | |
7741 case 309: | |
7742 pParty->uNumPrisonTerms += val; | |
7743 break; | |
7744 case 310: | |
7745 pParty->uNumArenaPageWins += val; | |
7746 break; | |
7747 case 311: | |
7748 pParty->uNumArenaSquireWins += val; | |
7749 break; | |
7750 case 312: | |
7751 pParty->uNumArenaKnightWins += val; | |
7752 break; | |
7753 case 313: | |
7754 pParty->uNumArenaLordWins += val; | |
7755 break; | |
7756 } | |
7757 } | |
7758 else | |
7759 { | |
310 | 7760 if ( var_type == VAR_GoldInBank ) |
0 | 7761 { |
7762 pParty->uNumGoldInBank += val; | |
7763 return; | |
7764 } | |
310 | 7765 if ( var_type <= VAR_Counter8 ) |
7766 { | |
7767 if ( (signed int)var_type >= 245 ) | |
7768 { | |
7769 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); | |
7770 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 7771 } |
7772 else | |
7773 { | |
310 | 7774 switch ( var_type ) |
0 | 7775 { |
7776 case VAR_MonthEquals|VAR_CurrentSP: | |
7777 _449B7E_toggle_bit((unsigned char *)Dst->field_1A50, val, 1u); | |
7778 break; | |
7779 case VAR_NPCs2: | |
7780 pParty->field_709 = 0; | |
7781 LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u; | |
1035 | 7782 pParty->CountHirelings(); |
7783 viewparams->bRedrawGameUI = true; | |
0 | 7784 break; |
7785 case VAR_NumSkillPoints: | |
7786 Dst->uSkillPoints += val; | |
7787 break; | |
7788 } | |
7789 } | |
7790 return; | |
7791 } | |
310 | 7792 if ( var_type < VAR_Counter9 ) |
0 | 7793 return; |
310 | 7794 if ( (signed int)var_type <= 274 ) |
7795 { | |
7796 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); | |
7797 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 7798 goto _play_sound; |
7799 } | |
310 | 7800 if ( var_type != VAR_ReputationInCurrentLocation ) |
7801 { | |
7802 if ( var_type <= VAR_ReputationInCurrentLocation | |
7803 || var_type > VAR_History_28 | |
7804 || (v25 = var_type - 276, pParty->field_3C.field_4F0[2 * v25 + 1] | pParty->field_3C.field_4F0[2 * v25]) | |
7805 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
233 | 7806 v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0, |
310 | 7807 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 7808 v26) ) |
7809 return; | |
7810 bFlashHistoryBook = 1; | |
7811 _play_sound: | |
7812 v28 = 8 * uPlayerIdx + 400; | |
862 | 7813 LOBYTE(v28) = PID(OBJECT_Player,uPlayerIdx - 112); |
0 | 7814 pAudioPlayer->PlaySound(SOUND_20001, v28, 0, -1, 0, 0, 0, 0); |
7815 return; | |
7816 } | |
7817 v27 = &pOutdoor->ddm; | |
7818 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
7819 v27 = &pIndoor->dlv; | |
7820 v27->uReputation += val; | |
7821 if ( v27->uReputation > 10000 ) | |
7822 v27->uReputation = 10000; | |
7823 } | |
7824 } | |
7825 | |
7826 | |
7827 //----- (0044B9C4) -------------------------------------------------------- | |
501 | 7828 bool Player::SubtractVariable(enum VariableType VarNum, signed int pValue) |
0 | 7829 { |
7830 unsigned int v3; // ebx@1 | |
7831 signed int v4; // esi@1 | |
501 | 7832 bool result; // eax@8 |
0 | 7833 int v6; // esi@11 |
7834 int v7; // edi@14 | |
7835 signed int v8; // eax@17 | |
7836 char *v9; // eax@20 | |
7837 char v10; // sf@20 | |
7838 char *v11; // ecx@26 | |
7839 char *v12; // ecx@27 | |
7840 __int64 v13; // qax@27 | |
7841 unsigned __int8 v14; // cf@27 | |
501 | 7842 int *v15; // edx@29 |
0 | 7843 char *v16; // eax@90 |
7844 char *v17; // ecx@94 | |
501 | 7845 int v18; // esi@97 |
0 | 7846 signed int v19; // edx@97 |
7847 char *v20; // ecx@98 | |
7848 int v21; // eax@100 | |
7849 __int16 v22; // dx@112 | |
7850 int v23; // [sp-8h] [bp-14h]@45 | |
7851 signed int v24; // [sp-4h] [bp-10h]@4 | |
7852 int v25; // [sp-4h] [bp-10h]@45 | |
7853 | |
7854 v3 = 0; | |
605 | 7855 v4 = uActiveCharacter - 1; |
501 | 7856 result = false; |
7857 if ( (signed int)VarNum > 222 ) | |
7858 { | |
7859 if ( (signed int)VarNum <= 307 ) | |
7860 { | |
7861 if ( VarNum == 307 ) | |
7862 { | |
7863 pParty->uNumDeaths -= (unsigned int)pValue; | |
7864 return pValue; | |
7865 } | |
7866 if ( VarNum == 223 ) | |
0 | 7867 { |
7868 v11 = (char *)pParty->_autonote_bits; | |
501 | 7869 v22 = (short)pValue - 1; |
0 | 7870 } |
7871 else | |
7872 { | |
501 | 7873 if ( VarNum != 231 ) |
0 | 7874 { |
501 | 7875 switch ( VarNum ) |
0 | 7876 { |
7877 case 232: | |
501 | 7878 VarNum = (VariableType)0; |
1094 | 7879 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int*)&VarNum); |
501 | 7880 result = (bool) pValue; |
7881 dword_5B65CC = 0; | |
7882 if ( (int)VarNum == pValue ) | |
0 | 7883 { |
501 | 7884 dword_5B65CC = (int)pValue; |
0 | 7885 } |
7886 else | |
7887 { | |
7888 pParty->field_709 = 0; | |
501 | 7889 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
1035 | 7890 pParty->CountHirelings(); |
7891 viewparams->bRedrawGameUI = true; | |
0 | 7892 } |
7893 break; | |
7894 case 241: | |
7895 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
7896 { | |
7897 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; | |
605 | 7898 for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 ) |
0 | 7899 { |
605 | 7900 if ( *((void **)v20 + 4) == (void *)pValue ) |
0 | 7901 { |
7902 v21 = *(int *)v20; | |
7903 if ( (char)*(int *)v20 < 0 ) | |
7904 { | |
7905 LOBYTE(v21) = v21 & 0x7F; | |
7906 *(int *)v20 = v21; | |
7907 } | |
7908 } | |
7909 v20 += 76; | |
7910 } | |
7911 } | |
605 | 7912 if ( pParty->pHirelings[0].uProfession == pValue ) |
0 | 7913 memset(pParty->pHirelings, 0, 0x4Cu); |
605 | 7914 if ( pParty->pHirelings[1].uProfession == pValue ) |
0 | 7915 memset(&pParty->pHirelings[1], 0, 0x4Cu); |
7916 pParty->field_709 = 0; | |
1035 | 7917 pParty->CountHirelings(); |
0 | 7918 break; |
7919 case 243: | |
7920 v17 = (char *)&this->uSkillPoints; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7921 result = *v17 != NULL; |
501 | 7922 if ( (unsigned int)pValue <= *(int *)v17 ) |
7923 { | |
7924 *(int *)v17 -= (int)pValue; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7925 result = (v17 != NULL); |
501 | 7926 } |
0 | 7927 else |
7928 *(int *)v17 = 0; | |
7929 break; | |
7930 case 275: | |
7931 v16 = (char *)&pOutdoor->ddm; | |
7932 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
7933 v16 = (char *)&pIndoor->dlv; | |
501 | 7934 *((int *)v16 + 2) -= (int)pValue; |
0 | 7935 if ( *((int *)v16 + 2) < -10000 ) |
7936 *((int *)v16 + 2) = -10000; | |
7937 break; | |
7938 case 306: | |
501 | 7939 result = VarNum - 306; |
7940 if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) | |
7941 { | |
7942 result = (bool)pValue; | |
7943 pParty->uNumGoldInBank -= (unsigned int)pValue; | |
605 | 7944 } |
0 | 7945 else |
7946 LABEL_88: | |
7947 dword_5B65C4 = 1; | |
7948 break; | |
7949 } | |
501 | 7950 return result; |
0 | 7951 } |
7952 v11 = this->field_1A50; | |
501 | 7953 v22 = (signed __int16)pValue; |
0 | 7954 } |
7955 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); | |
501 | 7956 return result; |
7957 } | |
7958 switch ( VarNum ) | |
0 | 7959 { |
7960 case 308: | |
501 | 7961 result = (bool)pValue; |
7962 pParty->uNumBountiesCollected -= (unsigned int)pValue; | |
0 | 7963 break; |
7964 case 309: | |
501 | 7965 result = (bool)pValue; |
7966 pParty->uNumPrisonTerms -= (int)pValue; | |
0 | 7967 break; |
7968 case 310: | |
501 | 7969 result = (bool)pValue; |
7970 pParty->uNumArenaPageWins -= (char)pValue; | |
0 | 7971 break; |
7972 case 311: | |
501 | 7973 result = (bool)pValue; |
7974 pParty->uNumArenaSquireWins -= (char)pValue; | |
0 | 7975 break; |
7976 case 312: | |
501 | 7977 result = (bool)pValue; |
7978 pParty->uNumArenaKnightWins -= (char)pValue; | |
0 | 7979 break; |
7980 case 313: | |
501 | 7981 result = (bool)pValue; |
7982 pParty->uNumArenaLordWins -= (char)pValue; | |
0 | 7983 break; |
7984 } | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
7985 assert(false && "Function not returning any value!"); |
0 | 7986 } |
7987 else | |
7988 { | |
501 | 7989 if ( (signed int)VarNum >= 123 ) |
7990 { | |
7991 byte_5E4C15[VarNum] -= (char)pValue; | |
0 | 7992 } |
7993 else | |
7994 { | |
501 | 7995 switch ( VarNum ) |
0 | 7996 { |
7997 case VAR_RandomGold: | |
501 | 7998 v6 = rand() % (signed int)pValue + 1; |
0 | 7999 if ( v6 > pParty->uNumGold ) |
8000 v6 = pParty->uNumGold; | |
8001 Party::TakeGold(v6); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
8002 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
8003 ShowStatusBarString(pTmpBuf.data(), 2); |
0 | 8004 GameUI_DrawFoodAndGold(); |
501 | 8005 return result; |
0 | 8006 case VAR_RandomFood: |
501 | 8007 v7 = rand() % (signed int)pValue + 1; |
0 | 8008 if ( v7 > pParty->uNumFoodRations ) |
8009 v7 = pParty->uNumFoodRations; | |
8010 Party::TakeFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
8011 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
8012 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 8013 GameUI_DrawFoodAndGold(); |
605 | 8014 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8015 v8 = 8 * v4 + 400; | |
862 | 8016 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8017 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 8018 return result; |
0 | 8019 case VAR_CurrentHP: |
1036 | 8020 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL); |
605 | 8021 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8022 v8 = 8 * v4 + 400; | |
862 | 8023 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8024 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8025 return result; | |
0 | 8026 case VAR_CurrentSP: |
8027 v9 = (char *)&this->sMana; | |
501 | 8028 v10 = this->sMana - (signed int)pValue < 0; |
8029 *(int *)v9 -= (int)pValue; | |
0 | 8030 if ( v10 ) |
8031 *(int *)v9 = 0; | |
605 | 8032 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8033 v8 = 8 * v4 + 400; | |
862 | 8034 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8035 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8036 return result; | |
0 | 8037 case VAR_ACModifier: |
501 | 8038 this->sACModifier -= (unsigned __int8)pValue; |
605 | 8039 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8040 v8 = 8 * v4 + 400; | |
862 | 8041 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8042 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8043 return result; | |
0 | 8044 case VAR_BaseLevel: |
501 | 8045 this->uLevel -= (unsigned __int8)pValue; |
605 | 8046 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8047 v8 = 8 * v4 + 400; | |
862 | 8048 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8049 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8050 return result; | |
0 | 8051 case VAR_LevelModifier: |
501 | 8052 this->sLevelModifier -= (unsigned __int8)pValue; |
605 | 8053 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8054 v8 = 8 * v4 + 400; | |
862 | 8055 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8056 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8057 return result; | |
0 | 8058 case VAR_Age: |
501 | 8059 this->sAgeModifier -= (signed __int16)pValue; |
8060 return result; | |
0 | 8061 case VAR_Award: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
8062 _449B7E_toggle_bit((unsigned char *)this->_achieved_awards_bits, (signed __int16)pValue, 0); |
605 | 8063 return result; |
0 | 8064 case VAR_Experience: |
8065 v12 = (char *)&this->uExperience; | |
501 | 8066 v13 = (signed int)pValue; |
8067 v14 = *(int *)v12 < (unsigned int)pValue; | |
8068 *(int *)v12 -= (int)pValue; | |
0 | 8069 *((int *)v12 + 1) -= v14 + HIDWORD(v13); |
605 | 8070 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8071 v8 = 8 * v4 + 400; | |
862 | 8072 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8073 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8074 return result; | |
0 | 8075 case VAR_QBits_QuestsDone: |
501 | 8076 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); |
187 | 8077 pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); |
501 | 8078 return true; |
0 | 8079 case VAR_PlayerItemInHands: |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8080 v15 = this->pInventoryMatrix; |
0 | 8081 break; |
8082 case VAR_FixedGold: | |
501 | 8083 if ( (unsigned int)pValue > pParty->uNumGold ) |
0 | 8084 goto LABEL_88; |
501 | 8085 Party::TakeGold((unsigned int)pValue); |
8086 return result; | |
0 | 8087 case VAR_MightBonus: |
8088 case VAR_ActualMight: | |
501 | 8089 this->uMightBonus -= (unsigned __int16)pValue; |
605 | 8090 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8091 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8092 v8 = 8 * v4 + 400; | |
862 | 8093 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8094 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8095 return result; | |
0 | 8096 case VAR_IntellectBonus: |
8097 case VAR_ActualIntellect: | |
501 | 8098 this->uIntelligenceBonus -= (unsigned __int16)pValue; |
605 | 8099 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8100 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8101 v8 = 8 * v4 + 400; | |
862 | 8102 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8103 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8104 return result; | |
0 | 8105 case VAR_PersonalityBonus: |
8106 case VAR_ActualPersonality: | |
501 | 8107 this->uWillpowerBonus -= (unsigned __int16)pValue; |
605 | 8108 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8109 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8110 v8 = 8 * v4 + 400; | |
862 | 8111 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8112 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8113 return result; | |
0 | 8114 case VAR_EnduranceBonus: |
8115 case VAR_ActualEndurance: | |
501 | 8116 this->uEnduranceBonus -= (unsigned __int16)pValue; |
605 | 8117 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8118 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8119 v8 = 8 * v4 + 400; | |
862 | 8120 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8121 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8122 return result; | |
0 | 8123 case VAR_SpeedBonus: |
8124 case VAR_ActualSpeed: | |
501 | 8125 this->uSpeedBonus -= (unsigned __int16)pValue; |
605 | 8126 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8127 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8128 v8 = 8 * v4 + 400; | |
862 | 8129 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8130 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8131 return result; | |
0 | 8132 case VAR_AccuracyBonus: |
8133 case VAR_ActualAccuracy: | |
501 | 8134 this->uAccuracyBonus -= (unsigned __int16)pValue; |
605 | 8135 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8136 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8137 v8 = 8 * v4 + 400; | |
862 | 8138 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8139 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8140 return result; | |
0 | 8141 case VAR_LuckBonus: |
8142 case VAR_ActualLuck: | |
501 | 8143 this->uLuckBonus -= (unsigned __int16)pValue; |
605 | 8144 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8145 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8146 v8 = 8 * v4 + 400; | |
862 | 8147 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8148 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8149 return result; | |
0 | 8150 case VAR_BaseMight: |
501 | 8151 this->uMight -= (unsigned __int16)pValue; |
605 | 8152 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8153 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8154 v8 = 8 * v4 + 400; | |
862 | 8155 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8156 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8157 return result; | |
0 | 8158 case VAR_BaseIntellect: |
501 | 8159 this->uIntelligence -= (unsigned __int16)pValue; |
605 | 8160 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8161 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8162 v8 = 8 * v4 + 400; | |
862 | 8163 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8164 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8165 return result; | |
0 | 8166 case VAR_BasePersonality: |
501 | 8167 this->uWillpower -= (unsigned __int16)pValue; |
605 | 8168 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8169 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8170 v8 = 8 * v4 + 400; | |
862 | 8171 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8172 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8173 return result; | |
0 | 8174 case VAR_BaseEndurance: |
501 | 8175 this->uEndurance -= (unsigned __int16)pValue; |
605 | 8176 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8177 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8178 v8 = 8 * v4 + 400; | |
862 | 8179 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8180 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8181 return result; | |
0 | 8182 case VAR_BaseSpeed: |
501 | 8183 this->uSpeed -= (unsigned __int16)pValue; |
605 | 8184 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8185 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8186 v8 = 8 * v4 + 400; | |
862 | 8187 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8188 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8189 return result; | |
0 | 8190 case VAR_BaseAccuracy: |
501 | 8191 this->uAccuracy -= (unsigned __int16)pValue; |
605 | 8192 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8193 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8194 v8 = 8 * v4 + 400; | |
862 | 8195 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8196 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8197 return result; | |
0 | 8198 case VAR_BaseLuck: |
501 | 8199 this->uLuck -= (unsigned __int16)pValue; |
605 | 8200 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8201 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8202 v8 = 8 * v4 + 400; | |
862 | 8203 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8204 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8205 return result; | |
0 | 8206 case VAR_FireResistance: |
501 | 8207 this->sResFireBase -= (signed __int16)pValue; |
605 | 8208 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8209 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8210 v8 = 8 * v4 + 400; | |
862 | 8211 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8212 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8213 return result; | |
0 | 8214 case VAR_AirResistance: |
501 | 8215 this->sResAirBase -= (signed __int16)pValue; |
605 | 8216 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8217 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8218 v8 = 8 * v4 + 400; | |
862 | 8219 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8220 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8221 return result; | |
0 | 8222 case VAR_WaterResistance: |
501 | 8223 this->sResWaterBase -= (signed __int16)pValue; |
605 | 8224 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8225 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8226 v8 = 8 * v4 + 400; | |
862 | 8227 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8228 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8229 return result; | |
0 | 8230 case VAR_EarthResistance: |
501 | 8231 this->sResEarthBase -= (signed __int16)pValue; |
605 | 8232 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8233 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8234 v8 = 8 * v4 + 400; | |
862 | 8235 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8236 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8237 return result; | |
0 | 8238 case VAR_SpiritResistance: |
501 | 8239 this->sResSpiritBase -= (signed __int16)pValue; |
605 | 8240 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8241 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8242 v8 = 8 * v4 + 400; | |
862 | 8243 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8244 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8245 return result; | |
0 | 8246 case VAR_MindResistance: |
501 | 8247 this->sResMindBase -= (signed __int16)pValue; |
605 | 8248 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8249 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8250 v8 = 8 * v4 + 400; | |
862 | 8251 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8252 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8253 return result; | |
0 | 8254 case VAR_BodyResistance: |
501 | 8255 this->sResBodyBase -= (signed __int16)pValue; |
605 | 8256 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8257 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8258 v8 = 8 * v4 + 400; | |
862 | 8259 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8260 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8261 return result; | |
0 | 8262 case VAR_LightResistance: |
501 | 8263 this->sResLightBase -= (signed __int16)pValue; |
605 | 8264 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8265 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8266 v8 = 8 * v4 + 400; | |
862 | 8267 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8268 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8269 return result; | |
0 | 8270 case VAR_DarkResistance: |
501 | 8271 this->sResDarkBase -= (signed __int16)pValue; |
605 | 8272 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8273 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8274 v8 = 8 * v4 + 400; | |
862 | 8275 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8276 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8277 return result; | |
0 | 8278 case VAR_MagicResistance: |
501 | 8279 this->sResMagicBase -= (signed __int16)pValue; |
605 | 8280 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8281 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8282 v8 = 8 * v4 + 400; | |
862 | 8283 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8284 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8285 return result; | |
0 | 8286 case VAR_FireResistanceBonus: |
501 | 8287 this->sResFireBonus -= (signed __int16)pValue; |
605 | 8288 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8289 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8290 v8 = 8 * v4 + 400; | |
862 | 8291 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8292 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8293 return result; | |
0 | 8294 case VAR_AirResistanceBonus: |
501 | 8295 this->sResAirBonus -= (signed __int16)pValue; |
605 | 8296 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
8297 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8298 v8 = 8 * v4 + 400; | |
862 | 8299 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8300 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8301 return result; | |
0 | 8302 case VAR_WaterResistanceBonus: |
501 | 8303 this->sResWaterBonus -= (signed __int16)pValue; |
605 | 8304 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8305 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8306 v8 = 8 * v4 + 400; | |
862 | 8307 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8308 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8309 return result; | |
0 | 8310 case VAR_EarthResistanceBonus: |
501 | 8311 this->sResEarthBonus -= (signed __int16)pValue; |
605 | 8312 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8313 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8314 v8 = 8 * v4 + 400; | |
862 | 8315 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8316 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8317 return result; | |
0 | 8318 case VAR_SpiritResistanceBonus: |
501 | 8319 this->sResSpiritBonus -= (signed __int16)pValue; |
605 | 8320 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8321 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8322 v8 = 8 * v4 + 400; | |
862 | 8323 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8324 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8325 return result; | |
0 | 8326 case VAR_MindResistanceBonus: |
501 | 8327 this->sResMindBonus -= (signed __int16)pValue; |
605 | 8328 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8329 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8330 v8 = 8 * v4 + 400; | |
862 | 8331 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8332 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8333 return result; | |
0 | 8334 case VAR_BodyResistanceBonus: |
501 | 8335 this->sResBodyBonus -= (signed __int16)pValue; |
605 | 8336 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8337 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8338 v8 = 8 * v4 + 400; | |
862 | 8339 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8340 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8341 return result; | |
0 | 8342 case VAR_LightResistanceBonus: |
501 | 8343 this->sResLightBonus -= (signed __int16)pValue; |
605 | 8344 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8345 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8346 v8 = 8 * v4 + 400; | |
862 | 8347 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8348 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8349 return result; | |
0 | 8350 case VAR_DarkResistanceBonus: |
501 | 8351 this->sResDarkBonus -= (signed __int16)pValue; |
605 | 8352 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
8353 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
8354 v8 = 8 * v4 + 400; | |
862 | 8355 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8356 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8357 return result; | |
0 | 8358 case VAR_MagicResistanceBonus: |
501 | 8359 this->sResMagicBonus -= (signed __int16)pValue; |
0 | 8360 v25 = 0; |
187 | 8361 v23 = SPEECH_91; |
8362 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); | |
605 | 8363 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8364 v8 = 8 * v4 + 400; | |
862 | 8365 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8366 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8367 return result; | |
0 | 8368 case VAR_FixedFood: |
501 | 8369 Party::TakeFood((unsigned int)pValue); |
605 | 8370 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8371 v8 = 8 * v4 + 400; | |
862 | 8372 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8373 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8374 return result; | |
0 | 8375 case VAR_StaffSkill: |
8376 case VAR_SwordSkill: | |
8377 case VAR_DaggerSkill: | |
8378 case VAR_AxeSkill: | |
8379 case VAR_SpearSkill: | |
8380 case VAR_BowSkill: | |
8381 case VAR_MaceSkill: | |
8382 case VAR_BlasterSkill: | |
8383 case VAR_ShieldSkill: | |
8384 case VAR_LeatherSkill: | |
8385 case VAR_SkillChain: | |
8386 case VAR_PlateSkill: | |
8387 case VAR_FireSkill: | |
8388 case VAR_AirSkill: | |
8389 case VAR_WaterSkill: | |
8390 case VAR_EarthSkill: | |
8391 case VAR_SpiritSkill: | |
8392 case VAR_MindSkill: | |
8393 case VAR_BodySkill: | |
8394 case VAR_LightSkill: | |
8395 case VAR_DarkSkill: | |
8396 case VAR_IdentifyItemSkill: | |
8397 case VAR_MerchantSkill: | |
8398 case VAR_RepairSkill: | |
8399 case VAR_BodybuildingSkill: | |
8400 case VAR_MeditationSkill: | |
8401 case VAR_PerceptionSkill: | |
8402 case VAR_DiplomacySkill: | |
8403 case VAR_DisarmTrapSkill: | |
8404 case VAR_LearningSkill: | |
501 | 8405 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue; |
605 | 8406 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8407 v8 = 8 * v4 + 400; | |
862 | 8408 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 8409 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
8410 return result; | |
0 | 8411 case VAR_Cursed: |
8412 case VAR_Weak: | |
8413 case VAR_Asleep: | |
8414 case VAR_Afraid: | |
8415 case VAR_Drunk: | |
8416 case VAR_Insane: | |
8417 case VAR_PoisonedGreen: | |
8418 case VAR_DiseasedGreen: | |
8419 case VAR_PoisonedYellow: | |
8420 case VAR_DiseasedYellow: | |
8421 case VAR_PoisonedRed: | |
8422 case VAR_DiseasedRed: | |
8423 case VAR_Paralyzed: | |
8424 case VAR_Unconsious: | |
8425 case VAR_Dead: | |
8426 case VAR_Stoned: | |
8427 case VAR_Eradicated: | |
1071 | 8428 //*((int *)this + 2 * VarNum - 210) = 0; |
8429 //*((int *)this + 2 * result - 209) = 0; | |
8430 this->pConditions[VarNum] = 0; | |
0 | 8431 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
8432 v8 = 8 * v4 + 400; | |
862 | 8433 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
0 | 8434 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 8435 return result; |
605 | 8436 default: |
8437 return result; | |
8438 } | |
8439 for (v3 = 1; v3 < 126; v3++) | |
8440 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8441 if ( *(&this->pInventoryItemList[pInventoryMatrix[v3] - 1].uItemID) == pValue ) |
0 | 8442 { |
605 | 8443 RemoveItemAtInventoryIndex(v3); |
501 | 8444 return true; |
0 | 8445 } |
605 | 8446 } |
501 | 8447 if ( pParty->pPickedItem.uItemID == pValue ) |
8448 { | |
605 | 8449 pMouse->RemoveHoldingItem(); |
8450 return true; | |
8451 } | |
8452 return false; | |
0 | 8453 } |
8454 } | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
8455 |
1430 | 8456 //assert(false); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
8457 return false; |
0 | 8458 } |
8459 // 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
|
8460 // 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
|
8461 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8462 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8463 //----- (00467E7F) -------------------------------------------------------- |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8464 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
|
8465 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8466 //unsigned int v1; // esi@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8467 int v2; // ebx@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8468 Player *v3; // eax@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8469 int v4; // edx@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8470 int v5; // esi@2 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8471 //int v6; // eax@2 |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
8472 int v7; // eax@3 |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8473 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
|
8474 //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
|
8475 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
|
8476 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
|
8477 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8478 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8479 _this.Reset(); |
1374 | 8480 v2 = pEquipTypeToBodyAnchor[uEquipType]; |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8481 v3 = pPlayers[uActiveCharacter]; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8482 v11 = (int *)&v3->pEquipment.pIndices[v2]; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8483 v4 = *v11; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8484 v10 = *v11; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8485 if ( v10 ) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8486 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8487 memcpy(&_this, &pParty->pPickedItem, sizeof(_this)); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8488 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
|
8489 *(char *)(v5 + 556) = 0; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8490 pParty->pPickedItem.Reset(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8491 pParty->SetHoldingItem((ItemGen *)(v5 + 532)); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8492 _this.uBodyAnchor = v2 + 1; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8493 memcpy((void *)(v5 + 532), &_this, 0x24u); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8494 *v11 = v10; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8495 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8496 else |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8497 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8498 v7 = v3->FindFreeInventoryListSlot(); |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8499 if (v7 >= 0) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8500 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8501 pParty->pPickedItem.uBodyAnchor = v2 + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8502 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
|
8503 *v11 = v7 + 1; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8504 pMouse->RemoveHoldingItem(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8505 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
8506 } |
1295 | 8507 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8508 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8509 |
1295 | 8510 //----- (0049387A) -------------------------------------------------------- |
1459 | 8511 int CycleCharacter(bool backwards) |
1295 | 8512 { |
8513 signed int result; // eax@1 | |
8514 signed int v2; // ecx@2 | |
8515 signed int v3; // ecx@8 | |
8516 | |
8517 result = uActiveCharacter; | |
1459 | 8518 if ( backwards ) |
1295 | 8519 { |
8520 v2 = 0; | |
8521 while ( 1 ) | |
8522 { | |
8523 --result; | |
8524 if ( result < 1 ) | |
8525 result = 4; | |
8526 if ( !pPlayers[result]->uTimeToRecovery ) | |
8527 break; | |
8528 ++v2; | |
8529 if ( v2 >= 4 ) | |
8530 return uActiveCharacter; | |
8531 } | |
8532 } | |
8533 else | |
8534 { | |
8535 v3 = 0; | |
8536 while ( 1 ) | |
8537 { | |
8538 ++result; | |
8539 if ( result > 4 ) | |
8540 result = 1; | |
8541 if ( !pPlayers[result]->uTimeToRecovery ) | |
8542 break; | |
8543 ++v3; | |
8544 if ( v3 >= 4 ) | |
8545 return uActiveCharacter; | |
8546 } | |
8547 } | |
8548 return result; | |
1297 | 8549 } |
8550 //----- (0043EE77) -------------------------------------------------------- | |
8551 bool __fastcall sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(signed int a1) | |
8552 { | |
8553 bool result; // eax@0 | |
8554 Player *v2; // edx@3 | |
8555 int v3; // ecx@3 | |
8556 Player **pPlayers; // esi@8 | |
1424 | 8557 //bool item_flag; |
1297 | 8558 Player *v6; // edx@9 |
8559 | |
1424 | 8560 //if ( a1 < 1 || a1 > 4 ) |
8561 //{ | |
8562 //if ( !a1 ) | |
8563 //{ | |
8564 //pPlayers = &::pPlayers[1]; | |
8565 //v5 = 604; | |
8566 //while ( 1 ) | |
8567 assert ( a1 > 0 && a1 < 5 ); | |
1432 | 8568 for ( uint i = 1; i < 5; ++i ) |
1424 | 8569 { |
8570 //item_flag = Player_has_item(604, *pPlayers, 0); | |
8571 if ( !Player_has_item(604, ::pPlayers[i], 0) ) | |
8572 return false; | |
8573 //__debugbreak(); // player.cpp(8748): warning C4700: uninitialized local variable 'v6' used | |
8574 //result = ::pPlayers[i]->pEquipment.uArmor; | |
8575 if ( !::pPlayers[i]->pEquipment.uArmor ) | |
8576 return false; | |
8577 //result *= 9; | |
1432 | 8578 if (::pPlayers[i]->pEquippedItems[::pPlayers[i]->pEquipment.uArmor].uItemID != 604 ) |
1424 | 8579 return false; |
8580 //++pPlayers; | |
8581 //if ( (signed int)pPlayers >= (signed int)&qword_A750D8 ) | |
8582 //return true; | |
8583 } | |
8584 return true; | |
8585 } | |
1432 | 8586 |
1297 | 8587 //----- (0043EE15) -------------------------------------------------------- |
8588 bool __fastcall Player_has_item(unsigned int uItemID, Player *pPlayer, char a3) | |
8589 { | |
8590 if ( !a3 || pParty->pPickedItem.uItemID != uItemID ) | |
8591 { | |
8592 for ( uint i = 0; i < 126; ++i ) | |
8593 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8594 if ( pPlayer->pInventoryMatrix[i] > 0 ) |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8595 { |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8596 if ( (unsigned int)pPlayer->pInventoryItemList[pPlayer->pInventoryMatrix[i] - 1].uItemID == uItemID ) |
1297 | 8597 return true; |
8598 } | |
8599 } | |
8600 for ( uint i = 0; i < 16; ++i ) | |
8601 { | |
8602 if ( pPlayer->pEquipment.pIndices[i] ) | |
8603 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
8604 if ( (unsigned int)pPlayer->pInventoryItemList[pPlayer->pEquipment.pIndices[i] - 1].uItemID == uItemID ) |
1297 | 8605 return true; |
8606 } | |
8607 } | |
8608 } | |
8609 return false; | |
8610 } | |
8611 //----- (0043EDB9) -------------------------------------------------------- | |
1458 | 8612 bool sub_43EDB9_get_some_race_sex_relation_2(unsigned int a1) |
1297 | 8613 { |
8614 unsigned int pNum; // ebp@1 | |
8615 Player **pPlayer; // ebx@1 | |
8616 Player *pPlayer2; // esi@2 | |
8617 enum CHARACTER_RACE pRace; // edi@2 | |
8618 bool pSex; // eax@2 | |
8619 char v6; // zf@7 | |
8620 | |
8621 //pPlayer = &pPlayers[1]; | |
8622 /*pNum = a1; | |
8623 | |
8624 while ( 1 ) | |
8625 { | |
8626 pPlayer2 = *pPlayer; | |
8627 pRace = pPlayer2->GetRace(); | |
8628 pSex = pPlayer2->GetSexByVoice(); | |
8629 if ( !pRace ) | |
8630 break; | |
8631 if ( pRace == 1 || pRace == 2 ) | |
8632 break; | |
8633 if ( !pSex && pNum == 2 )// | |
8634 //goto LABEL_15; | |
8635 { | |
8636 pSex = 1; | |
8637 return pSex; | |
8638 } | |
8639 v6 = pNum == 3;// | |
8640 LABEL_11: | |
8641 if ( v6 ) | |
8642 //goto LABEL_15; | |
8643 { | |
8644 pSex = 1; | |
8645 return pSex; | |
8646 } | |
8647 ++pPlayer; | |
8648 if ( (signed int)pPlayer >= (signed int)&qword_A750D8 )// | |
8649 { | |
8650 pSex = 0; | |
8651 return pSex; | |
8652 } | |
8653 } | |
8654 if ( pSex || pNum ) | |
8655 { | |
8656 v6 = pNum == 1; | |
8657 goto LABEL_11; | |
8658 } | |
8659 //LABEL_15: | |
8660 pSex = 1; | |
8661 return pSex;*/ | |
8662 for (uint i = 1; i <= 4; ++i) | |
8663 { | |
8664 pRace = pPlayers[i]->GetRace(); | |
8665 pSex = pPlayers[i]->GetSexByVoice(); | |
8666 if (pRace == 0 || pRace == 1 || pRace == 2 || pSex == 0 ) | |
8667 return 1; | |
8668 } | |
8669 return 0; | |
8670 } | |
8671 //----- (0043ED6F) -------------------------------------------------------- | |
8672 bool _43ED6F_check_party_races(bool a1) | |
8673 { | |
8674 bool v6; // zf@5 | |
8675 | |
8676 for (uint i = 0; i < 4; ++i) | |
8677 { | |
8678 auto player = pParty->pPlayers + i; | |
8679 auto race = player->GetRace(); | |
8680 | |
8681 if (race != CHARACTER_RACE_HUMAN && | |
8682 race != CHARACTER_RACE_ELF && | |
8683 race != CHARACTER_RACE_GOBLIN) | |
8684 v6 = a1 == 1; | |
8685 else | |
8686 v6 = !a1; | |
8687 | |
8688 if (v6) | |
8689 return true; | |
8690 } | |
8691 return false; | |
8692 } | |
8693 //----- (00439FCB) -------------------------------------------------------- | |
8694 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int a2, Vec3_int_ *pPos, unsigned int a4) | |
8695 { | |
8696 signed int v4; // esi@1 | |
8697 unsigned int v5; // ecx@1 | |
8698 Player *v6; // ebx@3 | |
8699 Actor *v7; // esi@3 | |
8700 unsigned int v8; // eax@4 | |
8701 char *v9; // eax@5 | |
8702 signed int v10; // eax@6 | |
8703 int v11; // edx@8 | |
8704 int v12; // edx@9 | |
8705 int v13; // edx@10 | |
8706 int v14; // edx@16 | |
8707 int v15; // edx@17 | |
8708 int v16; // edx@18 | |
8709 enum SoundID v17; // eax@24 | |
8710 int v18; // eax@26 | |
8711 unsigned __int8 v19; // zf@26 | |
8712 unsigned __int8 v20; // sf@26 | |
8713 unsigned __int16 v21; // ax@29 | |
8714 signed int v22; // edi@36 | |
8715 int v23; // eax@38 | |
8716 signed int v24; // eax@44 | |
8717 unsigned __int16 v25; // cx@47 | |
8718 signed int v26; // eax@49 | |
8719 int v27; // eax@54 | |
8720 float v28; // ST18_4@58 | |
8721 double v29; // st7@58 | |
8722 float v30; // ST08_4@58 | |
8723 double v31; // st7@58 | |
8724 float v32; // ST04_4@58 | |
8725 float v33; // ST00_4@58 | |
8726 int v34; // edi@61 | |
8727 int v35; // eax@70 | |
8728 double v36; // st7@70 | |
8729 SpriteObject *v37; // ebx@77 | |
8730 int v38; // edi@77 | |
8731 int v39; // esi@77 | |
8732 int v40; // eax@77 | |
8733 int v41; // eax@77 | |
8734 int v42; // eax@78 | |
8735 Player *v43; // eax@81 | |
8736 Actor *v44; // esi@82 | |
8737 Player *v45; // edi@84 | |
8738 unsigned __int16 v46; // ax@84 | |
8739 int v47; // ebx@105 | |
8740 int v48; // eax@107 | |
8741 unsigned __int16 v49; // ax@116 | |
8742 int v50; // ebx@123 | |
8743 unsigned __int16 v51; // ax@124 | |
8744 char v52; // bl@124 | |
8745 int v53; // eax@128 | |
8746 signed int v54; // eax@134 | |
8747 unsigned __int16 v55; // cx@137 | |
8748 signed int v56; // eax@139 | |
8749 int v57; // eax@144 | |
8750 float v58; // ST18_4@148 | |
8751 double v59; // st7@148 | |
8752 float v60; // ST08_4@148 | |
8753 double v61; // st7@148 | |
8754 float v62; // ST04_4@148 | |
8755 float v63; // ST00_4@148 | |
8756 int v64; // ebx@151 | |
8757 int v65; // eax@161 | |
8758 double v66; // st7@161 | |
8759 signed int v67; // ecx@164 | |
8760 signed int v68; // eax@170 | |
8761 int v69; // ecx@170 | |
8762 int v70; // eax@171 | |
8763 enum SoundID v71; // [sp+20h] [bp-34h]@12 | |
8764 int v72; // [sp+30h] [bp-24h]@164 | |
8765 double v73; // [sp+40h] [bp-14h]@72 | |
8766 signed int v74; // [sp+44h] [bp-10h]@1 | |
8767 unsigned int v75; // [sp+48h] [bp-Ch]@3 | |
8768 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 | |
8769 int v77; // [sp+50h] [bp-4h]@26 | |
8770 signed int a4a; // [sp+60h] [bp+Ch]@162 | |
8771 Player *a4b; // [sp+60h] [bp+Ch]@168 | |
8772 | |
8773 v4 = PID_ID(uObjID); | |
8774 v5 = PID_TYPE(uObjID) - 2; | |
8775 v74 = a2; | |
8776 uActorID = v4; | |
8777 if ( v5 ) | |
8778 { | |
8779 if ( v5 != 1 | |
8780 || (v6 = &pParty->pPlayers[a4], v7 = &pActors[v4], | |
8781 v75 = v6->sHealth, | |
8782 !stru_50C198.ActorHitOrMiss(v7, v6)) ) | |
8783 return; | |
8784 v8 = v6->pEquipment.uArmor; | |
8785 if ( !v8 | |
8786 || (v9 = (char *)v6 + 36 * v8, v9[516] & 2) | |
8787 || (v10 = pItemsTable->pItems[*((int *)v9 + 124)].uSkillType, v10 < 10) | |
8788 || v10 > 11 ) | |
8789 { | |
8790 v14 = rand() % 4; | |
8791 if ( !v14 ) | |
8792 { | |
8793 v71 = (SoundID)108; | |
8794 goto LABEL_24; | |
8795 } | |
8796 v15 = v14 - 1; | |
8797 if ( !v15 ) | |
8798 { | |
8799 v71 = (SoundID)109; | |
8800 goto LABEL_24; | |
8801 } | |
8802 v16 = v15 - 1; | |
8803 if ( !v16 ) | |
8804 { | |
8805 v71 = (SoundID)110; | |
8806 goto LABEL_24; | |
8807 } | |
8808 if ( v16 == 1 ) | |
8809 { | |
8810 v71 = (SoundID)44; | |
8811 goto LABEL_24; | |
8812 } | |
8813 } | |
8814 else | |
8815 { | |
8816 v11 = rand() % 4; | |
8817 if ( !v11 ) | |
8818 { | |
8819 v71 = (SoundID)105; | |
8820 goto LABEL_24; | |
8821 } | |
8822 v12 = v11 - 1; | |
8823 if ( !v12 ) | |
8824 { | |
8825 v71 = (SoundID)106; | |
8826 goto LABEL_24; | |
8827 } | |
8828 v13 = v12 - 1; | |
8829 if ( !v13 ) | |
8830 { | |
8831 v71 = (SoundID)107; | |
8832 goto LABEL_24; | |
8833 } | |
8834 if ( v13 == 1 ) | |
8835 { | |
8836 v71 = (SoundID)45; | |
8837 LABEL_24: | |
8838 v17 = v71; | |
8839 goto LABEL_26; | |
8840 } | |
8841 } | |
8842 v17 = (SoundID)a4; | |
8843 LABEL_26: | |
8844 pAudioPlayer->PlaySound(v17, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); | |
8845 v18 = Actor::_43B3E0_CalcDamage(v7, v74); | |
8846 v19 = HIDWORD(v7->pActorBuffs[3].uExpireTime) == 0; | |
8847 v20 = SHIDWORD(v7->pActorBuffs[3].uExpireTime) < 0; | |
8848 v77 = v18; | |
8849 if ( !v20 && (!(v20 | v19) || LODWORD(v7->pActorBuffs[3].uExpireTime) > 0) ) | |
8850 { | |
8851 v21 = v7->pActorBuffs[3].uPower; | |
8852 if ( v21 ) | |
8853 v77 /= (signed int)v21; | |
8854 } | |
8855 if ( v74 ) | |
8856 { | |
8857 if ( v74 == 1 ) | |
8858 { | |
8859 v22 = v7->pMonsterInfo.uAttack2Type; | |
8860 } | |
8861 else | |
8862 { | |
8863 if ( v74 == 2 ) | |
8864 { | |
8865 v23 = v7->pMonsterInfo.uSpell1ID; | |
8866 } | |
8867 else | |
8868 { | |
8869 if ( v74 != 3 ) | |
8870 { | |
8871 if ( v74 == 4 ) | |
8872 v22 = v7->pMonsterInfo.field_3C_some_special_attack; | |
8873 else | |
8874 v22 = 4; | |
8875 goto LABEL_43; | |
8876 } | |
8877 v23 = v7->pMonsterInfo.uSpell2ID; | |
8878 } | |
8879 v22 = LOBYTE(pSpellStats->pInfos[v23].uSchool); | |
8880 } | |
8881 } | |
8882 else | |
8883 { | |
8884 v22 = v7->pMonsterInfo.uAttack1Type; | |
8885 } | |
8886 LABEL_43: | |
8887 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
8888 { | |
8889 v24 = v6->ReceiveDamage(v77, (DAMAGE_TYPE)v22); | |
8890 if ( SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) >= 0 | |
8891 && (SHIDWORD(v6->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v6->pPlayerBuffs[10].uExpireTime)) ) | |
8892 { | |
8893 v25 = v7->uAIState; | |
8894 if ( v25 != 5 ) | |
8895 { | |
8896 if ( v25 != 4 ) | |
8897 { | |
8898 v26 = stru_50C198.CalcMagicalDamageToActor(v7, v22, v24); | |
8899 v7->sCurrentHP -= v26; | |
8900 if ( v26 ) | |
8901 { | |
8902 if ( v7->sCurrentHP >= 1 ) | |
8903 { | |
8904 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); | |
8905 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8906 } | |
8907 else | |
8908 { | |
8909 if ( pMonsterStats->pInfos[v7->pMonsterInfo.uID].bQuestMonster & 1 ) | |
8910 { | |
8911 v27 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v7->uActorRadius : v7->uActorRadius; | |
8912 v74 = v27; | |
8913 if ( pRenderer->pRenderD3D ) | |
8914 { | |
8915 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | |
8916 { | |
8917 v28 = (double)v74; | |
8918 v74 = v7->vPosition.z; | |
8919 v29 = (double)v74; | |
8920 v74 = v7->vPosition.y; | |
8921 v30 = v29; | |
8922 v31 = (double)v74; | |
8923 v74 = v7->vPosition.x; | |
8924 v32 = v31; | |
8925 v33 = (double)v74; | |
8926 pDecalBuilder->AddBloodsplat(v33, v32, v30, 1.0, 0.0, 0.0, v28, 0, 0); | |
8927 } | |
8928 } | |
8929 } | |
8930 Actor::Die(uActorID); | |
8931 Actor::ApplyFineForKillingPeasant(uActorID); | |
8932 Actor::AggroSurroundingPeasants(uActorID, 1); | |
8933 if ( v7->pMonsterInfo.uExp ) | |
8934 GivePartyExp(pMonsterStats->pInfos[v7->pMonsterInfo.uID].uExp); | |
8935 v34 = SPEECH_51; | |
8936 if ( rand() % 100 < 20 ) | |
8937 v34 = ((signed int)v7->pMonsterInfo.uHP >= 100) + 1; | |
8938 v6->PlaySound((PlayerSpeech)v34, 0); | |
8939 } | |
8940 } | |
8941 } | |
8942 } | |
8943 } | |
8944 if ( !(dword_6BE368_debug_settings_2 & 0x10) | |
8945 && v7->pMonsterInfo.uSpecialAttack | |
8946 && rand() % 100 < v7->pMonsterInfo.uLevel * v7->pMonsterInfo.uSpecialAttackType ) | |
8947 v6->_48DCF6(v7->pMonsterInfo.uSpecialAttack, v7); | |
8948 } | |
8949 if ( !pParty->bTurnBasedModeOn ) | |
8950 { | |
8951 v35 = v6->GetActualEndurance(); | |
8952 v36 = (double)(20 - v6->GetParameterBonus(v35)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333; | |
8953 v6->SetRecoveryTime((signed __int64)v36); | |
8954 } | |
8955 if ( v77 ) | |
8956 { | |
8957 v73 = (double)(signed int)v75; | |
8958 if ( (double)v6->GetMaxHealth() * 0.25 < v73 ) | |
8959 { | |
8960 if ( v6->sHealth > 0 ) | |
8961 { | |
8962 if ( (double)v6->GetMaxHealth() * 0.25 >= (double)v6->sHealth ) | |
8963 v6->PlaySound(SPEECH_48, 0); | |
8964 } | |
8965 } | |
8966 } | |
8967 viewparams->bRedrawGameUI = 1; | |
8968 return; | |
8969 } | |
8970 v37 = &pSpriteObjects[uActorID]; | |
8971 v38 = PID_TYPE(v37->spell_caster_pid); | |
8972 v39 = PID_ID(v37->spell_caster_pid); | |
8973 v40 = PID_TYPE(v37->spell_caster_pid); | |
8974 uActorID = PID_ID(v37->spell_caster_pid); | |
8975 v41 = v40 - 2; | |
8976 if ( !v41 ) | |
8977 goto LABEL_80; | |
8978 v42 = v41 - 1; | |
8979 if ( !v42 ) | |
8980 { | |
8981 v44 = &pActors[v39]; | |
8982 if ( a4 == -1 ) | |
8983 a4 = stru_50C198.which_player_would_attack(v44); | |
8984 v45 = &pParty->pPlayers[a4]; | |
8985 v77 = Actor::_43B3E0_CalcDamage(v44, v74); | |
8986 v46 = v37->uType; | |
8987 if ( v37->uType == 545 ) | |
8988 { | |
8989 LOBYTE(v51) = v45->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
8990 v52 = v51; | |
8991 if ( (signed int)SkillToMastery(v51) >= 4 && rand() % 100 < (v52 & 0x3F) ) | |
8992 { | |
8993 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], v45->pName); | |
8994 ShowStatusBarString(pTmpBuf.data(), 2u); | |
8995 v45->PlaySound(SPEECH_6, 0); | |
8996 return; | |
8997 } | |
8998 } | |
8999 else | |
9000 { | |
9001 if ( v46 != 555 | |
9002 && v46 != 510 | |
9003 && v46 != 500 | |
9004 && v46 != 515 | |
9005 && v46 != 505 | |
9006 && v46 != 530 | |
9007 && v46 != 525 | |
9008 && v46 != 520 | |
9009 && v46 != 535 | |
9010 && v46 != 540 ) | |
9011 goto LABEL_115; | |
9012 } | |
9013 if ( !stru_50C198.ActorHitOrMiss(v44, v45) ) | |
9014 return; | |
9015 if ( (signed __int64)v45->pPlayerBuffs[13].uExpireTime > 0 ) | |
9016 v77 >>= 1; | |
9017 if ( v45->HasEnchantedItemEquipped(36) ) | |
9018 v77 >>= 1; | |
9019 if ( v45->HasEnchantedItemEquipped(69) ) | |
9020 v77 >>= 1; | |
9021 if ( v45->HasItemEquipped(EQUIP_ARMOUR) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
9022 && *(_DWORD *)&v45->pInventoryItemList[v45->pEquipment.uArmor-1] == 504 ) |
1297 | 9023 v77 >>= 1; |
9024 v75 = 0; | |
9025 v47 = (int)&v45->pEquipment; | |
9026 do | |
9027 { | |
9028 if ( v45->HasItemEquipped((ITEM_EQUIP_TYPE)v75) ) | |
9029 { | |
9030 v48 = *(int *)&v45[36 * *(int *)v47 + 496]; | |
9031 if ( v48 == 520 ) | |
9032 v77 >>= 1; | |
9033 if ( v48 == 531 ) | |
9034 v77 >>= 1; | |
9035 if ( v45->GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v75) == EQUIP_SHIELD && SkillToMastery(v45->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4 ) | |
9036 v77 >>= 1; | |
9037 } | |
9038 ++v75; | |
9039 v47 += 4; | |
9040 } | |
9041 while ( (signed int)v75 <= 1 ); | |
9042 LABEL_115: | |
9043 if ( (signed __int64)v44->pActorBuffs[3].uExpireTime > 0 ) | |
9044 { | |
9045 v49 = v44->pActorBuffs[3].uPower; | |
9046 if ( v49 ) | |
9047 v77 /= (signed int)v49; | |
9048 } | |
9049 if ( !v74 ) | |
9050 { | |
9051 v50 = v44->pMonsterInfo.uAttack1Type; | |
9052 goto LABEL_133; | |
9053 } | |
9054 if ( v74 == 1 ) | |
9055 { | |
9056 v50 = v44->pMonsterInfo.uAttack2Type; | |
9057 goto LABEL_133; | |
9058 } | |
9059 if ( v74 == 2 ) | |
9060 { | |
9061 v53 = v44->pMonsterInfo.uSpell1ID; | |
9062 } | |
9063 else | |
9064 { | |
9065 if ( v74 != 3 ) | |
9066 { | |
9067 if ( v74 == 4 ) | |
9068 v50 = v44->pMonsterInfo.field_3C_some_special_attack; | |
9069 else | |
9070 v50 = 4; | |
9071 LABEL_133: | |
9072 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) | |
9073 { | |
9074 v54 = v45->ReceiveDamage(v77, (DAMAGE_TYPE)v50); | |
9075 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) >= 0 ) | |
9076 { | |
9077 if ( SHIDWORD(v45->pPlayerBuffs[10].uExpireTime) > 0 || LODWORD(v45->pPlayerBuffs[10].uExpireTime) ) | |
9078 { | |
9079 v55 = v44->uAIState; | |
9080 if ( v55 != 5 ) | |
9081 { | |
9082 if ( v55 != 4 ) | |
9083 { | |
9084 v56 = stru_50C198.CalcMagicalDamageToActor(v44, v50, v54); | |
9085 v44->sCurrentHP -= v56; | |
9086 if ( v56 ) | |
9087 { | |
9088 if ( v44->sCurrentHP >= 1 ) | |
9089 { | |
9090 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); | |
9091 Actor::AggroSurroundingPeasants(uActorID, 1); | |
9092 } | |
9093 else | |
9094 { | |
9095 if ( pMonsterStats->pInfos[v44->pMonsterInfo.uID].bQuestMonster & 1 ) | |
9096 { | |
9097 v57 = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * v44->uActorRadius : v44->uActorRadius; | |
9098 v75 = v57; | |
9099 if ( pRenderer->pRenderD3D ) | |
9100 { | |
9101 if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) | |
9102 { | |
9103 v58 = (double)(signed int)v75; | |
9104 v75 = v44->vPosition.z; | |
9105 v59 = (double)(signed int)v75; | |
9106 v75 = v44->vPosition.y; | |
9107 v60 = v59; | |
9108 v61 = (double)(signed int)v75; | |
9109 v75 = v44->vPosition.x; | |
9110 v62 = v61; | |
9111 v63 = (double)(signed int)v75; | |
9112 pDecalBuilder->AddBloodsplat(v63, v62, v60, 1.0, 0.0, 0.0, v58, 0, 0); | |
9113 } | |
9114 } | |
9115 } | |
9116 Actor::Die(uActorID); | |
9117 Actor::ApplyFineForKillingPeasant(uActorID); | |
9118 Actor::AggroSurroundingPeasants(uActorID, 1); | |
9119 if ( v44->pMonsterInfo.uExp ) | |
9120 GivePartyExp(pMonsterStats->pInfos[v44->pMonsterInfo.uID].uExp); | |
9121 v64 = SPEECH_51; | |
9122 if ( rand() % 100 < 20 ) | |
9123 v64 = ((signed int)v44->pMonsterInfo.uHP >= 100) + 1; | |
9124 v45->PlaySound((PlayerSpeech)v64, 0); | |
9125 } | |
9126 } | |
9127 } | |
9128 } | |
9129 } | |
9130 } | |
9131 } | |
9132 if ( !v74 | |
9133 && !(dword_6BE368_debug_settings_2 & 0x10) | |
9134 && v44->pMonsterInfo.uSpecialAttack | |
9135 && rand() % 100 < v44->pMonsterInfo.uLevel * v44->pMonsterInfo.uSpecialAttackType ) | |
9136 v45->_48DCF6(v44->pMonsterInfo.uSpecialAttack, v44); | |
9137 if ( !pParty->bTurnBasedModeOn ) | |
9138 { | |
9139 v65 = v45->GetActualEndurance(); | |
9140 v66 = (double)(20 - v45->GetParameterBonus(v65)) | |
9141 * flt_6BE3A4_debug_recmod1 | |
9142 * 2.133333333333333; | |
9143 v45->SetRecoveryTime((signed __int64)v66); | |
9144 } | |
9145 return; | |
9146 } | |
9147 v53 = v44->pMonsterInfo.uSpell2ID; | |
9148 } | |
9149 v50 = LOBYTE(pSpellStats->pInfos[v53].uSchool); | |
9150 goto LABEL_133; | |
9151 } | |
9152 if ( v42 != 1 ) | |
9153 return; | |
9154 LABEL_80: | |
9155 if ( a4 != -1 ) | |
9156 { | |
9157 v43 = &pParty->pPlayers[a4]; | |
9158 LABEL_168: | |
9159 a4b = v43; | |
9160 if ( v38 != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) | |
9161 { | |
9162 v70 = v43->GetMaxHealth(); | |
9163 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, v70); | |
9164 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); | |
9165 } | |
9166 else | |
9167 { | |
9168 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); | |
9169 v69 = 0; | |
9170 } | |
9171 a4b->ReceiveDamage(v68, (DAMAGE_TYPE)v69); | |
9172 if ( v38 == OBJECT_Player && !qword_A750D8 ) | |
9173 { | |
9174 qword_A750D8 = 256i64; | |
1406 | 9175 PlayerSpeechID = SPEECH_44; |
1407 | 9176 uSpeakingCharacter = uActorID + 1; |
1297 | 9177 } |
9178 return; | |
9179 } | |
9180 v74 = 0; | |
9181 a4a = 1; | |
9182 do | |
9183 { | |
9184 if ( pPlayers[a4a]->CanAct() ) | |
9185 { | |
9186 v67 = v74++; | |
9187 *(&v72 + v67) = a4a; | |
9188 } | |
9189 ++a4a; | |
9190 } | |
9191 while ( a4a <= 4 ); | |
9192 if ( v74 ) | |
9193 { | |
9194 v43 = &pParty->pPlayers[*(&v72+rand()%v74)-1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; | |
9195 goto LABEL_168; | |
9196 } | |
9197 } | |
9198 //----- (00421EA6) -------------------------------------------------------- | |
1458 | 9199 void OnInventoryLeftClick() |
1297 | 9200 { |
9201 Player *v0; // ebx@1 | |
9202 signed int v1; // eax@2 | |
9203 signed int v2; // ecx@2 | |
9204 int v3; // eax@2 | |
9205 char v4; // sf@2 | |
9206 int v5; // eax@2 | |
9207 unsigned int v6; // eax@7 | |
9208 unsigned int v7; // esi@12 | |
9209 unsigned int v8; // eax@12 | |
9210 unsigned int v9; // eax@16 | |
9211 unsigned int v10; // eax@18 | |
9212 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
9213 POINT a2; // [sp+30h] [bp-18h]@4 | |
9214 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
9215 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
9216 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
9217 int a4; // [sp+44h] [bp-4h]@2 | |
9218 | |
9219 v0 = pPlayers[uActiveCharacter]; | |
9220 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) | |
9221 { | |
9222 pMouse->GetClickPos(&pX, &pY); | |
9223 pY = pY - 17; | |
9224 v2 =pX - 14; | |
9225 pX = v2; | |
9226 v3 = 14 * (pY >> 5); | |
9227 v2 >>= 5; | |
9228 v4 = v2 + v3 < 0; | |
9229 v5 = v2 + v3; | |
9230 a4 = v5; | |
9231 if ( !v4 ) | |
9232 { | |
9233 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 | |
9234 && pMouse->GetCursorPos(&a2)->x >= 14 ) | |
9235 { | |
9236 if ( unk_50C9A0 ) | |
9237 { | |
9238 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
9239 if ( v6 ) | |
9240 { | |
9241 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
9242 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
9243 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
9244 *((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
|
9245 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItemList[v6-1]; |
1297 | 9246 unk_50C9A0 = 0; |
9247 if ( pMessageQueue_50CBD0->uNumMessages ) | |
9248 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
9249 pMouse->SetCursorBitmap("MICON1"); | |
9250 dword_50C9D0 = 113; | |
9251 dword_50C9D4 = 0; | |
9252 dword_50C9D8 = 256; | |
9253 } | |
9254 return; | |
9255 } | |
9256 if ( ptr_50C9A4 ) | |
9257 return; | |
9258 v7 = pParty->pPickedItem.uItemID; | |
9259 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
9260 if ( !v7 ) | |
9261 { | |
9262 if ( !v8 ) | |
9263 return; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
9264 memcpy(&pParty->pPickedItem, &v0->pInventoryItemList[v8-1], sizeof(pParty->pPickedItem)); |
1297 | 9265 v0->RemoveItemAtInventoryIndex(a4); |
9266 v9 = pParty->pPickedItem.uItemID; | |
9267 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
9268 return; | |
9269 } | |
9270 v13 = v8; | |
9271 if ( v8 ) | |
9272 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
9273 a2.y = (LONG)&v0->pInventoryItemList[v8-1]; |
1297 | 9274 memcpy(&this_, (const void *)a2.y, sizeof(this_)); |
9275 v0->RemoveItemAtInventoryIndex(a4); | |
9276 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
9277 if ( !pX ) | |
9278 { | |
9279 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
9280 if ( !pX ) | |
9281 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
9282 v0->PutItemArInventoryIndex(this_.uItemID, v13 - 1, a4); |
1297 | 9283 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); |
9284 return; | |
9285 } | |
9286 } | |
9287 v9 = this_.uItemID; | |
9288 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
9289 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
9290 return; | |
9291 } | |
9292 v10 = v0->AddItem(a4, v7); | |
9293 pX = v10; | |
9294 if ( v10 || (v10 = v0->AddItem(-1, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
9295 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
9296 memcpy(&v0->pInventoryItemList[v10-1], &pParty->pPickedItem, 0x24u); |
1297 | 9297 pMouse->RemoveHoldingItem(); |
9298 } | |
9299 } | |
9300 } | |
9301 } | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9302 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9303 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9304 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9305 bool Player::IsWeak() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9306 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9307 return pConditions[Condition_Weak] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9308 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9309 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9310 bool Player::IsDead() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9311 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9312 return pConditions[Condition_Dead] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9313 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9314 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9315 bool Player::IsEradicated() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9316 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9317 return pConditions[Condition_Eradicated] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9318 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9319 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9320 bool Player::IsZombie() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9321 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9322 return pConditions[Condition_Zombie] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9323 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9324 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9325 bool Player::IsCursed() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9326 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9327 return pConditions[Condition_Cursed] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9328 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9329 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9330 bool Player::IsPertified() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9331 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9332 return pConditions[Condition_Pertified] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9333 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9334 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9335 bool Player::IsUnconcious() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9336 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9337 return pConditions[Condition_Unconcious] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9338 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9339 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9340 bool Player::IsAsleep() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9341 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9342 return pConditions[Condition_Sleep] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9343 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9344 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9345 bool Player::IsParalyzed() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9346 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9347 return pConditions[Condition_Paralyzed] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9348 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9349 |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9350 void Player::SetCursed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9351 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9352 pConditions[Condition_Cursed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9353 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9354 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9355 void Player::SetWeak( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9356 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9357 pConditions[Condition_Weak] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9358 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9359 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9360 void Player::SetAsleep( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9361 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9362 pConditions[Condition_Sleep] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9363 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9364 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9365 void Player::SetAfraid( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9366 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9367 pConditions[Condition_Fear] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9368 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9369 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9370 void Player::SetDrunk( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9371 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9372 pConditions[Condition_Drunk] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9373 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9374 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9375 void Player::SetInsane( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9376 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9377 pConditions[Condition_Insane] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9378 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9379 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9380 void Player::SetPoison1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9381 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9382 pConditions[Condition_Poison1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9383 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9384 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9385 void Player::SetDisease1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9386 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9387 pConditions[Condition_Disease1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9388 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9389 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9390 void Player::SetPoison2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9391 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9392 pConditions[Condition_Poison2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9393 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9394 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9395 void Player::SetDisease2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9396 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9397 pConditions[Condition_Disease2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9398 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9399 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9400 void Player::SetPoison3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9401 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9402 pConditions[Condition_Poison3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9403 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9404 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9405 void Player::SetDisease3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9406 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9407 pConditions[Condition_Disease3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9408 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9409 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9410 void Player::SetParalyzed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9411 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9412 pConditions[Condition_Paralyzed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9413 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9414 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9415 void Player::SetUnconcious( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9416 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9417 pConditions[Condition_Unconcious] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9418 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9419 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9420 void Player::SetDead( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9421 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9422 pConditions[Condition_Dead] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9423 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9424 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9425 void Player::SetPertified( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9426 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9427 pConditions[Condition_Pertified] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9428 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9429 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9430 void Player::SetEradicated( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9431 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9432 pConditions[Condition_Eradicated] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9433 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9434 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9435 void Player::SetZombie( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9436 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9437 pConditions[Condition_Zombie] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9438 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9439 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9440 void Player::SetCondWeakWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9441 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9442 SetCondition(Condition_Weak, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9443 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9444 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9445 void Player::SetCondInsaneWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9446 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9447 SetCondition(Condition_Insane, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9448 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9449 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9450 void Player::SetCondDeadWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9451 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
9452 SetCondition(Condition_Dead, blockable); |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
9453 } |