Mercurial > mm7
annotate Player.cpp @ 1685:2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
author | Grumpy7 |
---|---|
date | Sat, 21 Sep 2013 12:38:43 +0200 |
parents | f84b8b2a875c |
children | df30a0c901e5 |
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 |
1016 | 5 #include "stru6.h" |
6 | |
0 | 7 #include "Player.h" |
8 #include "PlayerFrameTable.h" | |
9 #include "AudioPlayer.h" | |
10 #include "Party.h" | |
816 | 11 #include "Log.h" |
0 | 12 #include "LOD.h" |
13 #include "GUIWindow.h" | |
14 #include "Viewport.h" | |
15 #include "Actor.h" | |
16 #include "Game.h" | |
17 #include "Mouse.h" | |
18 #include "TurnEngine.h" | |
19 #include "Events.h" | |
20 #include "Events2D.h" | |
21 #include "Outdoor.h" | |
22 #include "StorylineTextTable.h" | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
23 #include "Autonotes.h" |
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
24 #include "Awards.h" |
189 | 25 #include "texts.h" |
816 | 26 |
0 | 27 #include "mm7_data.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
821
diff
changeset
|
28 #include "MM7.h" |
1297 | 29 #include "SpriteObject.h" |
30 #include "DecalBuilder.h" | |
0 | 31 |
32 | |
33 | |
34 | |
35 | |
36 /* 381 */ | |
37 #pragma pack(push, 1) | |
290 | 38 struct PlayerCreation_AttributeProps |
0 | 39 { |
40 unsigned __int8 uBaseValue; | |
41 char uMaxValue; | |
42 char uDroppedStep; | |
43 char uBaseStep; | |
44 }; | |
45 #pragma pack(pop) | |
46 | |
47 | |
48 #pragma pack(push, 1) | |
290 | 49 |
50 | |
51 | |
0 | 52 #pragma pack(pop) |
290 | 53 PlayerCreation_AttributeProps StatTable[4][7] = //0x4ED7B0 |
54 { | |
55 {{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},}, | |
56 {{ 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},}, | |
57 {{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},}, | |
58 {{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 | 59 }; |
60 | |
61 | |
62 | |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
63 std::array<int, 5> StealingMasteryBonuses = {0, 100, 200, 300, 500}; |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
64 std::array<int, 5> StealingRandomBonuses = {-200, -100, 0, 100, 200}; |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
65 std::array<int, 5> StealingEnchantmentBonusForSkill = {0, 2, 4, 6, 10}; |
0 | 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 |
1684 | 136 unsigned 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 | |
0 | 162 //----- (00490913) -------------------------------------------------------- |
1459 | 163 int PlayerCreation_GetUnspentAttributePointCount() |
0 | 164 { |
165 signed int v0; // edi@1 | |
1273 | 166 int raceId; // ebx@2 |
0 | 167 signed int v4; // eax@17 |
168 int v5; // edx@18 | |
169 signed int v6; // ecx@18 | |
1273 | 170 signed int remainingStatPoints; // [sp+Ch] [bp-8h]@1 |
171 | |
172 remainingStatPoints = 50; | |
0 | 173 v0 = 50; |
1273 | 174 for (int playerNum = 0; playerNum < 4; playerNum++) |
175 { | |
176 raceId = pParty->pPlayers[playerNum].GetRace(); | |
177 for (int statNum = 0; statNum <= 6; statNum++) | |
178 { | |
179 switch ( statNum ) | |
0 | 180 { |
1273 | 181 case 0: |
182 v0 = pParty->pPlayers[playerNum].uMight; | |
183 break; | |
184 case 1: | |
185 v0 = pParty->pPlayers[playerNum].uIntelligence; | |
186 break; | |
187 case 2: | |
188 v0 = pParty->pPlayers[playerNum].uWillpower; | |
189 break; | |
190 case 3: | |
191 v0 = pParty->pPlayers[playerNum].uEndurance; | |
192 break; | |
193 case 4: | |
194 v0 = pParty->pPlayers[playerNum].uAccuracy; | |
195 break; | |
196 case 5: | |
197 v0 = pParty->pPlayers[playerNum].uSpeed; | |
198 break; | |
199 case 6: | |
200 v0 = pParty->pPlayers[playerNum].uLuck; | |
201 break; | |
202 } | |
203 v4 = StatTable[raceId][statNum].uBaseValue; | |
204 if ( v0 >= v4 ) | |
205 { | |
206 v5 = StatTable[raceId][statNum].uDroppedStep; | |
207 v6 = StatTable[raceId][statNum].uBaseStep; | |
0 | 208 } |
209 else | |
210 { | |
1273 | 211 v5 = StatTable[raceId][statNum].uBaseStep; |
212 v6 = StatTable[raceId][statNum].uDroppedStep; | |
0 | 213 } |
1273 | 214 remainingStatPoints += v5 * (v4 - v0) / v6; |
215 } | |
216 } | |
217 return remainingStatPoints; | |
0 | 218 } |
219 | |
220 | |
221 | |
222 //----- (00427730) -------------------------------------------------------- | |
223 bool Player::CanCastSpell(unsigned int uRequiredMana) | |
224 { | |
1275 | 225 if (sMana >= (signed int)uRequiredMana) |
226 { | |
227 sMana -= (signed int)uRequiredMana; | |
488 | 228 return true; |
229 } | |
230 | |
231 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
232 return false; | |
0 | 233 } |
234 | |
235 | |
236 //----- (004BE2DD) -------------------------------------------------------- | |
1014 | 237 void Player::SalesProcess( unsigned int inventory_idnx, int item_index, int _2devent_idx ) |
238 { | |
0 | 239 float v6; // ST04_4@1 |
1014 | 240 signed int item_value; // eax@1 |
241 signed int sell_price; // ebx@1 | |
242 | |
243 item_value =pOwnItems[item_index].GetValue(); | |
244 v6 = p2DEvents[ _2devent_idx - 1].fPriceMultiplier; | |
245 sell_price = GetPriceSell(item_value, v6); | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
246 if ( pOwnItems[item_index].IsBroken() ) |
1014 | 247 sell_price = 1; |
248 if ( sell_price < 1 ) | |
249 sell_price = 1; | |
250 RemoveItemAtInventoryIndex(inventory_idnx); | |
251 Party::SetGold(pParty->uNumGold + sell_price); | |
0 | 252 } |
253 | |
254 | |
255 | |
256 //----- (0043EEF3) -------------------------------------------------------- | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
257 bool Player::NothingOrJustBlastersEquipped() |
0 | 258 { |
1014 | 259 signed int item_idx; // esi@1 |
260 signed int item_id; // esi@1 | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
261 for (int i = 0; i < 16; ++i) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
262 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
263 item_idx = pEquipment.pIndices[i]; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
264 if (item_idx) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
265 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
266 item_id = pOwnItems[item_idx - 1].uItemID; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
267 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
|
268 return false; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
269 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
270 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
271 return true; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
272 } |
1014 | 273 |
0 | 274 |
275 | |
276 | |
277 //----- (004B8040) -------------------------------------------------------- | |
1036 | 278 int Player::GetConditionDayOfWeek( unsigned int uCondition ) |
279 { | |
280 return (unsigned int)(((signed __int64)((double)this->pConditions[uCondition] * 0.234375) / 60 / 60) / 24) % 7 + 1; | |
0 | 281 } |
282 | |
283 //----- (004B807C) -------------------------------------------------------- | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
284 int Player::GetTempleHealCostModifier(float a2) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
285 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
286 unsigned int conditionIdx; // eax@1 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
287 int conditionTimeMultiplier; // esi@1 |
0 | 288 int v6; // eax@8 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
289 signed int result; // qax@13 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
290 signed int baseConditionMultiplier; // [sp+8h] [bp-8h]@4 |
1275 | 291 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
292 conditionIdx = GetMajorConditionIdx(); |
1275 | 293 if ( conditionIdx >= 14 && conditionIdx <= 16) |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
294 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
295 if ( conditionIdx <= 15 ) |
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 baseConditionMultiplier = 5; |
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 if ( conditionIdx == 16 ) |
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 baseConditionMultiplier = 10; |
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 conditionTimeMultiplier = GetConditionDayOfWeek(conditionIdx); |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
304 } |
1350 | 305 else |
306 { | |
1275 | 307 conditionTimeMultiplier = 1; |
308 baseConditionMultiplier = 1; | |
1350 | 309 if (conditionIdx < 14) |
310 { | |
311 for (int i = 0; i <= 13; i++) | |
312 { | |
313 v6 = GetConditionDayOfWeek(i); | |
314 if ( v6 > conditionTimeMultiplier ) | |
315 conditionTimeMultiplier = v6; | |
316 } | |
317 } | |
1275 | 318 } |
319 result = (int)((double)conditionTimeMultiplier * (double)baseConditionMultiplier * a2); | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
320 if ( result < 1 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
321 result = 1; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
322 return result; |
0 | 323 } |
324 | |
325 //----- (004B8102) -------------------------------------------------------- | |
917 | 326 int Player::GetPriceSell(int uRealValue, float price_multiplier) |
0 | 327 { |
328 signed int v3; // esi@1 | |
329 signed int result; // eax@3 | |
330 | |
1275 | 331 v3 = (signed int)((signed __int64)((double)uRealValue / (price_multiplier + 2.0)) + uRealValue * GetMerchant() / 100); |
917 | 332 if ( v3 > uRealValue ) |
333 v3 = uRealValue; | |
0 | 334 result = 1; |
335 if ( v3 >= 1 ) | |
336 result = v3; | |
337 return result; | |
338 } | |
339 | |
340 //----- (004B8142) -------------------------------------------------------- | |
749 | 341 int Player::GetBuyingPrice(unsigned int uRealValue, float price_multiplier) |
342 { | |
1275 | 343 uint price = (uint)(((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100); |
749 | 344 |
345 if (price < uRealValue) | |
346 price = uRealValue; | |
347 return price; | |
0 | 348 } |
349 | |
350 //----- (004B8179) -------------------------------------------------------- | |
916 | 351 int Player::GetPriceIdentification(float a2) |
0 | 352 { |
353 signed int v2; // esi@1 | |
354 int v3; // ecx@1 | |
355 signed int result; // eax@3 | |
356 | |
1275 | 357 v2 = (signed int)(a2 * 50.0); |
0 | 358 v3 = v2 * (100 - GetMerchant()) / 100; |
359 if ( v3 < v2 / 3 ) | |
360 v3 = v2 / 3; | |
361 result = 1; | |
362 if ( v3 >= 1 ) | |
363 result = v3; | |
364 return result; | |
365 } | |
366 | |
367 //----- (004B81C3) -------------------------------------------------------- | |
916 | 368 int Player::GetPriceRepair(int a2, float a3) |
0 | 369 { |
370 signed int v3; // esi@1 | |
371 int v4; // ecx@1 | |
372 signed int result; // eax@3 | |
373 | |
1275 | 374 v3 = (signed int)((double)a2 / (6.0 - a3)); |
0 | 375 v4 = v3 * (100 - GetMerchant()) / 100; |
376 if ( v4 < v3 / 3 ) | |
377 v4 = v3 / 3; | |
378 result = 1; | |
379 if ( v4 >= 1 ) | |
380 result = v4; | |
381 return result; | |
382 } | |
383 | |
384 //----- (004B8213) -------------------------------------------------------- | |
1275 | 385 int Player::GetBaseSellingPrice(int a2, float a3) |
386 { | |
387 signed int v3; // qax@1 | |
388 | |
389 v3 = (signed int)((double)a2 / (a3 + 2.0)); | |
390 if ( v3 < 1 ) | |
391 v3 = 1; | |
0 | 392 return v3; |
393 } | |
394 | |
395 //----- (004B8233) -------------------------------------------------------- | |
1275 | 396 int Player::GetBaseBuyingPrice(int a2, float a3) |
397 { | |
398 signed int v3; // qax@1 | |
399 | |
400 v3 = (signed int)((double)a2 * a3); | |
401 if ( v3 < 1 ) | |
402 v3 = 1; | |
0 | 403 return v3; |
404 } | |
405 | |
406 //----- (004B824B) -------------------------------------------------------- | |
1275 | 407 int Player::GetBaseIdentifyPrice(float a2) |
408 { | |
409 signed int v2; // qax@1 | |
410 | |
411 v2 = (signed int)(a2 * 50.0); | |
412 if ( v2 < 1 ) | |
413 v2 = 1; | |
0 | 414 return v2; |
415 } | |
416 | |
417 //----- (004B8265) -------------------------------------------------------- | |
1275 | 418 int Player::GetBaseRepairPrice(int a2, float a3) |
419 { | |
420 signed int v3; // qax@1 | |
421 | |
422 v3 = (signed int)((double)a2 / (6.0 - a3)); | |
423 if ( v3 < 1 ) | |
424 v3 = 1; | |
0 | 425 return v3; |
426 } | |
427 | |
428 | |
429 | |
430 | |
431 | |
432 //----- (004B6FF9) -------------------------------------------------------- | |
1348 | 433 bool Player::IsPlayerHealableByTemple() |
1278
ce8ea73e7678
changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
Grumpy7
parents:
1276
diff
changeset
|
434 { |
0 | 435 signed int v2; // eax@1 |
336 | 436 v2 = (signed int)window_SpeakInHouse->ptr_1C; |
1348 | 437 if (this->sHealth >= GetMaxHealth() && this->sMana >= GetMaxMana() && GetMajorConditionIdx() == Condition_Good) |
438 { | |
439 return false; | |
440 } | |
441 else | |
442 { | |
443 if (GetMajorConditionIdx() == Condition_Zombie) | |
444 { | |
445 if ((v2 == 78 || v2 == 81 || v2 == 82)) | |
446 { | |
447 return false; | |
448 } | |
449 else | |
450 { | |
451 return true; | |
452 } | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
453 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
454 else |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
455 { |
1348 | 456 return true; |
457 } | |
1278
ce8ea73e7678
changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
Grumpy7
parents:
1276
diff
changeset
|
458 } |
0 | 459 } |
460 | |
461 | |
462 | |
463 //----- (00421E75) -------------------------------------------------------- | |
1012 | 464 unsigned int Player::GetItemIDAtInventoryIndex(int *pitem_index) |
465 { | |
466 int item_idx; // eax@1 | |
467 int inv_index; // eax@3 | |
468 | |
1351 | 469 |
1012 | 470 item_idx = *pitem_index; |
471 if ( item_idx >125 || item_idx < 0 ) | |
472 { | |
473 return 0; | |
474 } | |
475 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
476 inv_index = this->pInventoryMatrix[item_idx]; |
1012 | 477 if ( inv_index < 0 ) |
478 { | |
479 *pitem_index = -1 - inv_index; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
480 inv_index = this->pInventoryMatrix[-1 - inv_index]; |
1012 | 481 } |
482 | |
483 return inv_index; | |
0 | 484 } |
485 | |
486 | |
487 | |
488 //----- (004160CA) -------------------------------------------------------- | |
1012 | 489 void Player::ItemsEnchant( int enchant_count ) |
490 { | |
491 int avalible_items; // ebx@1 | |
492 int i; // edx@8 | |
493 __int16 item_index_tabl[138]; // [sp+Ch] [bp-118h]@1 | |
494 | |
495 avalible_items = 0; | |
496 memset (item_index_tabl,0,sizeof(item_index_tabl)); | |
497 | |
1349 | 498 for (i = 0; i < 138; ++i) |
499 { | |
500 if (( pOwnItems[i].uItemID>0)&&(pOwnItems[i].uItemID <= 134)) | |
501 item_index_tabl[avalible_items++] = i; | |
502 } | |
1012 | 503 |
504 if ( avalible_items ) | |
505 { | |
506 if ( enchant_count ) | |
507 { | |
1349 | 508 for ( i = 0; i < enchant_count; ++i ) |
509 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
510 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
|
511 pInventoryItemList[item_index_tabl[rand() % avalible_items]].uAttributes |= ITEM_ENCHANTED; |
1349 | 512 } |
0 | 513 } |
514 else | |
515 { | |
1012 | 516 for ( i = 0; i < avalible_items; ++i ) |
517 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
518 pInventoryItemList[item_index_tabl[i]].uAttributes |= ITEM_ENCHANTED; |
1349 | 519 } |
520 } | |
521 } | |
0 | 522 } |
523 | |
524 //----- (004948B1) -------------------------------------------------------- | |
187 | 525 void Player::PlaySound(PlayerSpeech speech, int a3) |
526 { | |
1351 | 527 signed int speechCount = 0; // esi@4 |
528 signed int expressionCount = 0; // esi@4 | |
529 int pickedVariant; // esi@10 | |
248 | 530 CHARACTER_EXPRESSION_ID expression; // ebx@17 |
1406 | 531 signed int pSoundID; // ecx@19 |
1351 | 532 int speechVariantArray[5]; // [sp+Ch] [bp-1Ch]@7 |
533 int expressionVariantArray[5]; | |
534 unsigned int pickedSoundID; // [sp+30h] [bp+8h]@4 | |
535 unsigned int expressionDuration = 0; | |
187 | 536 |
1351 | 537 pickedSoundID = 0; |
203 | 538 if (uVoicesVolumeMultiplier) |
0 | 539 { |
1351 | 540 for (int i = 0; i < 2; i++) |
541 { | |
1406 | 542 if ( SoundSetAction[speech][i] ) |
543 { | |
544 speechVariantArray[speechCount] = SoundSetAction[speech][i]; | |
1351 | 545 speechCount++; |
546 } | |
547 } | |
548 if ( speechCount ) | |
549 { | |
550 pickedVariant = speechVariantArray[rand() % speechCount]; | |
551 int numberOfSubvariants = byte_4ECF08[pickedVariant - 1][uVoiceID]; | |
552 if (numberOfSubvariants > 0) | |
553 { | |
554 pickedSoundID = rand() % numberOfSubvariants + 2 * (pickedVariant + 50 * uVoiceID) + 4998; | |
1406 | 555 pAudioPlayer->PlaySound((SoundID)pickedSoundID, PID(OBJECT_Player, uActiveCharacter + 39), 0, -1, 0, 0, (int)(pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f), 0); |
1351 | 556 } |
557 } | |
558 } | |
559 | |
560 for (int i = 0; i < 5; i++) | |
561 { | |
1406 | 562 if ( SoundSetAction[speech][i + 3] ) |
563 { | |
564 expressionVariantArray[expressionCount] = SoundSetAction[speech][i + 3]; | |
1351 | 565 expressionCount++; |
566 } | |
567 } | |
568 if ( expressionCount ) | |
569 { | |
570 expression = (CHARACTER_EXPRESSION_ID)expressionVariantArray[rand() % expressionCount]; | |
571 if (expression == CHARACTER_EXPRESSION_21 && pickedSoundID ) | |
572 { | |
1406 | 573 pSoundID = 0; |
574 if ( pSoundList->sNumSounds ) | |
575 { | |
1351 | 576 for (int i = 0; i < pSoundList->sNumSounds; i++) |
0 | 577 { |
1406 | 578 if (pSoundList->pSounds[i].uSoundID == pickedSoundID) |
579 pSoundID = i; | |
0 | 580 } |
581 } | |
1406 | 582 if ( pSoundList->pSounds[pSoundID].pSoundData[0] ) |
1351 | 583 expressionDuration = (sLastTrackLengthMS << 7) / 1000; |
584 } | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
585 PlayEmotion(expression, expressionDuration); |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
586 } |
0 | 587 } |
588 // 4948B1: using guessed type int var_1C[5]; | |
589 | |
590 //----- (00494A25) -------------------------------------------------------- | |
187 | 591 void Player::PlayEmotion(CHARACTER_EXPRESSION_ID new_expression, int a3) |
592 { | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
593 unsigned int v3 = expression; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
594 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
|
595 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
596 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
597 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
598 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
|
599 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
600 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
601 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
602 else |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
603 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
604 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
|
605 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
606 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
|
607 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
608 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
609 } |
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 } |
0 | 612 this->uExpressionTimePassed = 0; |
613 if ( !a3 ) | |
614 { | |
187 | 615 this->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[a3].uAnimLength; |
616 } | |
1353
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
617 else |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
618 { |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
619 this->uExpressionTimeLength = 0; |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
620 } |
187 | 621 expression = new_expression; |
0 | 622 viewparams->bRedrawGameUI = 1; |
623 } | |
624 | |
625 //----- (0049327B) -------------------------------------------------------- | |
1355 | 626 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
|
627 { |
135 | 628 if ( this->classType == uClass ) |
0 | 629 { |
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 return true; |
0 | 631 } |
632 else | |
633 { | |
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
|
634 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
|
635 { |
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
|
636 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
|
637 } |
0 | 638 switch ( uClass ) |
639 { | |
640 case 0x1Au: | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
641 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 65)); |
0 | 642 case 0x1Bu: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
643 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 67)); |
0 | 644 case 0x22u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
645 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 77)); |
0 | 646 case 0x23u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
647 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 79)); |
0 | 648 break; |
649 default: | |
1545 | 650 Error("Should not be able to get here (%u)", uClass); |
0 | 651 break; |
652 } | |
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 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
|
654 } |
0 | 655 } |
656 | |
657 | |
658 //----- (00492C0B) -------------------------------------------------------- | |
659 bool Player::CanAct() | |
660 { | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
661 if ( this->IsAsleep() || this->IsParalyzed() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
662 this->IsUnconcious() || this->IsDead() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
663 this->IsPertified() || this->IsEradicated() ) |
1355 | 664 return false; |
0 | 665 else |
1355 | 666 return true; |
0 | 667 } |
668 | |
669 //----- (00492C40) -------------------------------------------------------- | |
670 bool Player::CanSteal() | |
671 { | |
1355 | 672 return GetActualSkillLevel(PLAYER_SKILL_STEALING) != 0; |
0 | 673 } |
674 | |
675 //----- (00492C4E) -------------------------------------------------------- | |
676 bool Player::CanEquip_RaceAndAlignmentCheck(unsigned int uItemID) | |
677 { | |
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
|
678 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
|
679 { |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
680 case ITEM_RELIC_ETHRICS_STAFF: |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
681 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
|
682 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
|
683 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
|
684 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
|
685 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
|
686 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
|
687 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
|
688 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
|
689 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
|
690 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
|
691 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
|
692 default: return 1; break; |
1356
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
693 } |
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
694 } |
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
|
695 |
0 | 696 //----- (00492D65) -------------------------------------------------------- |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
697 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
|
698 { |
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
|
699 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
|
700 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
|
701 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
|
702 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
|
703 |
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 if ( pConditions[uConditionIdx] ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
705 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
706 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
707 if (!ConditionProcessor::IsPlayerAffected(this, uConditionIdx, a3)) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
708 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
709 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
710 } |
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
|
711 |
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
|
712 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
|
713 { |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
714 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
|
715 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
|
716 case Condition_Sleep: break; //nosound |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
717 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
|
718 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
|
719 case Condition_Insane: PlaySound(SPEECH_29, 0); break; |
1014 | 720 case Condition_Poison1: |
721 case Condition_Poison2: | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
722 case Condition_Poison3: PlaySound(SPEECH_27, 0); break; |
1014 | 723 case Condition_Disease1: |
724 case Condition_Disease2: | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
725 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
|
726 case Condition_Paralyzed: break; //nosound |
1014 | 727 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
|
728 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
|
729 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
|
730 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
|
731 break; |
1014 | 732 case Condition_Dead: |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
733 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
|
734 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
|
735 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
|
736 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
|
737 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
|
738 break; |
1014 | 739 case Condition_Pertified: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
740 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
|
741 break; |
1014 | 742 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
|
743 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
|
744 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
|
745 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
|
746 if ( sMana > 0 ) |
1014 | 747 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
|
748 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
|
749 case Condition_Zombie: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
750 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
|
751 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
|
752 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
|
753 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
|
754 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
|
755 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
|
756 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
|
757 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
|
758 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
|
759 { |
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 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
|
761 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
|
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 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
|
764 { |
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 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
|
766 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
|
767 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
768 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
|
769 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
|
770 } |
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
|
771 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
772 players_before = 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
773 for (int i = 1; i < 5; ++i) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
774 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
775 if ( pPlayers[i]->CanAct() ) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
776 ++players_before; |
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 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
779 pConditions[uConditionIdx] = 1; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
780 |
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
|
781 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
|
782 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
|
783 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
|
784 { |
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 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
|
786 { |
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 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
|
788 ++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
|
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 } |
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 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
|
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 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
|
794 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
795 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
|
796 } |
0 | 797 |
798 //----- (00492528) -------------------------------------------------------- | |
799 bool Player::CanFitItem(unsigned int uSlot, unsigned int uItemID) | |
800 { | |
1363 | 801 Texture *texture; // esi@1 |
802 unsigned int slotWidth; // ebx@1 | |
803 unsigned int slotHeight; // [sp+1Ch] [bp+Ch]@1 | |
804 | |
805 texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
806 slotWidth = GetSizeInInventorySlots(texture->uTextureWidth); | |
807 slotHeight = GetSizeInInventorySlots(texture->uTextureHeight); | |
0 | 808 if ( !areWeLoadingTexture ) |
809 { | |
1363 | 810 texture->Release(); |
1006 | 811 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 812 } |
1555 | 813 Assert(slotHeight > 0 && slotWidth > 0, "Items should have nonzero dimensions"); |
1363 | 814 if ( (slotWidth + uSlot % INVETORYSLOTSWIDTH) <= INVETORYSLOTSWIDTH && (slotHeight + uSlot / INVETORYSLOTSWIDTH) <= INVETORYSLOTSHEIGHT ) |
815 { | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
816 for (unsigned int x = 0; x < slotWidth; x++) |
1363 | 817 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
818 for (unsigned int y = 0; y < slotHeight; y++) |
1363 | 819 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
820 if (pInventoryMatrix[y * INVETORYSLOTSWIDTH + x + uSlot] != 0) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
821 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
822 return false; |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
823 } |
1363 | 824 } |
825 } | |
826 return true; | |
827 } | |
828 return false; | |
0 | 829 } |
830 // 506128: using guessed type int areWeLoadingTexture; | |
831 | |
832 //----- (004925E6) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
833 int Player::FindFreeInventoryListSlot() |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
834 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
835 for (int i = 0; i < 126; i++ ) |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
836 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
837 if (pInventoryItemList[i].uItemID == 0) |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
838 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
839 return i; |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
840 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
841 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
842 return -1; |
0 | 843 } |
844 | |
845 //----- (00492600) -------------------------------------------------------- | |
846 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) | |
847 { | |
848 int result; // eax@8 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
849 signed int freeSlot; // [sp+8h] [bp-4h]@4 |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
850 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
851 freeSlot = FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
852 if ( freeSlot == -1 ) |
0 | 853 { |
854 if ( uActiveCharacter ) | |
201 | 855 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
1366
8f339c3bbdaf
Player::CreateItemInInventory small bugfix from previous change
Grumpy7
parents:
1365
diff
changeset
|
856 return 0; |
0 | 857 } |
858 else | |
859 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
860 PutItemArInventoryIndex(uItemID, freeSlot, uSlot); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
861 result = freeSlot + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
862 this->pInventoryItemList[freeSlot].uItemID = uItemID; |
0 | 863 } |
864 return result; | |
865 } | |
866 // 506128: using guessed type int areWeLoadingTexture; | |
867 | |
868 //----- (00492700) -------------------------------------------------------- | |
869 int Player::HasSkill(unsigned int uSkillType) | |
870 { | |
1374 | 871 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) |
872 { | |
873 return 1; | |
0 | 874 } |
875 else | |
876 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
877 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
878 ShowStatusBarString(pTmpBuf.data(), 2u); |
1374 | 879 return 0; |
880 } | |
0 | 881 } |
882 | |
883 //----- (00492745) -------------------------------------------------------- | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
884 void Player::WearItem( unsigned int uItemID ) |
0 | 885 { |
1010 | 886 int item_body_anch; // edi@6 |
887 int item_indx; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
888 item_indx = FindFreeInventoryListSlot(); |
1010 | 889 |
890 if ( item_indx != -1 ) | |
891 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
892 pInventoryItemList[item_indx].uItemID = uItemID; |
1374 | 893 item_body_anch = pEquipTypeToBodyAnchor[pItemsTable->pItems[uItemID].uEquipType]; |
894 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
|
895 pInventoryItemList[item_indx].uBodyAnchor = item_body_anch + 1; |
0 | 896 } |
897 } | |
898 | |
899 //----- (004927A8) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
900 int Player::AddItem(int index, unsigned int uItemID) |
0 | 901 { |
1374 | 902 int xStartValue = 0; |
903 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
904 if ( index == -1 ) |
0 | 905 { |
1385 | 906 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) |
907 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
908 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) |
0 | 909 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
910 if ( CanFitItem(ycoord * INVETORYSLOTSWIDTH + xcoord, uItemID) ) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
911 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
912 return CreateItemInInventory(ycoord * INVETORYSLOTSWIDTH + xcoord, uItemID); |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
913 } |
0 | 914 } |
1385 | 915 } |
0 | 916 return 0; |
917 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
918 if ( !CanFitItem(index, uItemID) ) |
0 | 919 { |
920 pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); | |
921 return 0; | |
922 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
923 return CreateItemInInventory(index, uItemID); |
0 | 924 } |
925 | |
926 //----- (00492826) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
927 int Player::AddItem2(int index, ItemGen *Src) |
0 | 928 { |
929 pItemsTable->SetSpecialBonus(Src); | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
930 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
931 if ( index == -1 ) |
0 | 932 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
933 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
934 { |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
935 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) //TODO: change pInventoryMatrix to 2 dimensional array. |
1385 | 936 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
937 if ( CanFitItem(ycoord * INVETORYSLOTSWIDTH + xcoord, Src->uItemID) ) |
0 | 938 { |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
939 return CreateItemInInventory2(ycoord * INVETORYSLOTSWIDTH + xcoord, Src); |
0 | 940 } |
1385 | 941 } |
0 | 942 } |
943 return 0; | |
944 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
945 if ( !CanFitItem(index, Src->uItemID) ) |
0 | 946 return 0; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
947 return CreateItemInInventory2(index, Src); |
0 | 948 } |
949 | |
950 //----- (0049289C) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
951 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src ) |
0 | 952 { |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
953 signed int freeSlot; // ebx@1 |
0 | 954 int result; // eax@6 |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
955 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
956 freeSlot = FindFreeInventoryListSlot(); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
957 if ( freeSlot == -1 ) |
0 | 958 { |
959 result = 0; | |
960 } | |
961 else | |
962 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
963 PutItemArInventoryIndex(Src->uItemID, freeSlot, index); |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
964 memcpy(&pInventoryItemList[freeSlot], Src, sizeof(ItemGen)); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
965 result = freeSlot + 1; |
0 | 966 } |
967 return result; | |
968 } | |
969 // 506128: using guessed type int areWeLoadingTexture; | |
970 | |
971 //----- (0049298B) -------------------------------------------------------- | |
1385 | 972 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
|
973 { |
1014 | 974 Texture *item_texture; // esi@1 |
975 int *pInvPos; // esi@4 | |
976 unsigned int slot_width; // [sp+Ch] [bp-4h]@1 | |
977 unsigned int slot_height; // [sp+18h] [bp+8h]@1 | |
978 | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
979 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1014 | 980 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); |
981 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 982 if ( !areWeLoadingTexture ) |
983 { | |
1014 | 984 item_texture->Release(); |
1006 | 985 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 986 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
987 if ( slot_width > 0 ) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
988 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
989 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
990 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
991 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
992 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
|
993 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
994 } |
1014 | 995 } |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
996 pInventoryMatrix[index] = itemListPos + 1; |
0 | 997 } |
278 | 998 |
0 | 999 // 506128: using guessed type int areWeLoadingTexture; |
1000 | |
1001 //----- (00492A36) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1002 void Player::RemoveItemAtInventoryIndex( unsigned int index ) |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1003 { |
1014 | 1004 ItemGen *item_in_slot; // ecx@1 |
1005 Texture *item_texture; // esi@1 | |
1006 unsigned int slot_height; // ebp@1 | |
1007 int *pInvPos; // edx@4 | |
1008 unsigned int slot_width; // [sp+14h] [bp+4h]@1 | |
1009 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1010 item_in_slot = &this->pInventoryItemList[pInventoryMatrix[index]-1]; |
1014 | 1011 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[item_in_slot->uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1012 item_in_slot->Reset(); | |
1013 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); | |
1014 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 1015 if ( !areWeLoadingTexture ) |
1016 { | |
1014 | 1017 item_texture->Release(); |
1006 | 1018 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1019 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1020 if ( slot_width > 0 ) |
1014 | 1021 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1022 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1023 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1024 { |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1025 memset32(pInvPos, 0, slot_width); |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1026 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1027 } |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
1028 } |
0 | 1029 } |
1030 // 506128: using guessed type int areWeLoadingTexture; | |
1031 | |
1032 //----- (00490EEE) -------------------------------------------------------- | |
1386 | 1033 int Player::SelectPhrasesTransaction(ItemGen *pItem, int building_type, int BuildID_2Events, int ShopMenuType) //TODO: probably move this somewhere else, not really Player:: stuff |
1034 { | |
1035 unsigned int idemId; // edx@1 | |
1036 signed int equipType; // esi@1 | |
1037 float multiplier; // ST04_4@26 | |
1038 int price; // edi@26 | |
1039 int merchantLevel; // [sp+10h] [bp-8h]@1 | |
1040 int itemValue; | |
1041 | |
1042 merchantLevel = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); | |
1043 idemId = pItem->uItemID; | |
1044 equipType = pItemsTable->pItems[idemId].uEquipType; | |
1045 itemValue = pItem->GetValue(); | |
1046 | |
1047 switch (building_type) | |
1048 { | |
1411 | 1049 case BuildingType_WeaponShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1050 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1051 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1052 if (equipType > EQUIP_BOW) |
1386 | 1053 return 4; |
1054 break; | |
1411 | 1055 case BuildingType_ArmorShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1056 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1057 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1058 if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS) |
1386 | 1059 return 4; |
1060 break; | |
1411 | 1061 case BuildingType_MagicShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1062 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1063 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1064 if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC ) |
1386 | 1065 return 4; |
1066 break; | |
1411 | 1067 case BuildingType_AlchemistShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1068 if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE) |
1386 | 1069 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1070 if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL)) |
1386 | 1071 return 4; |
1072 break; | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1073 default: |
1545 | 1074 Error("(%u)", building_type); |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1075 break; |
1386 | 1076 } |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1077 if (pItem->IsStolen()) |
1386 | 1078 return 6; |
1079 | |
1080 multiplier = p2DEvents[BuildID_2Events - 1].fPriceMultiplier; | |
1081 switch (ShopMenuType) | |
1082 { | |
1083 case 2: | |
1084 price = GetBuyingPrice(itemValue, multiplier); | |
1085 break; | |
1086 case 3: | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1087 if (pItem->IsBroken()) |
1386 | 1088 price = 1; |
917 | 1089 else |
1386 | 1090 price = this->GetPriceSell(itemValue, multiplier); |
1091 break; | |
1092 case 4: | |
1093 price = this->GetPriceIdentification(multiplier); | |
1094 break; | |
1095 case 5: | |
1096 price = this->GetPriceRepair(itemValue, multiplier); | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1097 break; |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1098 default: |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1099 Error("(%u)", ShopMenuType); |
1386 | 1100 break; |
1101 } | |
1102 if ( merchantLevel ) | |
1103 { | |
1104 if (price == itemValue) | |
1105 { | |
1106 return 3; | |
1107 } | |
917 | 1108 else |
1386 | 1109 { |
1110 return 2; | |
1111 } | |
1112 } | |
0 | 1113 else |
1386 | 1114 { |
1115 return 1; | |
1116 } | |
0 | 1117 } |
1118 | |
1119 //----- (0049107D) -------------------------------------------------------- | |
1120 int Player::GetBodybuilding() | |
1121 { | |
1010 | 1122 int v1; // al@1 |
0 | 1123 |
1124 v1 = GetActualSkillLevel(PLAYER_SKILL_BODYBUILDING); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1125 int multiplier = GetMultiplierForSkillLevel(v1, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1126 return multiplier * (v1 & 0x3F); |
0 | 1127 } |
1128 | |
1129 //----- (004910A8) -------------------------------------------------------- | |
607 | 1130 int Player::GetMeditation() |
0 | 1131 { |
1010 | 1132 int v1; // al@1 |
0 | 1133 |
1134 v1 = GetActualSkillLevel(PLAYER_SKILL_MEDITATION); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1135 int multiplier = GetMultiplierForSkillLevel(v1, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1136 return multiplier * (v1 & 0x3F); |
0 | 1137 } |
1138 | |
1139 //----- (004910D3) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1140 bool Player::CanIdentify( ItemGen *pItem ) |
0 | 1141 { |
1142 unsigned __int16 v2; // ax@1 | |
1143 int v5; // edi@7 | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
1144 return true; |
652 | 1145 if (CheckHiredNPCSpeciality(Scholar)) |
1146 return true; | |
0 | 1147 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1148 v2 = GetActualSkillLevel(PLAYER_SKILL_ITEM_ID); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1149 if ( (signed int)SkillToMastery(v2) >= 4 ) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1150 return true; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1151 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1152 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1153 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1154 return v5 >= pItemsTable->pItems[pItem->uItemID].uItemID_Rep_St; |
0 | 1155 } |
1156 | |
1157 //----- (00491151) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1158 bool Player::CanRepair( ItemGen *pItem ) |
0 | 1159 { |
1160 unsigned __int16 v2; // ax@1 | |
1161 int v5; // edi@7 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1162 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1163 ItemDesc* v7 = &pItemsTable->pItems[pItem->uItemID]; |
652 | 1164 if (CheckHiredNPCSpeciality(Smith) && v7->uEquipType <= 2 || |
1165 CheckHiredNPCSpeciality(Armorer) && v7->uEquipType >= 3 && v7->uEquipType <= 9 || | |
1166 CheckHiredNPCSpeciality(Alchemist) && v7->uEquipType >= 9 ) | |
1167 return true; | |
1168 | |
1010 | 1169 v2 = GetActualSkillLevel(PLAYER_SKILL_REPAIR); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1170 if ( (signed int)SkillToMastery(v2) >= 4 ) |
0 | 1171 return true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1172 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1173 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1174 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1175 return v5 >= v7->uItemID_Rep_St; |
0 | 1176 } |
1177 | |
1178 //----- (004911F3) -------------------------------------------------------- | |
1179 int Player::GetMerchant() | |
1180 { | |
1181 unsigned __int16 v2; // ax@1 | |
1182 int v5; // edi@1 | |
1183 int v7; // eax@3 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1184 |
607 | 1185 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1186 if ( SkillToMastery(v2) >= 4 ) |
0 | 1187 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1188 |
0 | 1189 v7 = GetPartyReputation(); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1190 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1191 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1192 if (v5 == 0) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1193 { |
0 | 1194 return -v7; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1195 } |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1196 return v5 - v7 + 7; |
0 | 1197 } |
1198 | |
1199 //----- (0049125A) -------------------------------------------------------- | |
1200 int Player::GetPerception() | |
1201 { | |
1202 unsigned __int16 v2; // ax@1 | |
1203 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1204 |
1010 | 1205 v2 = GetActualSkillLevel(PLAYER_SKILL_PERCEPTION); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1206 if ( SkillToMastery(v2) >= 4 ) |
0 | 1207 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1208 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1209 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1210 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1211 return v5; |
0 | 1212 } |
1213 | |
1214 //----- (004912B0) -------------------------------------------------------- | |
1215 int Player::GetDisarmTrap() | |
1216 { | |
1217 unsigned __int16 v2; // ax@1 | |
1218 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1219 |
1010 | 1220 v2 = GetActualSkillLevel(PLAYER_SKILL_TRAP_DISARM); |
0 | 1221 if ( (signed int)SkillToMastery(v2) >= 4 ) |
1222 return 10000; | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1223 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1224 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1225 if ( HasEnchantedItemEquipped(35) ) //only the real skill level is supposed to be added again, not the multiplied value |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1226 multiplier++; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1227 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1228 return v5; |
0 | 1229 } |
1230 | |
1231 //----- (00491317) -------------------------------------------------------- | |
1232 char Player::GetLearningPercent() | |
1233 { | |
1234 int v2; // eax@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1235 |
1010 | 1236 v2 = GetActualSkillLevel(PLAYER_SKILL_LEARNING); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1237 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1238 return multiplier * v2 + 9; |
0 | 1239 } |
1240 | |
1241 //----- (0048C6AF) -------------------------------------------------------- | |
1242 Player::Player() | |
1243 { | |
1244 memset(&pEquipment, 0, sizeof(PlayerEquipment)); | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1245 memset(pInventoryMatrix, 0, 126 * sizeof(int)); |
0 | 1246 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
|
1247 pInventoryItemList[i].Reset(); |
0 | 1248 for (uint i = 0; i < 12; ++i) |
1249 pEquippedItems[i].Reset(); | |
1250 | |
1251 | |
1252 for (uint i = 0; i < 24; ++i) | |
1253 { | |
1254 pPlayerBuffs[i].uSkill = 0; | |
1255 pPlayerBuffs[i].uSkill = 0; | |
1256 pPlayerBuffs[i].uPower = 0; | |
1257 pPlayerBuffs[i].uExpireTime = 0; | |
1258 pPlayerBuffs[i].uCaster = 0; | |
1259 pPlayerBuffs[i].uFlags = 0; | |
1260 } | |
1261 | |
1262 pName[0] = 0; | |
1014 | 1263 uCurrentFace = 0; |
0 | 1264 uVoiceID = 0; |
1265 memset(pConditions, 0, 20 * sizeof(__int64)); | |
1266 | |
1267 field_BB = 0; | |
1268 | |
1269 uMight = uMightBonus = 0; | |
1270 uIntelligence = uIntelligenceBonus = 0; | |
1271 uWillpower = uWillpowerBonus = 0; | |
1272 uEndurance = uEnduranceBonus = 0; | |
1273 uSpeed = uSpeedBonus = 0; | |
1274 uAccuracy = uAccuracyBonus = 0; | |
1275 uLuck = uLuckBonus = 0; | |
1276 uLevel = sLevelModifier = 0; | |
1277 sAgeModifier = 0; | |
1388
60d4885eb107
sACModifier zeroed in player constructor so AC is not always 0(or -some value) ingame
Grumpy7
parents:
1387
diff
changeset
|
1278 sACModifier = 0; |
0 | 1279 |
1019 | 1280 // memset(field_1F5, 0, 30); |
1281 pure_luck_used=0; | |
1282 pure_speed_used=0; | |
1283 pure_intellect_used=0; | |
1284 pure_endurance_used=0; | |
1285 pure_willpower_used=0; | |
1286 pure_accuracy_used=0; | |
1287 pure_might_used=0; | |
0 | 1288 |
1289 sResFireBase = sResFireBonus = 0; | |
1290 sResAirBase = sResAirBonus = 0; | |
1291 sResWaterBase = sResWaterBonus = 0; | |
1292 sResEarthBase = sResEarthBonus = 0; | |
1293 sResMagicBase = sResMagicBonus = 0; | |
1294 sResSpiritBase = sResSpiritBonus = 0; | |
1295 sResMindBase = sResMindBonus = 0; | |
1296 sResBodyBase = sResBodyBonus = 0; | |
1297 sResLightBase = sResLightBonus = 0; | |
1298 sResDarkBase = sResDarkBonus = 0; | |
1299 | |
1300 uTimeToRecovery = 0; | |
1301 | |
1302 uSkillPoints = 0; | |
1303 | |
1304 sHealth = 0; | |
1305 uFullHealthBonus = 0; | |
1306 _health_related = 0; | |
1307 | |
1308 sMana = 0; | |
1309 uFullManaBonus = 0; | |
1310 _mana_related = 0; | |
1311 | |
1312 uQuickSpell = 0; | |
1313 memset(pInstalledBeacons, 0, 5 * sizeof(LloydBeacon)); | |
1314 | |
1315 _some_attack_bonus = 0; | |
1316 field_1A91 = 0; | |
1317 _melee_dmg_bonus = 0; | |
1318 field_1A93 = 0; | |
1319 _ranged_atk_bonus = 0; | |
1320 field_1A95 = 0; | |
1321 _ranged_dmg_bonus = 0; | |
1322 field_1A97 = 0; | |
1323 | |
130 | 1324 expression = CHARACTER_EXPRESSION_INVALID; |
0 | 1325 uExpressionTimePassed = 0; |
1326 uExpressionTimeLength = 0; | |
1327 | |
1328 uNumDivineInterventionCastsThisDay = 0; | |
1329 uNumArmageddonCasts = 0; | |
1330 uNumFireSpikeCasts = 0; | |
1331 | |
1332 memset(field_1988, 0, 49 * sizeof(int)); | |
1333 memset(field_1A50, 0, 64 * sizeof(char)); | |
1334 | |
1335 field_E0 = 0; | |
1336 field_E4 = 0; | |
1337 field_E8 = 0; | |
1338 field_EC = 0; | |
1339 field_F0 = 0; | |
1340 field_F4 = 0; | |
1341 field_F8 = 0; | |
1342 field_FC = 0; | |
1343 field_100 = 0; | |
1344 field_104 = 0; | |
198 | 1345 |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1346 _expression21_animtime = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1347 _expression21_frameset = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1348 |
198 | 1349 lastOpenedSpellbookPage = 0; |
0 | 1350 } |
1351 | |
1352 //----- (0048C6F6) -------------------------------------------------------- | |
1560
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1353 bool Party::AddItemToParty(ItemGen *pItem) //TODO move to party.cpp |
0 | 1354 { |
1355 unsigned int v2; // eax@1 | |
1356 char *v5; // eax@8 | |
1357 Texture *v7; // ebx@10 | |
1358 signed int v8; // esi@10 | |
1359 Player *v9; // edi@11 | |
1360 int v10; // eax@11 | |
1361 int v21; // [sp+24h] [bp-4h]@10 | |
1362 | |
1363 v2 = pItem->uItemID; | |
222 | 1364 if ( !pItemsTable->pItems[v2].uItemID_Rep_St ) |
315 | 1365 pItem->SetIdentified(); |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1366 |
0 | 1367 v5 = pItemsTable->pItems[v2].pIconName; |
1368 if ( v5 ) | |
1369 { | |
973 | 1370 v7 = pIcons_LOD->LoadTexturePtr(v5, TEXTURE_16BIT_PALETTE); |
0 | 1371 v21 = areWeLoadingTexture; |
1372 v8 = 0; | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1373 int startId = uActiveCharacter >= 0 ? uActiveCharacter - 1 : 0; |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1374 for (int i = 0; i < 4; i++) |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1375 { |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1376 v9 = &pPlayers[(startId + i) % 4]; //start with current active player, then cycle right if item won't fit |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1377 v10 = v9->AddItem(-1, pItem->uItemID); |
0 | 1378 if ( v10 ) |
1379 { | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1380 memcpy(&v9->pInventoryItemList[v10-1], pItem, 0x24u); |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1381 pItem->Reset(); |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1382 pAudioPlayer->PlaySound(SOUND_GoldReceived, 0, 0, -1, 0, 0, 0, 0); |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1383 v9->PlaySound(SPEECH_60, 0); |
0 | 1384 if ( !v21 ) |
1385 { | |
1386 v7->Release(); | |
1006 | 1387 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1388 } |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1389 return true; |
0 | 1390 } |
1391 } | |
1392 if ( !v21 ) | |
1393 { | |
1394 v7->Release(); | |
1006 | 1395 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 1396 } |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1397 return false; |
0 | 1398 } |
1399 else | |
1400 { | |
1401 MessageBoxW(nullptr, L"Invalid picture_name detected ::addItem()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Party.cpp:795", 0); | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1402 return false; |
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1403 } |
0 | 1404 } |
1405 // 506128: using guessed type int areWeLoadingTexture; | |
1406 | |
1407 //----- (0048C855) -------------------------------------------------------- | |
1408 int Player::GetBaseStrength() | |
1409 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1410 return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH); |
0 | 1411 } |
1412 | |
1413 //----- (0048C86C) -------------------------------------------------------- | |
1414 int Player::GetBaseIntelligence() | |
1415 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1416 return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE); |
0 | 1417 } |
1418 | |
1419 //----- (0048C883) -------------------------------------------------------- | |
1420 int Player::GetBaseWillpower() | |
1421 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1422 return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER); |
0 | 1423 } |
1424 | |
1425 //----- (0048C89A) -------------------------------------------------------- | |
1426 int Player::GetBaseEndurance() | |
1427 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1428 return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE); |
0 | 1429 } |
1430 | |
1431 //----- (0048C8B1) -------------------------------------------------------- | |
1432 int Player::GetBaseAccuracy() | |
1433 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1434 return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY); |
0 | 1435 } |
1436 | |
1437 //----- (0048C8C8) -------------------------------------------------------- | |
1438 int Player::GetBaseSpeed() | |
1439 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1440 return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED); |
0 | 1441 } |
1442 | |
1443 //----- (0048C8DF) -------------------------------------------------------- | |
1444 int Player::GetBaseLuck() | |
1445 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1446 return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK); |
0 | 1447 } |
1448 | |
1449 //----- (0048C8F6) -------------------------------------------------------- | |
1450 int Player::GetBaseLevel() | |
1451 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1452 return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL); |
0 | 1453 } |
1454 | |
1455 //----- (0048C90D) -------------------------------------------------------- | |
1456 int Player::GetActualLevel() | |
1457 { | |
1458 return uLevel + sLevelModifier + | |
1459 GetMagicalBonus(CHARACTER_ATTRIBUTE_LEVEL) + | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1460 GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL); |
0 | 1461 } |
1462 | |
1463 //----- (0048C93C) -------------------------------------------------------- | |
1464 int Player::GetActualMight() | |
1465 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1466 return GetActualAttribute(CHARACTER_ATTRIBUTE_STRENGTH, &Player::uMight, &Player::uMightBonus); |
0 | 1467 } |
1468 | |
1469 //----- (0048C9C2) -------------------------------------------------------- | |
1470 int Player::GetActualIntelligence() | |
1471 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1472 return GetActualAttribute(CHARACTER_ATTRIBUTE_INTELLIGENCE, &Player::uIntelligence, &Player::uIntelligenceBonus); |
0 | 1473 } |
1474 | |
1475 //----- (0048CA3F) -------------------------------------------------------- | |
1476 int Player::GetActualWillpower() | |
1477 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1478 return GetActualAttribute(CHARACTER_ATTRIBUTE_WILLPOWER, &Player::uWillpower, &Player::uWillpowerBonus); |
0 | 1479 } |
1480 | |
1481 //----- (0048CABC) -------------------------------------------------------- | |
1482 int Player::GetActualEndurance() | |
1483 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1484 return GetActualAttribute(CHARACTER_ATTRIBUTE_ENDURANCE, &Player::uEndurance, &Player::uEnduranceBonus); |
0 | 1485 } |
1486 | |
1487 //----- (0048CB39) -------------------------------------------------------- | |
1488 int Player::GetActualAccuracy() | |
1489 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1490 return GetActualAttribute(CHARACTER_ATTRIBUTE_ACCURACY, &Player::uAccuracy, &Player::uAccuracyBonus); |
0 | 1491 } |
1492 | |
1493 //----- (0048CBB6) -------------------------------------------------------- | |
1494 int Player::GetActualSpeed() | |
1495 { | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1496 return GetActualAttribute(CHARACTER_ATTRIBUTE_SPEED, &Player::uSpeed, &Player::uSpeedBonus); |
0 | 1497 } |
1498 | |
1499 //----- (0048CC33) -------------------------------------------------------- | |
1500 int Player::GetActualLuck() | |
1501 { | |
1036 | 1502 signed int npc_luck_bonus; // [sp+10h] [bp-4h]@1 |
1503 | |
1504 npc_luck_bonus = 0; | |
652 | 1505 if ( CheckHiredNPCSpeciality(Fool) ) |
1036 | 1506 npc_luck_bonus = 5; |
652 | 1507 if ( CheckHiredNPCSpeciality(ChimneySweep) ) |
1036 | 1508 npc_luck_bonus += 20; |
652 | 1509 if ( CheckHiredNPCSpeciality(Psychic) ) |
1036 | 1510 npc_luck_bonus += 10; |
1324 | 1511 |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1512 return GetActualAttribute(CHARACTER_ATTRIBUTE_LUCK, &Player::uLuck, &Player::uLuckBonus) |
1325 | 1513 + npc_luck_bonus; |
1514 } | |
1515 | |
1516 //----- (new function) -------------------------------------------------------- | |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1517 int Player::GetActualAttribute( CHARACTER_ATTRIBUTE_TYPE attrId, unsigned short Player::* attrValue, unsigned short Player::* attrBonus ) |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1518 { |
1324 | 1519 uint uActualAge = this->sAgeModifier + GetBaseAge(); |
1520 uint uAgeingMultiplier = 100; | |
1521 for (uint i = 0; i < 4; ++i) | |
1325 | 1522 { |
1324 | 1523 if (uActualAge >= pAgeingTable[i]) |
1325 | 1524 uAgeingMultiplier = pAgingAttributeModifier[attrId][i]; |
1525 else | |
1526 break; | |
1527 } | |
1528 | |
1529 auto uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()]; | |
1530 int magicBonus = GetMagicalBonus(attrId); | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1531 int itemBonus = GetItemsBonus(attrId); |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1532 return uConditionMult * uAgeingMultiplier * this->*attrValue / 100 / 100 |
1325 | 1533 + magicBonus |
1552
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1534 + itemBonus |
d253172de469
Player::CanFitItem, AddItem, AddItem2 changed changed the retarded 2 dimensional array traversal, changed GetActualAttribute input parameters to get rid of the attrid case
Grumpy7
parents:
1551
diff
changeset
|
1535 + this->*attrBonus; |
0 | 1536 } |
1537 | |
1538 //----- (0048CCF5) -------------------------------------------------------- | |
1684 | 1539 int Player::GetActualAttack( bool a2 ) |
0 | 1540 { |
1541 int v3; // eax@1 | |
1542 int v4; // edi@1 | |
1543 int v5; // ebx@1 | |
1544 int v6; // ebp@1 | |
1545 | |
1546 v3 = GetActualAccuracy(); | |
1036 | 1547 v4 = GetParameterBonus(v3); |
0 | 1548 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_ATTACK); |
1549 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_ATTACK, a2); | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1550 return v4 + v5 + v6 + GetMagicalBonus(CHARACTER_ATTRIBUTE_ATTACK) + this->_some_attack_bonus; |
0 | 1551 } |
1552 | |
1553 //----- (0048CD45) -------------------------------------------------------- | |
1554 int Player::GetMeleeDamageMinimal() | |
1555 { | |
1556 int v2; // eax@1 | |
1557 int v3; // esi@1 | |
1558 int v4; // esi@1 | |
1559 int v5; // esi@1 | |
1560 signed int result; // eax@1 | |
1036 | 1561 |
0 | 1562 v2 = GetActualMight(); |
1036 | 1563 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1564 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN) + v3; |
0 | 1565 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; |
1036 | 1566 result = _melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
1567 if ( result < 1 ) | |
1568 result = 1; | |
0 | 1569 return result; |
1570 } | |
1571 | |
1572 //----- (0048CD90) -------------------------------------------------------- | |
1573 int Player::GetMeleeDamageMaximal() | |
1574 { | |
1575 int v2; // eax@1 | |
1576 int v3; // esi@1 | |
1577 int v4; // esi@1 | |
1578 int v5; // esi@1 | |
1579 int v6; // esi@1 | |
1580 signed int result; // eax@1 | |
1581 | |
1582 v2 = GetActualMight(); | |
1036 | 1583 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1584 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX) + v3; |
0 | 1585 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1586 v6 = this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
0 | 1587 result = 1; |
1588 if ( v6 >= 1 ) | |
1589 result = v6; | |
1590 return result; | |
1591 } | |
1592 | |
1593 //----- (0048CDDB) -------------------------------------------------------- | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1594 int Player::CalculateMeleeDamageTo( bool ignoreSkillBonus, bool ignoreOffhand, unsigned int uTargetActorID ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1595 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1596 int dmgSum; // esi@62 |
0 | 1597 signed int result; // eax@64 |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1598 int mainWpnDmg; // [sp+18h] [bp-8h]@1 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1599 int offHndWpnDmg; // [sp+1Ch] [bp-4h]@1 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1600 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1601 offHndWpnDmg = 0; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1602 mainWpnDmg = 0; |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1603 if ( IsUnarmed() ) |
0 | 1604 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1605 mainWpnDmg = rand() % 3 + 1; |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1606 } |
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1607 else |
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
1608 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1609 if ( HasItemEquipped(EQUIP_MAIN_HAND) ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1610 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1611 ItemGen *mainHandItemGen = &this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1612 int itemId = mainHandItemGen->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1613 bool addOneDice = false; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1614 if ( pItemsTable->pItems[itemId].uSkillType == PLAYER_SKILL_SPEAR && !this->pEquipment.uShield ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1615 addOneDice = true; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1616 mainWpnDmg = CalculateMeleeDmgToEnemyWithWeapon(mainHandItemGen, uTargetActorID, addOneDice); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1617 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1618 if ( !ignoreOffhand ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1619 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1620 if ( this->HasItemEquipped(EQUIP_OFF_HAND) ) |
0 | 1621 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1622 ItemGen *offHandItemGen = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uShield - 1]; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1623 int itemId = offHandItemGen->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1624 if ( pItemsTable->pItems[itemId].uEquipType != EQUIP_SHIELD ) |
0 | 1625 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1626 offHndWpnDmg = CalculateMeleeDmgToEnemyWithWeapon(offHandItemGen, uTargetActorID, false); |
0 | 1627 } |
1628 } | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1629 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1630 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1631 dmgSum = mainWpnDmg + offHndWpnDmg; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1632 if ( !ignoreSkillBonus ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1633 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1634 int might = GetActualMight(); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1635 int mightBonus = GetParameterBonus(might); |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1636 int mightAndSkillbonus = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + mightBonus; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1637 dmgSum += this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + mightAndSkillbonus; |
0 | 1638 } |
1639 result = 1; | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1640 if ( dmgSum >= 1 ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1641 result = dmgSum; |
0 | 1642 return result; |
1643 } | |
1644 | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1645 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1646 int Player::CalculateMeleeDmgToEnemyWithWeapon( ItemGen * weapon, unsigned int uTargetActorID , bool addOneDice ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1647 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1648 int itemId = weapon->uItemID; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1649 int diceCount = pItemsTable->pItems[itemId].uDamageDice; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1650 if (addOneDice) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1651 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1652 diceCount++; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1653 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1654 int diceSides = pItemsTable->pItems[itemId].uDamageRoll; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1655 int diceResult = 0; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1656 for (int i = 0; i < diceCount; i++) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1657 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1658 diceResult += rand() % diceSides + 1; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1659 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1660 int totalDmg = pItemsTable->pItems[itemId].uDamageMod + diceResult; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1661 if ( uTargetActorID > 0) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1662 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1663 int enchType = weapon->uSpecEnchantmentType; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1664 if ( MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_UNDEAD) && (enchType == 64 || itemId == ITEM_ARTIFACT_GHOULSBANE || itemId == ITEM_ARTIFACT_GIBBET || itemId == ITEM_RELIC_JUSTICE) ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1665 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1666 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1667 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1668 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_KREEGAN) && ( enchType == 39 || itemId == ITEM_ARTIFACT_GIBBET)) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1669 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1670 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1671 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1672 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_DRAGON) && ( enchType == 40 || itemId == ITEM_ARTIFACT_GIBBET)) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1673 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1674 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1675 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1676 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_TITAN) && ( enchType == 65 )) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1677 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1678 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1679 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1680 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1681 if ( (signed int)SkillToMastery(this->pActiveSkills[2]) >= 3 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1682 && pItemsTable->pItems[itemId].uSkillType == 2 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1683 && rand() % 100 < 10 ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1684 totalDmg *= 3; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1685 return totalDmg; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1686 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1687 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1688 |
0 | 1689 //----- (0048D0B9) -------------------------------------------------------- |
1690 int Player::GetRangedAttack() | |
1691 { | |
1692 int v2; // eax@1 | |
1693 int v3; // edi@3 | |
1694 int v4; // eax@4 | |
1695 int v5; // edi@4 | |
1696 int v6; // edi@4 | |
1697 int v7; // edi@4 | |
1698 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1699 v2 = *(int *)&this->pInventoryItemList[this->pEquipment.uMainHand-1]; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1700 if ( v2 < ITEM_BLASTER || v2 > ITEM_LASER_RIFLE ) |
0 | 1701 { |
1702 v4 = GetActualAccuracy(); | |
1036 | 1703 v5 = GetParameterBonus(v4); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1704 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v5; |
0 | 1705 v7 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v6; |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1706 v3 = this->_ranged_atk_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v7; |
0 | 1707 } |
1708 else | |
1709 { | |
1684 | 1710 v3 = GetActualAttack(true); |
0 | 1711 } |
1712 return v3; | |
1713 } | |
1714 | |
1715 //----- (0048D124) -------------------------------------------------------- | |
1716 int Player::GetRangedDamageMin() | |
1717 { | |
1718 int v2; // edi@1 | |
1719 int v3; // edi@1 | |
1720 int v4; // edi@1 | |
1721 int result; // eax@6 | |
1722 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1723 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN); |
1040 | 1724 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1725 v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; |
0 | 1726 if ( v4 >= 1 ) |
1727 result = v4; | |
1728 else | |
1729 result = 0; | |
1730 return result; | |
1731 } | |
1732 | |
1733 //----- (0048D191) -------------------------------------------------------- | |
1734 int Player::GetRangedDamageMax() | |
1735 { | |
1736 int v2; // edi@1 | |
1737 int v3; // edi@1 | |
1738 int v4; // edi@1 | |
1739 int result; // eax@6 | |
1740 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1741 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX); |
1040 | 1742 v3 = GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v2; |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
1743 v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; |
0 | 1744 if ( v4 >= 1 ) |
1745 result = v4; | |
1746 else | |
1747 result = 0; | |
1748 return result; | |
1749 } | |
1750 | |
1751 //----- (0048D1FE) -------------------------------------------------------- | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1752 int Player::CalculateRangedDamageTo( int a2 ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1753 { |
0 | 1754 ItemGen *v4; // ebx@2 |
1755 unsigned int v5; // edi@2 | |
1756 int v9; // esi@5 | |
1757 int v10; // ebx@6 | |
1758 signed int v15; // [sp+8h] [bp-Ch]@2 | |
1759 int v17; // [sp+10h] [bp-4h]@1 | |
1760 | |
1761 v17 = 0; | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1762 if ( !HasItemEquipped(EQUIP_BOW) ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1763 return 0; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1764 v4 = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uBow-1]; |
0 | 1765 v5 = v4->uItemID; |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1766 v15 = pItemsTable->pItems[v5].uDamageRoll; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1767 for( int i = 0; i < pItemsTable->pItems[v5].uDamageDice; i++ ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1768 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1769 int v7 = rand() % v15; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1770 v17 += v7 + 1; |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1771 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1772 v9 = pItemsTable->pItems[v5].uDamageMod + v17; |
0 | 1773 if ( a2 ) |
1774 { | |
377 | 1775 v10 = v4->uSpecEnchantmentType; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1776 if ( v10 == 64 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_UNDEAD)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1777 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1778 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1779 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1780 else if ( v10 == 39 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_KREEGAN)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1781 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1782 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1783 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1784 else if ( v10 == 40 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_DRAGON)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1785 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1786 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1787 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1788 else if ( v10 == 63 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_ELF)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1789 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1790 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1791 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1792 } |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1793 return v9 + this->GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS); |
0 | 1794 } |
1795 | |
1796 //----- (0048D2EA) -------------------------------------------------------- | |
1797 char *Player::GetMeleeDamageString() | |
1798 { | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1799 signed int itemid; // eax@1 |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1800 int min_damage; // edi@3 |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1801 int max_damage; // eax@3 |
0 | 1802 |
1803 static char player__getmeleedamagestring_static_buff[40]; // idb | |
1804 | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1805 if (pEquipment.uMainHand >= 0) |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1806 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1807 itemid = pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1808 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1809 |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1810 if (pEquipment.uMainHand >= 0 && ( itemid >= 135 ) && ( itemid <= 159 )) |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1811 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1812 strcpy(player__getmeleedamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1813 return player__getmeleedamagestring_static_buff; |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1814 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1815 else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE)) |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1816 { |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1817 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1818 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true); |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1819 } |
0 | 1820 else |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1821 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1822 min_damage = GetMeleeDamageMinimal(); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1823 max_damage = GetMeleeDamageMaximal(); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1824 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1825 if ( min_damage == max_damage ) |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1826 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1827 sprintf(player__getmeleedamagestring_static_buff, "%d", min_damage); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1828 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1829 else |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1830 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1831 sprintf(player__getmeleedamagestring_static_buff, "%d - %d", min_damage, max_damage); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1832 } |
1036 | 1833 return player__getmeleedamagestring_static_buff; |
0 | 1834 } |
1835 | |
1836 //----- (0048D396) -------------------------------------------------------- | |
1837 char *Player::GetRangedDamageString() | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1838 { |
1036 | 1839 signed int itemid; // eax@1 |
1840 int min_damage; // edi@3 | |
1841 int max_damage; // eax@3 | |
1842 | |
1843 static char player__getrangeddamagestring_static_buff[40]; // idb | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1844 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1845 if (pEquipment.uMainHand >= 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1846 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1847 itemid = pOwnItems[this->pEquipment.uMainHand-1].uItemID; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1848 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1849 |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1850 if (pEquipment.uMainHand >= 0 && ( itemid >= 135 ) && ( itemid <= 159 )) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1851 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1852 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1853 return player__getrangeddamagestring_static_buff; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1854 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1855 else if (pEquipment.uMainHand >= 0 && (itemid == ITEM_BLASTER || itemid == ITEM_LASER_RIFLE)) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1856 { |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1857 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1858 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true); |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1859 } |
0 | 1860 else |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1861 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1862 min_damage = GetRangedDamageMin(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1863 max_damage = GetRangedDamageMax(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1864 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1865 if ( max_damage > 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1866 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1867 if ( min_damage == max_damage ) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1868 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1869 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1870 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1871 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1872 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1873 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1874 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1875 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1876 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1877 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1878 strcpy(player__getrangeddamagestring_static_buff, "N/A"); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1879 } |
1036 | 1880 return player__getrangeddamagestring_static_buff; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1881 } |
0 | 1882 |
1883 //----- (0048D45A) -------------------------------------------------------- | |
1884 bool Player::CanTrainToNextLevel() | |
1885 { | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1886 int lvl = this->uLevel + 1; |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1887 int neededExp = ((lvl * (lvl - 1)) / 2 * 1000); |
1564 | 1888 return this->uExperience >= neededExp; |
0 | 1889 } |
1890 | |
1891 //----- (0048D498) -------------------------------------------------------- | |
1892 unsigned int Player::GetExperienceDisplayColor() | |
1893 { | |
1894 if ( CanTrainToNextLevel() ) | |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1895 return ui_character_bonus_text_color; |
0 | 1896 else |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1897 return ui_character_default_text_color; |
0 | 1898 } |
1899 | |
1900 //----- (0048D4B3) -------------------------------------------------------- | |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1901 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int dmg ) |
1561 | 1902 { |
1036 | 1903 int resist_value; // edi@8 |
1904 int player_luck; // eax@21 | |
1905 signed int res_rand_divider; // ebx@2 | |
1906 int armor_skill; // eax@29 | |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1907 |
1560
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1908 if ( classType == PLAYER_CLASS_LICH && (dmg_type == CHARACTER_ATTRIBUTE_RESIST_MIND || dmg_type == CHARACTER_ATTRIBUTE_RESIST_BODY || dmg_type == CHARACTER_ATTRIBUTE_RESIST_SPIRIT )) //TODO: determine if spirit resistance should be handled by body res. modifier |
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1909 return 0; |
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1910 |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1911 resist_value = 0; |
1036 | 1912 switch(dmg_type) |
1913 { | |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1914 case DMGT_FIRE: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); break; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1915 case DMGT_ELECTR: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); break; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1916 case DMGT_COLD: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); break; |
1560
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1917 case DMGT_EARTH: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); break; |
1036 | 1918 |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1919 case DMGT_SPIRIT: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_SPIRIT);break; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1920 case DMGT_MIND: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); break; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1921 case DMGT_BODY: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); break; |
1036 | 1922 } |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1923 |
1036 | 1924 player_luck = GetActualLuck(); |
1925 res_rand_divider = GetParameterBonus(player_luck) + resist_value + 30; | |
1926 | |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1927 if ( GetParameterBonus(player_luck) + resist_value > 0 ) |
1036 | 1928 { |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1929 for (int i = 0; i < 4; i++) |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1930 { |
1036 | 1931 if ( rand() % res_rand_divider >= 30 ) |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1932 dmg >>= 1; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1933 else |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1934 break; |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1935 } |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1936 } |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1937 if (( dmg_type == DMGT_PHISYCAL ) && ( pEquipment.uArmor )) |
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1938 { |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1939 if (!pOwnItems[pEquipment.uArmor - 1].IsBroken()) |
0 | 1940 { |
1036 | 1941 armor_skill = GetEquippedItemSkillType(EQUIP_ARMOUR); |
1942 if ( armor_skill==PLAYER_SKILL_PLATE ) | |
0 | 1943 { |
1036 | 1944 if ( SkillToMastery(pActiveSkills[PLAYER_SKILL_PLATE]) >= 3 ) |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1945 return dmg / 2; |
0 | 1946 } |
1036 | 1947 if (armor_skill==PLAYER_SKILL_CHAIN ) |
0 | 1948 { |
1036 | 1949 if (SkillToMastery(pActiveSkills[PLAYER_SKILL_CHAIN]) == 4) |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1950 return dmg * 2 / 3; |
0 | 1951 } |
1952 } | |
1036 | 1953 } |
1559
1f3f01d39300
Player::CanTrainToNextLevel simplified, Player::GetExperienceDisplayColor shortened a bit Player::CalculateIncommingDamage + fixed resistances not working if no resistance bonus (ignored luck bonus)
Grumpy7
parents:
1558
diff
changeset
|
1954 return dmg; |
0 | 1955 } |
1956 | |
1957 //----- (0048D62C) -------------------------------------------------------- | |
816 | 1958 ITEM_EQUIP_TYPE Player::GetEquippedItemEquipType(ITEM_EQUIP_TYPE uEquipSlot) |
1959 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1960 return pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uEquipType; |
0 | 1961 } |
1962 | |
1963 //----- (0048D651) -------------------------------------------------------- | |
816 | 1964 PLAYER_SKILL_TYPE Player::GetEquippedItemSkillType(ITEM_EQUIP_TYPE uEquipSlot) |
1965 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
1966 return (PLAYER_SKILL_TYPE)pItemsTable->pItems[pInventoryItemList[pEquipment.pIndices[uEquipSlot] - 1].uItemID].uSkillType; |
0 | 1967 } |
1968 | |
1969 //----- (0048D676) -------------------------------------------------------- | |
1970 bool Player::IsUnarmed() | |
1971 { | |
1561 | 1972 return !HasItemEquipped(EQUIP_MAIN_HAND) && |
1973 (!HasItemEquipped(EQUIP_OFF_HAND) || GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD); | |
0 | 1974 } |
1975 | |
1976 //----- (0048D6AA) -------------------------------------------------------- | |
1977 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex) | |
1978 { | |
1979 auto i = pEquipment.pIndices[uEquipIndex]; | |
1980 if (i) | |
1568 | 1981 return (~(pOwnItems[i - 1].uAttributes & ITEM_BROKEN)) != 0; |
1036 | 1982 else |
1983 return false; | |
0 | 1984 } |
1985 | |
1986 //----- (0048D6D0) -------------------------------------------------------- | |
1987 bool Player::HasEnchantedItemEquipped(int uEnchantment) | |
1988 { | |
1989 for (uint i = 0; i < 16; ++i) | |
1990 { | |
1991 if (HasItemEquipped((ITEM_EQUIP_TYPE)i) && | |
1080 | 1992 pOwnItems[pEquipment.pIndices[i]-1].uSpecEnchantmentType == uEnchantment) |
0 | 1993 return true; |
1994 } | |
1995 return false; | |
1996 } | |
1997 | |
1998 //----- (0048D709) -------------------------------------------------------- | |
1080 | 1999 bool Player::WearsItem( int item_id, ITEM_EQUIP_TYPE equip_type ) |
1563 | 2000 { |
2001 return ( HasItemEquipped(equip_type) && pInventoryItemList[pEquipment.pIndices[equip_type - 1]].uItemID == item_id ); | |
2002 } | |
2003 | |
2004 bool Player::WearsItemAnyWhere(int item_id) | |
2005 { | |
2006 for (int i = 0; i < 16; i++) | |
2007 { | |
2008 if (WearsItem(item_id, (ITEM_EQUIP_TYPE) i)) | |
2009 { | |
2010 return true; | |
2011 } | |
2012 } | |
2013 return false; | |
0 | 2014 } |
2015 | |
2016 //----- (0048D76C) -------------------------------------------------------- | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2017 bool Player::StealFromShop(ItemGen *itemToSteal, int a3, int reputation, int a5, int *a6) //check stealing in IDA pro once I get home. The whole thing looks odd, dword_4EDEB4 and dword_4EDEA0 are never filled, might be a bug, might me on purpose |
0 | 2018 { |
2019 unsigned __int16 v6; // cx@8 | |
2020 int v7; // edi@8 | |
2021 unsigned int v8; // ebx@8 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2022 unsigned int itemvalue; // esi@8 |
0 | 2023 int v10; // eax@8 |
2024 int v11; // edi@12 | |
2025 bool result; // eax@13 | |
2026 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2027 if ( !itemToSteal |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2028 || this->IsEradicated() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2029 || this->IsDead() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2030 || this->IsPertified() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2031 || this->pConditions[Condition_Drunk] |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2032 || this->IsUnconcious() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2033 || this->IsAsleep() ) |
0 | 2034 { |
2035 result = 0; | |
2036 } | |
2037 else | |
2038 { | |
2039 v6 = this->pActiveSkills[34]; | |
2040 v7 = v6 & 0x3F; | |
2041 v8 = SkillToMastery(v6); | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2042 itemvalue = itemToSteal->GetValue(); |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2043 v10 = pItemsTable->pItems[itemToSteal->uItemID].uEquipType; |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2044 if ( !pItemsTable->pItems[itemToSteal->uItemID].uEquipType || v10 == 1 || v10 == 2 ) |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2045 itemvalue *= 3; |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2046 v11 = StealingRandomBonuses[rand() % 100 / 20] + v7 * StealingMasteryBonuses[v8]; |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2047 *a6 = 100 * (reputation + a3) + itemvalue + (a5 != 0 ? 0x1F4 : 0); |
0 | 2048 if ( rand() % 100 >= 5 ) |
2049 { | |
2050 if ( *a6 > v11 ) | |
2051 result = *a6 - v11 < 500; | |
2052 else | |
2053 result = 2; | |
2054 } | |
2055 else | |
2056 { | |
2057 result = 0; | |
2058 } | |
2059 } | |
2060 return result; | |
2061 } | |
2062 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2063 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2064 | |
2065 //----- (0048D88B) -------------------------------------------------------- | |
2066 int Player::StealFromActor(unsigned int uActorID, int _steal_perm, int reputation) | |
2067 { | |
2068 Player *v4; // esi@1 | |
2069 Actor *v5; // edi@1 | |
2070 unsigned __int16 v6; // cx@10 | |
2071 int v7; // ebx@10 | |
2072 unsigned int v8; // esi@10 | |
2073 int v9; // eax@10 | |
2074 int v10; // esi@10 | |
2075 int v11; // eax@13 | |
2076 signed int v12; // ebx@15 | |
2077 signed int v13; // edx@15 | |
2078 int v14; // ecx@15 | |
2079 unsigned __int16 v15; // si@21 | |
2080 unsigned int v16; // ebx@24 | |
2081 int v17; // esi@24 | |
2082 const void *v18; // eax@29 | |
2083 unsigned int v19; // esi@31 | |
2084 int v20; // eax@34 | |
2085 char v21; // zf@36 | |
2086 unsigned int v22; // ST0C_4@39 | |
2087 char *v23; // esi@39 | |
2088 const char *v25; // [sp-Ch] [bp-48h]@40 | |
2089 int v26; // [sp-8h] [bp-44h]@40 | |
2090 ItemGen v27; // [sp+8h] [bp-34h]@15 | |
2091 unsigned int v28; // [sp+2Ch] [bp-10h]@10 | |
2092 int v29; // [sp+30h] [bp-Ch]@10 | |
2093 int v30; // [sp+34h] [bp-8h]@10 | |
2094 Player *v31; // [sp+38h] [bp-4h]@1 | |
2095 signed int _steal_perma; // [sp+48h] [bp+Ch]@12 | |
2096 | |
2097 v4 = this; | |
2098 v5 = &pActors[uActorID]; | |
2099 v31 = this; | |
2100 if ( &pActors[uActorID] | |
2101 && !this->pConditions[16] | |
2102 && !this->pConditions[14] | |
2103 && !this->pConditions[15] | |
2104 && !this->pConditions[4] | |
2105 && !this->pConditions[13] | |
2106 && !this->pConditions[2] ) | |
2107 { | |
2108 if ( !(BYTE2(v5->uAttributes) & 0x80) ) | |
2109 pActors[uActorID].SetRandomGoldIfTheresNoItem(); | |
2110 v6 = v4->pActiveSkills[34]; | |
2111 v7 = v6 & 0x3F; | |
2112 v8 = SkillToMastery(v6); | |
2113 v9 = rand(); | |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2114 v30 = StealingMasteryBonuses[v8]; |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2115 v29 = StealingRandomBonuses[v9 % 100 / 20]; |
0 | 2116 v10 = v5->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); |
2117 if ( rand() % 100 < 5 || v10 > v29 + v7 * v30 || (_steal_perma = 2, BYTE2(v5->uAttributes) & 8) ) | |
2118 { | |
322 | 2119 Actor::AggroSurroundingPeasants(uActorID, 1); |
0 | 2120 _steal_perma = 0; |
2121 v26 = (int)v31->pName; | |
2122 v25 = pGlobalTXT_LocalizationStrings[376]; | |
2123 } | |
2124 else | |
2125 { | |
2126 v11 = rand(); | |
2127 if ( v11 % 100 >= 40 ) | |
2128 { | |
2129 if ( v11 % 100 >= 70 ) | |
2130 { | |
2131 v19 = 0; | |
2132 if ( v7 > 0 ) | |
2133 { | |
2134 do | |
2135 { | |
2136 --v7; | |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
2137 v19 += rand() % StealingEnchantmentBonusForSkill[v8] + 1; |
0 | 2138 } |
2139 while ( v7 ); | |
2140 } | |
2141 if ( pItemsTable->pItems[v5->array_000234[3].uItemID].uEquipType != 18 ) | |
2142 return _steal_perma; | |
377 | 2143 v20 = (int)&v5->array_000234[3].uSpecEnchantmentType; |
2144 if ( (signed int)v19 > v5->array_000234[3].uSpecEnchantmentType ) | |
2145 v19 = v5->array_000234[3].uSpecEnchantmentType; | |
0 | 2146 v21 = *(int *)v20 == v19; |
2147 *(int *)v20 -= v19; | |
2148 if ( v21 ) | |
2149 v5->array_000234[3].uItemID = 0; | |
2150 if ( v19 ) | |
2151 { | |
2152 party_finds_gold(v19, 2); | |
2153 v22 = v19; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2154 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2155 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], v31->pName, v22); |
0 | 2156 LABEL_43: |
2157 ShowStatusBarString(v23, 2u); | |
2158 return _steal_perma; | |
2159 } | |
2160 } | |
2161 else | |
2162 { | |
2163 v27.Reset(); | |
2164 v12 = 0; | |
2165 v13 = 0; | |
2166 v14 = (int)v5->array_000234; | |
2167 while ( !*(int *)v14 || pItemsTable->pItems[*(int *)v14].uEquipType == 18 ) | |
2168 { | |
2169 ++v13; | |
2170 v14 += 36; | |
2171 if ( v13 >= 4 ) | |
2172 goto LABEL_21; | |
2173 } | |
2174 v12 = 1; | |
2175 LABEL_21: | |
2176 v15 = v5->uCarriedItemID; | |
2177 if ( v15 || v12 ) | |
2178 { | |
2179 v27.Reset(); | |
2180 if ( v15 ) | |
2181 { | |
2182 v16 = (signed __int16)v15; | |
2183 v5->uCarriedItemID = 0; | |
2184 v27.uItemID = (signed __int16)v15; | |
2185 v17 = (signed __int16)v15; | |
2186 if ( pItemsTable->pItems[v17].uEquipType == 12 ) | |
2187 v27.uNumCharges = rand() % 6 + pItemsTable->pItems[v17].uDamageMod + 1; | |
2188 if ( pItemsTable->pItems[v17].uEquipType == 14 ) | |
2189 { | |
2190 if ( v16 != 220 ) | |
570 | 2191 v27.uEnchantmentType = 2 * rand() % 4 + 2; |
0 | 2192 } |
2193 } | |
2194 else | |
2195 { | |
2196 v18 = &v5->array_000234[rand() % 4]; | |
2197 memcpy(&v27, v18, sizeof(v27)); | |
2198 ((ItemGen *)v18)->Reset(); | |
2199 v16 = v27.uItemID; | |
2200 } | |
2201 sub_421B2C_PlaceInInventory_or_DropPickedItem(); | |
2202 sprintf( | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2203 pTmpBuf2.data(), |
0 | 2204 pGlobalTXT_LocalizationStrings[304], |
2205 v31->pName, | |
2206 pItemsTable->pItems[v16].pUnidentifiedName); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2207 ShowStatusBarString(pTmpBuf2.data(), 2u); |
0 | 2208 sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
2209 memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem)); | |
2210 pMouse->SetCursorBitmapFromItemID(v16); | |
2211 return _steal_perma; | |
2212 } | |
2213 } | |
2214 } | |
2215 v26 = (int)v31->pName; | |
2216 v25 = pGlobalTXT_LocalizationStrings[377]; | |
2217 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2218 v23 = pTmpBuf2.data(); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
2219 sprintfex(pTmpBuf2.data(), v25, v26); |
0 | 2220 goto LABEL_43; |
2221 } | |
2222 return 0; | |
2223 } | |
2224 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2225 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2226 // 4EDEC4: using guessed type int dword_4EDEC4[]; | |
2227 | |
2228 //----- (0048DBB9) -------------------------------------------------------- | |
2229 void Player::Heal(int amount) | |
2230 { | |
1010 | 2231 signed int max_health; // eax@3 |
2232 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2233 if ( !IsEradicated() && !IsDead() ) |
1010 | 2234 { |
2235 max_health = GetMaxHealth(); | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2236 if ( IsZombie() ) |
1010 | 2237 max_health /= 2; |
2238 sHealth += amount; | |
2239 if ( sHealth > max_health ) | |
2240 sHealth = max_health; | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2241 if ( IsUnconcious() ) |
1010 | 2242 { |
2243 if ( sHealth > 0 ) | |
2244 { | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2245 SetUnconcious(false); |
0 | 2246 } |
2247 } | |
2248 } | |
2249 } | |
2250 | |
2251 //----- (0048DC1E) -------------------------------------------------------- | |
1036 | 2252 int Player::ReceiveDamage( signed int amount, DAMAGE_TYPE dmg_type ) |
2253 { | |
2254 signed int recieved_dmg; // eax@1 | |
2255 unsigned int armor_indx; // eax@8 | |
2256 bool broke_armor; | |
2257 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2258 SetAsleep(false); |
1036 | 2259 recieved_dmg = CalculateIncommingDamage(dmg_type, amount); |
2260 sHealth -= recieved_dmg; | |
2261 broke_armor = sHealth <= -10; | |
2262 if ( sHealth < 1 ) // | |
2263 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2264 if ( (sHealth + uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE) >= 1) |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2265 || pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime > 0 ) |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2266 { |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2267 SetCondUnconsciousWithBlockCheck(false); |
0 | 2268 } |
2269 else | |
2270 { | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2271 SetCondDeadWithBlockCheck(false); |
1036 | 2272 if ( sHealth > 0 ) |
2273 sHealth = 0; | |
2274 } | |
2275 if (broke_armor ) | |
2276 { | |
2277 armor_indx = pEquipment.uArmor; | |
2278 if ( armor_indx ) | |
0 | 2279 { |
1568 | 2280 if ( !(pOwnItems[armor_indx-1].uAttributes & ITEM_ENCHANTED)) |
0 | 2281 { |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2282 pOwnItems[armor_indx-1].SetBroken(); |
0 | 2283 } |
2284 } | |
2285 } | |
2286 } | |
1036 | 2287 if ( recieved_dmg && CanAct() ) |
187 | 2288 PlaySound(SPEECH_24, 0); |
1036 | 2289 return recieved_dmg; |
0 | 2290 } |
2291 | |
2292 //----- (0048DCF6) -------------------------------------------------------- | |
1568 | 2293 int Player::_48DCF6(int a2, Actor *pActor) //TODO check this with IDA to see what the uninitialized vars are supposed to contain |
0 | 2294 { |
2295 signed int v3; // edi@1 | |
2296 signed int v4; // ebx@1 | |
2297 Player *v5; // esi@1 | |
2298 int v6; // eax@2 | |
2299 int v7; // eax@5 | |
2300 int v8; // eax@8 | |
2301 int v9; // ebx@8 | |
2302 int v10; // eax@8 | |
2303 int v11; // ebx@8 | |
2304 signed int v12; // edx@9 | |
2305 ItemGen *v13; // eax@9 | |
2306 int v14; // edx@16 | |
2307 unsigned int v15; // edx@17 | |
2308 int v16; // edx@26 | |
2309 unsigned int v17; // edx@27 | |
2310 signed int v19; // edx@38 | |
2311 int *v20; // ecx@38 | |
2312 signed int v21; // eax@40 | |
2313 int v22; // eax@49 | |
2314 signed int v23; // ebx@49 | |
2315 unsigned int v24; // eax@60 | |
2316 int v25; // ecx@61 | |
2317 int v26; // ebx@74 | |
2318 void *v27; // ecx@76 | |
2319 unsigned int v28; // ebx@78 | |
2320 signed int result; // eax@86 | |
2321 SoundID v30; // [sp-20h] [bp-C0h]@56 | |
2322 signed int v31; // [sp-1Ch] [bp-BCh]@56 | |
2323 unsigned int v32; // [sp-18h] [bp-B8h]@56 | |
2324 signed int v33; // [sp-14h] [bp-B4h]@56 | |
2325 signed int v34; // [sp-10h] [bp-B0h]@56 | |
2326 int v35; // [sp-Ch] [bp-ACh]@56 | |
2327 unsigned int v36; // [sp-8h] [bp-A8h]@51 | |
2328 unsigned int v37; // [sp-8h] [bp-A8h]@56 | |
2329 unsigned int v38; // [sp-8h] [bp-A8h]@57 | |
2330 unsigned int v39; // [sp-8h] [bp-A8h]@68 | |
2331 enum CHARACTER_ATTRIBUTE_TYPE v40; // [sp-4h] [bp-A4h]@4 | |
2332 int v41; // [sp-4h] [bp-A4h]@51 | |
2333 int v42; // [sp-4h] [bp-A4h]@56 | |
2334 int v43; // [sp-4h] [bp-A4h]@57 | |
2335 signed int v44; // [sp-4h] [bp-A4h]@59 | |
2336 int v45; // [sp-4h] [bp-A4h]@68 | |
2337 char v46[140]; // [sp+Ch] [bp-94h]@13 | |
2338 unsigned int v47; // [sp+98h] [bp-8h]@1 | |
2339 int v48; // [sp+9Ch] [bp-4h]@1 | |
2340 | |
2341 v3 = 0; | |
2342 v4 = 0; | |
2343 v5 = this; | |
2344 v47 = 0; | |
2345 v48 = 0; | |
2346 switch ( a2 ) | |
2347 { | |
2348 case 1: | |
2349 v6 = GetActualWillpower(); | |
2350 goto LABEL_46; | |
2351 case 2: | |
2352 case 3: | |
2353 case 4: | |
2354 case 9: | |
2355 case 10: | |
2356 case 11: | |
2357 case 13: | |
2358 case 21: | |
2359 v6 = GetActualEndurance(); | |
2360 goto LABEL_46; | |
2361 case 5: | |
2362 case 12: | |
2363 case 23: | |
2364 v40 = (CHARACTER_ATTRIBUTE_TYPE)14; | |
2365 goto LABEL_5; | |
2366 case 15: | |
2367 v40 = (CHARACTER_ATTRIBUTE_TYPE)13; | |
2368 goto LABEL_5; | |
2369 case 6: | |
2370 case 7: | |
2371 case 8: | |
2372 case 14: | |
2373 case 16: | |
2374 v40 = (CHARACTER_ATTRIBUTE_TYPE)15; | |
2375 LABEL_5: | |
2376 v7 = GetActualResistance(v40); | |
2377 goto LABEL_47; | |
2378 case 22: | |
2379 v8 = GetActualWillpower(); | |
1036 | 2380 v9 = GetParameterBonus(v8); |
0 | 2381 v10 = GetActualIntelligence(); |
1036 | 2382 v11 = (GetParameterBonus(v10) + v9) >> 1; |
0 | 2383 break; |
2384 case 17: | |
2385 v12 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2386 v13 = this->pInventoryItemList; |
0 | 2387 do |
2388 { | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2389 if ( (signed int)v13->uItemID > 0 && (signed int)v13->uItemID <= 134 && !v13->IsBroken()) |
0 | 2390 v46[v4++] = v12; |
2391 ++v12; | |
2392 ++v13; | |
2393 } | |
2394 while ( v12 < 138 ); | |
2395 goto LABEL_36; | |
2396 case 18: | |
2397 v14 = 0; | |
2398 do | |
2399 { | |
2400 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v14) ) | |
2401 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2402 __debugbreak(); // player.cpp(2871): warning C4700: uninitialized local variable 'v15' used |
816 | 2403 if ( v15 == EQUIP_ARMOUR ) |
898 | 2404 v46[v4++] = LOBYTE(v5->pEquipment.uArmor) - 1; |
816 | 2405 if ( (!v15 || v15 == 1) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v15) == 4 ) |
898 | 2406 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v15) - 1; |
0 | 2407 } |
2408 v14 = v15 + 1; | |
2409 } | |
2410 while ( v14 < 16 ); | |
2411 goto LABEL_36; | |
2412 case 19: | |
2413 v16 = 0; | |
2414 do | |
2415 { | |
2416 if ( HasItemEquipped((ITEM_EQUIP_TYPE)v16) ) | |
2417 { | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
2418 __debugbreak(); // player.cpp(2886): warning C4700: uninitialized local variable 'v17' used |
0 | 2419 if ( v17 == 2 ) |
2420 v46[v4++] = LOBYTE(v5->pEquipment.uBow) - 1; | |
2421 if ( (!v17 || v17 == 1) | |
816 | 2422 && (!GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)v17) == 1) ) |
898 | 2423 v46[v4++] = *((char *)&v5->pEquipment.uShield + 4 * v17) - 1; |
0 | 2424 } |
2425 v16 = v17 + 1; | |
2426 } | |
2427 while ( v16 < 16 ); | |
2428 LABEL_36: | |
2429 if ( !v4 ) | |
2430 goto LABEL_87; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2431 v48 = (int)&v5->pInventoryItemList[(unsigned __int8)v46[rand() % v4]]; |
0 | 2432 v11 = 3 * (pItemsTable->pItems[*(int *)v48].uMaterial + pItemsTable->pItems[*(int *)v48].uDamageMod); |
2433 break; | |
2434 case 20: | |
2435 v19 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2436 v20 = this->pInventoryMatrix; |
0 | 2437 do |
2438 { | |
2439 if ( *v20 > 0 ) | |
2440 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2441 v21 = *(int *)&v5->pInventoryItemList[*v20-1]; |
0 | 2442 if ( v21 > 0 ) |
2443 { | |
2444 if ( v21 <= 134 ) | |
2445 v46[v4++] = v19; | |
2446 } | |
2447 } | |
2448 ++v19; | |
2449 ++v20; | |
2450 } | |
2451 while ( v19 < 126 ); | |
2452 if ( !v4 ) | |
2453 goto LABEL_87; | |
2454 v47 = (unsigned __int8)v46[rand() % v4]; | |
2455 v6 = GetActualAccuracy(); | |
2456 LABEL_46: | |
1036 | 2457 v7 = GetParameterBonus(v6); |
0 | 2458 LABEL_47: |
2459 v11 = v7; | |
2460 break; | |
2461 default: | |
2462 v11 = 0; | |
2463 break; | |
2464 } | |
2465 v22 = GetActualLuck(); | |
1036 | 2466 v23 = GetParameterBonus(v22) + v11 + 30; |
0 | 2467 if ( rand() % v23 >= 30 ) |
2468 { | |
2469 LABEL_87: | |
2470 result = 0; | |
2471 } | |
2472 else | |
2473 { | |
2474 switch ( a2 ) | |
2475 { | |
2476 case 1: | |
2477 v41 = 1; | |
2478 v36 = 0; | |
2479 goto LABEL_56; | |
2480 case 2: | |
2481 v41 = 1; | |
2482 v36 = 1; | |
2483 goto LABEL_56; | |
2484 case 3: | |
2485 v41 = 1; | |
2486 v36 = 2; | |
2487 goto LABEL_56; | |
2488 case 23: | |
2489 v41 = 1; | |
2490 v36 = 3; | |
2491 goto LABEL_56; | |
2492 case 4: | |
2493 v41 = 1; | |
2494 v36 = 4; | |
2495 LABEL_56: | |
2496 SetCondition(v36, v41); | |
2497 v42 = 0; | |
2498 v37 = 0; | |
2499 v35 = 0; | |
2500 v34 = 0; | |
2501 v33 = -1; | |
2502 v32 = 0; | |
2503 v31 = 0; | |
2504 v30 = (SoundID)221; | |
2505 goto LABEL_83; | |
2506 case 5: | |
2507 v43 = 1; | |
2508 v38 = 5; | |
2509 goto LABEL_70; | |
2510 case 6: | |
2511 case 7: | |
2512 case 8: | |
2513 if ( a2 == 6 ) | |
2514 { | |
2515 v44 = 6; | |
2516 goto LABEL_60; | |
2517 } | |
2518 v25 = 2 * (a2 != 8) + 8; | |
2519 goto LABEL_65; | |
2520 case 9: | |
2521 if ( a2 == 6 ) | |
2522 { | |
2523 v44 = 7; | |
2524 LABEL_60: | |
2525 v24 = v44; | |
2526 } | |
2527 else | |
2528 { | |
2529 v25 = 2 * (a2 != 8) + 9; | |
2530 LABEL_65: | |
2531 v24 = v25; | |
2532 } | |
2533 SetCondition(v24, 1); | |
2534 v42 = 0; | |
2535 v37 = 0; | |
2536 v35 = 0; | |
2537 v34 = 0; | |
2538 v33 = -1; | |
2539 v32 = 0; | |
2540 v31 = 0; | |
2541 v30 = (SoundID)222; | |
2542 LABEL_83: | |
2543 pAudioPlayer->PlaySound(v30, v31, v32, v33, v34, v35, v37, v42); | |
2544 do | |
2545 { | |
2546 LABEL_84: | |
2547 if ( v5 == pPlayers[v3 + 1] ) | |
2548 break; | |
2549 ++v3; | |
2550 } | |
2551 while ( v3 < 4 ); | |
2552 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); | |
2553 result = 1; | |
2554 break; | |
2555 case 12: | |
2556 v43 = 1; | |
2557 v38 = 12; | |
2558 goto LABEL_70; | |
2559 case 15: | |
2560 v45 = 1; | |
2561 v39 = 15; | |
2562 goto LABEL_73; | |
2563 case 13: | |
2564 v43 = 1; | |
2565 v38 = 13; | |
2566 LABEL_70: | |
2567 SetCondition(v38, v43); | |
2568 v42 = 0; | |
2569 v37 = 0; | |
2570 v35 = 0; | |
2571 v34 = 0; | |
2572 v33 = -1; | |
2573 v32 = 0; | |
2574 v31 = 0; | |
2575 v30 = (SoundID)224; | |
2576 goto LABEL_83; | |
2577 case 14: | |
2578 v45 = 1; | |
2579 v39 = 14; | |
2580 goto LABEL_73; | |
2581 case 16: | |
2582 v45 = 1; | |
2583 v39 = 16; | |
2584 LABEL_73: | |
2585 SetCondition(v39, v45); | |
2586 v42 = 0; | |
2587 v37 = 0; | |
2588 v35 = 0; | |
2589 v34 = 0; | |
2590 v33 = -1; | |
2591 v32 = 0; | |
2592 v31 = 0; | |
2593 v30 = (SoundID)225; | |
2594 goto LABEL_83; | |
2595 case 17: | |
2596 case 18: | |
2597 case 19: | |
2598 v26 = v48; | |
2599 if ( *(char *)(v48 + 21) & 2 ) | |
2600 goto LABEL_84; | |
187 | 2601 PlaySound(SPEECH_40, 0); |
0 | 2602 *(int *)(v26 + 20) |= 2u; |
2603 goto LABEL_79; | |
2604 case 20: | |
187 | 2605 PlaySound(SPEECH_40, 0); |
0 | 2606 v27 = pActor->array_000234; |
2607 if ( pActor->array_000234[0].uItemID ) | |
2608 { | |
2609 v27 = &pActor->array_000234[1]; | |
2610 if ( pActor->array_000234[1].uItemID ) | |
2611 goto LABEL_84; | |
2612 } | |
2613 v28 = v47; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2614 memcpy(v27, &v5->pInventoryItemList[v5->pInventoryMatrix[v47]-1], 0x24u); |
0 | 2615 RemoveItemAtInventoryIndex(v28); |
2616 LABEL_79: | |
2617 v42 = 0; | |
2618 v37 = 0; | |
2619 v35 = 0; | |
2620 v34 = 0; | |
2621 v33 = -1; | |
2622 v32 = 0; | |
2623 v31 = 0; | |
2624 v30 = (SoundID)47; | |
2625 goto LABEL_83; | |
2626 case 21: | |
187 | 2627 PlaySound(SPEECH_42, 0); |
0 | 2628 ++v5->sAgeModifier; |
2629 goto LABEL_82; | |
2630 case 22: | |
187 | 2631 PlaySound(SPEECH_41, 0); |
0 | 2632 v5->sMana = 0; |
2633 LABEL_82: | |
2634 v42 = 0; | |
2635 v37 = 0; | |
2636 v35 = 0; | |
2637 v34 = 0; | |
2638 v33 = -1; | |
2639 v32 = 0; | |
2640 v31 = 0; | |
2641 v30 = (SoundID)226; | |
2642 goto LABEL_83; | |
2643 default: | |
2644 goto LABEL_87; | |
2645 } | |
2646 } | |
2647 return result; | |
2648 } | |
324 | 2649 |
0 | 2650 // 48DCF6: using guessed type char var_94[140]; |
2651 | |
2652 //----- (0048E1A3) -------------------------------------------------------- | |
2653 unsigned int Player::GetSpellSchool(unsigned int uSpellID) | |
2654 { | |
1091 | 2655 return pSpellStats->pInfos[uSpellID].uSchool; |
0 | 2656 } |
2657 | |
2658 //----- (0048E1B5) -------------------------------------------------------- | |
816 | 2659 int Player::GetAttackRecoveryTime(bool bRangedAttack) |
2660 { | |
2661 ItemGen *weapon = nullptr; | |
2662 ItemDesc *weapon_desc = nullptr; | |
2663 uint weapon_recovery = base_recovery_times_per_weapon_type[0]; | |
2664 if (bRangedAttack) | |
0 | 2665 { |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2666 if ( HasItemEquipped(EQUIP_BOW) ) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2667 { |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2668 weapon = &pInventoryItemList[pEquipment.uBow - 1]; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2669 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2670 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2671 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2672 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2673 else if ( IsUnarmed() == 1 && GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2674 { |
816 | 2675 weapon_recovery = base_recovery_times_per_weapon_type[1]; |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2676 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2677 else if ( HasItemEquipped(EQUIP_MAIN_HAND) ) |
816 | 2678 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2679 weapon = &pInventoryItemList[pEquipment.uMainHand - 1]; |
816 | 2680 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
2681 if (weapon_desc->uEquipType == EQUIP_WAND) | |
2682 { | |
2683 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2684 __debugbreak(); // looks like wands were two-handed weapons once, or supposed to be. should not get here now | |
2685 weapon_recovery = pSpellDatas[wand_spell_ids[weapon->uItemID - ITEM_WAND_FIRE]].uExpertLevelRecovery; | |
2686 } | |
0 | 2687 else |
816 | 2688 weapon_recovery = base_recovery_times_per_weapon_type[weapon_desc->uSkillType]; |
2689 } | |
1010 | 2690 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) != EQUIP_SHIELD) |
2691 // ADD: shield check because shield recovery is added later and can be accidentally doubled | |
816 | 2692 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2693 auto v12 = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2694 auto v12_desc = &pItemsTable->pItems[v12->uItemID]; |
2695 if (base_recovery_times_per_weapon_type[v12_desc->uSkillType] > weapon_recovery) | |
2696 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2697 weapon = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2698 weapon_desc = &pItemsTable->pItems[weapon->uItemID]; |
2699 weapon_recovery = base_recovery_times_per_weapon_type[pItemsTable->pItems[weapon->uItemID].uSkillType]; | |
2700 } | |
2701 } | |
2702 | |
2703 uint armour_recovery = 0; | |
0 | 2704 if ( HasItemEquipped(EQUIP_ARMOUR) ) |
2705 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2706 auto armour_skill_type = pItemsTable->pItems[pInventoryItemList[pEquipment.uArmor - 1].uItemID].uSkillType; |
816 | 2707 uint base_armour_recovery = base_recovery_times_per_weapon_type[armour_skill_type]; |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2708 float multiplier; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2709 |
816 | 2710 if (armour_skill_type == PLAYER_SKILL_LEATHER) |
2711 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2712 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0, 0, 0); |
816 | 2713 } |
2714 else if (armour_skill_type == PLAYER_SKILL_CHAIN) | |
2715 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2716 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0, 0); |
816 | 2717 } |
2718 else if (armour_skill_type == PLAYER_SKILL_PLATE) | |
2719 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2720 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0.5f, 0); |
0 | 2721 } |
2722 else | |
2723 { | |
1545 | 2724 Error("Unknown armour type"); // what kind of armour is that? |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2725 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 1.0f, 1.0f, 1.0f); |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2726 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2727 |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2728 armour_recovery = (uint)(base_armour_recovery * multiplier); |
816 | 2729 } |
2730 | |
2731 uint shield_recovery = 0; | |
2732 if (HasItemEquipped(EQUIP_OFF_HAND) && GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD) | |
2733 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
2734 auto shield = &pInventoryItemList[pEquipment.uShield - 1]; |
816 | 2735 auto skill_type = pItemsTable->pItems[shield->uItemID].uSkillType; |
2736 | |
2737 uint shield_base_recovery = base_recovery_times_per_weapon_type[skill_type]; | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2738 float multiplier = GetArmorRecoveryMultiplierFromSkillLevel(skill_type, 1.0f, 0, 0, 0); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2739 shield_recovery = (uint)(shield_base_recovery * multiplier); |
816 | 2740 } |
2741 | |
1036 | 2742 uint player_speed_recovery_reduction = GetParameterBonus(GetActualSpeed()), |
816 | 2743 sword_axe_bow_recovery_reduction = 0; |
2744 bool shooting_laser = false; | |
2745 if (weapon_desc) | |
2746 { | |
2747 if (GetActualSkillLevel((PLAYER_SKILL_TYPE)weapon_desc->uSkillType) && | |
2748 (weapon_desc->uSkillType == PLAYER_SKILL_SWORD || weapon_desc->uSkillType == PLAYER_SKILL_AXE || weapon_desc->uSkillType == PLAYER_SKILL_BOW) ) | |
2749 { | |
2750 if (SkillToMastery(pActiveSkills[weapon_desc->uSkillType]) >= 2 ) // Expert Sword, Axe & Bow reduce recovery | |
2751 sword_axe_bow_recovery_reduction = pActiveSkills[weapon_desc->uSkillType] & 0x3F; | |
2752 } | |
2753 if (weapon_desc->uSkillType == PLAYER_SKILL_BLASTER) | |
2754 shooting_laser = true; | |
2755 } | |
2756 | |
2757 uint armsmaster_recovery_reduction = 0; | |
2758 if (!bRangedAttack && !shooting_laser) | |
2759 { | |
2760 if (uint armsmaster_level = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER)) | |
2761 { | |
2762 armsmaster_recovery_reduction = armsmaster_level & 0x3F; | |
2763 if (SkillToMastery(armsmaster_level) >= 4) | |
2764 armsmaster_recovery_reduction *= 2; | |
2765 } | |
2766 } | |
2767 | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2768 uint hasteRecoveryReduction = 0; |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
2769 if (pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime > 0 || pParty->pPartyBuffs[PARTY_BUFF_HASTE].uExpireTime > 0 ) |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2770 hasteRecoveryReduction = 25; |
816 | 2771 |
2772 uint weapon_enchantment_recovery_reduction = 0; | |
2773 if ( weapon ) | |
2774 { | |
2775 if (weapon->uSpecEnchantmentType == 59 || | |
2776 weapon->uSpecEnchantmentType == 41 || | |
2777 weapon->uSpecEnchantmentType == 500) | |
2778 weapon_enchantment_recovery_reduction = 20; | |
2779 } | |
2780 | |
2781 int recovery = weapon_recovery + | |
2782 armour_recovery + | |
2783 shield_recovery | |
2784 - armsmaster_recovery_reduction | |
2785 - weapon_enchantment_recovery_reduction | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2786 - hasteRecoveryReduction |
816 | 2787 - sword_axe_bow_recovery_reduction |
2788 - player_speed_recovery_reduction; | |
2789 | |
2790 if (recovery < 0) | |
2791 recovery = 0; | |
2792 return recovery; | |
0 | 2793 } |
2794 | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2795 |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2796 //----- new -------------------------------------------------------- |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2797 float Player::GetArmorRecoveryMultiplierFromSkillLevel( unsigned char armour_skill_type, float mult1, float mult2, float mult3, float mult4 ) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2798 { |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2799 uint skill_mastery = SkillToMastery(pActiveSkills[armour_skill_type]); |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2800 switch (skill_mastery) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2801 { |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2802 case 1: return mult1; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2803 case 2: return mult2; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2804 case 3: return mult3; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2805 case 4: return mult4; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2806 } |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2807 Error("Unexpected input value: %d", armour_skill_type); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2808 return 0; |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2809 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2810 |
0 | 2811 //----- (0048E4F8) -------------------------------------------------------- |
2812 int Player::GetMaxHealth() | |
2813 { | |
2814 int v3; // esi@1 | |
2815 int v4; // esi@1 | |
2816 int v6; // esi@1 | |
2817 | |
1036 | 2818 v3 = GetParameterBonus(GetActualEndurance()); |
135 | 2819 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); |
0 | 2820 v6 = uFullHealthBonus |
135 | 2821 + pBaseHealthByClass[classType / 4] |
0 | 2822 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2823 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2824 return max(1, v6); |
0 | 2825 } |
2826 | |
2827 //----- (0048E565) -------------------------------------------------------- | |
2828 int Player::GetMaxMana() | |
2829 { | |
2830 int v2; // eax@2 | |
2831 int v3; // esi@4 | |
2832 int v4; // eax@5 | |
2833 int v5; // esi@5 | |
2834 int v6; // eax@5 | |
2835 int v7; // esi@6 | |
2836 int v8; // esi@6 | |
2837 int v9; // esi@6 | |
1116 | 2838 |
135 | 2839 switch (classType) |
0 | 2840 { |
1116 | 2841 case PLAYER_CLASS_ROGUE: |
2842 case PLAYER_CLASS_SPY: | |
2843 case PLAYER_CLASS_ASSASSIN: | |
2844 case PLAYER_CLASS_ARCHER: | |
2845 case PLAYER_CLASS_WARRIOR_MAGE: | |
2846 case PLAYER_CLASS_MASTER_ARCHER: | |
2847 case PLAYER_CLASS_SNIPER: | |
2848 case PLAYER_CLASS_SORCERER: | |
2849 case PLAYER_CLASS_WIZARD: | |
2850 case PLAYER_CLASS_ARCHMAGE: | |
2851 case PLAYER_CLASS_LICH: | |
0 | 2852 v2 = GetActualIntelligence(); |
1036 | 2853 v3 = GetParameterBonus(v2); |
1116 | 2854 break; |
2855 case PLAYER_CLASS_INITIATE: | |
2856 case PLAYER_CLASS_MASTER: | |
2857 case PLAYER_CLASS_NINJA: | |
2858 case PLAYER_CLASS_PALADIN: | |
2859 case PLAYER_CLASS_CRUSADER: | |
2860 case PLAYER_CLASS_HERO: | |
2861 case PLAYER_CLASS_VILLIAN: | |
2862 case PLAYER_CLASS_CLERIC: | |
2863 case PLAYER_CLASS_PRIEST: | |
2864 case PLAYER_CLASS_PRIEST_OF_SUN: | |
2865 case PLAYER_CLASS_PRIEST_OF_MOON: | |
0 | 2866 v2 = GetActualWillpower(); |
1036 | 2867 v3 = GetParameterBonus(v2); |
1116 | 2868 break; |
2869 case PLAYER_CLASS_HUNTER: | |
2870 case PLAYER_CLASS_RANGER_LORD: | |
2871 case PLAYER_CLASS_BOUNTY_HUNTER: | |
2872 case PLAYER_CLASS_DRUID: | |
2873 case PLAYER_CLASS_GREAT_DRUID: | |
2874 case PLAYER_CLASS_ARCH_DRUID: | |
2875 case PLAYER_CLASS_WARLOCK: | |
0 | 2876 v4 = GetActualWillpower(); |
1036 | 2877 v5 = GetParameterBonus(v4); |
0 | 2878 v6 = GetActualIntelligence(); |
1036 | 2879 v3 = GetParameterBonus(v6) + v5; |
0 | 2880 break; |
2881 default: | |
1116 | 2882 return 0; |
0 | 2883 break; |
2884 } | |
1116 | 2885 v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2886 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA) + v7; |
1116 | 2887 v9 = uFullManaBonus |
2888 + pBaseManaByClass[classType / 4] | |
2889 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) | |
2890 + v8; | |
2891 return max(0,v9); | |
0 | 2892 } |
2893 | |
2894 //----- (0048E656) -------------------------------------------------------- | |
2895 int Player::GetBaseAC() | |
2896 { | |
2897 int v2; // eax@1 | |
2898 int v3; // esi@1 | |
2899 int v4; // esi@1 | |
2900 int v5; // esi@1 | |
2901 | |
2902 v2 = GetActualSpeed(); | |
1036 | 2903 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2904 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3; |
0 | 2905 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2906 return max(0, v5); |
0 | 2907 } |
2908 | |
2909 //----- (0048E68F) -------------------------------------------------------- | |
2910 int Player::GetActualAC() | |
2911 { | |
2912 int v2; // eax@1 | |
2913 int v3; // esi@1 | |
2914 int v4; // esi@1 | |
2915 int v5; // esi@1 | |
2916 int v6; // esi@1 | |
2917 | |
2918 v2 = GetActualSpeed(); | |
1036 | 2919 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2920 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3; |
0 | 2921 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2922 v6 = this->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5; |
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2923 return max(0, v6); |
0 | 2924 } |
2925 | |
2926 //----- (0048E6DC) -------------------------------------------------------- | |
2927 unsigned int Player::GetBaseAge() | |
2928 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2929 return (unsigned int)(((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year); |
0 | 2930 } |
2931 | |
2932 //----- (0048E72C) -------------------------------------------------------- | |
2933 unsigned int Player::GetActualAge() | |
2934 { | |
2935 return this->sAgeModifier + GetBaseAge(); | |
2936 } | |
2937 | |
2938 //----- (0048E73F) -------------------------------------------------------- | |
2939 int Player::GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
2940 { | |
2941 int v7; // esi@20 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2942 int racialBonus = 0; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2943 __int16* resStat; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2944 |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2945 switch (a2) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2946 { |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2947 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2948 resStat = &sResFireBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2949 if (IsRaceGoblin()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2950 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2951 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2952 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2953 resStat = &sResAirBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2954 if (IsRaceGoblin()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2955 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2956 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2957 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2958 resStat = &sResWaterBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2959 if (IsRaceDwarf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2960 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2961 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2962 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2963 resStat = &sResEarthBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2964 if (IsRaceDwarf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2965 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2966 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2967 case CHARACTER_ATTRIBUTE_RESIST_MIND: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2968 resStat = &sResMindBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2969 if (IsRaceElf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2970 racialBonus = 10; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2971 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2972 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2973 case CHARACTER_ATTRIBUTE_RESIST_SPIRIT: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2974 resStat = &sResBodyBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2975 if (IsRaceHuman()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2976 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2977 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2978 } |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2979 v7 = GetItemsBonus(a2) + racialBonus; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2980 return v7 + *resStat; |
0 | 2981 } |
2982 | |
2983 //----- (0048E7D0) -------------------------------------------------------- | |
2984 int Player::GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
2985 { | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2986 signed int v10 = 0; // [sp+14h] [bp-4h]@1 |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2987 __int16* resStat; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2988 int result; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2989 int baseRes; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2990 |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2991 int leatherArmorSkillLevel = GetActualSkillLevel(PLAYER_SKILL_LEATHER); |
652 | 2992 if ( CheckHiredNPCSpeciality(Enchanter) ) |
0 | 2993 v10 = 20; |
2994 if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE | |
2995 || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR | |
2996 || a2 == CHARACTER_ATTRIBUTE_RESIST_WATER | |
2997 || a2 == CHARACTER_ATTRIBUTE_RESIST_EARTH) | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
2998 && SkillToMastery(leatherArmorSkillLevel) == 4 |
0 | 2999 && HasItemEquipped(EQUIP_ARMOUR) |
3000 && GetEquippedItemSkillType(EQUIP_ARMOUR) == PLAYER_SKILL_LEATHER ) | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3001 v10 += leatherArmorSkillLevel & 0x3F; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3002 switch (a2) |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3003 { |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3004 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3005 resStat = &sResFireBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3006 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3007 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3008 resStat = &sResAirBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3009 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3010 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3011 resStat = &sResWaterBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3012 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3013 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3014 resStat = &sResEarthBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3015 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3016 case CHARACTER_ATTRIBUTE_RESIST_MIND: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3017 resStat = &sResMindBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3018 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3019 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3020 case CHARACTER_ATTRIBUTE_RESIST_SPIRIT: |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3021 resStat = &sResBodyBonus; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3022 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3023 } |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3024 baseRes = GetBaseResistance(a2); |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3025 result = v10 + GetMagicalBonus(a2) + baseRes + *(resStat); |
0 | 3026 return result; |
3027 } | |
3028 | |
3029 //----- (0048E8F5) -------------------------------------------------------- | |
816 | 3030 bool Player::Recover(int dt) |
3031 { | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3032 int v3; // qax@1 |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3033 |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3034 v3 = (int)(dt * GetSpecialItemBonus(17) * 0.01 + dt); |
816 | 3035 |
3036 Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery); | |
3037 | |
3038 if (uTimeToRecovery > v3) | |
3039 { | |
3040 uTimeToRecovery -= v3; | |
3041 return true; | |
0 | 3042 } |
3043 else | |
3044 { | |
816 | 3045 uTimeToRecovery = 0; |
3046 viewparams->bRedrawGameUI = true; | |
3047 if (!uActiveCharacter) | |
0 | 3048 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3049 return false; |
3050 } | |
0 | 3051 } |
3052 | |
3053 //----- (0048E96A) -------------------------------------------------------- | |
816 | 3054 void Player::SetRecoveryTime(signed int rec) |
3055 { | |
1545 | 3056 Assert(rec >= 0); |
816 | 3057 |
3058 if (rec > uTimeToRecovery) | |
3059 uTimeToRecovery = rec; | |
3060 | |
3061 if (pPlayers[uActiveCharacter] == this && !some_active_character) | |
0 | 3062 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 3063 |
3064 viewparams->bRedrawGameUI = true; | |
0 | 3065 } |
3066 // 50C0C4: using guessed type int some_active_character; | |
3067 | |
3068 //----- (0048E9B7) -------------------------------------------------------- | |
3069 void Player::RandomizeName() | |
3070 { | |
3071 if (!uExpressionTimePassed) | |
3072 strcpy(pName, pNPCStats->pNPCNames[rand() % pNPCStats->uNumNPCNames[uSex]][uSex]); | |
3073 } | |
3074 | |
3075 //----- (0048E9F4) -------------------------------------------------------- | |
3076 unsigned int Player::GetMajorConditionIdx() | |
3077 { | |
3078 for (uint i = 0; i < 18; ++i) | |
3079 if (pConditions[pConditionImportancyTable[i]] != 0) | |
3080 return pConditionImportancyTable[i]; | |
3081 | |
3082 return 18; | |
3083 } | |
3084 | |
3085 //----- (0048EA1B) -------------------------------------------------------- | |
1036 | 3086 int Player::GetParameterBonus( int player_parameter ) |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3087 { |
1036 | 3088 int i; // eax@1 |
3089 i = 0; | |
3090 while (param_to_bonus_table[i]) | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3091 { |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3092 if (player_parameter >= param_to_bonus_table[i]) |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3093 break; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3094 ++i; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3095 } |
1036 | 3096 return parameter_to_bonus_value[i]; |
0 | 3097 } |
3098 | |
3099 //----- (0048EA46) -------------------------------------------------------- | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3100 int Player::GetSpecialItemBonus( int enchantmentId ) |
0 | 3101 { |
1032 | 3102 int inv_indx; // eax@3 |
3103 | |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3104 for (int i = EQUIP_OFF_HAND; i < EQUIP_BOOK; ++i ) |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3105 { |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3106 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3107 { |
1032 | 3108 inv_indx = pEquipment.pIndices[i] - 1; |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3109 if (enchantmentId == 17) |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3110 { |
1599 | 3111 if ((pInventoryItemList[inv_indx].uSpecEnchantmentType == 17) || (pInventoryItemList[inv_indx].uItemID == 533)) //Elven Chainmail+Increases rate of Recovery |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3112 return 50; |
1032 | 3113 } |
1598
11bb463837b1
_48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus, forgot to commit actor.cpp
Grumpy7
parents:
1597
diff
changeset
|
3114 if (enchantmentId == 24) |
1597
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3115 { |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3116 if (pInventoryItemList[inv_indx].uSpecEnchantmentType == 24) //Increased Knockback. |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3117 return 5; |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3118 } |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3119 } |
33a82b36c3e8
Player::GetActualResistance cleaned up, some minor changes in Player::Recover, _48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus
Grumpy7
parents:
1595
diff
changeset
|
3120 } |
1032 | 3121 return 0; |
0 | 3122 } |
3123 | |
3124 //----- (0048EAAE) -------------------------------------------------------- | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3125 int Player::GetItemsBonus( enum CHARACTER_ATTRIBUTE_TYPE attr, bool getOnlyMainHandDmg /*= false*/ ) |
0 | 3126 { |
3127 int v5; // edi@1 | |
3128 int v9; // eax@49 | |
3129 int v14; // ecx@58 | |
3130 int v15; // eax@58 | |
3131 int v17; // eax@62 | |
3132 int v20; // eax@69 | |
3133 int v22; // eax@76 | |
3134 int v23; // edx@76 | |
3135 int v25; // ecx@80 | |
3136 int v26; // edi@80 | |
3137 int v31; // ebp@97 | |
3138 int v32; // eax@98 | |
3139 unsigned int v33; // eax@100 | |
3140 int v56; // eax@365 | |
3141 int v57; // ebx@368 | |
3142 signed int v58; // [sp-4h] [bp-20h]@10 | |
3143 int v61; // [sp+10h] [bp-Ch]@1 | |
3144 int v62; // [sp+14h] [bp-8h]@1 | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3145 ItemGen *currEquippedItem; // [sp+20h] [bp+4h]@101 |
1040 | 3146 bool no_skills; |
0 | 3147 |
3148 v5 = 0; | |
3149 v62 = 0; | |
3150 v61 = 0; | |
1040 | 3151 |
3152 no_skills=false; | |
0 | 3153 switch (attr) |
1599 | 3154 { |
3155 case CHARACTER_ATTRIBUTE_SKILL_ALCHEMY: v58 = PLAYER_SKILL_ALCHEMY; break; | |
3156 case CHARACTER_ATTRIBUTE_SKILL_STEALING: v58 = PLAYER_SKILL_STEALING; break; | |
3157 case CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM: v58 = PLAYER_SKILL_TRAP_DISARM; break; | |
3158 case CHARACTER_ATTRIBUTE_SKILL_ITEM_ID: v58 = PLAYER_SKILL_ITEM_ID; break; | |
3159 case CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID: v58 = PLAYER_SKILL_MONSTER_ID; break; | |
3160 case CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER: v58 = PLAYER_SKILL_ARMSMASTER; break; | |
3161 case CHARACTER_ATTRIBUTE_SKILL_DODGE: v58 = PLAYER_SKILL_DODGE; break; | |
3162 case CHARACTER_ATTRIBUTE_SKILL_UNARMED: v58 = PLAYER_SKILL_UNARMED; break; | |
3163 case CHARACTER_ATTRIBUTE_SKILL_FIRE: v58 = PLAYER_SKILL_FIRE; break; | |
3164 case CHARACTER_ATTRIBUTE_SKILL_AIR: v58 = PLAYER_SKILL_AIR; break; | |
3165 case CHARACTER_ATTRIBUTE_SKILL_WATER: v58 = PLAYER_SKILL_WATER; break; | |
3166 case CHARACTER_ATTRIBUTE_SKILL_EARTH: v58 = PLAYER_SKILL_EARTH; break; | |
3167 case CHARACTER_ATTRIBUTE_SKILL_SPIRIT: v58 = PLAYER_SKILL_SPIRIT; break; | |
3168 case CHARACTER_ATTRIBUTE_SKILL_MIND: v58 = PLAYER_SKILL_MIND; break; | |
3169 case CHARACTER_ATTRIBUTE_SKILL_BODY: v58 = PLAYER_SKILL_BODY; break; | |
3170 case CHARACTER_ATTRIBUTE_SKILL_LIGHT: v58 = PLAYER_SKILL_LIGHT; break; | |
3171 case CHARACTER_ATTRIBUTE_SKILL_DARK: v58 = PLAYER_SKILL_DARK; break; | |
3172 case CHARACTER_ATTRIBUTE_SKILL_MEDITATION: v58 = PLAYER_SKILL_MEDITATION; break; | |
3173 case CHARACTER_ATTRIBUTE_SKILL_BOW: v58 = PLAYER_SKILL_BOW; break; | |
3174 case CHARACTER_ATTRIBUTE_SKILL_SHIELD: v58 = PLAYER_SKILL_SHIELD; break; | |
3175 case CHARACTER_ATTRIBUTE_SKILL_LEARNING: v58 = PLAYER_SKILL_LEARNING; break; | |
3176 default: | |
1040 | 3177 no_skills=true; |
1599 | 3178 } |
1040 | 3179 if (!no_skills) |
1599 | 3180 { |
3181 if ( !this->pActiveSkills[v58] ) | |
3182 return 0; | |
3183 } | |
1040 | 3184 |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3185 switch(attr) //TODO would be nice to move these into separate functions |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3186 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3187 case CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3188 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: |
0 | 3189 if ( HasItemEquipped(EQUIP_BOW) ) |
1599 | 3190 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uBow-1].uItemID].uDamageMod; |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3191 return v5; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3192 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3193 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3194 case CHARACTER_ATTRIBUTE_RANGED_DMG_MIN: |
0 | 3195 if ( !HasItemEquipped(EQUIP_BOW) ) |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3196 return 0; |
1599 | 3197 v57 = this->pOwnItems[this->pEquipment.uBow-1].uItemID; |
0 | 3198 v5 = pItemsTable->pItems[v57].uDamageMod; |
3199 v56 = pItemsTable->pItems[v57].uDamageDice; | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3200 return v5 + v56; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3201 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3202 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3203 case CHARACTER_ATTRIBUTE_RANGED_DMG_MAX: |
0 | 3204 if ( !HasItemEquipped(EQUIP_BOW) ) |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3205 return 0; |
1599 | 3206 v20 = this->pOwnItems[this->pEquipment.uBow-1].uItemID; |
0 | 3207 v5 = pItemsTable->pItems[v20].uDamageDice * pItemsTable->pItems[v20].uDamageRoll; |
3208 v56 = pItemsTable->pItems[v20].uDamageMod; | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3209 return v5 + v56; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3210 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3211 case CHARACTER_ATTRIBUTE_LEVEL: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3212 if ( !Player::HasEnchantedItemEquipped(25) ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3213 return 0; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3214 return 5; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3215 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3216 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3217 case CHARACTER_ATTRIBUTE_MELEE_DMG_MAX: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3218 if ( IsUnarmed() ) |
0 | 3219 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3220 return 3; |
0 | 3221 } |
3222 else | |
3223 { | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3224 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) |
0 | 3225 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3226 v22 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3227 if ( v22 >= 0 && v22 <= 2) |
0 | 3228 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3229 v23 = this->pOwnItems[this->pEquipment.uMainHand].uItemID; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3230 v26 = pItemsTable->pItems[v23].uDamageRoll; |
1599 | 3231 if ( this->pEquipment.uShield || pItemsTable->pItems[v23].uSkillType != 4 ) |
0 | 3232 { |
3233 v25 = pItemsTable->pItems[v23].uDamageDice; | |
3234 } | |
3235 else | |
3236 { | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3237 v25 = pItemsTable->pItems[v23].uDamageDice + 1; |
0 | 3238 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
3239 v5 = pItemsTable->pItems[v23].uDamageMod + v25 * v26; |
0 | 3240 } |
3241 } | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3242 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0 && GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2)) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3243 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3244 return v5; |
1040 | 3245 } |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3246 else |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3247 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3248 v23 = this->pOwnItems[this->pEquipment.uShield].uItemID; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3249 v15 = pItemsTable->pItems[v23].uDamageMod; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3250 v14 = pItemsTable->pItems[v23].uDamageDice * pItemsTable->pItems[v23].uDamageRoll; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3251 return v5 + v15 + v14; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3252 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3253 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3254 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3255 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3256 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3257 case CHARACTER_ATTRIBUTE_ATTACK: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3258 if ( IsUnarmed() ) |
1040 | 3259 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3260 return 0; |
1040 | 3261 } |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3262 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) |
0 | 3263 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3264 v17 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3265 if ( v17 >= 0 && v17 <= 2) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3266 { |
1599 | 3267 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand-1].uItemID].uDamageMod; |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3268 } |
0 | 3269 } |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3270 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (this->GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0) || this->GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2 ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3271 return v5; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3272 else |
0 | 3273 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3274 v20 = this->pOwnItems[this->pEquipment.uShield - 1].uItemID; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3275 v56 = pItemsTable->pItems[v20].uDamageMod; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3276 return v5 + v56; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3277 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3278 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3279 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3280 case CHARACTER_ATTRIBUTE_MELEE_DMG_MIN: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3281 if ( IsUnarmed() ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3282 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3283 return 1; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3284 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3285 if ( this->HasItemEquipped(EQUIP_MAIN_HAND) ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3286 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3287 v9 = this->GetEquippedItemEquipType(EQUIP_MAIN_HAND); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3288 if ( v9 >= 0 && v9 <= 2) |
0 | 3289 { |
1040 | 3290 v5 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageDice + |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3291 pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uDamageMod; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3292 if ( !this->pEquipment.uShield && pItemsTable->pItems[this->pOwnItems[this->pEquipment.uMainHand].uItemID].uSkillType == 4) |
0 | 3293 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3294 ++v5; |
0 | 3295 } |
3296 } | |
3297 } | |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3298 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3299 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_OFF_HAND) || (this->GetEquippedItemEquipType(EQUIP_OFF_HAND) < 0) || this->GetEquippedItemEquipType(EQUIP_OFF_HAND) > 2 ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3300 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3301 return v5; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3302 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3303 else |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3304 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3305 v14 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageMod; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3306 v15 = pItemsTable->pItems[this->pOwnItems[this->pEquipment.uShield].uItemID].uDamageDice; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3307 return v5 + v15 + v14; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3308 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3309 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3310 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3311 case CHARACTER_ATTRIBUTE_STRENGTH: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3312 case CHARACTER_ATTRIBUTE_INTELLIGENCE: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3313 case CHARACTER_ATTRIBUTE_WILLPOWER: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3314 case CHARACTER_ATTRIBUTE_ENDURANCE: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3315 case CHARACTER_ATTRIBUTE_ACCURACY: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3316 case CHARACTER_ATTRIBUTE_SPEED: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3317 case CHARACTER_ATTRIBUTE_LUCK: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3318 case CHARACTER_ATTRIBUTE_HEALTH: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3319 case CHARACTER_ATTRIBUTE_MANA: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3320 case CHARACTER_ATTRIBUTE_AC_BONUS: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3321 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3322 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3323 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3324 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3325 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3326 case CHARACTER_ATTRIBUTE_RESIST_MIND: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3327 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3328 case CHARACTER_ATTRIBUTE_RESIST_SPIRIT: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3329 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3330 case CHARACTER_ATTRIBUTE_SKILL_ALCHEMY: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3331 case CHARACTER_ATTRIBUTE_SKILL_STEALING: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3332 case CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3333 case CHARACTER_ATTRIBUTE_SKILL_ITEM_ID: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3334 case CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3335 case CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3336 case CHARACTER_ATTRIBUTE_SKILL_DODGE: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3337 case CHARACTER_ATTRIBUTE_SKILL_UNARMED: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3338 |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3339 case CHARACTER_ATTRIBUTE_SKILL_FIRE: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3340 case CHARACTER_ATTRIBUTE_SKILL_AIR: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3341 case CHARACTER_ATTRIBUTE_SKILL_WATER: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3342 case CHARACTER_ATTRIBUTE_SKILL_EARTH: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3343 case CHARACTER_ATTRIBUTE_SKILL_SPIRIT: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3344 case CHARACTER_ATTRIBUTE_SKILL_MIND: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3345 case CHARACTER_ATTRIBUTE_SKILL_BODY: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3346 case CHARACTER_ATTRIBUTE_SKILL_LIGHT: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3347 case CHARACTER_ATTRIBUTE_SKILL_DARK: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3348 case CHARACTER_ATTRIBUTE_SKILL_MEDITATION: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3349 case CHARACTER_ATTRIBUTE_SKILL_BOW: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3350 case CHARACTER_ATTRIBUTE_SKILL_SHIELD: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3351 case CHARACTER_ATTRIBUTE_SKILL_LEARNING: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3352 for (int i = 0; i < 16; i++) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3353 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3354 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
1040 | 3355 { |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3356 v31 = this->pEquipment.pIndices[i] - 1; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3357 currEquippedItem = &this->pInventoryItemList[v31]; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3358 if ( attr == CHARACTER_ATTRIBUTE_AC_BONUS ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3359 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3360 v32 = GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3361 if ( v32 >= 3 && v32 <= 11 ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3362 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3363 v33 = currEquippedItem->uItemID; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3364 v5 += pItemsTable->pItems[v33].uDamageDice + pItemsTable->pItems[v33].uDamageMod; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3365 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3366 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3367 if ( pItemsTable->IsMaterialNonCommon((ItemGen *)(currEquippedItem)) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3368 && !pItemsTable->IsMaterialSpecial(currEquippedItem) ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3369 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3370 currEquippedItem->GetItemBonusArtifact(this, attr, &v62); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3371 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3372 else if ( currEquippedItem->uEnchantmentType != 0 ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3373 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3374 if (currEquippedItem->IsRegularEnchanmentForAttribute(attr)) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3375 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3376 if ( attr > CHARACTER_ATTRIBUTE_RESIST_BODY && v5 < currEquippedItem->m_enchantmentStrength ) |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3377 v5 = currEquippedItem->m_enchantmentStrength; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3378 else |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3379 v5 += currEquippedItem->m_enchantmentStrength; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3380 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3381 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3382 else |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3383 { |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3384 currEquippedItem->GetItemBonusSpecialEnchantment(this, attr, &v5, &v61); |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3385 } |
1040 | 3386 } |
1604
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3387 } |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3388 return v5 + v62 + v61; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3389 break; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3390 default: |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3391 return 0; |
4b79ff62df3a
Moved enchantment attribute bonus list to items.cpp/h, created static function that create the enchantments + helper functions to get the enchantment strength, moved the whole logic of Player::GetItemsBonus to a case
Grumpy7
parents:
1601
diff
changeset
|
3392 } |
0 | 3393 } |
3394 | |
3395 //----- (0048F73C) -------------------------------------------------------- | |
3396 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3397 { | |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3398 int v3 = 0; // eax@4 |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3399 int v4 = 0; // ecx@5 |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3400 |
0 | 3401 switch ( a2 ) |
3402 { | |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3403 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3404 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_FIRE].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3405 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_FIRE].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3406 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3407 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3408 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_AIR].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3409 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_AIR].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3410 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3411 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3412 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_BODY].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3413 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_BODY].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3414 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3415 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3416 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_WATER].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3417 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_WATER].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3418 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3419 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3420 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_EARTH].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3421 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_EARTH].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3422 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3423 case CHARACTER_ATTRIBUTE_RESIST_MIND: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3424 v3 = this->pPlayerBuffs[PLAYER_BUFF_RESIST_MIND].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3425 v4 = pParty->pPartyBuffs[PARTY_BUFF_RESIST_MIND].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3426 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3427 case CHARACTER_ATTRIBUTE_ATTACK: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3428 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3429 v3 = this->pPlayerBuffs[PLAYER_BUFF_BLESS].uPower; //only player effect spell in both VI and VII |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3430 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3431 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3432 v3 = this->pPlayerBuffs[PLAYER_BUFF_HEROISM].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3433 v4 = pParty->pPartyBuffs[PARTY_BUFF_HEROISM].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3434 break; |
0 | 3435 case CHARACTER_ATTRIBUTE_STRENGTH: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3436 v3 = pPlayerBuffs[PLAYER_BUFF_STRENGTH].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3437 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3438 break; |
0 | 3439 case CHARACTER_ATTRIBUTE_INTELLIGENCE: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3440 v3 = pPlayerBuffs[PLAYER_BUFF_INTELLIGENCE].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3441 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3442 break; |
0 | 3443 case CHARACTER_ATTRIBUTE_WILLPOWER: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3444 v3 = pPlayerBuffs[PLAYER_BUFF_WILLPOWER].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3445 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3446 break; |
0 | 3447 case CHARACTER_ATTRIBUTE_ENDURANCE: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3448 v3 = pPlayerBuffs[PLAYER_BUFF_ENDURANCE].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3449 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3450 break; |
0 | 3451 case CHARACTER_ATTRIBUTE_ACCURACY: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3452 v3 = pPlayerBuffs[PLAYER_BUFF_ACCURACY].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3453 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3454 break; |
0 | 3455 case CHARACTER_ATTRIBUTE_SPEED: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3456 v3 = pPlayerBuffs[PLAYER_BUFF_SPEED].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3457 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3458 break; |
0 | 3459 case CHARACTER_ATTRIBUTE_LUCK: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3460 v3 = pPlayerBuffs[PLAYER_BUFF_LUCK].uPower; |
1167 | 3461 v4 = pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].uPower; |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3462 break; |
0 | 3463 case CHARACTER_ATTRIBUTE_AC_BONUS: |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3464 v3 = this->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uPower; |
1167 | 3465 v4 = pParty->pPartyBuffs[PARTY_BUFF_STONE_SKIN].uPower; |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3466 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3467 } |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3468 return v3 + v4; |
0 | 3469 } |
3470 | |
3471 //----- (0048F882) -------------------------------------------------------- | |
1008 | 3472 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3473 { |
1064 | 3474 signed int bonus_value; // esi@1 |
3475 unsigned __int16 skill_value; // ax@126 | |
3476 int result; // al@127 | |
353 | 3477 |
1064 | 3478 bonus_value = 0; |
353 | 3479 switch (uSkillType) |
3480 { | |
3481 case PLAYER_SKILL_MONSTER_ID: | |
3482 { | |
652 | 3483 if ( CheckHiredNPCSpeciality(Hunter) ) |
1064 | 3484 bonus_value = 6; |
652 | 3485 if ( CheckHiredNPCSpeciality(Sage) ) |
1064 | 3486 bonus_value += 6; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3487 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID); |
353 | 3488 } |
3489 break; | |
3490 | |
3491 case PLAYER_SKILL_ARMSMASTER: | |
3492 { | |
652 | 3493 if ( CheckHiredNPCSpeciality(Armsmaster) ) |
1064 | 3494 bonus_value = 2; |
652 | 3495 if ( CheckHiredNPCSpeciality(Weaponsmaster) ) |
1064 | 3496 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3497 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER); |
353 | 3498 } |
3499 break; | |
3500 | |
3501 case PLAYER_SKILL_STEALING: | |
3502 { | |
652 | 3503 if (CheckHiredNPCSpeciality(Burglar)) |
1064 | 3504 bonus_value = 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3505 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING); |
353 | 3506 } |
3507 break; | |
3508 | |
3509 | |
3510 case PLAYER_SKILL_ALCHEMY: | |
3511 { | |
652 | 3512 if ( CheckHiredNPCSpeciality(Herbalist) ) |
1064 | 3513 bonus_value = 4; |
652 | 3514 if ( CheckHiredNPCSpeciality(Apothecary) ) |
1064 | 3515 bonus_value += 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3516 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY); |
353 | 3517 } |
3518 break; | |
3519 | |
3520 case PLAYER_SKILL_LEARNING: | |
3521 { | |
652 | 3522 if ( CheckHiredNPCSpeciality(Teacher) ) |
1064 | 3523 bonus_value = 10; |
652 | 3524 if ( CheckHiredNPCSpeciality(Instructor) ) |
1064 | 3525 bonus_value += 15; |
652 | 3526 if ( CheckHiredNPCSpeciality(Scholar) ) |
1064 | 3527 bonus_value += 5; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3528 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING); |
353 | 3529 } |
3530 break; | |
3531 | |
3532 case PLAYER_SKILL_UNARMED: | |
3533 { | |
652 | 3534 if (CheckHiredNPCSpeciality(Monk) ) |
1064 | 3535 bonus_value = 2; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3536 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED); |
353 | 3537 } |
3538 break; | |
3539 | |
3540 case PLAYER_SKILL_DODGE: | |
3541 { | |
652 | 3542 if ( CheckHiredNPCSpeciality(Monk) ) |
1064 | 3543 bonus_value = 2; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3544 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE); |
353 | 3545 } |
3546 break; | |
3547 | |
3548 case PLAYER_SKILL_BOW: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3549 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW); |
353 | 3550 break; |
3551 case PLAYER_SKILL_SHIELD: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3552 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD); |
353 | 3553 break; |
3554 | |
3555 case PLAYER_SKILL_EARTH: | |
652 | 3556 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3557 bonus_value = 2; |
652 | 3558 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3559 bonus_value += 3; |
652 | 3560 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3561 bonus_value += 4; |
353 | 3562 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3563 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3564 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH); |
353 | 3565 break; |
3566 case PLAYER_SKILL_FIRE: | |
652 | 3567 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3568 bonus_value = 2; |
652 | 3569 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3570 bonus_value += 3; |
652 | 3571 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3572 bonus_value += 4; |
353 | 3573 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3574 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3575 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE); |
353 | 3576 break; |
3577 case PLAYER_SKILL_AIR: | |
652 | 3578 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3579 bonus_value = 2; |
652 | 3580 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3581 bonus_value += 3; |
652 | 3582 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3583 bonus_value += 4; |
353 | 3584 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3585 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3586 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR); |
353 | 3587 break; |
3588 case PLAYER_SKILL_WATER: | |
652 | 3589 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3590 bonus_value = 2; |
652 | 3591 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3592 bonus_value += 3; |
652 | 3593 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3594 bonus_value += 4; |
353 | 3595 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3596 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3597 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER); |
353 | 3598 break; |
3599 case PLAYER_SKILL_SPIRIT: | |
652 | 3600 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3601 bonus_value = 2; |
652 | 3602 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3603 bonus_value += 3; |
652 | 3604 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3605 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3606 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT); |
353 | 3607 break; |
3608 case PLAYER_SKILL_MIND: | |
652 | 3609 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3610 bonus_value = 2; |
652 | 3611 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3612 bonus_value += 3; |
652 | 3613 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3614 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3615 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND); |
353 | 3616 break; |
3617 case PLAYER_SKILL_BODY: | |
652 | 3618 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3619 bonus_value = 2; |
652 | 3620 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3621 bonus_value += 3; |
652 | 3622 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3623 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3624 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY); |
353 | 3625 break; |
3626 case PLAYER_SKILL_LIGHT: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3627 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT); |
353 | 3628 break; |
3629 case PLAYER_SKILL_DARK: | |
3630 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3631 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK); |
353 | 3632 } |
3633 break; | |
3634 | |
3635 case PLAYER_SKILL_MERCHANT: | |
3636 { | |
652 | 3637 if ( CheckHiredNPCSpeciality(Trader) ) |
1064 | 3638 bonus_value = 4; |
652 | 3639 if ( CheckHiredNPCSpeciality(Merchant) ) |
1064 | 3640 bonus_value += 6; |
652 | 3641 if ( CheckHiredNPCSpeciality(Gypsy) ) |
1064 | 3642 bonus_value += 3; |
652 | 3643 if ( CheckHiredNPCSpeciality(Duper) ) |
1064 | 3644 bonus_value += 8; |
353 | 3645 } |
3646 break; | |
3647 | |
3648 case PLAYER_SKILL_PERCEPTION: | |
3649 { | |
652 | 3650 if ( CheckHiredNPCSpeciality(Scout) ) |
1064 | 3651 bonus_value = 6; |
652 | 3652 if ( CheckHiredNPCSpeciality(Psychic) ) |
1064 | 3653 bonus_value += 5; |
353 | 3654 } |
3655 break; | |
3656 | |
0 | 3657 case PLAYER_SKILL_ITEM_ID: |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3658 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID); |
0 | 3659 break; |
3660 case PLAYER_SKILL_MEDITATION: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3661 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION); |
353 | 3662 break; |
0 | 3663 case PLAYER_SKILL_TRAP_DISARM: |
353 | 3664 { |
652 | 3665 if ( CheckHiredNPCSpeciality(Tinker) ) |
1064 | 3666 bonus_value = 4; |
652 | 3667 if ( CheckHiredNPCSpeciality(Locksmith) ) |
1064 | 3668 bonus_value += 6; |
652 | 3669 if ( CheckHiredNPCSpeciality(Burglar) ) |
1064 | 3670 bonus_value += 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3671 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM); |
353 | 3672 } |
3673 break; | |
3674 } | |
3675 | |
1064 | 3676 skill_value = pActiveSkills[uSkillType]; |
3677 if ( bonus_value + (skill_value & 0x3F) < 60 ) | |
3678 result = bonus_value + skill_value; | |
0 | 3679 else |
1064 | 3680 result = skill_value & 0xFFFC | 0x3C; //al |
0 | 3681 return result; |
3682 } | |
3683 | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3684 |
0 | 3685 //----- (0048FC00) -------------------------------------------------------- |
1538 | 3686 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
|
3687 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3688 int armsMasterBonus; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3689 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3690 armsMasterBonus = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3691 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
|
3692 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
|
3693 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3694 int multiplier = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3695 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
|
3696 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3697 multiplier = GetMultiplierForSkillLevel(armmaster_skill, 0, 0, 1, 2); |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3698 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3699 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
|
3700 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3701 multiplier = GetMultiplierForSkillLevel(armmaster_skill, 0, 1, 1, 2); |
1064 | 3702 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3703 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
|
3704 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3705 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3706 switch(inSkill) |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3707 { |
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
|
3708 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
|
3709 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
|
3710 { |
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
|
3711 int bowSkillLevel = GetActualSkillLevel(PLAYER_SKILL_DODGE); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3712 int multiplier = GetMultiplierForSkillLevel(bowSkillLevel, 0, 0, 0, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3713 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
|
3714 } |
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
|
3715 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
|
3716 break; |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3717 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
|
3718 { |
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
|
3719 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
|
3720 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
|
3721 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
|
3722 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3723 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3724 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
|
3725 { |
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
|
3726 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
|
3727 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
|
3728 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
|
3729 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3730 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3731 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
|
3732 { |
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
|
3733 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
|
3734 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
|
3735 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
|
3736 |
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
|
3737 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
|
3738 { |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
3739 if (pEquipment.pIndices[j] && (!pOwnItems[pEquipment.pIndices[j]].IsBroken())) |
1538 | 3740 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
3741 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
|
3742 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
|
3743 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
|
3744 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
|
3745 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
|
3746 { |
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
|
3747 case PLAYER_SKILL_STAFF: |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3748 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3749 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
|
3750 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
|
3751 case PLAYER_SKILL_SPEAR: |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3752 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 0, 0, 0, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3753 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
|
3754 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
|
3755 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3756 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3757 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
|
3758 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
|
3759 wearingLeather = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3760 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 2, 2); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3761 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
|
3762 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
|
3763 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3764 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3765 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
|
3766 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
|
3767 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3768 multiplier = GetMultiplierForSkillLevel(currArmorSkillLevel, 1, 1, 1, 1); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3769 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
|
3770 } |
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
|
3771 ACSum += multiplier * (currArmorSkillLevel & 0x3F); |
1538 | 3772 } |
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
|
3773 } |
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
|
3774 |
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
|
3775 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
|
3776 int dodgeMastery = SkillToMastery(dodgeSkillLevel); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3777 int multiplier = GetMultiplierForSkillLevel(dodgeSkillLevel, 1, 2, 3, 3); |
1539
5cf28ec7322d
Player:GetSkillBonus cleanup, added back some brackets, because of var declarations, moved here CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS from GetRangedDamageMin and GetRangedDamageMax
Grumpy7
parents:
1538
diff
changeset
|
3778 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
|
3779 { |
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
|
3780 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
|
3781 } |
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
|
3782 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
|
3783 } |
1538 | 3784 break; |
3785 case CHARACTER_ATTRIBUTE_ATTACK: | |
3786 if ( this->IsUnarmed() ) | |
3787 { | |
3788 int unarmedSkill = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
3789 if (!unarmedSkill) | |
3790 { | |
3791 return 0; | |
3792 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3793 int multiplier = GetMultiplierForSkillLevel(unarmedSkill, 0, 1, 2, 2); |
1538 | 3794 return armsMasterBonus + multiplier * (unarmedSkill & 0x3F); |
3795 } | |
3796 for (int i = 0; i < 16; ++i) | |
3797 { | |
3798 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3799 { | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
3800 ItemDesc currItem = pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID]; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
3801 if ( currItem.uEquipType <= EQUIP_MAIN_HAND) |
1533 | 3802 { |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
3803 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItem.uSkillType; |
1538 | 3804 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
3805 if (currItemSkillType == PLAYER_SKILL_BLASTER) | |
3806 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3807 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); |
1538 | 3808 return multiplier * (currentItemSkillLevel & 0x3F); |
3809 } | |
3810 else if (currItemSkillType == PLAYER_SKILL_STAFF && this->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) | |
3811 { | |
3812 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3813 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 2, 2); |
1538 | 3814 return multiplier * (unarmedSkillLevel & 0x3F) + armsMasterBonus + (currentItemSkillLevel & 0x3F); |
3815 } | |
3816 else | |
3817 { | |
3818 return armsMasterBonus + (currentItemSkillLevel & 0x3F); | |
3819 } | |
3820 } | |
3821 } | |
3822 } | |
3823 return 0; | |
3824 break; | |
3825 | |
3826 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: | |
3827 for (int i = 0; i < 16; i++) | |
3828 { | |
3829 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3830 { | |
3831 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID].uSkillType; | |
3832 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); | |
3833 if ( currentItemSkillType == PLAYER_SKILL_BOW ) | |
3834 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3835 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 1, 1); |
1538 | 3836 return multiplier * (currentItemSkillLevel & 0x3F); |
3837 } | |
3838 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) | |
3839 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3840 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); |
1538 | 3841 return multiplier * (currentItemSkillLevel & 0x3F); |
3842 } | |
3843 } | |
3844 } | |
3845 return 0; | |
3846 break; | |
3847 | |
3848 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: | |
3849 if ( this->IsUnarmed() ) | |
3850 { | |
3851 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
3852 if ( !unarmedSkillLevel ) | |
3853 { | |
3854 return 0; | |
3855 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3856 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 3857 return multiplier * (unarmedSkillLevel & 0x3F); |
3858 } | |
3859 for (int i = 0; i < 16; i++) | |
3860 { | |
3861 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3862 { | |
3863 int currItemId = this->pInventoryItemList[this->pEquipment.pIndices[i]].uItemID; | |
3864 if ( pItemsTable->pItems[currItemId].uEquipType == EQUIP_MAIN_HAND || pItemsTable->pItems[currItemId].uEquipType == EQUIP_OFF_HAND ) | |
3865 { | |
3866 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)pItemsTable->pItems[currItemId].uSkillType; | |
3867 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); | |
3868 int baseSkillBonus; | |
3869 int multiplier; | |
3870 switch (currItemSkillType) | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3871 { |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3872 case PLAYER_SKILL_STAFF: |
1538 | 3873 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
|
3874 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3875 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3876 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 3877 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
|
3878 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3879 else |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3880 { |
1538 | 3881 return armsMasterBonus; |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3882 } |
1538 | 3883 break; |
3884 | |
3885 case PLAYER_SKILL_DAGGER: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3886 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 1); |
1538 | 3887 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3888 return armsMasterBonus + baseSkillBonus; | |
3889 break; | |
3890 case PLAYER_SKILL_SWORD: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3891 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 0); |
1538 | 3892 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3893 return armsMasterBonus + baseSkillBonus; | |
3894 break; | |
3895 case PLAYER_SKILL_MACE: | |
3896 case PLAYER_SKILL_SPEAR: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3897 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 1, 1, 1); |
1538 | 3898 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3899 return armsMasterBonus + baseSkillBonus; | |
3900 break; | |
3901 case PLAYER_SKILL_AXE: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3902 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 1, 1); |
1538 | 3903 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3904 return armsMasterBonus + baseSkillBonus; | |
3905 break; | |
1535 | 3906 } |
1533 | 3907 } |
1535 | 3908 } |
1538 | 3909 } |
3910 return 0; | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3911 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3912 default: |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3913 return 0; |
1533 | 3914 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3915 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3916 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3917 unsigned int Player::GetMultiplierForSkillLevel(unsigned int skillValue, int mult1, int mult2, int mult3, int mult4) |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3918 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3919 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
|
3920 switch (masteryLvl) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3921 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3922 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
|
3923 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
|
3924 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
|
3925 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
|
3926 } |
1545 | 3927 Error("(%u)", masteryLvl); |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3928 return 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3929 } |
0 | 3930 //----- (00490109) -------------------------------------------------------- |
3931 // faces are: 0 1 2 3 human males | |
3932 // 4 5 6 7 human females | |
3933 // 8 9 elf males | |
3934 // 10 11 elf females | |
3935 // 12 13 dwarf males | |
3936 // 14 15 dwarf females | |
3937 // 16 17 goblin males | |
3938 // 18 19 goblin females | |
3939 // 20 lich male | |
3940 // 21 lich female | |
3941 // 22 underwater suits (unused) | |
3942 // 23 zombie male | |
3943 // 24 zombie female | |
3944 enum CHARACTER_RACE Player::GetRace() | |
3945 { | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3946 if ( uCurrentFace <= 7 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3947 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3948 return CHARACTER_RACE_HUMAN; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3949 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3950 else if ( uCurrentFace <= 11 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3951 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3952 return CHARACTER_RACE_ELF; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3953 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3954 else if ( uCurrentFace <= 15 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3955 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3956 return CHARACTER_RACE_DWARF; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3957 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3958 else if ( uCurrentFace <= 19 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3959 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3960 return CHARACTER_RACE_GOBLIN; |
0 | 3961 } |
3962 else | |
3963 { | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3964 return CHARACTER_RACE_HUMAN; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3965 } |
0 | 3966 } |
3967 | |
3968 //----- (00490141) -------------------------------------------------------- | |
187 | 3969 PLAYER_SEX Player::GetSexByVoice() |
0 | 3970 { |
3971 switch ( this->uVoiceID ) | |
3972 { | |
3973 case 0u: | |
3974 case 1u: | |
3975 case 2u: | |
3976 case 3u: | |
3977 case 8u: | |
3978 case 9u: | |
3979 case 0xCu: | |
3980 case 0xDu: | |
3981 case 0x10u: | |
3982 case 0x11u: | |
3983 case 0x14u: | |
3984 case 0x17u: | |
187 | 3985 return SEX_MALE; |
3986 | |
0 | 3987 case 4u: |
3988 case 5u: | |
3989 case 6u: | |
3990 case 7u: | |
3991 case 0xAu: | |
3992 case 0xBu: | |
3993 case 0xEu: | |
3994 case 0xFu: | |
3995 case 0x12u: | |
3996 case 0x13u: | |
3997 case 0x15u: | |
3998 case 0x18u: | |
187 | 3999 return SEX_FEMALE; |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4000 } |
1545 | 4001 Error("(%u)", this->uVoiceID); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4002 return SEX_MALE; |
0 | 4003 } |
4004 | |
4005 //----- (00490188) -------------------------------------------------------- | |
4006 void Player::SetInitialStats() | |
4007 { | |
4008 auto v1 = GetRace(); | |
290 | 4009 uMight = StatTable[v1][0].uBaseValue; |
4010 uIntelligence = StatTable[v1][1].uBaseValue; | |
4011 uWillpower = StatTable[v1][2].uBaseValue; | |
4012 uEndurance = StatTable[v1][3].uBaseValue; | |
4013 uAccuracy = StatTable[v1][4].uBaseValue; | |
4014 uSpeed = StatTable[v1][5].uBaseValue; | |
4015 uLuck = StatTable[v1][6].uBaseValue; | |
0 | 4016 } |
4017 | |
4018 //----- (004901FC) -------------------------------------------------------- | |
1021 | 4019 void Player::SetSexByVoice() |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4020 { |
1021 | 4021 switch ( this->uVoiceID) |
0 | 4022 { |
4023 case 0: | |
4024 case 1: | |
4025 case 2: | |
4026 case 3: | |
4027 case 8: | |
4028 case 9: | |
4029 case 0xC: | |
4030 case 0xD: | |
4031 case 0x10: | |
4032 case 0x11: | |
4033 case 0x14: | |
4034 case 0x17: | |
1021 | 4035 this->uSex = SEX_MALE; |
0 | 4036 break; |
4037 case 4: | |
4038 case 5: | |
4039 case 6: | |
4040 case 7: | |
4041 case 0xA: | |
4042 case 0xB: | |
4043 case 0xE: | |
4044 case 0xF: | |
4045 case 0x12: | |
4046 case 0x13: | |
4047 case 0x15: | |
4048 case 0x18: | |
1021 | 4049 this->uSex = SEX_FEMALE; |
0 | 4050 break; |
4051 default: | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4052 Error("(%u)", this->uVoiceID); |
0 | 4053 break; |
4054 } | |
1021 | 4055 |
0 | 4056 } |
4057 | |
4058 //----- (0049024A) -------------------------------------------------------- | |
135 | 4059 void Player::Reset(PLAYER_CLASS_TYPE cls) |
0 | 4060 { |
4061 sLevelModifier = 0; | |
4062 sAgeModifier = 0; | |
4063 | |
135 | 4064 classType = cls; |
0 | 4065 uLuckBonus = 0; |
4066 uSpeedBonus = 0; | |
4067 uAccuracyBonus = 0; | |
4068 uEnduranceBonus = 0; | |
4069 uWillpowerBonus = 0; | |
4070 uIntelligenceBonus = 0; | |
4071 uMightBonus = 0; | |
4072 uLevel = 1; | |
4073 uExperience = 251 + rand() % 100; | |
4074 uBirthYear = 1147 - rand() % 6; | |
4075 memset(pActiveSkills, 0, sizeof(pActiveSkills)); | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
4076 memset(_achieved_awards_bits, 0, 64); |
0 | 4077 memset(&spellbook, 0, sizeof(PlayerSpells)); |
4078 | |
4079 for (uint i = 0; i < 37; ++i) | |
4080 { | |
135 | 4081 if (pSkillAvailabilityPerClass[classType / 4][i] != 2) |
0 | 4082 continue; |
4083 | |
4084 pActiveSkills[i] = 1; | |
4085 | |
4086 switch (i) | |
4087 { | |
886 | 4088 case PLAYER_SKILL_FIRE: |
4089 spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;//its temporary, for test spells | |
894 | 4090 |
4091 extern bool all_magic; | |
4092 if ( all_magic == true ) | |
4093 { | |
4094 pActiveSkills[PLAYER_SKILL_AIR] = 1; | |
4095 pActiveSkills[PLAYER_SKILL_WATER] = 1; | |
4096 pActiveSkills[PLAYER_SKILL_EARTH] = 1; | |
4097 spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; | |
4098 spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; | |
4099 spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; | |
4100 spellbook.pFireSpellbook.bIsSpellAvailable[4] = true; | |
4101 spellbook.pFireSpellbook.bIsSpellAvailable[5] = true; | |
4102 spellbook.pFireSpellbook.bIsSpellAvailable[6] = true; | |
4103 spellbook.pFireSpellbook.bIsSpellAvailable[7] = true; | |
4104 spellbook.pFireSpellbook.bIsSpellAvailable[8] = true; | |
4105 spellbook.pFireSpellbook.bIsSpellAvailable[9] = true; | |
4106 spellbook.pFireSpellbook.bIsSpellAvailable[10] = true; | |
886 | 4107 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; |
569 | 4108 spellbook.pAirSpellbook.bIsSpellAvailable[1] = true; |
4109 spellbook.pAirSpellbook.bIsSpellAvailable[2] = true; | |
4110 spellbook.pAirSpellbook.bIsSpellAvailable[3] = true; | |
4111 spellbook.pAirSpellbook.bIsSpellAvailable[4] = true; | |
4112 spellbook.pAirSpellbook.bIsSpellAvailable[5] = true; | |
4113 spellbook.pAirSpellbook.bIsSpellAvailable[6] = true; | |
4114 spellbook.pAirSpellbook.bIsSpellAvailable[7] = true; | |
4115 spellbook.pAirSpellbook.bIsSpellAvailable[8] = true; | |
4116 spellbook.pAirSpellbook.bIsSpellAvailable[9] = true; | |
4117 spellbook.pAirSpellbook.bIsSpellAvailable[10] = true; | |
4118 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
4119 spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true; | |
4120 spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true; | |
4121 spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true; | |
4122 spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true; | |
4123 spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true; | |
710 | 4124 spellbook.pWaterSpellbook.bIsSpellAvailable[6] = true; |
4125 spellbook.pWaterSpellbook.bIsSpellAvailable[7] = true; | |
4126 spellbook.pWaterSpellbook.bIsSpellAvailable[8] = true; | |
886 | 4127 spellbook.pWaterSpellbook.bIsSpellAvailable[9] = true; |
4128 spellbook.pWaterSpellbook.bIsSpellAvailable[10] = true; | |
894 | 4129 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; |
4130 spellbook.pEarthSpellbook.bIsSpellAvailable[1] = true; | |
4131 spellbook.pEarthSpellbook.bIsSpellAvailable[2] = true; | |
4132 spellbook.pEarthSpellbook.bIsSpellAvailable[3] = true; | |
4133 spellbook.pEarthSpellbook.bIsSpellAvailable[4] = true; | |
4134 spellbook.pEarthSpellbook.bIsSpellAvailable[5] = true; | |
4135 spellbook.pEarthSpellbook.bIsSpellAvailable[6] = true; | |
4136 spellbook.pEarthSpellbook.bIsSpellAvailable[7] = true; | |
4137 spellbook.pEarthSpellbook.bIsSpellAvailable[8] = true; | |
4138 spellbook.pEarthSpellbook.bIsSpellAvailable[9] = true; | |
4139 spellbook.pEarthSpellbook.bIsSpellAvailable[10] = true; | |
4140 } | |
486 | 4141 break; |
886 | 4142 case PLAYER_SKILL_AIR: |
4143 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; | |
4144 break; | |
4145 case PLAYER_SKILL_WATER: | |
4146 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
4147 break; | |
4148 case PLAYER_SKILL_EARTH: | |
4149 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; | |
4150 break; | |
4151 case PLAYER_SKILL_SPIRIT: | |
4152 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; | |
4153 break; | |
4154 case PLAYER_SKILL_MIND: | |
4155 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; | |
4156 break; | |
4157 case PLAYER_SKILL_BODY: | |
4158 spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; | |
894 | 4159 |
4160 if ( all_magic == true ) | |
4161 { | |
4162 pActiveSkills[PLAYER_SKILL_MIND] = 1; | |
4163 pActiveSkills[PLAYER_SKILL_SPIRIT] = 1; | |
4164 spellbook.pBodySpellbook.bIsSpellAvailable[1] = true; | |
4165 spellbook.pBodySpellbook.bIsSpellAvailable[2] = true; | |
4166 spellbook.pBodySpellbook.bIsSpellAvailable[3] = true; | |
4167 spellbook.pBodySpellbook.bIsSpellAvailable[4] = true; | |
4168 spellbook.pBodySpellbook.bIsSpellAvailable[5] = true; | |
4169 spellbook.pBodySpellbook.bIsSpellAvailable[6] = true; | |
4170 spellbook.pBodySpellbook.bIsSpellAvailable[7] = true; | |
4171 spellbook.pBodySpellbook.bIsSpellAvailable[8] = true; | |
4172 spellbook.pBodySpellbook.bIsSpellAvailable[9] = true; | |
4173 spellbook.pBodySpellbook.bIsSpellAvailable[10] = true; | |
924 | 4174 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; |
894 | 4175 spellbook.pMindSpellbook.bIsSpellAvailable[1] = true; |
4176 spellbook.pMindSpellbook.bIsSpellAvailable[2] = true; | |
4177 spellbook.pMindSpellbook.bIsSpellAvailable[3] = true; | |
4178 spellbook.pMindSpellbook.bIsSpellAvailable[4] = true; | |
4179 spellbook.pMindSpellbook.bIsSpellAvailable[5] = true; | |
4180 spellbook.pMindSpellbook.bIsSpellAvailable[6] = true; | |
4181 spellbook.pMindSpellbook.bIsSpellAvailable[7] = true; | |
4182 spellbook.pMindSpellbook.bIsSpellAvailable[8] = true; | |
4183 spellbook.pMindSpellbook.bIsSpellAvailable[9] = true; | |
4184 spellbook.pMindSpellbook.bIsSpellAvailable[10] = true; | |
924 | 4185 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; |
894 | 4186 spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true; |
4187 spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true; | |
4188 spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true; | |
4189 spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true; | |
4190 spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true; | |
4191 spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true; | |
4192 spellbook.pSpiritSpellbook.bIsSpellAvailable[7] = true; | |
4193 spellbook.pSpiritSpellbook.bIsSpellAvailable[8] = true; | |
4194 spellbook.pSpiritSpellbook.bIsSpellAvailable[9] = true; | |
4195 spellbook.pSpiritSpellbook.bIsSpellAvailable[10] = true; | |
4196 } | |
569 | 4197 break; |
886 | 4198 case PLAYER_SKILL_LIGHT: |
4199 spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; | |
4200 break; | |
4201 case PLAYER_SKILL_DARK: | |
4202 spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; | |
4203 break; | |
0 | 4204 } |
4205 } | |
4206 | |
4207 sHealth = GetMaxHealth(); | |
4208 sMana = GetMaxMana(); | |
4209 } | |
4210 | |
4211 //----- (004903C9) -------------------------------------------------------- | |
821 | 4212 PLAYER_SKILL_TYPE Player::GetSkillIdxByOrder(signed int order) |
4213 { | |
1271
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4214 int counter; // edx@5 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4215 bool canBeInactive; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4216 unsigned char requiredValue; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4217 signed int offset; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4218 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4219 if ( order <= 1 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4220 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4221 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4222 requiredValue = 2; // 2 - primary skill |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4223 offset = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4224 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4225 else if ( order <= 3 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4226 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4227 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4228 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4229 offset = 2; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4230 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4231 else if ( order <= 12 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4232 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4233 canBeInactive = true; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4234 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4235 offset = 4; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4236 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4237 else |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4238 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4239 return (PLAYER_SKILL_TYPE)37; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4240 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4241 counter = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4242 for (int i = 0; i < 37; i++) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4243 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4244 if ( (this->pActiveSkills[i] || canBeInactive) && pSkillAvailabilityPerClass[classType / 4][i] == requiredValue ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4245 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4246 if ( counter == order - offset ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4247 return (PLAYER_SKILL_TYPE)i; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4248 ++counter; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4249 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4250 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4251 |
1549
5a3afcaa6717
Player::CalculateMeleeDamageTo removed labels, ifdowhile patterns changed to for cycles, magic numbers to enum values, fixing gibbet being only undead slaying
Grumpy7
parents:
1547
diff
changeset
|
4252 return (PLAYER_SKILL_TYPE)37; |
0 | 4253 } |
4254 | |
4255 | |
4256 | |
4257 //----- (0049048D) -------------------------------------------------------- | |
4258 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) | |
4259 void Player::DecreaseAttribute(int eAttribute) | |
4260 { | |
4261 int pBaseValue; // ecx@1 | |
4262 int pDroppedStep; // ebx@1 | |
4263 int pStep; // esi@1 | |
4264 int uMinValue; // [sp+Ch] [bp-4h]@1 | |
4265 | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4266 int raceId = GetRace(); |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4267 pBaseValue = StatTable[raceId][eAttribute].uBaseValue; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4268 pDroppedStep = StatTable[raceId][eAttribute].uDroppedStep; |
0 | 4269 uMinValue = pBaseValue - 2; |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4270 pStep = StatTable[raceId][eAttribute].uBaseStep; |
1272 | 4271 unsigned short* AttrToChange = nullptr; |
4272 switch ( eAttribute ) | |
4273 { | |
4274 case CHARACTER_ATTRIBUTE_STRENGTH: | |
4275 AttrToChange = &this->uMight; | |
4276 break; | |
4277 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
4278 AttrToChange = &this->uIntelligence; | |
4279 break; | |
4280 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
4281 AttrToChange = &this->uWillpower; | |
4282 break; | |
4283 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
4284 AttrToChange = &this->uEndurance; | |
4285 break; | |
4286 case CHARACTER_ATTRIBUTE_ACCURACY: | |
4287 AttrToChange = &this->uAccuracy; | |
4288 break; | |
4289 case CHARACTER_ATTRIBUTE_SPEED: | |
4290 AttrToChange = &this->uSpeed; | |
4291 break; | |
4292 case CHARACTER_ATTRIBUTE_LUCK: | |
4293 AttrToChange = &this->uLuck; | |
4294 break; | |
4295 } | |
4296 if ( *AttrToChange <= pBaseValue ) | |
4297 pStep = pDroppedStep; | |
4298 if ( *AttrToChange - pStep >= uMinValue ) | |
4299 *AttrToChange -= pStep; | |
0 | 4300 } |
4301 | |
4302 //----- (004905F5) -------------------------------------------------------- | |
1458 | 4303 //signed int PartyCreation_BtnPlusClick(Player *this, int eAttribute) |
1273 | 4304 void Player::IncreaseAttribute( int eAttribute ) |
4305 { | |
4306 int raceId; // eax@1 | |
4307 int maxValue; // ebx@1 | |
4308 signed int baseStep; // edi@1 | |
4309 signed int tmp; // eax@17 | |
0 | 4310 signed int result; // eax@18 |
1273 | 4311 int baseValue; // [sp+Ch] [bp-8h]@1 |
4312 signed int droppedStep; // [sp+10h] [bp-4h]@1 | |
4313 unsigned short* statToChange; | |
4314 | |
4315 raceId = GetRace(); | |
4316 maxValue = StatTable[raceId][eAttribute].uMaxValue; | |
4317 baseStep = StatTable[raceId][eAttribute].uBaseStep; | |
4318 baseValue = StatTable[raceId][eAttribute].uBaseValue; | |
4319 droppedStep = StatTable[raceId][eAttribute].uDroppedStep; | |
4320 PlayerCreation_GetUnspentAttributePointCount(); | |
4321 switch ( eAttribute ) | |
4322 { | |
4323 case 0: | |
4324 statToChange = &this->uMight; | |
4325 break; | |
4326 case 1: | |
4327 statToChange = &this->uIntelligence; | |
4328 break; | |
4329 case 2: | |
4330 statToChange = &this->uWillpower; | |
4331 break; | |
4332 case 3: | |
4333 statToChange = &this->uEndurance; | |
4334 break; | |
4335 case 4: | |
4336 statToChange = &this->uAccuracy; | |
4337 break; | |
4338 case 5: | |
4339 statToChange = &this->uSpeed; | |
4340 break; | |
4341 case 6: | |
4342 statToChange = &this->uLuck; | |
4343 default: | |
1545 | 4344 Error("(%u)", eAttribute); |
1273 | 4345 } |
4346 if ( *statToChange < baseValue ) | |
4347 { | |
4348 tmp = baseStep; | |
4349 baseStep = droppedStep; | |
4350 droppedStep = tmp; | |
4351 } | |
4352 result = PlayerCreation_GetUnspentAttributePointCount(); | |
4353 if ( result >= droppedStep ) | |
4354 { | |
4355 if ( baseStep + *statToChange <= maxValue ) | |
4356 *statToChange += baseStep; | |
4357 } | |
0 | 4358 } |
4359 | |
4360 //----- (0049070F) -------------------------------------------------------- | |
4361 void Player::Zero() | |
4362 { | |
4363 this->sLevelModifier = 0; | |
4364 this->sACModifier = 0; | |
4365 this->uLuckBonus = 0; | |
4366 this->uAccuracyBonus = 0; | |
4367 this->uSpeedBonus = 0; | |
4368 this->uEnduranceBonus = 0; | |
4369 this->uWillpowerBonus = 0; | |
4370 this->uIntelligenceBonus = 0; | |
4371 this->uMightBonus = 0; | |
4372 this->field_100 = 0; | |
4373 this->field_FC = 0; | |
4374 this->field_F8 = 0; | |
4375 this->field_F4 = 0; | |
4376 this->field_F0 = 0; | |
4377 this->field_EC = 0; | |
4378 this->field_E8 = 0; | |
4379 this->field_E4 = 0; | |
4380 this->field_E0 = 0; | |
766 | 4381 memset(&this->sResFireBonus, 0, 0x16u); |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4382 this->field_1A97 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4383 this->_ranged_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4384 this->field_1A95 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4385 this->_ranged_atk_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4386 this->field_1A93 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4387 this->_melee_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4388 this->field_1A91 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4389 this->_some_attack_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4390 this->_mana_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4391 this->uFullManaBonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4392 this->_health_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4393 this->uFullHealthBonus = 0; |
0 | 4394 } |
4395 | |
4396 //----- (004907E7) -------------------------------------------------------- | |
299 | 4397 unsigned int Player::GetStatColor(int uStat) |
0 | 4398 { |
290 | 4399 int attribute_value; // edx@1 |
1393 | 4400 |
4401 int base_attribute_value = StatTable[GetRace()][uStat].uBaseValue; | |
0 | 4402 switch (uStat) |
4403 { | |
4404 case 0: attribute_value = uMight; break; | |
4405 case 1: attribute_value = uIntelligence; break; | |
4406 case 2: attribute_value = uWillpower; break; | |
4407 case 3: attribute_value = uEndurance; break; | |
290 | 4408 case 4: attribute_value = uAccuracy; break; |
4409 case 5: attribute_value = uSpeed; break; | |
0 | 4410 case 6: attribute_value = uLuck; break; |
4411 }; | |
4412 | |
1393 | 4413 if (attribute_value == base_attribute_value) |
4414 return ui_character_stat_default_color; | |
4415 else if (attribute_value > base_attribute_value) | |
4416 return ui_character_stat_buffed_color; | |
0 | 4417 else |
1393 | 4418 return ui_character_stat_debuffed_color; |
0 | 4419 } |
4420 | |
4421 //----- (004908A8) -------------------------------------------------------- | |
4422 bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, unsigned __int64 uTime) | |
4423 { | |
1684 | 4424 if ( pConditions[uCondition] && (uTime < (signed long long)pConditions[uCondition]) ) |
1014 | 4425 { |
1393 | 4426 pConditions[uCondition] = 0i64; |
1014 | 4427 return true; |
0 | 4428 } |
4429 else | |
1014 | 4430 return false; |
0 | 4431 } |
4432 | |
4433 //----- (004680ED) -------------------------------------------------------- | |
1019 | 4434 void Player::UseItem_DrinkPotion_etc(signed int player_num, int a3) |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4435 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4436 Player *playerAffected; // esi@1 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4437 signed int v5; // eax@17 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4438 int v8; // edx@39 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4439 char *v13; // eax@45 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4440 signed int v15; // edi@68 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4441 int v16; // edx@73 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4442 unsigned __int16 v17; // edi@73 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4443 unsigned int v18; // eax@73 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4444 const char *v22; // eax@84 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4445 int scroll_id; // esi@96 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4446 int v25; // eax@109 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4447 int v26; // eax@113 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4448 int new_mana_val; // edi@114 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4449 signed __int64 v28; // qax@120 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4450 __int64 v30; // edi@137 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4451 __int64 v32; // ST3C_4@137 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4452 __int64 v34; // ST34_4@137 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4453 unsigned __int16 v50; // [sp-Ch] [bp-38h]@120 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4454 const char *v66; // [sp-4h] [bp-30h]@69 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4455 signed int v67; // [sp-4h] [bp-30h]@77 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4456 const char *v68; // [sp-4h] [bp-30h]@89 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4457 char v72; // [sp+20h] [bp-Ch]@68 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4458 signed int v73; // [sp+24h] [bp-8h]@1 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4459 char* v74; // [sp+24h] [bp-8h]@23 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4460 Player *thisb; // [sp+28h] [bp-4h]@1 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4461 unsigned int thisa; // [sp+28h] [bp-4h]@22 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4462 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4463 thisb = this; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4464 playerAffected = &pParty->pPlayers[player_num-1]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4465 v73 = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4466 if ( pParty->bTurnBasedModeOn == 1 && (pTurnEngine->turn_stage == 1 || pTurnEngine->turn_stage == 3) ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4467 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4468 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_REAGENT ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4469 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4470 if ( pParty->pPickedItem.uItemID == 160 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4471 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4472 playerAffected->SetCondition(Condition_Poison1, 1); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4473 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4474 else if ( pParty->pPickedItem.uItemID == 161 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4475 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4476 new_mana_val = playerAffected->sMana; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4477 new_mana_val += 2; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4478 if ( new_mana_val > playerAffected->GetMaxMana() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4479 new_mana_val = playerAffected->GetMaxMana(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4480 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4481 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4482 else if ( pParty->pPickedItem.uItemID == 162 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4483 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4484 playerAffected->Heal(2); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4485 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4486 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4487 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4488 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4489 v68 = pParty->pPickedItem.GetDisplayName(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4490 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4491 ShowStatusBarString(pTmpBuf.data(), 2); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4492 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4493 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4494 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4495 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4496 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4497 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4498 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4499 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4500 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4501 if ( v73 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4502 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4503 if ( pParty->bTurnBasedModeOn ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4504 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4505 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4506 thisb->SetRecoveryTime(100); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4507 pTurnEngine->ApplyPlayerAction(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4508 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4509 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4510 { |
1684 | 4511 thisb->SetRecoveryTime((int)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4512 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4513 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4514 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4515 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4516 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4517 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4518 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_POTION ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4519 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4520 switch ( pParty->pPickedItem.uItemID ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4521 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4522 case 221: //Catalyst |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4523 playerAffected->SetCondition(Condition_Poison1, 1); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4524 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4525 case 222: //Cure Wounds |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4526 v25 = pParty->pPickedItem.uEnchantmentType + 10; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4527 playerAffected->Heal(v25); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4528 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4529 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4530 case 223: //Magic Potion |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4531 v26 = pParty->pPickedItem.uEnchantmentType + 10; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4532 new_mana_val = playerAffected->sMana; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4533 new_mana_val += v26; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4534 if ( new_mana_val > playerAffected->GetMaxMana() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4535 new_mana_val = playerAffected->GetMaxMana(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4536 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4537 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4538 case 224: //Cure Weakness |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4539 playerAffected->pConditions[Condition_Weak] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4540 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4541 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4542 case 225: //Cure Disease |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4543 playerAffected->pConditions[Condition_Disease3] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4544 playerAffected->pConditions[Condition_Disease2] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4545 playerAffected->pConditions[Condition_Disease1] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4546 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4547 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4548 case 226: //Cure Poison |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4549 playerAffected->pConditions[Condition_Poison3] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4550 playerAffected->pConditions[Condition_Poison2] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4551 playerAffected->pConditions[Condition_Poison1] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4552 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4553 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4554 case 227: //Awaken |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4555 playerAffected->pConditions[Condition_Sleep] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4556 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4557 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4558 case 228: //Haste |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4559 if ( !playerAffected->pConditions[Condition_Weak] ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4560 { |
1021 | 4561 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4562 playerAffected->pPlayerBuffs[7].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4563 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4564 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4565 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4566 case 229: //Heroism |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4567 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4568 playerAffected->pPlayerBuffs[8].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4569 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4570 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4571 case 230: //Bless |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4572 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4573 playerAffected->pPlayerBuffs[1].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4574 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4575 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4576 case 231: //Preservation |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4577 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4578 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4579 playerAffected->pPlayerBuffs[11].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4580 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4581 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4582 case 232: //Shield |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4583 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4584 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4585 playerAffected->pPlayerBuffs[13].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4586 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4587 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4588 case 234: //Stoneskin |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4589 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4590 playerAffected->pPlayerBuffs[14].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4591 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4592 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4593 case 235: //Water Breathing |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4594 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4595 playerAffected->pPlayerBuffs[23].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4596 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4597 case 237: //Remove Fear |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4598 playerAffected->pConditions[Condition_Fear] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4599 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4600 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4601 case 238: //Remove Curse |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4602 playerAffected->pConditions[Condition_Cursed] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4603 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4604 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4605 case 239: //Cure Insanity |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4606 playerAffected->pConditions[Condition_Insane] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4607 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4608 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4609 case 240: //Might Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4610 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4611 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4612 playerAffected->pPlayerBuffs[19].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4613 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4614 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4615 case 241: //Intellect Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4616 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4617 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4618 playerAffected->pPlayerBuffs[17].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4619 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4620 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4621 case 242: //Personality Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4622 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4623 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4624 playerAffected->pPlayerBuffs[20].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4625 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4626 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4627 case 243://Endurance Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4628 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4629 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4630 playerAffected->pPlayerBuffs[16].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4631 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4632 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4633 case 244: //Speed Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4634 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4635 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4636 playerAffected->pPlayerBuffs[21].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4637 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4638 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4639 case 245: //Accuracy Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4640 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4641 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4642 playerAffected->pPlayerBuffs[15].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4643 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4644 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4645 case 251: //Cure Paralysis |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4646 playerAffected->pConditions[Condition_Paralyzed] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4647 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4648 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4649 case 252://Divine Restoration |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4650 v30 = playerAffected->pConditions[Condition_Dead]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4651 v32 = playerAffected->pConditions[Condition_Pertified]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4652 v34 = playerAffected->pConditions[Condition_Eradicated]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4653 memset(&playerAffected->pConditions,0,sizeof(pConditions)); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4654 playerAffected->pConditions[Condition_Dead] = v30; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4655 playerAffected->pConditions[Condition_Pertified] = v32; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4656 playerAffected->pConditions[Condition_Eradicated] = v34; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4657 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4658 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4659 case 253: //Divine Cure |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4660 v25 = 5 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4661 playerAffected->Heal(v25); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4662 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4663 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4664 case 254: //Divine Power |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4665 v26 = 5 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4666 new_mana_val = playerAffected->sMana; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4667 new_mana_val += v26; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4668 if ( new_mana_val > playerAffected->GetMaxMana() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4669 new_mana_val = playerAffected->GetMaxMana(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4670 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4671 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4672 case 255: //Luck Boost |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4673 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4674 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4675 playerAffected->pPlayerBuffs[18].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4676 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4677 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4678 case 256: //Fire Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4679 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4680 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4681 playerAffected->pPlayerBuffs[5].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4682 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4683 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4684 case 257: //Air Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4685 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4686 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4687 playerAffected->pPlayerBuffs[0].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4688 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4689 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4690 case 258: //Water Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4691 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4692 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4693 playerAffected->pPlayerBuffs[22].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4694 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4695 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4696 case 259: //Earth Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4697 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4698 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4699 playerAffected->pPlayerBuffs[3].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4700 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4701 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4702 case 260: //Mind Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4703 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4704 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4705 playerAffected->pPlayerBuffs[9].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4706 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4707 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4708 case 261: //Body Resistance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4709 v50 = 3 * pParty->pPickedItem.uEnchantmentType; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4710 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4711 playerAffected->pPlayerBuffs[2].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4712 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4713 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4714 case 262: //Stone to Flesh |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4715 playerAffected->pConditions[Condition_Pertified] = 0i64; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4716 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4717 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4718 case 264: //Pure Luck |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4719 if ( !playerAffected->pure_luck_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4720 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4721 playerAffected->uLuck += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4722 playerAffected->pure_luck_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4723 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4724 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4725 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4726 case 265: //Pure Speed |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4727 if ( !playerAffected->pure_speed_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4728 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4729 playerAffected->uSpeed += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4730 playerAffected->pure_speed_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4731 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4732 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4733 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4734 case 266: //Pure Intellect |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4735 if ( !playerAffected->pure_intellect_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4736 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4737 playerAffected->uIntelligence += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4738 playerAffected->pure_intellect_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4739 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4740 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4741 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4742 case 267: //Pure Endurance |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4743 if ( !playerAffected->pure_endurance_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4744 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4745 playerAffected->uEndurance += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4746 playerAffected->pure_endurance_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4747 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4748 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4749 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4750 case 268: //Pure Personality |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4751 if ( !playerAffected->pure_willpower_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4752 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4753 playerAffected->uWillpower += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4754 playerAffected->pure_willpower_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4755 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4756 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4757 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4758 case 269: //Pure Accuracy |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4759 if ( !playerAffected->pure_accuracy_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4760 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4761 playerAffected->uAccuracy += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4762 playerAffected->pure_accuracy_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4763 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4764 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4765 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4766 case 270: //Pure Might |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4767 if ( !playerAffected->pure_might_used ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4768 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4769 playerAffected->uMight += 50; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4770 playerAffected->pure_might_used = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4771 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4772 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4773 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4774 case 271: //Rejuvenation |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4775 playerAffected->sAgeModifier = 0; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4776 playerAffected->PlaySound(SPEECH_36, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4777 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4778 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4779 default: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4780 v68 = pParty->pPickedItem.GetDisplayName(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4781 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4782 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4783 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4784 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4785 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4786 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4787 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4788 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4789 // if ( !v73 ) v73 is always 1 at this point |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4790 // { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4791 // pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4792 // return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4793 // } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4794 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4795 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4796 if ( v73 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4797 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4798 if ( pParty->bTurnBasedModeOn ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4799 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4800 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4801 thisb->SetRecoveryTime(100); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4802 pTurnEngine->ApplyPlayerAction(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4803 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4804 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4805 { |
1684 | 4806 thisb->SetRecoveryTime((int)(flt_6BE3A4_debug_recmod1 * 213.3333333333333)); |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4807 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4808 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4809 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4810 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4811 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4812 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4813 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4814 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_SPELL_SCROLL ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4815 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4816 if ( pCurrentScreen == SCREEN_CASTING ) |
1032 | 4817 return; |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4818 if ( !playerAffected->CanAct() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4819 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4820 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4821 v68 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4822 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4823 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4824 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4825 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4826 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4827 if ( bUnderwater == 1 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4828 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4829 ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2u);//"You can not do that while you are underwater!" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4830 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4831 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4832 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4833 dword_50C9AC = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4834 scroll_id = pParty->pPickedItem.uItemID - 299; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4835 if ( scroll_id == 30 || scroll_id == 4 || scroll_id == 91 || scroll_id == 28 ) //Enchant Item scroll, Vampiric Weapon scroll ,Recharge Item ,Fire Aura |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4836 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4837 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4838 pGUIWindow_CurrentMenu->Release(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4839 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4840 pCurrentScreen = SCREEN_GAME; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4841 viewparams->bRedrawGameUI = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4842 _42777D_CastSpell_UseWand_ShootArrow(scroll_id, player_num - 1, 0x85u, 1, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4843 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4844 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4845 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4846 _720984_unused = pParty->pPickedItem.uItemID; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4847 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4848 pMessageQueue_50C9E8->AddMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4849 if ( pCurrentScreen && pGUIWindow_CurrentMenu |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4850 && (pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4851 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4852 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4853 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4854 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4855 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4856 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4857 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4858 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_BOOK ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4859 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4860 v15 = pParty->pPickedItem.uItemID - 400; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4861 v72 = playerAffected->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4862 if ( v72 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4863 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4864 v66 = pParty->pPickedItem.GetDisplayName(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4865 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell" |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
4866 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 4867 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 4868 return; |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4869 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4870 if ( !playerAffected->CanAct() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4871 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4872 v66 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4873 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4874 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4875 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 4876 return; |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4877 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4878 v16 = v15 % 11 + 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4879 v17 = playerAffected->pActiveSkills[v15 / 11 + 12]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4880 v18 = SkillToMastery(v17) - 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4881 switch (v18) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4882 { |
1032 | 4883 case 0: v67 = 4; break; |
4884 case 1: v67 = 7; break; | |
4885 case 2: v67 = 10; break; | |
4886 case 3: v67 = 11; break; | |
4887 default: | |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4888 v67 = player_num; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4889 } |
1032 | 4890 |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4891 if ( v16 > v67 || !v17 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4892 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4893 v22 = pParty->pPickedItem.GetDisplayName(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4894 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4895 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4896 playerAffected->PlaySound((PlayerSpeech)20, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4897 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4898 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4899 // v72 = 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4900 playerAffected->PlaySound(SPEECH_21, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4901 v73 = 0; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4902 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4903 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4904 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4905 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4906 if ( !v73 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4907 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4908 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4909 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4910 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4911 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4912 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4913 // if ( v73 ) v73 is always 0 at this point |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4914 // { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4915 // if ( pParty->bTurnBasedModeOn ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4916 // { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4917 // pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4918 // thisb->SetRecoveryTime(100); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4919 // pTurnEngine->ApplyPlayerAction(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4920 // } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4921 // else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4922 // { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4923 // thisb->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * 213.3333333333333); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4924 // } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4925 // } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4926 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4927 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4928 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4929 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4930 if ( pItemsTable->pItems[pParty->pPickedItem.uItemID].uEquipType == EQUIP_MESSAGE_SCROLL ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4931 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4932 if ( playerAffected->CanAct() ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4933 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4934 CreateMsgScrollWindow(pParty->pPickedItem.uItemID); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4935 playerAffected->PlaySound(SPEECH_37, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4936 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4937 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4938 v68 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4939 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4940 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4941 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4942 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4943 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4944 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4945 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4946 if (pParty->pPickedItem.uItemID == 616) //Genie Lamp |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4947 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4948 thisa = pParty->uCurrentMonthWeek + 1; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4949 if ( pParty->uCurrentMonth >= 7 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4950 v74 = NULL; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4951 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4952 v74 = aAttributeNames[pParty->uCurrentMonth]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4953 switch ( pParty->uCurrentMonth ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4954 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4955 case 0: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4956 playerAffected->uMight += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4957 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4958 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4959 case 1: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4960 playerAffected->uIntelligence += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4961 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4962 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4963 case 2: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4964 playerAffected->uWillpower += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4965 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4966 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4967 case 3: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4968 playerAffected->uEndurance += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4969 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4970 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4971 case 4: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4972 playerAffected->uAccuracy += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4973 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4974 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4975 case 5: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4976 playerAffected->uSpeed += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4977 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4978 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4979 case 6: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4980 playerAffected->uLuck += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4981 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4982 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4983 case 7: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4984 party_finds_gold(1000 * thisa, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4985 sprintf(pTmpBuf.data(), "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4986 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4987 case 8: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4988 Party::GiveFood(5 * thisa); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4989 sprintf(pTmpBuf.data(), "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food" |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4990 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4991 case 9u: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4992 playerAffected->uSkillPoints += 2 * thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4993 sprintf(pTmpBuf.data(), "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4994 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4995 case 10: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4996 playerAffected->uExperience += 2500 * thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4997 sprintf(pTmpBuf.data(), "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4998 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4999 case 11: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5000 v8 = rand() % 6; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5001 switch (v8) |
1032 | 5002 { |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5003 case 0: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5004 playerAffected->sResFireBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5005 v13 = pGlobalTXT_LocalizationStrings[87]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5006 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5007 case 1: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5008 playerAffected->sResAirBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5009 v13 = pGlobalTXT_LocalizationStrings[6]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5010 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5011 case 2: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5012 playerAffected->sResWaterBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5013 v13 = pGlobalTXT_LocalizationStrings[240]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5014 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5015 case 3: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5016 playerAffected->sResEarthBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5017 v13 = pGlobalTXT_LocalizationStrings[70]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5018 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5019 case 4: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5020 playerAffected->sResMindBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5021 v13 = pGlobalTXT_LocalizationStrings[142]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5022 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5023 case 5: |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5024 playerAffected->sResBodyBase += thisa; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5025 v13 = pGlobalTXT_LocalizationStrings[29]; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5026 break; |
1021 | 5027 } |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5028 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5029 break; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5030 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5031 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5032 ShowStatusBarString(pTmpBuf.data(), 2u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5033 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5034 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5035 playerAffected->PlaySound(SPEECH_93, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5036 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5037 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5038 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5039 playerAffected->SetCondition(Condition_Eradicated, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5040 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5041 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5042 else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5043 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5044 playerAffected->SetCondition(Condition_Dead, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5045 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5046 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5047 else if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 ) |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5048 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5049 playerAffected->SetCondition(Condition_Pertified, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5050 pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5051 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5052 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5053 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5054 else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5055 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5056 Party::GiveFood(1u); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5057 pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5058 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5059 else if ( pParty->pPickedItem.uItemID == 632 ) //Lute |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5060 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5061 pAudioPlayer->PlaySound(SOUND_PlayLute, 0, 0, -1, 0, 0, 0, 0); |
1032 | 5062 return; |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5063 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5064 else if ( pParty->pPickedItem.uItemID == 633 ) //Faerie Pipes |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5065 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5066 pAudioPlayer->PlaySound(SOUND_PlayFaeriePipes, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5067 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5068 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5069 else if ( pParty->pPickedItem.uItemID == 634 ) //Gryphonheart's Trumpet |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5070 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5071 pAudioPlayer->PlaySound(SOUND_PlayGryphonheartsTrumpet, 0, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5072 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5073 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5074 else if ( pParty->pPickedItem.uItemID == 646 ) //Horseshoe |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5075 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5076 pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5077 v5 = PID(OBJECT_Player, player_num + 49); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5078 pAudioPlayer->PlaySound(SOUND_20001, v5, 0, -1, 0, 0, 0, 0); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5079 playerAffected->AddVariable(VAR_NumSkillPoints, 2); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5080 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5081 else if ( pParty->pPickedItem.uItemID == 650 ) //Temple in a Bottle |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5082 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5083 TeleportToNWCDungeon(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5084 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5085 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5086 else |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5087 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5088 v68 = pParty->pPickedItem.GetDisplayName(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5089 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way" |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
5090 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 5091 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 5092 return; |
1618
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5093 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5094 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5095 pMouse->RemoveHoldingItem(); |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5096 return; |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5097 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
5098 } |
0 | 5099 |
5100 //----- (00449BB4) -------------------------------------------------------- | |
484 | 5101 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue ) |
1033 | 5102 { |
0 | 5103 Player *v3; // esi@1 |
5104 signed int v4; // edi@1 | |
5105 unsigned int v5; // eax@8 | |
5106 int v6; // eax@9 | |
5107 enum CHARACTER_RACE v7; // eax@11 | |
5108 signed int v8; // eax@17 | |
5109 unsigned __int8 v9; // sf@17 | |
5110 unsigned __int8 v10; // of@17 | |
5111 int v11; // eax@19 | |
5112 unsigned int v12; // eax@20 | |
484 | 5113 unsigned int test_bit_value; // eax@25 |
5114 unsigned __int8 our_bit_value; // cl@25 | |
0 | 5115 signed int v15; // ecx@28 |
5116 ItemGen *v16; // eax@28 | |
5117 char v17; // zf@31 | |
5118 int v18; // edi@90 | |
5119 DDM_DLV_Header *v19; // eax@122 | |
5120 char v20; // cl@124 | |
5121 DDM_DLV_Header *v21; // eax@126 | |
5122 unsigned int v22; // edi@129 | |
100 | 5123 Player *v23; // esi@134 |
0 | 5124 ItemGen *v24; // ecx@135 |
5125 signed int v25; // edx@135 | |
5126 ITEM_EQUIP_TYPE v26; // ebx@155 | |
5127 char *v27; // edi@155 | |
5128 int v28; // ebx@161 | |
5129 int v29; // eax@161 | |
5130 | |
469 | 5131 v6 = 0; |
0 | 5132 v3 = this; |
5133 v4 = -1; | |
469 | 5134 if ( VarNum > VAR_AutoNotes ) |
5135 { | |
5136 switch ( VarNum ) | |
0 | 5137 { |
5138 case VAR_Invisible: | |
1167 | 5139 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime >0 ) |
469 | 5140 return true; |
484 | 5141 return false; |
0 | 5142 case VAR_NumDeaths: |
5143 v4 = pParty->uNumDeaths; | |
469 | 5144 return v4 >= pValue; |
0 | 5145 case VAR_NumBounties: |
5146 v4 = pParty->uNumBountiesCollected; | |
469 | 5147 return v4 >= pValue; |
0 | 5148 case VAR_PrisonTerms: |
5149 v4 = pParty->uNumPrisonTerms; | |
469 | 5150 return v4 >= pValue; |
0 | 5151 case VAR_ArenaWinsPage: |
5152 v4 = (unsigned __int8)pParty->uNumArenaPageWins; | |
469 | 5153 return v4 >= pValue; |
0 | 5154 case VAR_ArenaWinsSquire: |
5155 v4 = (unsigned __int8)pParty->uNumArenaSquireWins; | |
469 | 5156 return v4 >= pValue; |
0 | 5157 case VAR_ArenaWinsKnight: |
5158 v4 = (unsigned __int8)pParty->uNumArenaKnightWins; | |
469 | 5159 return v4 >= pValue; |
0 | 5160 case VAR_ArenaWinsLord: |
5161 v4 = (unsigned __int8)pParty->uNumArenaLordWins; | |
469 | 5162 return v4 >= pValue; |
0 | 5163 case VAR_ReputationInCurrentLocation: |
5164 v19 = &pOutdoor->ddm; | |
5165 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5166 v19 = &pIndoor->dlv; | |
469 | 5167 v6 = v19->uReputation >= pValue; |
5168 return v6; | |
0 | 5169 case VAR_History_28|VAR_Sex: |
5170 v21 = &pOutdoor->ddm; | |
5171 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5172 v21 = &pIndoor->dlv; | |
469 | 5173 v6 = v21->field_C_alert == pValue; |
0 | 5174 return v6; |
5175 case VAR_MonthEquals2|VAR_Sex: | |
5176 case VAR_MonthEquals2|VAR_Class: | |
5177 case VAR_Counter1: | |
5178 case VAR_Counter2: | |
5179 case VAR_Counter3: | |
5180 case VAR_Counter4: | |
5181 case VAR_Counter5: | |
5182 case VAR_Counter6: | |
5183 case VAR_Counter7: | |
5184 case VAR_Counter8: | |
469 | 5185 v22 = *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304]; |
5186 if ( v22 | *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300] | |
5187 && (signed __int64)(__PAIR__(v22, *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]) | |
5188 + (signed __int64)((double)(460800 * pValue) * 0.033333335)) <= (signed __int64)pParty->uTimePlayed ) | |
5189 return true; | |
5190 return false; | |
0 | 5191 case VAR_NumSkillPoints: |
5192 v4 = this->uSkillPoints; | |
469 | 5193 return v4 >= pValue; |
0 | 5194 case VAR_CircusPrises: |
5195 v4 = 0; | |
100 | 5196 v23 = pParty->pPlayers;//[0].pInventoryItems; |
0 | 5197 do |
5198 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
5199 v24 = v23->pInventoryItemList; |
0 | 5200 v25 = 138; |
5201 do | |
5202 { | |
5203 switch ( v24->uItemID ) | |
5204 { | |
5205 case 0x1D6u: | |
5206 ++v4; | |
5207 break; | |
5208 case 0x1D7u: | |
5209 v4 += 3; | |
5210 break; | |
5211 case 0x1DDu: | |
5212 v4 += 5; | |
5213 break; | |
5214 } | |
5215 ++v24; | |
5216 --v25; | |
5217 } | |
5218 while ( v25 ); | |
100 | 5219 ++v23; |
0 | 5220 } |
100 | 5221 while ( v23 <= &pParty->pPlayers[3] ); |
469 | 5222 return v4 >= pValue; |
0 | 5223 case VAR_MonthEquals2: |
469 | 5224 v6 = pParty->uCurrentMonth == pValue; |
5225 return v6; | |
0 | 5226 case VAR_IsFlying: |
5227 if ( pParty->bFlying | |
1167 | 5228 && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) ) |
469 | 5229 return true; |
5230 return false; | |
0 | 5231 case VAR_HiredNPCHasSpeciality: |
469 | 5232 LOBYTE(v6) = CheckHiredNPCSpeciality(pValue); |
0 | 5233 return v6; |
5234 case VAR_NPCs2: | |
469 | 5235 return pNPCStats->pNewNPCData[pValue].Hired(); |
0 | 5236 case VAR_MonthEquals|VAR_CurrentSP: |
1033 | 5237 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
5238 our_bit_value = this->field_1A50[((signed __int16)pValue - 1)/8]; | |
484 | 5239 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
469 | 5240 return v4 >= pValue; |
5241 v4 = pValue; | |
5242 return v4 >= pValue; | |
0 | 5243 case VAR_ItemEquipped: |
5244 v26 = (ITEM_EQUIP_TYPE)0; | |
5245 v27 = (char *)&this->pEquipment; | |
5246 break; | |
5247 case VAR_GoldInBank: | |
5248 v4 = pParty->uNumGoldInBank; | |
469 | 5249 return v4 >= pValue; |
0 | 5250 case VAR_ThieverySkill|0x80: |
5251 v28 = GetActualMight(); | |
5252 v29 = v3->GetBaseStrength(); | |
5253 goto LABEL_168; | |
5254 case VAR_DisarmTrapSkill|0x80: | |
5255 v28 = GetActualIntelligence(); | |
5256 v29 = v3->GetBaseIntelligence(); | |
5257 goto LABEL_168; | |
5258 case VAR_MonthEquals: | |
5259 v28 = GetActualWillpower(); | |
5260 v29 = v3->GetBaseWillpower(); | |
5261 goto LABEL_168; | |
5262 case VAR_MonthEquals|VAR_Sex: | |
5263 v28 = GetActualEndurance(); | |
5264 v29 = v3->GetBaseEndurance(); | |
5265 goto LABEL_168; | |
5266 case VAR_IdentifyMonsterSkill|0x80: | |
5267 v28 = GetActualSpeed(); | |
5268 v29 = v3->GetBaseSpeed(); | |
5269 goto LABEL_168; | |
5270 case VAR_ArmsmasterSkill|0x80: | |
5271 v28 = GetActualAccuracy(); | |
5272 v29 = v3->GetBaseAccuracy(); | |
5273 goto LABEL_168; | |
5274 case VAR_MonthEquals|VAR_MaxHP: | |
5275 v28 = GetActualLuck(); | |
5276 v29 = v3->GetBaseLuck(); | |
5277 LABEL_168: | |
5278 v10 = __OFSUB__(v28, v29); | |
5279 v9 = v28 - v29 < 0; | |
5280 LABEL_169: | |
5281 if ( v9 ^ v10 ) | |
469 | 5282 return v4 >= pValue; |
5283 return true; | |
0 | 5284 default: |
469 | 5285 return v4 >= pValue; |
0 | 5286 } |
5287 while ( !v3->HasItemEquipped(v26) | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
5288 || *(int *)&v3->pInventoryItemList[*(int *)v27-1] != pValue ) |
0 | 5289 { |
5290 v26 = (ITEM_EQUIP_TYPE)((int)v26 + 1); | |
5291 v27 += 4; | |
5292 if ( (signed int)v26 >= 16 ) | |
469 | 5293 return false; |
5294 } | |
5295 return true; | |
5296 } | |
5297 if ( VarNum == VAR_AutoNotes ) | |
0 | 5298 { |
1033 | 5299 test_bit_value = 0x80u >> ((signed __int16)(pValue - 1) - 1) % 8; |
5300 our_bit_value = pParty->_autonote_bits[((signed __int16)(pValue - 1) - 1) /8]; | |
484 | 5301 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
5302 return false; | |
5303 return true; | |
469 | 5304 } |
5305 if ( VarNum <= VAR_BaseLuck ) | |
5306 { | |
5307 if ( VarNum != VAR_BaseLuck ) | |
5308 { | |
5309 switch ( VarNum ) | |
0 | 5310 { |
5311 case VAR_Hour: | |
469 | 5312 if ( (signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == pValue ) |
5313 return true; | |
5314 return false; | |
0 | 5315 case VAR_DayOfYear: |
469 | 5316 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 0x150 + 1; |
5317 v6 = v5 == pValue; | |
5318 return v6; | |
0 | 5319 case VAR_DayOfWeek: |
469 | 5320 v5 = (unsigned int)((signed __int64)((double)(signed __int64)pParty->uTimePlayed * 0.234375) / 60 / 60) / 0x18 % 7; |
5321 v6 = v5 == pValue; | |
0 | 5322 return v6; |
5323 case VAR_Sex: | |
469 | 5324 if ( pValue == (CHARACTER_RACE)this->uSex ) |
5325 return true; | |
5326 return v4 >= pValue; | |
0 | 5327 case VAR_Class: |
135 | 5328 v7 = (CHARACTER_RACE)this->classType; |
469 | 5329 if ( pValue == v7 ) |
5330 return true; | |
5331 return v4 >= pValue; | |
0 | 5332 case VAR_Race: |
5333 v7 = GetRace(); | |
469 | 5334 if ( pValue == v7 ) |
5335 return true; | |
5336 return v4 >= pValue; | |
0 | 5337 case VAR_CurrentHP: |
5338 v4 = this->sHealth; | |
469 | 5339 return v4 >= pValue; |
0 | 5340 case VAR_MaxHP: |
5341 v8 = GetMaxHealth(); | |
5342 v10 = __OFSUB__(v3->sHealth, v8); | |
5343 v9 = v3->sHealth - v8 < 0; | |
5344 goto LABEL_169; | |
5345 case VAR_CurrentSP: | |
5346 v4 = this->sMana; | |
469 | 5347 return v4 >= pValue; |
0 | 5348 case VAR_MaxSP: |
5349 v11 = GetMaxMana(); | |
5350 v10 = __OFSUB__(v3->sMana, v11); | |
5351 v9 = v3->sMana - v11 < 0; | |
5352 goto LABEL_169; | |
5353 case VAR_ActualAC: | |
5354 v12 = GetActualAC(); | |
5355 goto _j_cmp_against_arg; | |
5356 case VAR_ACModifier: | |
5357 v4 = this->sACModifier; | |
469 | 5358 return v4 >= pValue; |
0 | 5359 case VAR_BaseLevel: |
5360 v4 = this->uLevel; | |
469 | 5361 return v4 >= pValue; |
0 | 5362 case VAR_LevelModifier: |
5363 v4 = this->sLevelModifier; | |
469 | 5364 return v4 >= pValue; |
0 | 5365 case VAR_Age: |
5366 v12 = GetActualAge(); | |
5367 goto _j_cmp_against_arg; | |
5368 case VAR_Award: | |
1033 | 5369 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
5370 our_bit_value = this->_achieved_awards_bits[((signed __int16)pValue - 1) /8]; |
484 | 5371 if ( !((unsigned __int8)test_bit_value & our_bit_value) ) |
5372 return true; | |
5373 return false; | |
0 | 5374 case VAR_Experience: |
5375 v4 = LODWORD(this->uExperience); | |
469 | 5376 return v4 >= pValue; |
0 | 5377 case VAR_QBits_QuestsDone: |
484 | 5378 test_bit_value = 0x80u >> (pValue - 1) % 8; |
5379 our_bit_value = pParty->_quest_bits[(pValue - 1)/8]; | |
5380 if ( test_bit_value & our_bit_value ) | |
478 | 5381 return true; |
5382 return false; | |
0 | 5383 case VAR_PlayerItemInHands: |
5384 v15 = 0; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
5385 v16 = v3->pInventoryItemList; |
0 | 5386 break; |
5387 case VAR_FixedGold: | |
5388 v4 = pParty->uNumGold; | |
469 | 5389 return v4 >= pValue; |
0 | 5390 case VAR_MightBonus: |
5391 v4 = this->uMightBonus; | |
469 | 5392 return v4 >= pValue; |
0 | 5393 case VAR_IntellectBonus: |
5394 v4 = this->uIntelligenceBonus; | |
469 | 5395 return v4 >= pValue; |
0 | 5396 case VAR_PersonalityBonus: |
5397 v4 = this->uWillpowerBonus; | |
469 | 5398 return v4 >= pValue; |
0 | 5399 case VAR_EnduranceBonus: |
5400 v4 = this->uEnduranceBonus; | |
469 | 5401 return v4 >= pValue; |
0 | 5402 case VAR_SpeedBonus: |
5403 v4 = this->uSpeedBonus; | |
469 | 5404 return v4 >= pValue; |
0 | 5405 case VAR_AccuracyBonus: |
5406 v4 = this->uAccuracyBonus; | |
469 | 5407 return v4 >= pValue; |
0 | 5408 case VAR_LuckBonus: |
5409 v4 = this->uLuckBonus; | |
469 | 5410 return v4 >= pValue; |
0 | 5411 case VAR_BaseMight: |
5412 v4 = this->uMight; | |
469 | 5413 return v4 >= pValue; |
0 | 5414 case VAR_BaseIntellect: |
5415 v4 = this->uIntelligence; | |
469 | 5416 return v4 >= pValue; |
0 | 5417 case VAR_BasePersonality: |
5418 v4 = this->uWillpower; | |
469 | 5419 return v4 >= pValue; |
0 | 5420 case VAR_BaseEndurance: |
5421 v4 = this->uEndurance; | |
469 | 5422 return v4 >= pValue; |
0 | 5423 case VAR_BaseSpeed: |
5424 v4 = this->uSpeed; | |
469 | 5425 return v4 >= pValue; |
0 | 5426 case VAR_BaseAccuracy: |
5427 v4 = this->uAccuracy; | |
469 | 5428 return v4 >= pValue; |
0 | 5429 case VAR_FixedFood: |
5430 v4 = pParty->uNumFoodRations; | |
469 | 5431 return v4 >= pValue; |
0 | 5432 default: |
469 | 5433 return v4 >= pValue; |
5434 } | |
5435 while ( v16->uItemID != pValue ) | |
0 | 5436 { |
5437 ++v15; | |
5438 ++v16; | |
5439 if ( v15 >= 138 ) | |
5440 { | |
469 | 5441 v6 = pParty->pPickedItem.uItemID == pValue; |
0 | 5442 return v6; |
5443 } | |
5444 } | |
469 | 5445 return true; |
0 | 5446 } |
5447 v4 = this->uLuck; | |
469 | 5448 return v4 >= pValue; |
5449 } | |
5450 if ( VarNum <= VAR_MagicResistance ) | |
5451 { | |
5452 if ( VarNum == VAR_MagicResistance ) | |
0 | 5453 { |
5454 v4 = this->sResMagicBase; | |
5455 } | |
5456 else | |
5457 { | |
469 | 5458 switch ( VarNum ) |
0 | 5459 { |
5460 case VAR_FireResistance: | |
5461 v4 = this->sResFireBase; | |
469 | 5462 return v4 >= pValue; |
0 | 5463 case VAR_AirResistance: |
5464 v4 = this->sResAirBase; | |
469 | 5465 return v4 >= pValue; |
0 | 5466 case VAR_WaterResistance: |
5467 v4 = this->sResWaterBase; | |
469 | 5468 return v4 >= pValue; |
0 | 5469 case VAR_EarthResistance: |
5470 v4 = this->sResEarthBase; | |
469 | 5471 return v4 >= pValue; |
0 | 5472 case VAR_SpiritResistance: |
5473 v4 = this->sResSpiritBase; | |
469 | 5474 return v4 >= pValue; |
0 | 5475 case VAR_MindResistance: |
5476 v4 = this->sResMindBase; | |
469 | 5477 return v4 >= pValue; |
0 | 5478 case VAR_BodyResistance: |
5479 v4 = this->sResBodyBase; | |
469 | 5480 return v4 >= pValue; |
0 | 5481 case VAR_LightResistance: |
5482 v4 = this->sResLightBase; | |
469 | 5483 return v4 >= pValue; |
0 | 5484 case VAR_DarkResistance: |
5485 v4 = this->sResDarkBase; | |
469 | 5486 return v4 >= pValue; |
0 | 5487 case VAR_ActualMight: |
5488 v12 = GetActualMight(); | |
5489 goto _j_cmp_against_arg; | |
5490 case VAR_ActualIntellect: | |
5491 v12 = GetActualIntelligence(); | |
5492 goto _j_cmp_against_arg; | |
5493 case VAR_ActualPersonality: | |
5494 v12 = GetActualWillpower(); | |
5495 goto _j_cmp_against_arg; | |
5496 case VAR_ActualEndurance: | |
5497 v12 = GetActualEndurance(); | |
5498 goto _j_cmp_against_arg; | |
5499 case VAR_ActualSpeed: | |
5500 v12 = GetActualSpeed(); | |
5501 goto _j_cmp_against_arg; | |
5502 case VAR_ActualAccuracy: | |
5503 v12 = GetActualAccuracy(); | |
5504 goto _j_cmp_against_arg; | |
5505 case VAR_ActualLuck: | |
5506 v12 = GetActualLuck(); | |
5507 _j_cmp_against_arg: | |
5508 v4 = v12; | |
5509 break; | |
5510 default: | |
469 | 5511 return v4 >= pValue; |
5512 } | |
5513 } | |
5514 return v4 >= pValue; | |
5515 } | |
5516 if ( VarNum <= VAR_DisarmTrapSkill ) | |
5517 { | |
5518 if ( VarNum != VAR_DisarmTrapSkill ) | |
5519 { | |
5520 if ( VarNum <= VAR_MindResistanceBonus ) | |
5521 { | |
5522 switch ( VarNum ) | |
0 | 5523 { |
5524 case VAR_MindResistanceBonus: | |
5525 v4 = this->sResMindBonus; | |
5526 break; | |
5527 case VAR_FireResistanceBonus: | |
5528 v4 = this->sResFireBonus; | |
5529 break; | |
5530 case VAR_AirResistanceBonus: | |
5531 v4 = this->sResAirBonus; | |
5532 break; | |
5533 case VAR_WaterResistanceBonus: | |
5534 v4 = this->sResWaterBonus; | |
5535 break; | |
5536 case VAR_EarthResistanceBonus: | |
5537 v4 = this->sResEarthBonus; | |
5538 break; | |
5539 case VAR_SpiritResistanceBonus: | |
5540 v4 = this->sResSpiritBonus; | |
5541 break; | |
5542 } | |
469 | 5543 return v4 >= pValue; |
5544 } | |
5545 if ( VarNum == VAR_BodyResistanceBonus ) | |
0 | 5546 { |
5547 v4 = this->sResBodyBonus; | |
469 | 5548 return v4 >= pValue; |
5549 } | |
5550 if ( VarNum == VAR_LightResistanceBonus ) | |
0 | 5551 { |
5552 v4 = this->sResLightBonus; | |
469 | 5553 return v4 >= pValue; |
5554 } | |
5555 if ( VarNum == VAR_DarkResistanceBonus ) | |
0 | 5556 { |
5557 v4 = this->sResDarkBonus; | |
469 | 5558 return v4 >= pValue; |
5559 } | |
5560 if ( VarNum == VAR_MagicResistanceBonus ) | |
0 | 5561 { |
5562 v4 = this->sResMagicBonus; | |
469 | 5563 return v4 >= pValue; |
5564 } | |
5565 if ( VarNum <= VAR_MagicResistanceBonus || VarNum > VAR_DiplomacySkill ) | |
5566 return v4 >= pValue; | |
0 | 5567 } |
5568 LABEL_90: | |
469 | 5569 v18 = *((short *)&this->pConditions[16] + VarNum); |
5570 if ( pValue <= 63 ) | |
0 | 5571 v4 = v18 & 0x3F; |
5572 else | |
469 | 5573 v4 = pValue & v18; |
5574 return v4 >= pValue; | |
5575 } | |
5576 if ( VarNum == 104 ) | |
0 | 5577 goto LABEL_90; |
469 | 5578 if ( (signed int)VarNum <= 104 ) |
5579 return v4 >= pValue; | |
5580 if ( (signed int)VarNum > 0x79 ) | |
5581 { | |
5582 if ( VarNum != 122 ) | |
5583 { | |
5584 if ( (signed int)VarNum > 122 && VarNum <= VAR_ActiveSpells ) | |
5585 v4 = (unsigned __int8)byte_5E4C15[VarNum]; | |
5586 return v4 >= pValue; | |
0 | 5587 } |
5588 v4 = GetMajorConditionIdx(); | |
5589 if ( v4 != 18 ) | |
5590 { | |
469 | 5591 return v4 >= pValue; |
5592 } | |
5593 v4 = pValue; | |
5594 return v4 >= pValue; | |
5595 } | |
1072 | 5596 return &LODWORD(this->pConditions[VarNum]);// *((int *)this + 2 * VarNum - 210); |
0 | 5597 } |
5598 | |
5599 | |
5600 //----- (0044A5CB) -------------------------------------------------------- | |
492 | 5601 void Player::SetVariable(enum VariableType var_type, signed int var_value) |
5602 { | |
5603 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
|
5604 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
|
5605 unsigned int v5_unused; // edi@1 |
0 | 5606 unsigned int v6; // esi@13 |
5607 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
|
5608 signed int v8_unused; // eax@17 |
0 | 5609 ItemGen *v9; // ecx@17 |
5610 int v10; // eax@21 | |
5611 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
|
5612 Player *unused12; // ecx@44 |
0 | 5613 char *v13; // ecx@45 |
5614 Player *v14; // ecx@49 | |
5615 int v15; // ecx@86 | |
5616 int v16; // esi@106 | |
5617 char v17; // al@106 | |
5618 int v18; // eax@107 | |
5619 Player *v19; // ecx@112 | |
5620 Player *v20; // ecx@127 | |
5621 int v21; // eax@127 | |
5622 int v22; // eax@145 | |
5623 char v23; // zf@146 | |
5624 DDM_DLV_Header *v24; // ecx@148 | |
5625 signed int v25; // eax@172 | |
5626 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
|
5627 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
|
5628 int v28_unused; // [sp-4h] [bp-38h]@84 |
0 | 5629 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
|
5630 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
|
5631 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
|
5632 |
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
|
5633 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
|
5634 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
|
5635 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5636 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
|
5637 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5638 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
|
5639 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
|
5640 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5641 } |
1545 | 5642 |
5643 Assert(currPlayerId != -1); | |
492 | 5644 if ( var_type > VAR_AutoNotes ) |
5645 { | |
5646 if ( var_type <= VAR_GoldInBank ) | |
5647 { | |
5648 if ( var_type == VAR_GoldInBank ) | |
5649 { | |
5650 pParty->uNumGoldInBank = var_value; | |
0 | 5651 return; |
5652 } | |
492 | 5653 if ( var_type <= VAR_Counter8 ) |
5654 { | |
5655 if ( (signed int)var_type >= 0xF5 ) | |
0 | 5656 { |
1619 | 5657 __debugbreak(); //how do I get here? |
492 | 5658 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); |
5659 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 5660 } |
5661 else | |
5662 { | |
492 | 5663 switch ( var_type ) |
0 | 5664 { |
5665 case VAR_MonthEquals|VAR_CurrentSP: | |
1619 | 5666 __debugbreak(); //how do I get here? |
492 | 5667 _449B7E_toggle_bit((unsigned char *)field_1A50, var_value, 1u); |
0 | 5668 break; |
5669 case VAR_NPCs2: | |
1619 | 5670 __debugbreak(); //how do I get here? |
0 | 5671 pParty->field_709 = 0; |
492 | 5672 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; |
1035 | 5673 pParty->CountHirelings(); |
5674 viewparams->bRedrawGameUI = true; | |
0 | 5675 break; |
5676 case VAR_NumSkillPoints: | |
492 | 5677 this->uSkillPoints = var_value; |
0 | 5678 break; |
5679 } | |
5680 } | |
5681 return; | |
5682 } | |
492 | 5683 if ( var_type < VAR_Counter9 ) |
0 | 5684 return; |
492 | 5685 if ( (signed int)var_type <= 0x112 ) |
5686 { | |
1619 | 5687 __debugbreak(); //how do I get here? |
492 | 5688 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); |
5689 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 5690 } |
5691 else | |
5692 { | |
492 | 5693 if ( var_type == VAR_ReputationInCurrentLocation ) |
0 | 5694 { |
5695 v24 = &pOutdoor->ddm; | |
5696 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5697 v24 = &pIndoor->dlv; | |
492 | 5698 v24->uReputation = var_value; |
5699 if ( var_value > 10000 ) | |
0 | 5700 v24->uReputation = 10000; |
5701 return; | |
5702 } | |
492 | 5703 if ( var_type <= VAR_ReputationInCurrentLocation |
5704 || var_type > VAR_History_28 | |
5705 || (v22 = var_type - 276, pParty->field_3C.field_4F0[2 * v22 + 1] | pParty->field_3C.field_4F0[2 * v22]) | |
5706 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
1455 | 5707 v23 = pStorylineText->StoreLine[v22].pText == 0,//*(&pStorylineText->field_0 + 3 * v22) == 0, |
492 | 5708 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 5709 v23) ) |
1619 | 5710 __debugbreak(); //how do I get here? |
0 | 5711 return; |
5712 bFlashHistoryBook = 1; | |
5713 } | |
492 | 5714 v25 = 8 * currPlayerId + 400; |
862 | 5715 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
|
5716 pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); |
0 | 5717 return; |
5718 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5719 switch ( var_type ) |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5720 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5721 case VAR_NumDeaths: |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5722 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
|
5723 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5724 case VAR_NumBounties: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5725 pParty->uNumBountiesCollected = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5726 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5727 case VAR_PrisonTerms: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5728 pParty->uNumPrisonTerms = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5729 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5730 case VAR_ArenaWinsPage: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5731 pParty->uNumArenaPageWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5732 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5733 case VAR_ArenaWinsSquire: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5734 pParty->uNumArenaSquireWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5735 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5736 case VAR_ArenaWinsKnight: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5737 pParty->uNumArenaKnightWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5738 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5739 case VAR_ArenaWinsLord: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5740 pParty->uNumArenaLordWins = var_value; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5741 break; |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5742 } |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5743 return; |
0 | 5744 } |
492 | 5745 if ( var_type == VAR_AutoNotes ) |
5746 { | |
5747 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
|
5748 //&& (&dword_723718_autonote_related)[8 * a3] ) |
1310 | 5749 && pAutonoteTxt[var_value].pText ) |
492 | 5750 { |
5751 v20 = pPlayers[currPlayerId + 1]; | |
187 | 5752 v20->PlaySound(SPEECH_96, 0); |
1453 | 5753 //v21 = pAutonoteTxt[var_value].eType;// dword_72371C[2 * a3]; |
0 | 5754 bFlashAutonotesBook = 1; |
1453 | 5755 _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
|
5756 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
0 | 5757 } |
1453 | 5758 _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
|
5759 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5760 return; |
0 | 5761 } |
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
|
5762 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
|
5763 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5764 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
|
5765 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5766 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
|
5767 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
|
5768 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
|
5769 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
|
5770 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
|
5771 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
|
5772 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5773 v9 = NULL; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5774 for (int i = 0; i < 138; i++) |
0 | 5775 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
5776 v9 = &this->pInventoryItemList[i]; |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
5777 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
|
5778 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
|
5779 } |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
5780 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
|
5781 { |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5782 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
|
5783 *(int *)(v10 + 532) = 601; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5784 *(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
|
5785 } |
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
|
5786 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
|
5787 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
|
5788 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
|
5789 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
|
5790 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
|
5791 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
|
5792 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
|
5793 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
|
5794 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
|
5795 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
|
5796 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
|
5797 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
|
5798 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
|
5799 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
|
5800 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5801 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
|
5802 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
|
5803 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5804 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
|
5805 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5806 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
|
5807 this->uVoiceID = 20; |
0 | 5808 } |
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
|
5809 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
|
5810 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5811 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
|
5812 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
|
5813 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
|
5814 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
|
5815 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
|
5816 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
|
5817 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
|
5818 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
|
5819 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
|
5820 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
|
5821 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
|
5822 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
|
5823 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
|
5824 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
|
5825 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
|
5826 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
|
5827 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
|
5828 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
|
5829 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
|
5830 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
|
5831 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
|
5832 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
|
5833 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
|
5834 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
|
5835 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
|
5836 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
|
5837 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
|
5838 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
|
5839 //&& 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
|
5840 && 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
|
5841 { |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5842 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
|
5843 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5844 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
|
5845 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
5846 _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
|
5847 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
|
5848 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
|
5849 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
|
5850 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
|
5851 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
|
5852 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
|
5853 // && (&dword_722F10)[4 * a3] ) |
1310 | 5854 && pQuestTable[var_value] ) |
0 | 5855 { |
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
|
5856 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
|
5857 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
|
5858 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
|
5859 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5860 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
|
5861 } |
7ef8ae7ce42a
Player::SetVariable cleanup - moved around some cases to group similar types together, some cases reordered according to enum values
Grumpy7
parents:
1213
diff
changeset
|
5862 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
|
5863 _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
|
5864 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
|
5865 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
|
5866 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
|
5867 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
|
5868 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
|
5869 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
|
5870 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
|
5871 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
|
5872 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
|
5873 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
|
5874 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
|
5875 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
|
5876 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
|
5877 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
|
5878 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
|
5879 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
|
5880 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
|
5881 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
|
5882 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
|
5883 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
|
5884 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
|
5885 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
|
5886 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
|
5887 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
|
5888 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
|
5889 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
|
5890 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
|
5891 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
|
5892 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
|
5893 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
|
5894 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
|
5895 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
|
5896 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
|
5897 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
|
5898 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
|
5899 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
|
5900 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
|
5901 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
|
5902 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
|
5903 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
|
5904 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
|
5905 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
|
5906 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
|
5907 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
|
5908 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
|
5909 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
|
5910 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5911 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
|
5912 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
|
5913 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
|
5914 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5915 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
|
5916 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
|
5917 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
|
5918 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5919 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
|
5920 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
|
5921 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
|
5922 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5923 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
|
5924 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
|
5925 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
|
5926 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5927 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
|
5928 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
|
5929 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
|
5930 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5931 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
|
5932 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
|
5933 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
|
5934 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5935 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
|
5936 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
|
5937 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
|
5938 } |
0 | 5939 LABEL_111: |
187 | 5940 v26 = SPEECH_91; |
0 | 5941 LABEL_112: |
492 | 5942 v19 = pPlayers[currPlayerId + 1]; |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
5943 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
|
5944 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5945 PlaySoundBasedOnCondition(currPlayerId); |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5946 return; |
0 | 5947 } |
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
|
5948 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
|
5949 { |
492 | 5950 switch ( var_type ) |
0 | 5951 { |
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
|
5952 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
|
5953 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
|
5954 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
|
5955 goto LABEL_111; |
0 | 5956 case VAR_ActualIntellect: |
5957 LABEL_68: | |
492 | 5958 this->uIntelligenceBonus = (unsigned __int8)var_value; |
0 | 5959 goto LABEL_111; |
5960 case VAR_ActualPersonality: | |
5961 LABEL_69: | |
492 | 5962 this->uWillpowerBonus = (unsigned __int8)var_value; |
0 | 5963 goto LABEL_111; |
5964 case VAR_ActualEndurance: | |
5965 LABEL_70: | |
492 | 5966 this->uEnduranceBonus = (unsigned __int8)var_value; |
0 | 5967 goto LABEL_111; |
5968 case VAR_ActualSpeed: | |
5969 LABEL_71: | |
492 | 5970 this->uSpeedBonus = (unsigned __int8)var_value; |
0 | 5971 goto LABEL_111; |
5972 case VAR_ActualAccuracy: | |
5973 LABEL_72: | |
492 | 5974 this->uAccuracyBonus = (unsigned __int8)var_value; |
0 | 5975 goto LABEL_111; |
5976 case VAR_ActualLuck: | |
5977 LABEL_73: | |
492 | 5978 this->uLuckBonus = (unsigned __int8)var_value; |
0 | 5979 goto LABEL_111; |
5980 case VAR_FireResistance: | |
492 | 5981 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
|
5982 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5983 goto LABEL_112; |
0 | 5984 case VAR_AirResistance: |
492 | 5985 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
|
5986 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5987 goto LABEL_112; |
0 | 5988 case VAR_WaterResistance: |
492 | 5989 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
|
5990 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5991 goto LABEL_112; |
0 | 5992 case VAR_EarthResistance: |
492 | 5993 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
|
5994 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5995 goto LABEL_112; |
0 | 5996 case VAR_SpiritResistance: |
492 | 5997 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
|
5998 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5999 goto LABEL_112; |
0 | 6000 case VAR_MindResistance: |
492 | 6001 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
|
6002 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6003 goto LABEL_112; |
0 | 6004 case VAR_BodyResistance: |
492 | 6005 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
|
6006 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6007 goto LABEL_112; |
0 | 6008 case VAR_LightResistance: |
492 | 6009 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
|
6010 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6011 goto LABEL_112; |
0 | 6012 case VAR_DarkResistance: |
492 | 6013 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
|
6014 v26 = 92; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6015 goto LABEL_112; |
0 | 6016 case VAR_MagicResistance: |
492 | 6017 this->sResMagicBase = (unsigned __int8)var_value; |
0 | 6018 v26 = 92; |
6019 goto LABEL_112; | |
6020 default: | |
6021 return; | |
6022 } | |
6023 return; | |
6024 } | |
6025 HIWORD(v15) = 0; | |
492 | 6026 if ( var_type > VAR_DisarmTrapSkill ) |
6027 { | |
6028 if ( var_type != VAR_LearningSkill ) | |
6029 { | |
6030 if ( var_type <= VAR_LearningSkill ) | |
0 | 6031 return; |
492 | 6032 if ( var_type <= VAR_Eradicated ) |
6033 { | |
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
|
6034 this->SetCondition(var_type - 105, 1); |
0 | 6035 } |
6036 else | |
6037 { | |
492 | 6038 if ( var_type != VAR_MajorCondition ) |
0 | 6039 { |
492 | 6040 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
6041 byte_5E4C15[var_type] = var_value; | |
0 | 6042 return; |
6043 } | |
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
|
6044 memset(this, 0, 0xA0u); |
0 | 6045 } |
6046 } | |
6047 else | |
6048 { | |
1260
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6049 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
|
6050 v17 = *(char *)v16; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6051 if ( var_value <= VAR_BodyResistanceBonus ) |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6052 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6053 LOWORD(v15) = (unsigned __int8)var_value; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6054 v18 = v15 | v17 & VAR_BodyResistanceBonus; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6055 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6056 else |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6057 { |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6058 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
|
6059 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6060 *(short *)v16 = v18; |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6061 } |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6062 LABEL_124: |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6063 DrawPlayerBuffAnimBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6064 PlaySoundBasedOnCondition(currPlayerId); |
dd70fc7eaf08
Player::SetVariable cleanup - preparing to remove LABEL_111 and LABEL_112
Grumpy7
parents:
1259
diff
changeset
|
6065 return; |
0 | 6066 } |
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
|
6067 if ( var_type <= VAR_MagicResistanceBonus ) |
492 | 6068 { |
6069 switch ( var_type ) | |
0 | 6070 { |
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
|
6071 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
|
6072 this->sResFireBonus = (unsigned __int8)var_value; |
0 | 6073 break; |
6074 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
|
6075 this->sResAirBonus = (unsigned __int8)var_value; |
0 | 6076 break; |
6077 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
|
6078 this->sResWaterBonus = (unsigned __int8)var_value; |
0 | 6079 break; |
6080 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
|
6081 this->sResEarthBonus = (unsigned __int8)var_value; |
0 | 6082 break; |
6083 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
|
6084 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
|
6085 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
|
6086 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
|
6087 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
|
6088 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
|
6089 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
|
6090 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
|
6091 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
|
6092 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
|
6093 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
|
6094 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
|
6095 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
|
6096 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
|
6097 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
|
6098 case VAR_PhysicalResistanceBonus: |
1545 | 6099 Assert("VAR_PhysicalResistanceBonus variable unsupported" && false); |
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
|
6100 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
|
6101 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
|
6102 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
|
6103 this->sResMagicBonus = (unsigned __int8)var_value; |
0 | 6104 break; |
6105 default: | |
1558
30db6d265ceb
Changed the new Assert macro definition slightly, Party::AddItem (for some reason in players.cpp) renamed to Party::AddItemToParty, cleaned up; some unused variables in previous functions removed
Grumpy7
parents:
1555
diff
changeset
|
6106 Error("Unexpected var_type: %u", var_type); |
0 | 6107 return; |
6108 break; | |
6109 } | |
6110 goto LABEL_111; | |
6111 } | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6112 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
|
6113 { |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6114 return; |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6115 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6116 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6117 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6118 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6119 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6120 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
|
6121 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6122 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
|
6123 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
|
6124 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
|
6125 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6126 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
6127 //----- (new function) -------------------------------------------------------- |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6128 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
|
6129 { |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
6130 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
|
6131 } |
0 | 6132 |
6133 //----- (0044AFFB) -------------------------------------------------------- | |
310 | 6134 void Player::AddVariable(enum VariableType var_type, signed int val) |
0 | 6135 { |
6136 char v3; // bl@1 | |
6137 Player *v4; // esi@1 | |
6138 signed int uPlayerIdx; // edi@1 | |
6139 int v6; // eax@15 | |
6140 unsigned int v7; // esi@18 | |
6141 int *v8; // ebx@21 | |
6142 int v9; // eax@22 | |
6143 signed int v10; // eax@24 | |
6144 int v11; // eax@27 | |
6145 __int16 *v12; // esi@28 | |
6146 Player *v13; // ecx@34 | |
6147 Player *v14; // ecx@36 | |
6148 char *v15; // ecx@37 | |
6149 unsigned __int8 v16; // cf@38 | |
6150 Player *v17; // ecx@42 | |
6151 __int16 *v18; // esi@53 | |
6152 __int16 *v19; // esi@62 | |
6153 char *v20; // esi@107 | |
6154 __int16 v21; // dx@107 | |
6155 int v22; // ecx@107 | |
6156 Player *v23; // ecx@132 | |
6157 int v24; // eax@132 | |
6158 int v25; // eax@150 | |
6159 char v26; // zf@151 | |
6160 DDM_DLV_Header *v27; // eax@153 | |
6161 signed int v28; // eax@176 | |
6162 int v29; // [sp-8h] [bp-40h]@84 | |
310 | 6163 // signed int v30; // [sp-4h] [bp-3Ch]@4 |
0 | 6164 int v31; // [sp-4h] [bp-3Ch]@84 |
6165 ItemGen item; // [sp+Ch] [bp-2Ch]@45 | |
6166 unsigned int v33; // [sp+30h] [bp-8h]@34 | |
6167 char v34; // [sp+37h] [bp-1h]@1 | |
6168 | |
6169 auto Dst = this; | |
6170 v3 = 0; | |
6171 v34 = 0; | |
6172 v4 = Dst; | |
6173 uPlayerIdx = 0; | |
6174 if ( Dst == pPlayers[2] ) | |
6175 uPlayerIdx = 1; | |
310 | 6176 else if ( Dst == pPlayers[3] ) |
6177 uPlayerIdx = 2; | |
6178 else if ( Dst == pPlayers[4] ) | |
6179 uPlayerIdx = 3; | |
6180 | |
6181 if ( var_type <= VAR_AutoNotes ) | |
6182 { | |
6183 if ( var_type != VAR_AutoNotes ) | |
6184 { | |
6185 if ( var_type <= VAR_ActualMight ) | |
6186 { | |
6187 if ( var_type != VAR_ActualMight ) | |
0 | 6188 { |
310 | 6189 switch ( var_type ) |
0 | 6190 { |
6191 case VAR_RandomGold: | |
6192 if ( !val ) | |
6193 val = 1; | |
6194 v6 = rand(); | |
6195 party_finds_gold(v6 % val + 1, 1); | |
6196 GameUI_DrawFoodAndGold(); | |
6197 return; | |
6198 case VAR_RandomFood: | |
6199 if ( !val ) | |
6200 val = 1; | |
6201 v7 = rand() % val + 1; | |
6202 Party::GiveFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6203 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
|
6204 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 6205 GameUI_DrawFoodAndGold(); |
6206 goto _play_sound; | |
6207 case VAR_Sex: | |
6208 Dst->uSex = (PLAYER_SEX)val; | |
1507 | 6209 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6210 goto _play_sound; | |
0 | 6211 case VAR_Class: |
135 | 6212 Dst->classType = (PLAYER_CLASS_TYPE)val; |
1507 | 6213 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6214 goto _play_sound; | |
0 | 6215 case VAR_CurrentHP: |
6216 v8 = &Dst->sHealth; | |
6217 *v8 += val; | |
6218 if ( Dst->sHealth <= Dst->GetMaxHealth() ) | |
1507 | 6219 { |
6220 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6221 goto _play_sound; | |
6222 } | |
0 | 6223 v9 = v4->GetMaxHealth(); |
6224 goto LABEL_23; | |
6225 case VAR_MaxHP: | |
6226 v10 = Dst->GetMaxHealth(); | |
6227 v4->_health_related = 0; | |
6228 v4->uFullHealthBonus = 0; | |
6229 v4->sHealth = v10; | |
6230 return; | |
6231 case VAR_CurrentSP: | |
6232 v8 = &Dst->sMana; | |
6233 *v8 += val; | |
6234 if ( Dst->sMana > GetMaxMana() ) | |
6235 { | |
6236 v9 = v4->GetMaxMana(); | |
6237 LABEL_23: | |
6238 *v8 = v9; | |
6239 } | |
1507 | 6240 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6241 goto _play_sound; | |
0 | 6242 case VAR_MaxSP: |
6243 v11 = GetMaxMana(); | |
6244 v4->_mana_related = 0; | |
6245 v4->uFullManaBonus = 0; | |
6246 v4->sMana = v11; | |
6247 return; | |
6248 case VAR_ACModifier: | |
6249 v12 = &Dst->sACModifier; | |
6250 goto LABEL_29; | |
6251 case VAR_BaseLevel: | |
6252 v12 = (__int16 *)&Dst->uLevel; | |
6253 goto LABEL_29; | |
6254 case VAR_LevelModifier: | |
6255 v12 = &Dst->sLevelModifier; | |
6256 LABEL_29: | |
6257 *v12 += val; | |
6258 if ( *v12 > 255 ) | |
6259 *v12 = 255; | |
1507 | 6260 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6261 goto _play_sound; | |
0 | 6262 case VAR_Age: |
6263 Dst->sAgeModifier += val; | |
6264 return; | |
6265 case VAR_Award: | |
6266 v13 = pPlayers[uPlayerIdx + 1]; | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6267 if (_449B57_test_bit((unsigned __int8 *)pPlayers[uPlayerIdx + 1]->_achieved_awards_bits, val) |
521 | 6268 |
492 | 6269 && pAwards[val].pText ) |
0 | 6270 { |
6271 v14 = pPlayers[uPlayerIdx + 1]; | |
6272 v34 = 1; | |
6273 v3 = 1; | |
187 | 6274 v14->PlaySound(SPEECH_96, 0); |
0 | 6275 } |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6276 v15 = (char *)v4->_achieved_awards_bits; |
1507 | 6277 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
6278 if ( v34 != 1 ) | |
6279 { | |
6280 if ( v3 != 1 ) | |
6281 return; | |
6282 goto _play_sound; | |
6283 } | |
6284 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6285 if ( v3 != 1 ) | |
6286 return; | |
6287 goto _play_sound; | |
0 | 6288 case VAR_Experience: |
6289 v16 = __CFADD__(val, LODWORD(Dst->uExperience)); | |
6290 LODWORD(Dst->uExperience) += val; | |
6291 HIDWORD(Dst->uExperience) += ((unsigned __int64)val >> 32) + v16; | |
6292 if ( (signed __int64)Dst->uExperience > 4000000000i64 ) | |
6293 Dst->uExperience = 4000000000i64; | |
1507 | 6294 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6295 goto _play_sound; | |
0 | 6296 case VAR_QBits_QuestsDone: |
484 | 6297 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
|
6298 //&& (&dword_722F10)[4 * val] ) |
1310 | 6299 && pQuestTable[val] ) |
0 | 6300 { |
501 | 6301 //v17 = pPlayers[uPlayerIdx + 1]; |
0 | 6302 bFlashQuestBook = 1; |
6303 v34 = 1; | |
6304 v3 = 1; | |
501 | 6305 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0); |
0 | 6306 } |
484 | 6307 v15 = (char *)pParty->_quest_bits; |
1507 | 6308 _449B7E_toggle_bit((unsigned char *)v15, val, 1); |
6309 if ( v34 != 1 ) | |
6310 { | |
6311 if ( v3 != 1 ) | |
6312 return; | |
6313 goto _play_sound; | |
6314 } | |
6315 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6316 if ( v3 != 1 ) | |
6317 return; | |
6318 goto _play_sound; | |
0 | 6319 case VAR_PlayerItemInHands: |
6320 item.Reset(); | |
6321 item.Reset(); | |
6322 item.uAttributes = 1; | |
6323 item.uItemID = val; | |
6324 if ( val >= ITEM_ARTIFACT_PUCK && val <= ITEM_RELIC_MEKORIGS_HAMMER ) | |
484 | 6325 pParty->pIsArtifactFound[val-500] = 1; |
0 | 6326 if ( val >= ITEM_WAND_FIRE && val <= ITEM_WAND_INCENERATION ) |
6327 { | |
6328 item.uNumCharges = rand() % 6 + pItemsTable->pItems[item.uItemID].uDamageMod + 1; | |
6329 item.uMaxCharges = LOBYTE(item.uNumCharges); | |
6330 } | |
6331 pParty->SetHoldingItem(&item); | |
6332 return; | |
6333 case VAR_FixedGold: | |
6334 party_finds_gold(val, 1); | |
6335 return; | |
6336 case VAR_BaseMight: | |
6337 v18 = (__int16 *)&Dst->uMight; | |
6338 goto LABEL_82; | |
6339 case VAR_BaseIntellect: | |
6340 v18 = (__int16 *)&Dst->uIntelligence; | |
6341 goto LABEL_82; | |
6342 case VAR_BasePersonality: | |
6343 v18 = (__int16 *)&Dst->uWillpower; | |
6344 goto LABEL_82; | |
6345 case VAR_BaseEndurance: | |
6346 v18 = (__int16 *)&Dst->uEndurance; | |
6347 goto LABEL_82; | |
6348 case VAR_BaseSpeed: | |
6349 v18 = (__int16 *)&Dst->uSpeed; | |
6350 goto LABEL_82; | |
6351 case VAR_BaseAccuracy: | |
6352 v18 = (__int16 *)&Dst->uAccuracy; | |
6353 goto LABEL_82; | |
6354 case VAR_BaseLuck: | |
6355 v18 = (__int16 *)&Dst->uLuck; | |
6356 goto LABEL_82; | |
6357 case VAR_FixedFood: | |
6358 Party::GiveFood(val); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6359 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6360 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 6361 if ( pParty->uNumFoodRations > 0xFFFF ) |
6362 Party::SetFood(0xFFFFu); | |
6363 goto _play_sound; | |
6364 case VAR_MightBonus: | |
6365 goto LABEL_62; | |
6366 case VAR_IntellectBonus: | |
6367 goto LABEL_66; | |
6368 case VAR_PersonalityBonus: | |
6369 goto LABEL_67; | |
6370 case VAR_EnduranceBonus: | |
6371 goto LABEL_68; | |
6372 case VAR_SpeedBonus: | |
6373 goto LABEL_69; | |
6374 case VAR_AccuracyBonus: | |
6375 goto LABEL_70; | |
6376 case VAR_LuckBonus: | |
6377 goto LABEL_71; | |
6378 default: | |
6379 return; | |
6380 } | |
6381 return; | |
6382 } | |
6383 LABEL_62: | |
6384 v19 = (__int16 *)&Dst->uMightBonus; | |
6385 goto LABEL_113; | |
6386 } | |
310 | 6387 if ( var_type <= VAR_FireResistanceBonus ) |
6388 { | |
6389 if ( var_type != VAR_FireResistanceBonus ) | |
0 | 6390 { |
310 | 6391 switch ( var_type ) |
0 | 6392 { |
6393 case VAR_ActualIntellect: | |
6394 LABEL_66: | |
6395 v19 = (__int16 *)&Dst->uIntelligenceBonus; | |
6396 goto LABEL_113; | |
6397 case VAR_ActualPersonality: | |
6398 LABEL_67: | |
6399 v19 = (__int16 *)&Dst->uWillpowerBonus; | |
6400 goto LABEL_113; | |
6401 case VAR_ActualEndurance: | |
6402 LABEL_68: | |
6403 v19 = (__int16 *)&Dst->uEnduranceBonus; | |
6404 goto LABEL_113; | |
6405 case VAR_ActualSpeed: | |
6406 LABEL_69: | |
6407 v19 = (__int16 *)&Dst->uSpeedBonus; | |
6408 goto LABEL_113; | |
6409 case VAR_ActualAccuracy: | |
6410 LABEL_70: | |
6411 v19 = (__int16 *)&Dst->uAccuracyBonus; | |
6412 goto LABEL_113; | |
6413 case VAR_ActualLuck: | |
6414 LABEL_71: | |
6415 v19 = (__int16 *)&Dst->uLuckBonus; | |
6416 goto LABEL_113; | |
6417 case VAR_FireResistance: | |
6418 v18 = &Dst->sResFireBase; | |
6419 goto LABEL_82; | |
6420 case VAR_AirResistance: | |
6421 v18 = &Dst->sResAirBase; | |
6422 goto LABEL_82; | |
6423 case VAR_WaterResistance: | |
6424 v18 = &Dst->sResWaterBase; | |
6425 goto LABEL_82; | |
6426 case VAR_EarthResistance: | |
6427 v18 = &Dst->sResEarthBase; | |
6428 goto LABEL_82; | |
6429 case VAR_SpiritResistance: | |
6430 v18 = &Dst->sResSpiritBase; | |
6431 goto LABEL_82; | |
6432 case VAR_MindResistance: | |
6433 v18 = &Dst->sResMindBase; | |
6434 goto LABEL_82; | |
6435 case VAR_BodyResistance: | |
6436 v18 = &Dst->sResBodyBase; | |
6437 goto LABEL_82; | |
6438 case VAR_LightResistance: | |
6439 v18 = &Dst->sResLightBase; | |
6440 goto LABEL_82; | |
6441 case VAR_DarkResistance: | |
6442 v18 = &Dst->sResDarkBase; | |
6443 goto LABEL_82; | |
6444 case VAR_MagicResistance: | |
6445 v18 = &Dst->sResMagicBase; | |
6446 LABEL_82: | |
6447 *v18 += val; | |
6448 if ( *v18 > 255 ) | |
6449 *v18 = 255; | |
1507 | 6450 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_92, 0); |
6451 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6452 goto _play_sound; | |
0 | 6453 default: |
6454 return; | |
6455 } | |
6456 return; | |
6457 } | |
6458 v19 = &Dst->sResFireBonus; | |
6459 LABEL_113: | |
6460 *v19 += val; | |
6461 if ( *v19 > 255 ) | |
6462 *v19 = 255; | |
6463 v31 = 0; | |
187 | 6464 v29 = SPEECH_91; |
6465 pPlayers[uPlayerIdx + 1]->PlaySound((PlayerSpeech)v29, v31); | |
1507 | 6466 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6467 goto _play_sound; | |
0 | 6468 } |
310 | 6469 if ( var_type <= VAR_DisarmTrapSkill ) |
6470 { | |
6471 if ( var_type != VAR_DisarmTrapSkill ) | |
0 | 6472 { |
310 | 6473 if ( var_type <= VAR_BodyResistanceBonus ) |
0 | 6474 { |
310 | 6475 switch ( var_type ) |
0 | 6476 { |
6477 case VAR_BodyResistanceBonus: | |
6478 v19 = &Dst->sResBodyBonus; | |
6479 break; | |
6480 case VAR_AirResistanceBonus: | |
6481 v19 = &Dst->sResAirBonus; | |
6482 break; | |
6483 case VAR_WaterResistanceBonus: | |
6484 v19 = &Dst->sResWaterBonus; | |
6485 break; | |
6486 case VAR_EarthResistanceBonus: | |
6487 v19 = &Dst->sResEarthBonus; | |
6488 break; | |
6489 case VAR_SpiritResistanceBonus: | |
6490 v19 = &Dst->sResSpiritBonus; | |
6491 break; | |
6492 default: | |
310 | 6493 if ( var_type != 62 ) |
0 | 6494 return; |
6495 v19 = &Dst->sResMindBonus; | |
6496 break; | |
6497 } | |
6498 goto LABEL_113; | |
6499 } | |
310 | 6500 if ( var_type == VAR_LightResistanceBonus ) |
0 | 6501 { |
6502 v19 = &Dst->sResLightBonus; | |
6503 goto LABEL_113; | |
6504 } | |
310 | 6505 if ( var_type == VAR_DarkResistanceBonus ) |
0 | 6506 { |
6507 v19 = &Dst->sResDarkBonus; | |
6508 goto LABEL_113; | |
6509 } | |
310 | 6510 if ( var_type == VAR_MagicResistanceBonus ) |
0 | 6511 { |
6512 v19 = &Dst->sResMagicBonus; | |
6513 goto LABEL_113; | |
6514 } | |
310 | 6515 if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill ) |
0 | 6516 return; |
6517 } | |
6518 goto LABEL_106; | |
6519 } | |
310 | 6520 if ( var_type == VAR_LearningSkill ) |
0 | 6521 { |
6522 LABEL_106: | |
6523 if ( val <= VAR_BodyResistanceBonus ) | |
6524 { | |
310 | 6525 *((short *)&Dst->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&Dst->pConditions[16] + 2 * var_type) & VAR_BodyResistanceBonus; |
0 | 6526 } |
6527 else | |
6528 { | |
310 | 6529 v20 = (char *)&Dst->pConditions[16] + 2 * var_type; |
0 | 6530 v21 = *(short *)v20; |
6531 v22 = (unsigned __int8)val + (v21 & VAR_BodyResistanceBonus); | |
6532 if ( v22 > 60 ) | |
6533 LOWORD(v22) = 60; | |
6534 LOBYTE(v21) = v21 & 0xC0; | |
6535 *(short *)v20 = v22 | v21; | |
6536 } | |
1507 | 6537 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6538 goto _play_sound; | |
0 | 6539 } |
310 | 6540 if ( var_type <= VAR_LearningSkill ) |
0 | 6541 return; |
310 | 6542 if ( var_type <= VAR_Eradicated ) |
6543 { | |
6544 Dst->SetCondition(var_type - 105, 0); | |
0 | 6545 } |
6546 else | |
6547 { | |
310 | 6548 if ( var_type != VAR_MajorCondition ) |
0 | 6549 { |
310 | 6550 if ( var_type > VAR_MajorCondition && var_type <= VAR_ActiveSpells ) |
0 | 6551 { |
310 | 6552 if ( (unsigned __int8)val + (unsigned __int8)byte_5E4C15[var_type] <= 255 ) |
6553 byte_5E4C15[var_type] += val; | |
0 | 6554 else |
310 | 6555 byte_5E4C15[var_type] = -1; |
0 | 6556 } |
6557 return; | |
6558 } | |
6559 memset(Dst, 0, 0xA0u); | |
6560 } | |
6561 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6562 goto _play_sound; | |
6563 } | |
6564 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
|
6565 //&& (&dword_723718_autonote_related)[8 * val] ) |
1310 | 6566 && pAutonoteTxt[val].pText ) |
0 | 6567 { |
6568 v23 = pPlayers[uPlayerIdx + 1]; | |
6569 v34 = 1; | |
187 | 6570 v23->PlaySound(SPEECH_96, 0); |
1453 | 6571 //v24 = pAutonoteTxt[val].eType;//dword_72371C[2 * val]; |
0 | 6572 bFlashAutonotesBook = 1; |
1453 | 6573 _506568_autonote_type = pAutonoteTxt[val].eType; |
6574 } | |
6575 _449B7E_toggle_bit(pParty->_autonote_bits, val, 1); | |
0 | 6576 v3 = 1; |
6577 if ( v34 != 1 ) | |
1507 | 6578 { |
6579 if ( v3 != 1 ) | |
6580 return; | |
6581 goto _play_sound; | |
6582 } | |
6583 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6584 if ( v3 != 1 ) | |
6585 return; | |
6586 goto _play_sound; | |
0 | 6587 } |
310 | 6588 if ( var_type > VAR_GoldInBank ) |
6589 { | |
6590 if ( var_type == 307 ) | |
0 | 6591 { |
6592 pParty->uNumDeaths += val; | |
1507 | 6593 if ( v34 != 1 ) |
6594 { | |
6595 if ( v3 != 1 ) | |
6596 return; | |
6597 goto _play_sound; | |
6598 } | |
6599 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6600 if ( v3 != 1 ) | |
6601 return; | |
6602 goto _play_sound; | |
0 | 6603 } |
310 | 6604 switch ( var_type ) |
0 | 6605 { |
6606 case 308: | |
6607 pParty->uNumBountiesCollected += val; | |
6608 break; | |
6609 case 309: | |
6610 pParty->uNumPrisonTerms += val; | |
6611 break; | |
6612 case 310: | |
6613 pParty->uNumArenaPageWins += val; | |
6614 break; | |
6615 case 311: | |
6616 pParty->uNumArenaSquireWins += val; | |
6617 break; | |
6618 case 312: | |
6619 pParty->uNumArenaKnightWins += val; | |
6620 break; | |
6621 case 313: | |
6622 pParty->uNumArenaLordWins += val; | |
6623 break; | |
6624 } | |
6625 } | |
6626 else | |
6627 { | |
310 | 6628 if ( var_type == VAR_GoldInBank ) |
0 | 6629 { |
6630 pParty->uNumGoldInBank += val; | |
6631 return; | |
6632 } | |
310 | 6633 if ( var_type <= VAR_Counter8 ) |
6634 { | |
6635 if ( (signed int)var_type >= 245 ) | |
6636 { | |
6637 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed); | |
6638 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); | |
0 | 6639 } |
6640 else | |
6641 { | |
310 | 6642 switch ( var_type ) |
0 | 6643 { |
6644 case VAR_MonthEquals|VAR_CurrentSP: | |
6645 _449B7E_toggle_bit((unsigned char *)Dst->field_1A50, val, 1u); | |
6646 break; | |
6647 case VAR_NPCs2: | |
6648 pParty->field_709 = 0; | |
6649 LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u; | |
1035 | 6650 pParty->CountHirelings(); |
6651 viewparams->bRedrawGameUI = true; | |
0 | 6652 break; |
6653 case VAR_NumSkillPoints: | |
6654 Dst->uSkillPoints += val; | |
6655 break; | |
6656 } | |
6657 } | |
6658 return; | |
6659 } | |
310 | 6660 if ( var_type < VAR_Counter9 ) |
0 | 6661 return; |
310 | 6662 if ( (signed int)var_type <= 274 ) |
6663 { | |
6664 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed); | |
6665 *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed); | |
0 | 6666 goto _play_sound; |
6667 } | |
310 | 6668 if ( var_type != VAR_ReputationInCurrentLocation ) |
6669 { | |
6670 if ( var_type <= VAR_ReputationInCurrentLocation | |
6671 || var_type > VAR_History_28 | |
6672 || (v25 = var_type - 276, pParty->field_3C.field_4F0[2 * v25 + 1] | pParty->field_3C.field_4F0[2 * v25]) | |
6673 || (pParty->field_3C.field_4F0[2 * (var_type - 276)] = LODWORD(pParty->uTimePlayed), | |
233 | 6674 v26 = pStorylineText->StoreLine[v25].pText==0,//*(&pStorylineText->field_0 + 3 * v25) == 0, |
310 | 6675 pParty->field_3C.field_4F0[2 * (var_type - 276) + 1] = HIDWORD(pParty->uTimePlayed), |
0 | 6676 v26) ) |
6677 return; | |
6678 bFlashHistoryBook = 1; | |
6679 _play_sound: | |
6680 v28 = 8 * uPlayerIdx + 400; | |
862 | 6681 LOBYTE(v28) = PID(OBJECT_Player,uPlayerIdx - 112); |
0 | 6682 pAudioPlayer->PlaySound(SOUND_20001, v28, 0, -1, 0, 0, 0, 0); |
6683 return; | |
6684 } | |
6685 v27 = &pOutdoor->ddm; | |
6686 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6687 v27 = &pIndoor->dlv; | |
6688 v27->uReputation += val; | |
6689 if ( v27->uReputation > 10000 ) | |
6690 v27->uReputation = 10000; | |
6691 } | |
6692 } | |
6693 | |
6694 | |
6695 //----- (0044B9C4) -------------------------------------------------------- | |
501 | 6696 bool Player::SubtractVariable(enum VariableType VarNum, signed int pValue) |
0 | 6697 { |
6698 unsigned int v3; // ebx@1 | |
6699 signed int v4; // esi@1 | |
501 | 6700 bool result; // eax@8 |
0 | 6701 int v6; // esi@11 |
6702 int v7; // edi@14 | |
6703 signed int v8; // eax@17 | |
6704 char *v9; // eax@20 | |
6705 char v10; // sf@20 | |
6706 char *v11; // ecx@26 | |
6707 char *v12; // ecx@27 | |
6708 __int64 v13; // qax@27 | |
6709 unsigned __int8 v14; // cf@27 | |
501 | 6710 int *v15; // edx@29 |
0 | 6711 char *v16; // eax@90 |
6712 char *v17; // ecx@94 | |
501 | 6713 int v18; // esi@97 |
0 | 6714 signed int v19; // edx@97 |
6715 char *v20; // ecx@98 | |
6716 int v21; // eax@100 | |
6717 __int16 v22; // dx@112 | |
6718 int v23; // [sp-8h] [bp-14h]@45 | |
6719 signed int v24; // [sp-4h] [bp-10h]@4 | |
6720 int v25; // [sp-4h] [bp-10h]@45 | |
6721 | |
6722 v3 = 0; | |
605 | 6723 v4 = uActiveCharacter - 1; |
501 | 6724 result = false; |
6725 if ( (signed int)VarNum > 222 ) | |
6726 { | |
6727 if ( (signed int)VarNum <= 307 ) | |
6728 { | |
6729 if ( VarNum == 307 ) | |
6730 { | |
6731 pParty->uNumDeaths -= (unsigned int)pValue; | |
6732 return pValue; | |
6733 } | |
6734 if ( VarNum == 223 ) | |
0 | 6735 { |
6736 v11 = (char *)pParty->_autonote_bits; | |
501 | 6737 v22 = (short)pValue - 1; |
0 | 6738 } |
6739 else | |
6740 { | |
501 | 6741 if ( VarNum != 231 ) |
0 | 6742 { |
501 | 6743 switch ( VarNum ) |
0 | 6744 { |
6745 case 232: | |
501 | 6746 VarNum = (VariableType)0; |
1094 | 6747 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, (int*)&VarNum); |
501 | 6748 result = (bool) pValue; |
6749 dword_5B65CC = 0; | |
6750 if ( (int)VarNum == pValue ) | |
0 | 6751 { |
501 | 6752 dword_5B65CC = (int)pValue; |
0 | 6753 } |
6754 else | |
6755 { | |
6756 pParty->field_709 = 0; | |
501 | 6757 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
1035 | 6758 pParty->CountHirelings(); |
6759 viewparams->bRedrawGameUI = true; | |
0 | 6760 } |
6761 break; | |
6762 case 241: | |
6763 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
6764 { | |
6765 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; | |
605 | 6766 for ( v19 = 0; v19 < (signed int)pNPCStats->uNumNewNPCs; ++v19 ) |
0 | 6767 { |
605 | 6768 if ( *((void **)v20 + 4) == (void *)pValue ) |
0 | 6769 { |
6770 v21 = *(int *)v20; | |
6771 if ( (char)*(int *)v20 < 0 ) | |
6772 { | |
6773 LOBYTE(v21) = v21 & 0x7F; | |
6774 *(int *)v20 = v21; | |
6775 } | |
6776 } | |
6777 v20 += 76; | |
6778 } | |
6779 } | |
605 | 6780 if ( pParty->pHirelings[0].uProfession == pValue ) |
0 | 6781 memset(pParty->pHirelings, 0, 0x4Cu); |
605 | 6782 if ( pParty->pHirelings[1].uProfession == pValue ) |
0 | 6783 memset(&pParty->pHirelings[1], 0, 0x4Cu); |
6784 pParty->field_709 = 0; | |
1035 | 6785 pParty->CountHirelings(); |
0 | 6786 break; |
6787 case 243: | |
6788 v17 = (char *)&this->uSkillPoints; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
6789 result = *v17 != NULL; |
501 | 6790 if ( (unsigned int)pValue <= *(int *)v17 ) |
6791 { | |
6792 *(int *)v17 -= (int)pValue; | |
1113
39eaa6b00141
something to bool cast (performance warning) mostly fixed
Grumpy7
parents:
1097
diff
changeset
|
6793 result = (v17 != NULL); |
501 | 6794 } |
0 | 6795 else |
6796 *(int *)v17 = 0; | |
6797 break; | |
6798 case 275: | |
6799 v16 = (char *)&pOutdoor->ddm; | |
6800 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
6801 v16 = (char *)&pIndoor->dlv; | |
501 | 6802 *((int *)v16 + 2) -= (int)pValue; |
0 | 6803 if ( *((int *)v16 + 2) < -10000 ) |
6804 *((int *)v16 + 2) = -10000; | |
6805 break; | |
6806 case 306: | |
501 | 6807 result = VarNum - 306; |
6808 if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) | |
6809 { | |
6810 result = (bool)pValue; | |
6811 pParty->uNumGoldInBank -= (unsigned int)pValue; | |
605 | 6812 } |
0 | 6813 else |
6814 LABEL_88: | |
6815 dword_5B65C4 = 1; | |
6816 break; | |
6817 } | |
501 | 6818 return result; |
0 | 6819 } |
6820 v11 = this->field_1A50; | |
501 | 6821 v22 = (signed __int16)pValue; |
0 | 6822 } |
6823 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); | |
501 | 6824 return result; |
6825 } | |
6826 switch ( VarNum ) | |
0 | 6827 { |
6828 case 308: | |
501 | 6829 result = (bool)pValue; |
6830 pParty->uNumBountiesCollected -= (unsigned int)pValue; | |
0 | 6831 break; |
6832 case 309: | |
501 | 6833 result = (bool)pValue; |
6834 pParty->uNumPrisonTerms -= (int)pValue; | |
0 | 6835 break; |
6836 case 310: | |
501 | 6837 result = (bool)pValue; |
6838 pParty->uNumArenaPageWins -= (char)pValue; | |
0 | 6839 break; |
6840 case 311: | |
501 | 6841 result = (bool)pValue; |
6842 pParty->uNumArenaSquireWins -= (char)pValue; | |
0 | 6843 break; |
6844 case 312: | |
501 | 6845 result = (bool)pValue; |
6846 pParty->uNumArenaKnightWins -= (char)pValue; | |
0 | 6847 break; |
6848 case 313: | |
501 | 6849 result = (bool)pValue; |
6850 pParty->uNumArenaLordWins -= (char)pValue; | |
0 | 6851 break; |
6852 } | |
1545 | 6853 Error("Function not returning any value! (%u)", VarNum); |
0 | 6854 } |
6855 else | |
6856 { | |
501 | 6857 if ( (signed int)VarNum >= 123 ) |
6858 { | |
6859 byte_5E4C15[VarNum] -= (char)pValue; | |
0 | 6860 } |
6861 else | |
6862 { | |
501 | 6863 switch ( VarNum ) |
0 | 6864 { |
6865 case VAR_RandomGold: | |
501 | 6866 v6 = rand() % (signed int)pValue + 1; |
0 | 6867 if ( v6 > pParty->uNumGold ) |
6868 v6 = pParty->uNumGold; | |
6869 Party::TakeGold(v6); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6870 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6871 ShowStatusBarString(pTmpBuf.data(), 2); |
0 | 6872 GameUI_DrawFoodAndGold(); |
501 | 6873 return result; |
0 | 6874 case VAR_RandomFood: |
501 | 6875 v7 = rand() % (signed int)pValue + 1; |
0 | 6876 if ( v7 > pParty->uNumFoodRations ) |
6877 v7 = pParty->uNumFoodRations; | |
6878 Party::TakeFood(v7); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6879 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
6880 ShowStatusBarString(pTmpBuf.data(), 2u); |
0 | 6881 GameUI_DrawFoodAndGold(); |
605 | 6882 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6883 v8 = 8 * v4 + 400; | |
862 | 6884 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6885 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 6886 return result; |
0 | 6887 case VAR_CurrentHP: |
1036 | 6888 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL); |
605 | 6889 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6890 v8 = 8 * v4 + 400; | |
862 | 6891 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6892 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6893 return result; | |
0 | 6894 case VAR_CurrentSP: |
6895 v9 = (char *)&this->sMana; | |
501 | 6896 v10 = this->sMana - (signed int)pValue < 0; |
6897 *(int *)v9 -= (int)pValue; | |
0 | 6898 if ( v10 ) |
6899 *(int *)v9 = 0; | |
605 | 6900 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6901 v8 = 8 * v4 + 400; | |
862 | 6902 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6903 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6904 return result; | |
0 | 6905 case VAR_ACModifier: |
501 | 6906 this->sACModifier -= (unsigned __int8)pValue; |
605 | 6907 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6908 v8 = 8 * v4 + 400; | |
862 | 6909 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6910 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6911 return result; | |
0 | 6912 case VAR_BaseLevel: |
501 | 6913 this->uLevel -= (unsigned __int8)pValue; |
605 | 6914 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6915 v8 = 8 * v4 + 400; | |
862 | 6916 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6917 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6918 return result; | |
0 | 6919 case VAR_LevelModifier: |
501 | 6920 this->sLevelModifier -= (unsigned __int8)pValue; |
605 | 6921 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6922 v8 = 8 * v4 + 400; | |
862 | 6923 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6924 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6925 return result; | |
0 | 6926 case VAR_Age: |
501 | 6927 this->sAgeModifier -= (signed __int16)pValue; |
6928 return result; | |
0 | 6929 case VAR_Award: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
6930 _449B7E_toggle_bit((unsigned char *)this->_achieved_awards_bits, (signed __int16)pValue, 0); |
605 | 6931 return result; |
0 | 6932 case VAR_Experience: |
6933 v12 = (char *)&this->uExperience; | |
501 | 6934 v13 = (signed int)pValue; |
6935 v14 = *(int *)v12 < (unsigned int)pValue; | |
6936 *(int *)v12 -= (int)pValue; | |
0 | 6937 *((int *)v12 + 1) -= v14 + HIDWORD(v13); |
605 | 6938 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
6939 v8 = 8 * v4 + 400; | |
862 | 6940 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6941 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6942 return result; | |
0 | 6943 case VAR_QBits_QuestsDone: |
501 | 6944 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); |
187 | 6945 pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); |
501 | 6946 return true; |
0 | 6947 case VAR_PlayerItemInHands: |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
6948 v15 = this->pInventoryMatrix; |
0 | 6949 break; |
6950 case VAR_FixedGold: | |
501 | 6951 if ( (unsigned int)pValue > pParty->uNumGold ) |
0 | 6952 goto LABEL_88; |
501 | 6953 Party::TakeGold((unsigned int)pValue); |
6954 return result; | |
0 | 6955 case VAR_MightBonus: |
6956 case VAR_ActualMight: | |
501 | 6957 this->uMightBonus -= (unsigned __int16)pValue; |
605 | 6958 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
6959 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
6960 v8 = 8 * v4 + 400; | |
862 | 6961 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6962 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6963 return result; | |
0 | 6964 case VAR_IntellectBonus: |
6965 case VAR_ActualIntellect: | |
501 | 6966 this->uIntelligenceBonus -= (unsigned __int16)pValue; |
605 | 6967 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
6968 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
6969 v8 = 8 * v4 + 400; | |
862 | 6970 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6971 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6972 return result; | |
0 | 6973 case VAR_PersonalityBonus: |
6974 case VAR_ActualPersonality: | |
501 | 6975 this->uWillpowerBonus -= (unsigned __int16)pValue; |
605 | 6976 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
6977 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
6978 v8 = 8 * v4 + 400; | |
862 | 6979 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6980 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6981 return result; | |
0 | 6982 case VAR_EnduranceBonus: |
6983 case VAR_ActualEndurance: | |
501 | 6984 this->uEnduranceBonus -= (unsigned __int16)pValue; |
605 | 6985 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
6986 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
6987 v8 = 8 * v4 + 400; | |
862 | 6988 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6989 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6990 return result; | |
0 | 6991 case VAR_SpeedBonus: |
6992 case VAR_ActualSpeed: | |
501 | 6993 this->uSpeedBonus -= (unsigned __int16)pValue; |
605 | 6994 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
6995 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
6996 v8 = 8 * v4 + 400; | |
862 | 6997 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 6998 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
6999 return result; | |
0 | 7000 case VAR_AccuracyBonus: |
7001 case VAR_ActualAccuracy: | |
501 | 7002 this->uAccuracyBonus -= (unsigned __int16)pValue; |
605 | 7003 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7004 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7005 v8 = 8 * v4 + 400; | |
862 | 7006 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7007 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7008 return result; | |
0 | 7009 case VAR_LuckBonus: |
7010 case VAR_ActualLuck: | |
501 | 7011 this->uLuckBonus -= (unsigned __int16)pValue; |
605 | 7012 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7013 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7014 v8 = 8 * v4 + 400; | |
862 | 7015 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7016 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7017 return result; | |
0 | 7018 case VAR_BaseMight: |
501 | 7019 this->uMight -= (unsigned __int16)pValue; |
605 | 7020 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7021 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7022 v8 = 8 * v4 + 400; | |
862 | 7023 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7024 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7025 return result; | |
0 | 7026 case VAR_BaseIntellect: |
501 | 7027 this->uIntelligence -= (unsigned __int16)pValue; |
605 | 7028 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7029 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7030 v8 = 8 * v4 + 400; | |
862 | 7031 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7032 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7033 return result; | |
0 | 7034 case VAR_BasePersonality: |
501 | 7035 this->uWillpower -= (unsigned __int16)pValue; |
605 | 7036 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7037 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7038 v8 = 8 * v4 + 400; | |
862 | 7039 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7040 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7041 return result; | |
0 | 7042 case VAR_BaseEndurance: |
501 | 7043 this->uEndurance -= (unsigned __int16)pValue; |
605 | 7044 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7045 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7046 v8 = 8 * v4 + 400; | |
862 | 7047 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7048 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7049 return result; | |
0 | 7050 case VAR_BaseSpeed: |
501 | 7051 this->uSpeed -= (unsigned __int16)pValue; |
605 | 7052 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7053 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7054 v8 = 8 * v4 + 400; | |
862 | 7055 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7056 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7057 return result; | |
0 | 7058 case VAR_BaseAccuracy: |
501 | 7059 this->uAccuracy -= (unsigned __int16)pValue; |
605 | 7060 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7061 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7062 v8 = 8 * v4 + 400; | |
862 | 7063 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7064 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7065 return result; | |
0 | 7066 case VAR_BaseLuck: |
501 | 7067 this->uLuck -= (unsigned __int16)pValue; |
605 | 7068 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7069 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7070 v8 = 8 * v4 + 400; | |
862 | 7071 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7072 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7073 return result; | |
0 | 7074 case VAR_FireResistance: |
501 | 7075 this->sResFireBase -= (signed __int16)pValue; |
605 | 7076 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7077 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7078 v8 = 8 * v4 + 400; | |
862 | 7079 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7080 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7081 return result; | |
0 | 7082 case VAR_AirResistance: |
501 | 7083 this->sResAirBase -= (signed __int16)pValue; |
605 | 7084 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7085 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7086 v8 = 8 * v4 + 400; | |
862 | 7087 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7088 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7089 return result; | |
0 | 7090 case VAR_WaterResistance: |
501 | 7091 this->sResWaterBase -= (signed __int16)pValue; |
605 | 7092 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7093 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7094 v8 = 8 * v4 + 400; | |
862 | 7095 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7096 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7097 return result; | |
0 | 7098 case VAR_EarthResistance: |
501 | 7099 this->sResEarthBase -= (signed __int16)pValue; |
605 | 7100 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7101 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7102 v8 = 8 * v4 + 400; | |
862 | 7103 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7104 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7105 return result; | |
0 | 7106 case VAR_SpiritResistance: |
501 | 7107 this->sResSpiritBase -= (signed __int16)pValue; |
605 | 7108 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7109 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7110 v8 = 8 * v4 + 400; | |
862 | 7111 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7112 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7113 return result; | |
0 | 7114 case VAR_MindResistance: |
501 | 7115 this->sResMindBase -= (signed __int16)pValue; |
605 | 7116 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7117 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7118 v8 = 8 * v4 + 400; | |
862 | 7119 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7120 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7121 return result; | |
0 | 7122 case VAR_BodyResistance: |
501 | 7123 this->sResBodyBase -= (signed __int16)pValue; |
605 | 7124 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7125 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7126 v8 = 8 * v4 + 400; | |
862 | 7127 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7128 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7129 return result; | |
0 | 7130 case VAR_LightResistance: |
501 | 7131 this->sResLightBase -= (signed __int16)pValue; |
605 | 7132 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7133 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7134 v8 = 8 * v4 + 400; | |
862 | 7135 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7136 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7137 return result; | |
0 | 7138 case VAR_DarkResistance: |
501 | 7139 this->sResDarkBase -= (signed __int16)pValue; |
605 | 7140 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7141 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7142 v8 = 8 * v4 + 400; | |
862 | 7143 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7144 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7145 return result; | |
0 | 7146 case VAR_MagicResistance: |
501 | 7147 this->sResMagicBase -= (signed __int16)pValue; |
605 | 7148 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7149 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7150 v8 = 8 * v4 + 400; | |
862 | 7151 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7152 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7153 return result; | |
0 | 7154 case VAR_FireResistanceBonus: |
501 | 7155 this->sResFireBonus -= (signed __int16)pValue; |
605 | 7156 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7157 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7158 v8 = 8 * v4 + 400; | |
862 | 7159 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7160 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7161 return result; | |
0 | 7162 case VAR_AirResistanceBonus: |
501 | 7163 this->sResAirBonus -= (signed __int16)pValue; |
605 | 7164 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)92, 0); |
7165 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7166 v8 = 8 * v4 + 400; | |
862 | 7167 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7168 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7169 return result; | |
0 | 7170 case VAR_WaterResistanceBonus: |
501 | 7171 this->sResWaterBonus -= (signed __int16)pValue; |
605 | 7172 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7173 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7174 v8 = 8 * v4 + 400; | |
862 | 7175 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7176 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7177 return result; | |
0 | 7178 case VAR_EarthResistanceBonus: |
501 | 7179 this->sResEarthBonus -= (signed __int16)pValue; |
605 | 7180 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7181 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7182 v8 = 8 * v4 + 400; | |
862 | 7183 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7184 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7185 return result; | |
0 | 7186 case VAR_SpiritResistanceBonus: |
501 | 7187 this->sResSpiritBonus -= (signed __int16)pValue; |
605 | 7188 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7189 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7190 v8 = 8 * v4 + 400; | |
862 | 7191 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7192 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7193 return result; | |
0 | 7194 case VAR_MindResistanceBonus: |
501 | 7195 this->sResMindBonus -= (signed __int16)pValue; |
605 | 7196 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7197 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7198 v8 = 8 * v4 + 400; | |
862 | 7199 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7200 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7201 return result; | |
0 | 7202 case VAR_BodyResistanceBonus: |
501 | 7203 this->sResBodyBonus -= (signed __int16)pValue; |
605 | 7204 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7205 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7206 v8 = 8 * v4 + 400; | |
862 | 7207 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7208 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7209 return result; | |
0 | 7210 case VAR_LightResistanceBonus: |
501 | 7211 this->sResLightBonus -= (signed __int16)pValue; |
605 | 7212 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7213 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7214 v8 = 8 * v4 + 400; | |
862 | 7215 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7216 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7217 return result; | |
0 | 7218 case VAR_DarkResistanceBonus: |
501 | 7219 this->sResDarkBonus -= (signed __int16)pValue; |
605 | 7220 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)SPEECH_91, 0); |
7221 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | |
7222 v8 = 8 * v4 + 400; | |
862 | 7223 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7224 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7225 return result; | |
0 | 7226 case VAR_MagicResistanceBonus: |
501 | 7227 this->sResMagicBonus -= (signed __int16)pValue; |
0 | 7228 v25 = 0; |
187 | 7229 v23 = SPEECH_91; |
7230 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); | |
605 | 7231 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7232 v8 = 8 * v4 + 400; | |
862 | 7233 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7234 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7235 return result; | |
0 | 7236 case VAR_FixedFood: |
501 | 7237 Party::TakeFood((unsigned int)pValue); |
605 | 7238 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7239 v8 = 8 * v4 + 400; | |
862 | 7240 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7241 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7242 return result; | |
0 | 7243 case VAR_StaffSkill: |
7244 case VAR_SwordSkill: | |
7245 case VAR_DaggerSkill: | |
7246 case VAR_AxeSkill: | |
7247 case VAR_SpearSkill: | |
7248 case VAR_BowSkill: | |
7249 case VAR_MaceSkill: | |
7250 case VAR_BlasterSkill: | |
7251 case VAR_ShieldSkill: | |
7252 case VAR_LeatherSkill: | |
7253 case VAR_SkillChain: | |
7254 case VAR_PlateSkill: | |
7255 case VAR_FireSkill: | |
7256 case VAR_AirSkill: | |
7257 case VAR_WaterSkill: | |
7258 case VAR_EarthSkill: | |
7259 case VAR_SpiritSkill: | |
7260 case VAR_MindSkill: | |
7261 case VAR_BodySkill: | |
7262 case VAR_LightSkill: | |
7263 case VAR_DarkSkill: | |
7264 case VAR_IdentifyItemSkill: | |
7265 case VAR_MerchantSkill: | |
7266 case VAR_RepairSkill: | |
7267 case VAR_BodybuildingSkill: | |
7268 case VAR_MeditationSkill: | |
7269 case VAR_PerceptionSkill: | |
7270 case VAR_DiplomacySkill: | |
7271 case VAR_DisarmTrapSkill: | |
7272 case VAR_LearningSkill: | |
501 | 7273 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue; |
605 | 7274 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7275 v8 = 8 * v4 + 400; | |
862 | 7276 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
605 | 7277 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
7278 return result; | |
0 | 7279 case VAR_Cursed: |
7280 case VAR_Weak: | |
7281 case VAR_Asleep: | |
7282 case VAR_Afraid: | |
7283 case VAR_Drunk: | |
7284 case VAR_Insane: | |
7285 case VAR_PoisonedGreen: | |
7286 case VAR_DiseasedGreen: | |
7287 case VAR_PoisonedYellow: | |
7288 case VAR_DiseasedYellow: | |
7289 case VAR_PoisonedRed: | |
7290 case VAR_DiseasedRed: | |
7291 case VAR_Paralyzed: | |
7292 case VAR_Unconsious: | |
7293 case VAR_Dead: | |
7294 case VAR_Stoned: | |
7295 case VAR_Eradicated: | |
1071 | 7296 //*((int *)this + 2 * VarNum - 210) = 0; |
7297 //*((int *)this + 2 * result - 209) = 0; | |
7298 this->pConditions[VarNum] = 0; | |
0 | 7299 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
7300 v8 = 8 * v4 + 400; | |
862 | 7301 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); |
0 | 7302 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
501 | 7303 return result; |
605 | 7304 default: |
7305 return result; | |
7306 } | |
7307 for (v3 = 1; v3 < 126; v3++) | |
7308 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
7309 if ( *(&this->pInventoryItemList[pInventoryMatrix[v3] - 1].uItemID) == pValue ) |
0 | 7310 { |
605 | 7311 RemoveItemAtInventoryIndex(v3); |
501 | 7312 return true; |
0 | 7313 } |
605 | 7314 } |
501 | 7315 if ( pParty->pPickedItem.uItemID == pValue ) |
7316 { | |
605 | 7317 pMouse->RemoveHoldingItem(); |
7318 return true; | |
7319 } | |
7320 return false; | |
0 | 7321 } |
7322 } | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
7323 |
1430 | 7324 //assert(false); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
7325 return false; |
0 | 7326 } |
7327 // 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
|
7328 // 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
|
7329 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7330 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7331 //----- (00467E7F) -------------------------------------------------------- |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7332 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
|
7333 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7334 int v2; // ebx@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7335 Player *v3; // eax@1 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7336 int v4; // edx@1 |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
7337 int v7; // eax@3 |
1619 | 7338 ItemGen tempPickedItem; // [sp+Ch] [bp-30h]@1 |
7339 unsigned int *v11; // [sp+38h] [bp-4h]@1 | |
7340 | |
7341 tempPickedItem.Reset(); | |
1374 | 7342 v2 = pEquipTypeToBodyAnchor[uEquipType]; |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7343 v3 = pPlayers[uActiveCharacter]; |
1619 | 7344 v11 = &v3->pEquipment.pIndices[v2]; |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7345 v4 = *v11; |
1619 | 7346 if ( v4 ) |
7347 { | |
7348 memcpy(&tempPickedItem, &pParty->pPickedItem, sizeof(tempPickedItem)); | |
7349 v3->pInventoryItemList[v4 - 1].uBodyAnchor = 0; | |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7350 pParty->pPickedItem.Reset(); |
1619 | 7351 pParty->SetHoldingItem(&v3->pInventoryItemList[v4 - 1]); |
7352 tempPickedItem.uBodyAnchor = v2 + 1; | |
7353 memcpy(&v3->pInventoryItemList[v4 - 1], &tempPickedItem, sizeof(ItemGen)); | |
7354 *v11 = v4; | |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7355 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7356 else |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7357 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
7358 v7 = v3->FindFreeInventoryListSlot(); |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7359 if (v7 >= 0) |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7360 { |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7361 pParty->pPickedItem.uBodyAnchor = v2 + 1; |
1619 | 7362 memcpy(&v3->pInventoryItemList[v7], &pParty->pPickedItem, sizeof(ItemGen)); |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7363 *v11 = v7 + 1; |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7364 pMouse->RemoveHoldingItem(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7365 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7366 } |
1295 | 7367 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7368 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7369 |
1295 | 7370 //----- (0049387A) -------------------------------------------------------- |
1459 | 7371 int CycleCharacter(bool backwards) |
1295 | 7372 { |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7373 const int PARTYSIZE = 4; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7374 int valToAdd = backwards ? (PARTYSIZE - 2) : 0; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7375 int mult = backwards ? -1 : 1; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7376 |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7377 for (int i = 0; i < (PARTYSIZE - 1); i++) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7378 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7379 int currCharId = ((uActiveCharacter + mult * i + valToAdd) % PARTYSIZE) + 1; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7380 if ( pPlayers[currCharId]->uTimeToRecovery == 0 ) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7381 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7382 return currCharId; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7383 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7384 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7385 return uActiveCharacter; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7386 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7387 |
1297 | 7388 //----- (0043EE77) -------------------------------------------------------- |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7389 bool Player::HasUnderwaterSuitEquipped() //the original function took the player number as a parameter. if it was 0, the whole party was checked. calls with the parameter 0 have been changed to calls to this for every player |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7390 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7391 if (this->pEquipment.uArmor == 0 || this->pInventoryItemList[this->pEquipment.uArmor].uItemID != 604) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7392 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7393 return false; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7394 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7395 return true; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7396 } |
1432 | 7397 |
1297 | 7398 //----- (0043EE15) -------------------------------------------------------- |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7399 bool Player::HasItem( unsigned int uItemID, char a3 ) |
1297 | 7400 { |
7401 if ( !a3 || pParty->pPickedItem.uItemID != uItemID ) | |
7402 { | |
7403 for ( uint i = 0; i < 126; ++i ) | |
7404 { | |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7405 if ( this->pInventoryMatrix[i] > 0 ) |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
7406 { |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7407 if ( (unsigned int)this->pInventoryItemList[this->pInventoryMatrix[i] - 1].uItemID == uItemID ) |
1297 | 7408 return true; |
7409 } | |
7410 } | |
7411 for ( uint i = 0; i < 16; ++i ) | |
7412 { | |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7413 if ( this->pEquipment.pIndices[i] ) |
1297 | 7414 { |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7415 if ( (unsigned int)this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID == uItemID ) |
1297 | 7416 return true; |
7417 } | |
7418 } | |
7419 } | |
7420 return false; | |
7421 } | |
7422 //----- (0043EDB9) -------------------------------------------------------- | |
1620
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7423 bool ShouldLoadTexturesForRaceAndGender(unsigned int _this) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7424 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7425 CHARACTER_RACE race; // edi@2 |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7426 PLAYER_SEX sex; // eax@2 |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7427 |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7428 for (int i = 1; i <= 4; i++) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7429 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7430 race = pPlayers[i]->GetRace(); |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7431 sex = pPlayers[i]->GetSexByVoice(); |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7432 switch(_this) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7433 { |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7434 case 0: |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7435 if (( race == CHARACTER_RACE_HUMAN || race == CHARACTER_RACE_ELF || race == CHARACTER_RACE_GOBLIN ) && sex == SEX_MALE ) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7436 return true; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7437 break; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7438 case 1: |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7439 if (( race == CHARACTER_RACE_HUMAN || race == CHARACTER_RACE_ELF || race == CHARACTER_RACE_GOBLIN ) && sex == SEX_FEMALE ) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7440 return true; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7441 break; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7442 case 2: |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7443 if ( race == CHARACTER_RACE_DWARF && sex == SEX_MALE ) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7444 return true; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7445 break; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7446 case 3: |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7447 if ( race == CHARACTER_RACE_DWARF && sex == SEX_FEMALE ) |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7448 return true; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7449 break; |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7450 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7451 } |
61ea994a1812
sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped to Player::HasUnderwaterSuitEquipped, sub_43EDB9_get_some_race_sex_relation_2 to ShouldLoadTexturesForRaceAndGender, Player_has_item to Player::HasItem
Grumpy7
parents:
1619
diff
changeset
|
7452 return false; |
1297 | 7453 } |
7454 //----- (0043ED6F) -------------------------------------------------------- | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7455 bool IsDwarfPresentInParty(bool a1) |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7456 { |
1297 | 7457 for (uint i = 0; i < 4; ++i) |
7458 { | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7459 CHARACTER_RACE race = pParty->pPlayers[i].GetRace(); |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7460 |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7461 if (race == CHARACTER_RACE_DWARF && a1) |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7462 return true; |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7463 else if (race != CHARACTER_RACE_DWARF && !a1) |
1297 | 7464 return true; |
7465 } | |
7466 return false; | |
7467 } | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7468 |
1649 | 7469 |
7470 | |
1297 | 7471 //----- (00439FCB) -------------------------------------------------------- |
1681 | 7472 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int element, Vec3_int_ *pPos, unsigned int a4) |
7473 { | |
1649 | 7474 Player *playerPtr; // ebx@3 |
7475 Actor *actorPtr; // esi@3 | |
1297 | 7476 unsigned int v8; // eax@4 |
1681 | 7477 int spellId; // eax@38 |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7478 signed int recvdMagicDmg; // eax@139 |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7479 int v72[4]; // [sp+30h] [bp-24h]@164 |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7480 int healthBeforeRecvdDamage; // [sp+48h] [bp-Ch]@3 |
1297 | 7481 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 |
1681 | 7482 |
7483 uActorID = PID_ID(uObjID); | |
7484 if ( PID_TYPE(uObjID) != 2) | |
1297 | 7485 { |
1649 | 7486 playerPtr = &pParty->pPlayers[a4]; |
1681 | 7487 actorPtr = &pActors[uActorID]; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7488 healthBeforeRecvdDamage = playerPtr->sHealth; |
1681 | 7489 if ( PID_TYPE(uObjID) != 3 || !stru_50C198.ActorHitOrMiss(actorPtr, playerPtr) ) |
1297 | 7490 return; |
1649 | 7491 v8 = playerPtr->pEquipment.uArmor; |
1681 | 7492 SoundID soundToPlay; |
1297 | 7493 if ( !v8 |
1649 | 7494 || playerPtr->pInventoryItemList[v8 - 1].IsBroken() |
7495 || | |
7496 (pItemsTable->pItems[playerPtr->pInventoryItemList[v8 - 1].uItemID].uSkillType != PLAYER_SKILL_CHAIN | |
7497 && pItemsTable->pItems[playerPtr->pInventoryItemList[v8 - 1].uItemID].uSkillType != PLAYER_SKILL_PLATE | |
7498 ) | |
7499 ) | |
1297 | 7500 { |
1681 | 7501 int randVal = rand() % 4; |
7502 switch (randVal) | |
1297 | 7503 { |
1681 | 7504 case 0 : soundToPlay = (SoundID)108; break; |
7505 case 1 : soundToPlay = (SoundID)109; break; | |
7506 case 2 : soundToPlay = (SoundID)110; break; | |
7507 case 3 : soundToPlay = (SoundID)44; break; | |
1297 | 7508 } |
7509 } | |
7510 else | |
7511 { | |
1681 | 7512 int randVal = rand() % 4; |
7513 switch (randVal) | |
1297 | 7514 { |
1681 | 7515 case 0 : soundToPlay = (SoundID)105; break; |
7516 case 1 : soundToPlay = (SoundID)106; break; | |
7517 case 2 : soundToPlay = (SoundID)107; break; | |
7518 case 3 : soundToPlay = (SoundID)45; break; | |
1297 | 7519 } |
1648 | 7520 } |
1681 | 7521 pAudioPlayer->PlaySound(soundToPlay, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); |
7522 int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, element); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7523 if ( actorPtr->pActorBuffs[3].uExpireTime > 0 ) |
1649 | 7524 { |
1681 | 7525 __int16 spellPower = actorPtr->pActorBuffs[3].uPower; |
7526 if ( spellPower ) | |
7527 dmgToReceive /= (signed int)spellPower; | |
7528 } | |
1682 | 7529 int damageType; |
1681 | 7530 switch (element) |
1648 | 7531 { |
1682 | 7532 case 0: damageType = actorPtr->pMonsterInfo.uAttack1Type; |
1648 | 7533 break; |
1682 | 7534 case 1: damageType = actorPtr->pMonsterInfo.uAttack2Type; |
1648 | 7535 break; |
1681 | 7536 case 2: spellId = actorPtr->pMonsterInfo.uSpell1ID; |
1682 | 7537 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); |
1648 | 7538 break; |
1681 | 7539 case 3: spellId = actorPtr->pMonsterInfo.uSpell2ID; |
1682 | 7540 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); |
1648 | 7541 break; |
1682 | 7542 case 4: damageType = actorPtr->pMonsterInfo.field_3C_some_special_attack; |
1648 | 7543 break; |
7544 default: | |
1682 | 7545 case 5: damageType = 4; //yes, the original just assigned the value 4 |
1648 | 7546 break; |
7547 } | |
1297 | 7548 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) |
7549 { | |
1682 | 7550 dmgToReceive = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7551 if ( playerPtr->pPlayerBuffs[10].uExpireTime > 0 ) |
1297 | 7552 { |
1681 | 7553 int actorState = actorPtr->uAIState; |
7554 if ( actorState != Dying && actorState != Dead) | |
1297 | 7555 { |
1682 | 7556 int reflectedDamage = stru_50C198.CalcMagicalDamageToActor(actorPtr, damageType, dmgToReceive); |
1681 | 7557 actorPtr->sCurrentHP -= reflectedDamage; |
7558 if ( reflectedDamage >= 0 ) | |
1297 | 7559 { |
1649 | 7560 if ( actorPtr->sCurrentHP >= 1 ) |
1297 | 7561 { |
1682 | 7562 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); //todo extract this branch to a function once Actor::functions are changed to nonstatic actor functions |
1648 | 7563 Actor::AggroSurroundingPeasants(uActorID, 1); |
7564 } | |
7565 else | |
7566 { | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7567 if ( pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].bQuestMonster & 1 && pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS) |
1297 | 7568 { |
1681 | 7569 int splatRadius = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * actorPtr->uActorRadius : actorPtr->uActorRadius; |
7570 pDecalBuilder->AddBloodsplat(actorPtr->vPosition.x, actorPtr->vPosition.y, actorPtr->vPosition.z, 1.0, 0.0, 0.0, (float)splatRadius, 0, 0); | |
1297 | 7571 } |
1648 | 7572 Actor::Die(uActorID); |
7573 Actor::ApplyFineForKillingPeasant(uActorID); | |
7574 Actor::AggroSurroundingPeasants(uActorID, 1); | |
1649 | 7575 if ( actorPtr->pMonsterInfo.uExp ) |
7576 GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); | |
1681 | 7577 int speechToPlay = SPEECH_51; |
1648 | 7578 if ( rand() % 100 < 20 ) |
1681 | 7579 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; |
7580 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); | |
1297 | 7581 } |
7582 } | |
7583 } | |
7584 } | |
7585 if ( !(dword_6BE368_debug_settings_2 & 0x10) | |
1649 | 7586 && actorPtr->pMonsterInfo.uSpecialAttack |
7587 && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackType ) | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7588 { |
1649 | 7589 playerPtr->_48DCF6(actorPtr->pMonsterInfo.uSpecialAttack, actorPtr); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7590 } |
1297 | 7591 } |
7592 if ( !pParty->bTurnBasedModeOn ) | |
7593 { | |
1681 | 7594 int actEndurance = playerPtr->GetActualEndurance(); |
7595 int recoveryTime = (int)((20 - playerPtr->GetParameterBonus(actEndurance)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333); | |
7596 playerPtr->SetRecoveryTime(recoveryTime); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7597 } |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7598 int yellThreshold = playerPtr->GetMaxHealth() / 4; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7599 if ( yellThreshold < playerPtr->sHealth && yellThreshold >= healthBeforeRecvdDamage && playerPtr->sHealth > 0 ) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7600 { |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7601 playerPtr->PlaySound(SPEECH_48, 0); |
1297 | 7602 } |
7603 viewparams->bRedrawGameUI = 1; | |
7604 return; | |
7605 } | |
1648 | 7606 else |
7607 { | |
1681 | 7608 SpriteObject* v37 = &pSpriteObjects[uActorID]; |
7609 int uActorType = PID_TYPE(v37->spell_caster_pid); | |
7610 int uActorID = PID_ID(v37->spell_caster_pid); | |
7611 if ( uActorType == 2 ) | |
7612 { | |
7613 Player *playerPtr; // eax@81 | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7614 if ( a4 != -1 ) |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7615 { |
1681 | 7616 playerPtr = &pParty->pPlayers[a4]; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7617 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7618 else |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7619 { |
1681 | 7620 element = 0; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7621 for (int i = 1; i <= 4; i++) |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7622 { |
1681 | 7623 v72[element] = i; |
7624 element++; | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7625 } |
1681 | 7626 if ( element ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7627 { |
1681 | 7628 playerPtr = &pParty->pPlayers[v72[rand() % element]];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7629 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7630 } |
1681 | 7631 int v68; |
7632 int v69; | |
7633 if ( uActorType != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7634 { |
1681 | 7635 int playerMaxHp = playerPtr->GetMaxHealth(); |
7636 v68 = _43AFE3_calc_spell_damage(v37->spell_id, v37->spell_level, v37->spell_skill, playerMaxHp); | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7637 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7638 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7639 else |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7640 { |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7641 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7642 v69 = 0; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7643 } |
1681 | 7644 playerPtr->ReceiveDamage(v68, (DAMAGE_TYPE)v69); |
7645 if ( uActorType == OBJECT_Player && !qword_A750D8 ) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7646 { |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7647 qword_A750D8 = 256i64; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7648 PlayerSpeechID = SPEECH_44; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7649 uSpeakingCharacter = uActorID + 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7650 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7651 return; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7652 } |
1681 | 7653 else if ( uActorType == 3 ) |
7654 { | |
7655 Actor *actorPtr = &pActors[uActorID]; | |
1648 | 7656 if ( a4 == -1 ) |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7657 a4 = stru_50C198.which_player_would_attack(actorPtr); |
1681 | 7658 Player *playerPtr = &pParty->pPlayers[a4]; |
7659 int dmgToReceive = Actor::_43B3E0_CalcDamage(actorPtr, element); | |
7660 unsigned __int16 spriteType = v37->uType; | |
1648 | 7661 if ( v37->uType == 545 ) |
1297 | 7662 { |
1681 | 7663 __int16 skillLevel = playerPtr->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
7664 if ( SkillToMastery(skillLevel) >= 4 && rand() % 100 < (skillLevel & 0x3F) ) | |
1648 | 7665 { |
1681 | 7666 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], playerPtr->pName); |
1648 | 7667 ShowStatusBarString(pTmpBuf.data(), 2u); |
1681 | 7668 playerPtr->PlaySound(SPEECH_6, 0); |
1648 | 7669 return; |
7670 } | |
1297 | 7671 } |
1681 | 7672 else if ( spriteType == 555 |
7673 || spriteType == 510 | |
7674 || spriteType == 500 | |
7675 || spriteType == 515 | |
7676 || spriteType == 505 | |
7677 || spriteType == 530 | |
7678 || spriteType == 525 | |
7679 || spriteType == 520 | |
7680 || spriteType == 535 | |
7681 || spriteType == 540 ) | |
1297 | 7682 { |
1681 | 7683 if ( !stru_50C198.ActorHitOrMiss(actorPtr, playerPtr) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7684 return; |
1681 | 7685 if ( playerPtr->pPlayerBuffs[13].uExpireTime > 0 ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7686 dmgToReceive >>= 1; |
1681 | 7687 if ( playerPtr->HasEnchantedItemEquipped(36) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7688 dmgToReceive >>= 1; |
1681 | 7689 if ( playerPtr->HasEnchantedItemEquipped(69) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7690 dmgToReceive >>= 1; |
1681 | 7691 if ( playerPtr->HasItemEquipped(EQUIP_ARMOUR) |
7692 && playerPtr->pInventoryItemList[playerPtr->pEquipment.uArmor-1].uItemID == ITEM_ARTIFACT_GOVERNORS_ARMOR ) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7693 dmgToReceive >>= 1; |
1681 | 7694 if ( playerPtr->HasItemEquipped(EQUIP_MAIN_HAND)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7695 { |
1681 | 7696 int itemId = playerPtr->pInventoryItemList[playerPtr->pEquipment.uMainHand - 1].uItemID; |
7697 if ( itemId == ITEM_RELIC_KELEBRIM || itemId == ITEM_ARTIFACT_ELFBANE || (playerPtr->GetEquippedItemEquipType(EQUIP_MAIN_HAND) == EQUIP_SHIELD && SkillToMastery(playerPtr->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7698 dmgToReceive >>= 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7699 } |
1681 | 7700 if ( playerPtr->HasItemEquipped(EQUIP_OFF_HAND)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7701 { |
1681 | 7702 int itemId = playerPtr->pInventoryItemList[playerPtr->pEquipment.uShield - 1].uItemID; |
7703 if ( itemId == ITEM_RELIC_KELEBRIM || itemId == ITEM_ARTIFACT_ELFBANE || (playerPtr->GetEquippedItemEquipType(EQUIP_OFF_HAND) == EQUIP_SHIELD && SkillToMastery(playerPtr->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7704 dmgToReceive >>= 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7705 } |
1648 | 7706 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7707 if ( actorPtr->pActorBuffs[3].uExpireTime > 0 ) |
1648 | 7708 { |
1681 | 7709 int spellPower = actorPtr->pActorBuffs[3].uPower; |
7710 if ( spellPower ) | |
7711 dmgToReceive /= (signed int)spellPower; | |
1648 | 7712 } |
1681 | 7713 int damageType; |
7714 switch(element) | |
1648 | 7715 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7716 case 0: |
1681 | 7717 damageType = actorPtr->pMonsterInfo.uAttack1Type; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7718 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7719 case 1: |
1681 | 7720 damageType = actorPtr->pMonsterInfo.uAttack2Type; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7721 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7722 case 2: |
1681 | 7723 spellId = actorPtr->pMonsterInfo.uSpell1ID; |
7724 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7725 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7726 case 3: |
1681 | 7727 spellId = actorPtr->pMonsterInfo.uSpell2ID; |
7728 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7729 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7730 case 4: |
1681 | 7731 damageType = actorPtr->pMonsterInfo.field_3C_some_special_attack; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7732 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7733 case 5: |
1681 | 7734 damageType = 4; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7735 break; |
1648 | 7736 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7737 if ( !(dword_6BE368_debug_settings_2 & 0x10) ) |
1648 | 7738 { |
1681 | 7739 int reflectedDmg = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType); |
7740 if ( playerPtr->pPlayerBuffs[10].uExpireTime > 0 ) | |
1297 | 7741 { |
1681 | 7742 unsigned __int16 actorState = actorPtr->uAIState; |
7743 if ( actorState != Dying && actorState != Dead) | |
1297 | 7744 { |
1681 | 7745 recvdMagicDmg = stru_50C198.CalcMagicalDamageToActor(actorPtr, damageType, reflectedDmg); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7746 actorPtr->sCurrentHP -= recvdMagicDmg; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7747 if ( recvdMagicDmg >= 0 ) |
1297 | 7748 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7749 if ( actorPtr->sCurrentHP >= 1 ) |
1297 | 7750 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7751 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7752 Actor::AggroSurroundingPeasants(uActorID, 1); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7753 } |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7754 else |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7755 { |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7756 if ( pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].bQuestMonster & 1 && pRenderer->pRenderD3D && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) |
1297 | 7757 { |
1681 | 7758 int splatRadius = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * actorPtr->uActorRadius : actorPtr->uActorRadius; |
7759 pDecalBuilder->AddBloodsplat(actorPtr->vPosition.x, actorPtr->vPosition.y, actorPtr->vPosition.z, 1.0, 0.0, 0.0, (float)splatRadius, 0, 0); | |
1297 | 7760 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7761 Actor::Die(uActorID); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7762 Actor::ApplyFineForKillingPeasant(uActorID); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7763 Actor::AggroSurroundingPeasants(uActorID, 1); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7764 if ( actorPtr->pMonsterInfo.uExp ) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7765 GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); |
1681 | 7766 int speechToPlay = SPEECH_51; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7767 if ( rand() % 100 < 20 ) |
1681 | 7768 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; |
7769 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); | |
1297 | 7770 } |
7771 } | |
7772 } | |
7773 } | |
7774 } | |
1681 | 7775 if ( !element |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7776 && !(dword_6BE368_debug_settings_2 & 0x10) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7777 && actorPtr->pMonsterInfo.uSpecialAttack |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7778 && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackType ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7779 { |
1681 | 7780 playerPtr->_48DCF6(actorPtr->pMonsterInfo.uSpecialAttack, actorPtr); |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7781 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7782 if ( !pParty->bTurnBasedModeOn ) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7783 { |
1681 | 7784 int actEnd = playerPtr->GetActualEndurance(); |
7785 int recTime = (int)((20 - playerPtr->GetParameterBonus(actEnd)) | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7786 * flt_6BE3A4_debug_recmod1 |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7787 * 2.133333333333333); |
1681 | 7788 playerPtr->SetRecoveryTime(recTime); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7789 } |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7790 return; |
1648 | 7791 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7792 else |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7793 { |
1648 | 7794 return; |
7795 } | |
1297 | 7796 } |
7797 } | |
7798 //----- (00421EA6) -------------------------------------------------------- | |
1683 | 7799 void Player::OnInventoryLeftClick() |
7800 { | |
1297 | 7801 signed int v2; // ecx@2 |
7802 int v3; // eax@2 | |
1682 | 7803 int invMatrixIndex; // eax@2 |
1297 | 7804 unsigned int v6; // eax@7 |
1682 | 7805 unsigned int pickedItemId; // esi@12 |
7806 unsigned int invItemIndex; // eax@12 | |
1297 | 7807 unsigned int v9; // eax@16 |
7808 unsigned int v10; // eax@18 | |
1682 | 7809 ItemGen tmpItem; // [sp+Ch] [bp-3Ch]@1 |
1297 | 7810 POINT a2; // [sp+30h] [bp-18h]@4 |
7811 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
7812 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
7813 | |
7814 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) | |
7815 { | |
7816 pMouse->GetClickPos(&pX, &pY); | |
1682 | 7817 v3 = Player::INVETORYSLOTSWIDTH * ((pY - 17) / 32); |
7818 v2 = (pX - 14) / 32; | |
7819 invMatrixIndex = v2 + v3; | |
7820 if ( v2 + v3 >= 0 ) | |
7821 { | |
7822 if ( invMatrixIndex <= 126 && pMouse->GetCursorPos(&a2)->x < 462 | |
1297 | 7823 && pMouse->GetCursorPos(&a2)->x >= 14 ) |
7824 { | |
1682 | 7825 if ( _50C9A0_IsEnchantingInProgress ) |
1297 | 7826 { |
1683 | 7827 v6 = this->GetItemIDAtInventoryIndex(&invMatrixIndex); |
1297 | 7828 if ( v6 ) |
7829 { | |
7830 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
7831 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
7832 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
1682 | 7833 *((short *)pGUIWindow_Settings->ptr_1C + 3) = invMatrixIndex; |
1683 | 7834 ptr_50C9A4_ItemToEnchant = &this->pInventoryItemList[v6-1]; |
1682 | 7835 _50C9A0_IsEnchantingInProgress = 0; |
1297 | 7836 if ( pMessageQueue_50CBD0->uNumMessages ) |
7837 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
7838 pMouse->SetCursorBitmap("MICON1"); | |
1682 | 7839 _50C9D0_AfterEnchClickEventId = 113; |
7840 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
7841 _50C9D8_AfterEnchClickEventTimeout = 256; | |
1297 | 7842 } |
7843 return; | |
7844 } | |
1682 | 7845 if ( ptr_50C9A4_ItemToEnchant ) |
1297 | 7846 return; |
1682 | 7847 pickedItemId = pParty->pPickedItem.uItemID; |
1683 | 7848 invItemIndex = this->GetItemIDAtInventoryIndex(&invMatrixIndex); |
1682 | 7849 if (!pickedItemId) |
1297 | 7850 { |
1682 | 7851 if ( !invItemIndex ) |
1297 | 7852 return; |
1682 | 7853 else |
7854 { | |
1683 | 7855 memcpy(&pParty->pPickedItem, &this->pInventoryItemList[invItemIndex-1], sizeof(pParty->pPickedItem)); |
7856 this->RemoveItemAtInventoryIndex(invMatrixIndex); | |
1682 | 7857 v9 = pParty->pPickedItem.uItemID; |
7858 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
7859 return; | |
7860 } | |
1297 | 7861 } |
1682 | 7862 else |
1297 | 7863 { |
1682 | 7864 if ( invItemIndex ) |
1297 | 7865 { |
1683 | 7866 ItemGen* invItemPtr = &this->pInventoryItemList[invItemIndex-1]; |
1682 | 7867 memcpy(&tmpItem, invItemPtr, sizeof(tmpItem)); |
1683 | 7868 this->RemoveItemAtInventoryIndex(invMatrixIndex); |
7869 int emptyIndex = this->AddItem2(invMatrixIndex, &pParty->pPickedItem); | |
1682 | 7870 if ( !emptyIndex ) |
1297 | 7871 { |
1683 | 7872 emptyIndex = this->AddItem2(-1, &pParty->pPickedItem); |
1682 | 7873 if ( !emptyIndex ) |
7874 { | |
1683 | 7875 this->PutItemArInventoryIndex(tmpItem.uItemID, invItemIndex - 1, invMatrixIndex); |
1682 | 7876 memcpy(invItemPtr, &tmpItem, sizeof(ItemGen)); |
7877 return; | |
7878 } | |
7879 } | |
7880 v9 = tmpItem.uItemID; | |
7881 memcpy(&pParty->pPickedItem, &tmpItem, sizeof(ItemGen)); | |
7882 pMouse->SetCursorBitmap(pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName); | |
7883 return; | |
7884 } | |
7885 else | |
7886 { | |
1683 | 7887 v10 = this->AddItem(invMatrixIndex, pickedItemId); |
1682 | 7888 if ( v10 ) |
7889 { | |
1683 | 7890 memcpy(&this->pInventoryItemList[v10-1], &pParty->pPickedItem, sizeof(ItemGen)); |
1682 | 7891 pMouse->RemoveHoldingItem(); |
7892 return; | |
7893 } | |
1683 | 7894 v10 = this->AddItem(-1, pickedItemId); |
1682 | 7895 if ( v10 ) |
7896 { | |
1683 | 7897 memcpy(&this->pInventoryItemList[v10-1], &pParty->pPickedItem, sizeof(ItemGen)); |
1682 | 7898 pMouse->RemoveHoldingItem(); |
1297 | 7899 return; |
7900 } | |
7901 } | |
7902 } | |
7903 } | |
7904 } | |
7905 } | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7906 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7907 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7908 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7909 bool Player::IsWeak() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7910 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7911 return pConditions[Condition_Weak] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7912 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7913 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7914 bool Player::IsDead() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7915 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7916 return pConditions[Condition_Dead] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7917 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7918 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7919 bool Player::IsEradicated() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7920 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7921 return pConditions[Condition_Eradicated] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7922 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7923 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7924 bool Player::IsZombie() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7925 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7926 return pConditions[Condition_Zombie] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7927 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7928 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7929 bool Player::IsCursed() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7930 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7931 return pConditions[Condition_Cursed] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7932 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7933 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7934 bool Player::IsPertified() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7935 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7936 return pConditions[Condition_Pertified] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7937 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7938 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7939 bool Player::IsUnconcious() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7940 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7941 return pConditions[Condition_Unconcious] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7942 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7943 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7944 bool Player::IsAsleep() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7945 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7946 return pConditions[Condition_Sleep] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7947 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7948 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7949 bool Player::IsParalyzed() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7950 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7951 return pConditions[Condition_Paralyzed] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7952 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7953 |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7954 bool Player::IsDrunk() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7955 { |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7956 return pConditions[Condition_Drunk] != 0; |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7957 } |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7958 |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7959 void Player::SetCursed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7960 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7961 pConditions[Condition_Cursed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7962 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7963 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7964 void Player::SetWeak( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7965 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7966 pConditions[Condition_Weak] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7967 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7968 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7969 void Player::SetAsleep( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7970 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7971 pConditions[Condition_Sleep] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7972 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7973 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7974 void Player::SetAfraid( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7975 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7976 pConditions[Condition_Fear] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7977 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7978 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7979 void Player::SetDrunk( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7980 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7981 pConditions[Condition_Drunk] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7982 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7983 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7984 void Player::SetInsane( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7985 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7986 pConditions[Condition_Insane] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7987 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7988 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7989 void Player::SetPoison1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7990 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7991 pConditions[Condition_Poison1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7992 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7993 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7994 void Player::SetDisease1( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7995 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7996 pConditions[Condition_Disease1] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7997 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7998 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7999 void Player::SetPoison2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8000 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8001 pConditions[Condition_Poison2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8002 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8003 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8004 void Player::SetDisease2( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8005 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8006 pConditions[Condition_Disease2] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8007 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8008 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8009 void Player::SetPoison3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8010 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8011 pConditions[Condition_Poison3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8012 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8013 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8014 void Player::SetDisease3( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8015 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8016 pConditions[Condition_Disease3] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8017 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8018 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8019 void Player::SetParalyzed( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8020 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8021 pConditions[Condition_Paralyzed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8022 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8023 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8024 void Player::SetUnconcious( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8025 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8026 pConditions[Condition_Unconcious] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8027 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8028 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8029 void Player::SetDead( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8030 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8031 pConditions[Condition_Dead] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8032 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8033 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8034 void Player::SetPertified( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8035 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8036 pConditions[Condition_Pertified] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8037 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8038 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8039 void Player::SetEradicated( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8040 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8041 pConditions[Condition_Eradicated] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8042 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8043 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8044 void Player::SetZombie( bool state ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8045 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8046 pConditions[Condition_Zombie] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8047 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8048 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8049 void Player::SetCondWeakWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8050 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8051 SetCondition(Condition_Weak, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8052 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8053 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8054 void Player::SetCondInsaneWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8055 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8056 SetCondition(Condition_Insane, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8057 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8058 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8059 void Player::SetCondDeadWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8060 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
8061 SetCondition(Condition_Dead, blockable); |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
8062 } |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
8063 |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
8064 void Player::SetCondUnconsciousWithBlockCheck( int blockable ) |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
8065 { |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
8066 SetCondition(Condition_Dead, blockable); |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
8067 } |