Mercurial > mm7
annotate Player.cpp @ 2466:5a6cd79069ae
project and filter
author | zipi |
---|---|
date | Sun, 17 Aug 2014 20:34:56 +0100 |
parents | b054ea5daf45 |
children | 85a12b497698 |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2242
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
1016 | 6 #include "stru6.h" |
2464 | 7 |
2336 | 8 #include "ErrorHandling.h" |
1016 | 9 |
0 | 10 #include "Player.h" |
11 #include "PlayerFrameTable.h" | |
12 #include "AudioPlayer.h" | |
13 #include "Party.h" | |
14 #include "LOD.h" | |
15 #include "GUIWindow.h" | |
16 #include "Viewport.h" | |
17 #include "Actor.h" | |
18 #include "Game.h" | |
19 #include "Mouse.h" | |
20 #include "TurnEngine.h" | |
21 #include "Events.h" | |
22 #include "Events2D.h" | |
23 #include "Outdoor.h" | |
24 #include "StorylineTextTable.h" | |
81
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
25 #include "Autonotes.h" |
377535d6e366
structure boundaries fixed in many places. fixed quests, notes, awards, calendar.
zipi
parents:
45
diff
changeset
|
26 #include "Awards.h" |
189 | 27 #include "texts.h" |
816 | 28 |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
29 #include "stru123.h" |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
30 #include "stru298.h" |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
31 #include "ObjectList.h" |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
821
diff
changeset
|
32 #include "MM7.h" |
1297 | 33 #include "SpriteObject.h" |
34 #include "DecalBuilder.h" | |
2156 | 35 #include "CastSpellInfo.h" |
2340 | 36 #include "OurMath.h" |
2350
7c10dfb6d802
Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents:
2340
diff
changeset
|
37 #include "UI\UIPartyCreation.h" |
0 | 38 |
39 | |
40 | |
41 | |
2054 | 42 NZIArray<struct Player *, 5> pPlayers; |
43 | |
44 | |
0 | 45 /* 381 */ |
46 #pragma pack(push, 1) | |
290 | 47 struct PlayerCreation_AttributeProps |
0 | 48 { |
49 unsigned __int8 uBaseValue; | |
50 char uMaxValue; | |
51 char uDroppedStep; | |
52 char uBaseStep; | |
53 }; | |
54 #pragma pack(pop) | |
55 | |
56 | |
57 #pragma pack(push, 1) | |
290 | 58 |
59 | |
60 | |
0 | 61 #pragma pack(pop) |
290 | 62 PlayerCreation_AttributeProps StatTable[4][7] = //0x4ED7B0 |
63 { | |
64 {{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},}, | |
65 {{ 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},}, | |
66 {{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},}, | |
67 {{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 | 68 }; |
69 | |
70 | |
71 | |
1700 | 72 std::array<int, 5> StealingMasteryBonuses = {0, 100, 200, 300, 500}; //dword_4EDEA0 //the zeroth element isn't accessed, it just helps avoid -1 indexing, originally 4 element array off by one |
1686 | 73 std::array<int, 5> StealingRandomBonuses = {-200, -100, 0, 100, 200}; //dword_4EDEB4 |
1700 | 74 std::array<int, 5> StealingEnchantmentBonusForSkill = {0, 2, 4, 6, 10}; //dword_4EDEC4 //the zeroth element isn't accessed, it just helps avoid -1 indexing, originally 4 element array off by one |
0 | 75 |
76 | |
77 | |
78 // available skills per class ( 9 classes X 37 skills ) | |
79 // 0 - not available | |
80 // 1 - available | |
81 // 2 - primary skill | |
82 unsigned char pSkillAvailabilityPerClass[9][37] = // byte[] @ MM7.exe::004ED820 | |
83 { | |
84 {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}, | |
85 {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}, | |
86 {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}, | |
87 {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}, | |
88 {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}, | |
89 {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}, | |
90 {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}, | |
91 {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}, | |
92 {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 | |
93 }; | |
94 | |
95 | |
1374 | 96 unsigned char pEquipTypeToBodyAnchor[21] = // 4E8398 |
97 { | |
1989 | 98 1, // EQUIP_SINGLE_HANDED |
99 1, // EQUIP_TWO_HANDED | |
1374 | 100 2, // EQUIP_BOW |
101 3, // EQUIP_ARMOUR | |
102 0, // EQUIP_SHIELD | |
103 4, // EQUIP_HELMET | |
104 5, // EQUIP_BELT | |
105 6, // EQUIP_CLOAK | |
106 7, // EQUIP_GAUNTLETS | |
107 8, // EQUIP_BOOTS | |
108 10, // EQUIP_RING | |
109 9, // EQUIP_AMULET | |
110 1, // EQUIP_WAND | |
111 0, // EQUIP_REAGENT | |
112 0, // EQUIP_POTION | |
113 0, // EQUIP_SPELL_SCROLL | |
114 0, // EQUIP_BOOK | |
115 0, // EQUIP_MESSAGE_SCROLL | |
116 0, // EQUIP_GOLD | |
117 0, // EQUIP_GEM | |
118 0 // EQUIP_NONE | |
119 }; | |
0 | 120 |
121 | |
122 unsigned char pBaseHealthByClass[12] = {40, 35, 35, 30, 30, 30, 25, 20, 20, 0, 0, 0}; | |
123 unsigned char pBaseManaByClass[12] = { 0, 0, 0, 5, 5, 0, 10, 10, 15, 0, 0, 0}; | |
124 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}; | |
125 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}; | |
126 | |
1325 | 127 unsigned char pConditionAttributeModifier[7][19] = |
128 {{100, 100, 100, 120, 50, 200, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}, //Might | |
129 {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}, //Intelligence | |
130 {100, 100, 100, 50, 25, 10, 100, 100, 75, 60, 50, 30, 100, 100, 100, 100, 100, 1, 100}, //Willpower | |
131 {100, 100, 100, 100, 50, 150, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 100, 100}, //Endurance | |
132 {100, 100, 100, 50, 10, 100, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}, //Accuracy | |
133 {100, 100, 100, 120, 20, 120, 75, 60, 50, 30, 25, 10, 100, 100, 100, 100, 100, 50, 100}, //Speed | |
134 {100, 100, 100, 100, 200, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}}; //Luck | |
135 | |
136 unsigned char pAgingAttributeModifier[7][4] = | |
137 {{100, 75, 40, 10}, //Might | |
138 {100, 150, 100, 10}, //Intelligence | |
139 {100, 150, 100, 10}, //Willpower | |
140 {100, 75, 40, 10}, //Endurance | |
141 {100, 100, 40, 10}, //Accuracy | |
142 {100, 100, 40, 10}, //Speed | |
143 {100, 100, 100, 100}}; //Luck | |
0 | 144 |
1684 | 145 unsigned int pAgeingTable[4] = {50, 100, 150, 0xFFFF}; |
0 | 146 |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1205
diff
changeset
|
147 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 | 148 |
1036 | 149 short param_to_bonus_table[29] = {500, 400, 350, 300, 275, 250, 225, 200, 175, |
0 | 150 150, 125, 100, 75, 50, 40, 35, 30, 25, 21, |
1036 | 151 19, 17, 15, 13, 11, 9, 7, 5, 3, 0}; |
152 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 | 153 |
154 | |
816 | 155 unsigned short base_recovery_times_per_weapon_type[12] = |
156 { | |
157 100, // PLAYER_SKILL_STAFF && Unarmed withoud skill | |
158 90, // PLAYER_SKILL_SWORD && Unarmed with skill | |
159 60, // PLAYER_SKILL_DAGGER | |
160 100, // PLAYER_SKILL_AXE | |
161 80, // PLAYER_SKILL_SPEAR | |
162 100, // PLAYER_SKILL_BOW | |
163 80, // PLAYER_SKILL_MACE | |
164 30, // PLAYER_SKILL_BLASTER | |
165 10, // PLAYER_SKILL_SHIELD | |
166 10, // PLAYER_SKILL_LEATHER | |
167 20, // PLAYER_SKILL_CHAIN | |
168 30 // PLAYER_SKILL_PLATE | |
169 }; | |
170 | |
0 | 171 //----- (00490913) -------------------------------------------------------- |
1459 | 172 int PlayerCreation_GetUnspentAttributePointCount() |
0 | 173 { |
174 signed int v0; // edi@1 | |
1273 | 175 int raceId; // ebx@2 |
0 | 176 signed int v4; // eax@17 |
177 int v5; // edx@18 | |
178 signed int v6; // ecx@18 | |
1273 | 179 signed int remainingStatPoints; // [sp+Ch] [bp-8h]@1 |
180 | |
181 remainingStatPoints = 50; | |
0 | 182 v0 = 50; |
1273 | 183 for (int playerNum = 0; playerNum < 4; playerNum++) |
184 { | |
185 raceId = pParty->pPlayers[playerNum].GetRace(); | |
186 for (int statNum = 0; statNum <= 6; statNum++) | |
187 { | |
188 switch ( statNum ) | |
0 | 189 { |
1273 | 190 case 0: |
191 v0 = pParty->pPlayers[playerNum].uMight; | |
192 break; | |
193 case 1: | |
194 v0 = pParty->pPlayers[playerNum].uIntelligence; | |
195 break; | |
196 case 2: | |
197 v0 = pParty->pPlayers[playerNum].uWillpower; | |
198 break; | |
199 case 3: | |
200 v0 = pParty->pPlayers[playerNum].uEndurance; | |
201 break; | |
202 case 4: | |
203 v0 = pParty->pPlayers[playerNum].uAccuracy; | |
204 break; | |
205 case 5: | |
206 v0 = pParty->pPlayers[playerNum].uSpeed; | |
207 break; | |
208 case 6: | |
209 v0 = pParty->pPlayers[playerNum].uLuck; | |
210 break; | |
211 } | |
212 v4 = StatTable[raceId][statNum].uBaseValue; | |
213 if ( v0 >= v4 ) | |
214 { | |
215 v5 = StatTable[raceId][statNum].uDroppedStep; | |
216 v6 = StatTable[raceId][statNum].uBaseStep; | |
0 | 217 } |
218 else | |
219 { | |
1273 | 220 v5 = StatTable[raceId][statNum].uBaseStep; |
221 v6 = StatTable[raceId][statNum].uDroppedStep; | |
0 | 222 } |
1273 | 223 remainingStatPoints += v5 * (v4 - v0) / v6; |
224 } | |
225 } | |
226 return remainingStatPoints; | |
0 | 227 } |
228 | |
229 //----- (00427730) -------------------------------------------------------- | |
230 bool Player::CanCastSpell(unsigned int uRequiredMana) | |
231 { | |
1275 | 232 if (sMana >= (signed int)uRequiredMana) |
233 { | |
234 sMana -= (signed int)uRequiredMana; | |
488 | 235 return true; |
236 } | |
237 | |
238 pAudioPlayer->PlaySound(SOUND_PlayerCantCastSpell, 0, 0, -1, 0, 0, 0, 0); | |
239 return false; | |
0 | 240 } |
241 | |
242 //----- (004BE2DD) -------------------------------------------------------- | |
1014 | 243 void Player::SalesProcess( unsigned int inventory_idnx, int item_index, int _2devent_idx ) |
244 { | |
0 | 245 float v6; // ST04_4@1 |
1014 | 246 signed int item_value; // eax@1 |
247 signed int sell_price; // ebx@1 | |
248 | |
249 item_value =pOwnItems[item_index].GetValue(); | |
250 v6 = p2DEvents[ _2devent_idx - 1].fPriceMultiplier; | |
251 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
|
252 if ( pOwnItems[item_index].IsBroken() ) |
1014 | 253 sell_price = 1; |
254 if ( sell_price < 1 ) | |
255 sell_price = 1; | |
256 RemoveItemAtInventoryIndex(inventory_idnx); | |
257 Party::SetGold(pParty->uNumGold + sell_price); | |
0 | 258 } |
259 | |
260 //----- (0043EEF3) -------------------------------------------------------- | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
261 bool Player::NothingOrJustBlastersEquipped() |
0 | 262 { |
1014 | 263 signed int item_idx; // esi@1 |
264 signed int item_id; // esi@1 | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
265 for (int i = 0; i < 16; ++i) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
266 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
267 item_idx = pEquipment.pIndices[i]; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
268 if (item_idx) |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
269 { |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
270 item_id = pOwnItems[item_idx - 1].uItemID; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
271 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
|
272 return false; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
273 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
274 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
275 return true; |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
276 } |
0 | 277 |
278 //----- (004B8040) -------------------------------------------------------- | |
1036 | 279 int Player::GetConditionDayOfWeek( unsigned int uCondition ) |
280 { | |
281 return (unsigned int)(((signed __int64)((double)this->pConditions[uCondition] * 0.234375) / 60 / 60) / 24) % 7 + 1; | |
0 | 282 } |
283 | |
284 //----- (004B807C) -------------------------------------------------------- | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
285 int Player::GetTempleHealCostModifier(float a2) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
286 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
287 unsigned int conditionIdx; // eax@1 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
288 int conditionTimeMultiplier; // esi@1 |
0 | 289 int v6; // eax@8 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
290 signed int result; // qax@13 |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
291 signed int baseConditionMultiplier; // [sp+8h] [bp-8h]@4 |
1275 | 292 |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
293 conditionIdx = GetMajorConditionIdx(); |
1275 | 294 if ( conditionIdx >= 14 && conditionIdx <= 16) |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
295 { |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
296 if ( conditionIdx <= 15 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
297 baseConditionMultiplier = 5; |
1783 | 298 else //if ( conditionIdx == 16 ) |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
299 baseConditionMultiplier = 10; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
300 conditionTimeMultiplier = GetConditionDayOfWeek(conditionIdx); |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
301 } |
1350 | 302 else |
303 { | |
1275 | 304 conditionTimeMultiplier = 1; |
305 baseConditionMultiplier = 1; | |
1350 | 306 if (conditionIdx < 14) |
307 { | |
308 for (int i = 0; i <= 13; i++) | |
309 { | |
310 v6 = GetConditionDayOfWeek(i); | |
311 if ( v6 > conditionTimeMultiplier ) | |
312 conditionTimeMultiplier = v6; | |
313 } | |
314 } | |
1275 | 315 } |
316 result = (int)((double)conditionTimeMultiplier * (double)baseConditionMultiplier * a2); | |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
317 if ( result < 1 ) |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
318 result = 1; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
319 return result; |
0 | 320 } |
321 | |
322 //----- (004B8102) -------------------------------------------------------- | |
917 | 323 int Player::GetPriceSell(int uRealValue, float price_multiplier) |
0 | 324 { |
325 signed int v3; // esi@1 | |
326 signed int result; // eax@3 | |
327 | |
1275 | 328 v3 = (signed int)((signed __int64)((double)uRealValue / (price_multiplier + 2.0)) + uRealValue * GetMerchant() / 100); |
917 | 329 if ( v3 > uRealValue ) |
330 v3 = uRealValue; | |
0 | 331 result = 1; |
332 if ( v3 >= 1 ) | |
333 result = v3; | |
334 return result; | |
335 } | |
336 | |
337 //----- (004B8142) -------------------------------------------------------- | |
749 | 338 int Player::GetBuyingPrice(unsigned int uRealValue, float price_multiplier) |
339 { | |
1275 | 340 uint price = (uint)(((100 - GetMerchant()) * (uRealValue * price_multiplier)) / 100); |
749 | 341 |
342 if (price < uRealValue) | |
343 price = uRealValue; | |
344 return price; | |
0 | 345 } |
346 | |
347 //----- (004B8179) -------------------------------------------------------- | |
916 | 348 int Player::GetPriceIdentification(float a2) |
0 | 349 { |
350 signed int v2; // esi@1 | |
351 int v3; // ecx@1 | |
352 signed int result; // eax@3 | |
353 | |
1275 | 354 v2 = (signed int)(a2 * 50.0); |
0 | 355 v3 = v2 * (100 - GetMerchant()) / 100; |
356 if ( v3 < v2 / 3 ) | |
357 v3 = v2 / 3; | |
358 result = 1; | |
359 if ( v3 >= 1 ) | |
360 result = v3; | |
361 return result; | |
362 } | |
363 | |
364 //----- (004B81C3) -------------------------------------------------------- | |
916 | 365 int Player::GetPriceRepair(int a2, float a3) |
0 | 366 { |
367 signed int v3; // esi@1 | |
368 int v4; // ecx@1 | |
369 signed int result; // eax@3 | |
370 | |
1275 | 371 v3 = (signed int)((double)a2 / (6.0 - a3)); |
0 | 372 v4 = v3 * (100 - GetMerchant()) / 100; |
373 if ( v4 < v3 / 3 ) | |
374 v4 = v3 / 3; | |
375 result = 1; | |
376 if ( v4 >= 1 ) | |
377 result = v4; | |
378 return result; | |
379 } | |
380 | |
381 //----- (004B8213) -------------------------------------------------------- | |
1275 | 382 int Player::GetBaseSellingPrice(int a2, float a3) |
383 { | |
384 signed int v3; // qax@1 | |
385 | |
386 v3 = (signed int)((double)a2 / (a3 + 2.0)); | |
387 if ( v3 < 1 ) | |
388 v3 = 1; | |
0 | 389 return v3; |
390 } | |
391 | |
392 //----- (004B8233) -------------------------------------------------------- | |
1275 | 393 int Player::GetBaseBuyingPrice(int a2, float a3) |
394 { | |
395 signed int v3; // qax@1 | |
396 | |
397 v3 = (signed int)((double)a2 * a3); | |
398 if ( v3 < 1 ) | |
399 v3 = 1; | |
0 | 400 return v3; |
401 } | |
402 | |
403 //----- (004B824B) -------------------------------------------------------- | |
1275 | 404 int Player::GetBaseIdentifyPrice(float a2) |
405 { | |
406 signed int v2; // qax@1 | |
407 | |
408 v2 = (signed int)(a2 * 50.0); | |
409 if ( v2 < 1 ) | |
410 v2 = 1; | |
0 | 411 return v2; |
412 } | |
413 | |
414 //----- (004B8265) -------------------------------------------------------- | |
1275 | 415 int Player::GetBaseRepairPrice(int a2, float a3) |
416 { | |
417 signed int v3; // qax@1 | |
418 | |
419 v3 = (signed int)((double)a2 / (6.0 - a3)); | |
420 if ( v3 < 1 ) | |
421 v3 = 1; | |
0 | 422 return v3; |
423 } | |
424 | |
425 //----- (004B6FF9) -------------------------------------------------------- | |
1348 | 426 bool Player::IsPlayerHealableByTemple() |
1278
ce8ea73e7678
changed Player::_4B6FF9 to Player::IsPlayerHealableByTemple
Grumpy7
parents:
1276
diff
changeset
|
427 { |
1348 | 428 if (this->sHealth >= GetMaxHealth() && this->sMana >= GetMaxMana() && GetMajorConditionIdx() == Condition_Good) |
429 return false; | |
430 else | |
431 { | |
432 if (GetMajorConditionIdx() == Condition_Zombie) | |
433 { | |
2156 | 434 if (((signed int)window_SpeakInHouse->ptr_1C == 78 || (signed int)window_SpeakInHouse->ptr_1C == 81 || (signed int)window_SpeakInHouse->ptr_1C == 82)) |
1348 | 435 return false; |
436 else | |
437 return true; | |
1346
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
438 } |
1434b36f4bdb
Player::_43EEF3 renamed to NothingOrJustBlastersEquipped
Grumpy7
parents:
1325
diff
changeset
|
439 else |
1348 | 440 return true; |
2156 | 441 } |
442 } | |
0 | 443 |
444 //----- (00421E75) -------------------------------------------------------- | |
1012 | 445 unsigned int Player::GetItemIDAtInventoryIndex(int *pitem_index) |
446 { | |
447 int item_idx; // eax@1 | |
448 int inv_index; // eax@3 | |
449 | |
450 item_idx = *pitem_index; | |
451 if ( item_idx >125 || item_idx < 0 ) | |
452 return 0; | |
2156 | 453 inv_index = this->pInventoryMatrix[item_idx]; |
454 if ( inv_index < 0 ) | |
455 { | |
456 *pitem_index = -1 - inv_index; | |
457 inv_index = this->pInventoryMatrix[-1 - inv_index]; | |
458 } | |
1012 | 459 return inv_index; |
0 | 460 } |
461 | |
462 //----- (004160CA) -------------------------------------------------------- | |
1012 | 463 void Player::ItemsEnchant( int enchant_count ) |
464 { | |
465 int avalible_items; // ebx@1 | |
466 int i; // edx@8 | |
467 __int16 item_index_tabl[138]; // [sp+Ch] [bp-118h]@1 | |
468 | |
469 avalible_items = 0; | |
470 memset (item_index_tabl,0,sizeof(item_index_tabl)); | |
471 | |
1349 | 472 for (i = 0; i < 138; ++i) |
473 { | |
474 if (( pOwnItems[i].uItemID>0)&&(pOwnItems[i].uItemID <= 134)) | |
475 item_index_tabl[avalible_items++] = i; | |
476 } | |
1012 | 477 |
478 if ( avalible_items ) | |
479 { | |
480 if ( enchant_count ) | |
481 { | |
1349 | 482 for ( i = 0; i < enchant_count; ++i ) |
483 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
484 if (!(pInventoryItemList[item_index_tabl[i]].uAttributes&ITEM_HARDENED)) |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
485 pInventoryItemList[item_index_tabl[rand() % avalible_items]].uAttributes |= ITEM_HARDENED; |
1349 | 486 } |
0 | 487 } |
488 else | |
489 { | |
1012 | 490 for ( i = 0; i < avalible_items; ++i ) |
491 { | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
492 pInventoryItemList[item_index_tabl[i]].uAttributes |= ITEM_HARDENED; |
1349 | 493 } |
494 } | |
495 } | |
0 | 496 } |
497 | |
498 //----- (004948B1) -------------------------------------------------------- | |
187 | 499 void Player::PlaySound(PlayerSpeech speech, int a3) |
500 { | |
1351 | 501 signed int speechCount = 0; // esi@4 |
502 signed int expressionCount = 0; // esi@4 | |
503 int pickedVariant; // esi@10 | |
248 | 504 CHARACTER_EXPRESSION_ID expression; // ebx@17 |
1406 | 505 signed int pSoundID; // ecx@19 |
1351 | 506 int speechVariantArray[5]; // [sp+Ch] [bp-1Ch]@7 |
507 int expressionVariantArray[5]; | |
508 unsigned int pickedSoundID; // [sp+30h] [bp+8h]@4 | |
509 unsigned int expressionDuration = 0; | |
187 | 510 |
1351 | 511 pickedSoundID = 0; |
203 | 512 if (uVoicesVolumeMultiplier) |
0 | 513 { |
1351 | 514 for (int i = 0; i < 2; i++) |
515 { | |
1406 | 516 if ( SoundSetAction[speech][i] ) |
517 { | |
518 speechVariantArray[speechCount] = SoundSetAction[speech][i]; | |
1351 | 519 speechCount++; |
520 } | |
521 } | |
522 if ( speechCount ) | |
523 { | |
524 pickedVariant = speechVariantArray[rand() % speechCount]; | |
525 int numberOfSubvariants = byte_4ECF08[pickedVariant - 1][uVoiceID]; | |
526 if (numberOfSubvariants > 0) | |
527 { | |
528 pickedSoundID = rand() % numberOfSubvariants + 2 * (pickedVariant + 50 * uVoiceID) + 4998; | |
1406 | 529 pAudioPlayer->PlaySound((SoundID)pickedSoundID, PID(OBJECT_Player, uActiveCharacter + 39), 0, -1, 0, 0, (int)(pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f), 0); |
1351 | 530 } |
531 } | |
532 } | |
533 | |
534 for (int i = 0; i < 5; i++) | |
535 { | |
1406 | 536 if ( SoundSetAction[speech][i + 3] ) |
537 { | |
538 expressionVariantArray[expressionCount] = SoundSetAction[speech][i + 3]; | |
1351 | 539 expressionCount++; |
540 } | |
541 } | |
542 if ( expressionCount ) | |
543 { | |
544 expression = (CHARACTER_EXPRESSION_ID)expressionVariantArray[rand() % expressionCount]; | |
545 if (expression == CHARACTER_EXPRESSION_21 && pickedSoundID ) | |
546 { | |
1406 | 547 pSoundID = 0; |
548 if ( pSoundList->sNumSounds ) | |
549 { | |
1351 | 550 for (int i = 0; i < pSoundList->sNumSounds; i++) |
0 | 551 { |
2113 | 552 if (pSoundList->pSL_Sounds[i].uSoundID == pickedSoundID) |
1406 | 553 pSoundID = i; |
0 | 554 } |
555 } | |
2113 | 556 if ( pSoundList->pSL_Sounds[pSoundID].pSoundData[0] ) |
1351 | 557 expressionDuration = (sLastTrackLengthMS << 7) / 1000; |
558 } | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
559 PlayEmotion(expression, expressionDuration); |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
560 } |
0 | 561 } |
562 // 4948B1: using guessed type int var_1C[5]; | |
563 | |
564 //----- (00494A25) -------------------------------------------------------- | |
187 | 565 void Player::PlayEmotion(CHARACTER_EXPRESSION_ID new_expression, int a3) |
566 { | |
1352
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
567 unsigned int v3 = expression; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
568 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
|
569 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
570 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
571 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
572 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
|
573 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
574 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
575 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
576 else |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
577 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
578 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
|
579 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
580 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
|
581 { |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
582 return; |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
583 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
584 } |
88f80476c99c
Player::PlayEmotion simplified main condition, renamed a few expression enum vals
Grumpy7
parents:
1351
diff
changeset
|
585 } |
0 | 586 this->uExpressionTimePassed = 0; |
587 if ( !a3 ) | |
588 { | |
187 | 589 this->uExpressionTimeLength = 8 * pPlayerFrameTable->pFrames[a3].uAnimLength; |
590 } | |
1353
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
591 else |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
592 { |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
593 this->uExpressionTimeLength = 0; |
8f69f77a0067
Player::PlayEmotion removed unused variables, deleted a useless secion of code (unused calculations)
Grumpy7
parents:
1352
diff
changeset
|
594 } |
187 | 595 expression = new_expression; |
0 | 596 viewparams->bRedrawGameUI = 1; |
597 } | |
598 | |
599 //----- (0049327B) -------------------------------------------------------- | |
1355 | 600 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
|
601 { |
135 | 602 if ( this->classType == uClass ) |
0 | 603 { |
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
|
604 return true; |
0 | 605 } |
606 else | |
607 { | |
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
|
608 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
|
609 { |
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
|
610 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
|
611 } |
0 | 612 switch ( uClass ) |
613 { | |
614 case 0x1Au: | |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
615 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 65)); |
0 | 616 case 0x1Bu: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
617 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 67)); |
0 | 618 case 0x22u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
619 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 77)); |
0 | 620 case 0x23u: |
1460
ff2118028c71
renaming _guilds_member_bits to _achieved_awards_bits
Gloval
parents:
1455
diff
changeset
|
621 return(_449B57_test_bit((unsigned __int8 *)this->_achieved_awards_bits, 79)); |
0 | 622 break; |
623 default: | |
1545 | 624 Error("Should not be able to get here (%u)", uClass); |
0 | 625 break; |
626 } | |
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 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
|
628 } |
0 | 629 } |
630 | |
631 | |
632 //----- (00492C0B) -------------------------------------------------------- | |
633 bool Player::CanAct() | |
634 { | |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
635 if ( this->IsAsleep() || this->IsParalyzed() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
636 this->IsUnconcious() || this->IsDead() || |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
637 this->IsPertified() || this->IsEradicated() ) |
1355 | 638 return false; |
0 | 639 else |
1355 | 640 return true; |
0 | 641 } |
642 | |
643 //----- (00492C40) -------------------------------------------------------- | |
644 bool Player::CanSteal() | |
645 { | |
1355 | 646 return GetActualSkillLevel(PLAYER_SKILL_STEALING) != 0; |
0 | 647 } |
648 | |
649 //----- (00492C4E) -------------------------------------------------------- | |
650 bool Player::CanEquip_RaceAndAlignmentCheck(unsigned int uItemID) | |
651 { | |
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
|
652 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
|
653 { |
1358
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
654 case ITEM_RELIC_ETHRICS_STAFF: |
61010a655c94
a few itemID changed to their enum values + added a few new ones
Grumpy7
parents:
1357
diff
changeset
|
655 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
|
656 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
|
657 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
|
658 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
|
659 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
|
660 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
|
661 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
|
662 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
|
663 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
|
664 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
|
665 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
|
666 default: return 1; break; |
1356
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
667 } |
301e227439e7
Player::CanEquip_RaceAndAlignmentCheck condition reorganizing, label removal, using GetSexByVoice()
Grumpy7
parents:
1355
diff
changeset
|
668 } |
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
|
669 |
0 | 670 //----- (00492D65) -------------------------------------------------------- |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
671 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
|
672 { |
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
|
673 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
|
674 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
|
675 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
|
676 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
|
677 |
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
|
678 if ( pConditions[uConditionIdx] ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
679 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
680 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
681 if (!ConditionProcessor::IsPlayerAffected(this, uConditionIdx, a3)) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
682 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
683 return; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
684 } |
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
|
685 |
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
|
686 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
|
687 { |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
688 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
|
689 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
|
690 case Condition_Sleep: break; //nosound |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
691 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
|
692 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
|
693 case Condition_Insane: PlaySound(SPEECH_29, 0); break; |
2187 | 694 case Condition_Poison_Weak: |
695 case Condition_Poison_Medium: | |
696 case Condition_Poison_Severe: PlaySound(SPEECH_27, 0); break; | |
697 case Condition_Disease_Weak: | |
698 case Condition_Disease_Medium: | |
699 case Condition_Disease_Severe: PlaySound(SPEECH_28, 0);break; | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
700 case Condition_Paralyzed: break; //nosound |
1014 | 701 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
|
702 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
|
703 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
|
704 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
|
705 break; |
1014 | 706 case Condition_Dead: |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
707 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
|
708 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
|
709 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
|
710 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
|
711 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
|
712 break; |
1014 | 713 case Condition_Pertified: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
714 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
|
715 break; |
1014 | 716 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
|
717 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
|
718 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
|
719 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
|
720 if ( sMana > 0 ) |
1014 | 721 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
|
722 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
|
723 case Condition_Zombie: |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
724 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
|
725 return; |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
726 pConditions.fill(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
|
727 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
|
728 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
|
729 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
|
730 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
|
731 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
|
732 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
|
733 { |
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 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
|
735 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
|
736 } |
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 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
|
738 { |
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
739 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
|
740 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
|
741 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
742 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
|
743 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
|
744 } |
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 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
746 players_before = 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
747 for (int i = 1; i < 5; ++i) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
748 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
749 if ( pPlayers[i]->CanAct() ) |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
750 ++players_before; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
751 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
752 |
2187 | 753 pConditions[uConditionIdx] = pParty->uTimePlayed; |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
754 |
1360
a47d9282ea7c
Player::SetCondition added spaces for readability, fixed stoning and poisioning bug wit prot. from magic, using IsMale() function instead of case
Grumpy7
parents:
1359
diff
changeset
|
755 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
|
756 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
|
757 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
|
758 { |
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 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
|
760 { |
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 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
|
762 ++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
|
763 } |
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 if (( players_before == 2 ) && ( players_after == 1 )) |
2187 | 766 pPlayers[remainig_player]->PlaySound(SPEECH_107, 0);//ñêîðåå âñåãî îáíàä¸æûâàþùèé âîçãëàñ ïîñëåäíåãî |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
767 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
|
768 } |
0 | 769 |
770 //----- (00492528) -------------------------------------------------------- | |
771 bool Player::CanFitItem(unsigned int uSlot, unsigned int uItemID) | |
772 { | |
1363 | 773 Texture *texture; // esi@1 |
774 unsigned int slotWidth; // ebx@1 | |
775 unsigned int slotHeight; // [sp+1Ch] [bp+Ch]@1 | |
776 | |
777 texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
778 slotWidth = GetSizeInInventorySlots(texture->uTextureWidth); | |
779 slotHeight = GetSizeInInventorySlots(texture->uTextureHeight); | |
0 | 780 if ( !areWeLoadingTexture ) |
781 { | |
1363 | 782 texture->Release(); |
1006 | 783 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 784 } |
1555 | 785 Assert(slotHeight > 0 && slotWidth > 0, "Items should have nonzero dimensions"); |
1363 | 786 if ( (slotWidth + uSlot % INVETORYSLOTSWIDTH) <= INVETORYSLOTSWIDTH && (slotHeight + uSlot / INVETORYSLOTSWIDTH) <= INVETORYSLOTSHEIGHT ) |
787 { | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
788 for (unsigned int x = 0; x < slotWidth; x++) |
1363 | 789 { |
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
|
790 for (unsigned int y = 0; y < slotHeight; y++) |
1363 | 791 { |
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
|
792 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
|
793 { |
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
|
794 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
|
795 } |
1363 | 796 } |
797 } | |
798 return true; | |
799 } | |
800 return false; | |
0 | 801 } |
802 // 506128: using guessed type int areWeLoadingTexture; | |
803 | |
804 //----- (004925E6) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
805 int Player::FindFreeInventoryListSlot() |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
806 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
807 for (int i = 0; i < 126; i++ ) |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
808 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
809 if (pInventoryItemList[i].uItemID == 0) |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
810 { |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
811 return i; |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
812 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
813 } |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
814 return -1; |
0 | 815 } |
816 | |
817 //----- (00492600) -------------------------------------------------------- | |
818 int Player::CreateItemInInventory(unsigned int uSlot, unsigned int uItemID) | |
819 { | |
820 int result; // eax@8 | |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
821 signed int freeSlot; // [sp+8h] [bp-4h]@4 |
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
822 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
823 freeSlot = FindFreeInventoryListSlot(); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
824 if ( freeSlot == -1 ) |
0 | 825 { |
826 if ( uActiveCharacter ) | |
201 | 827 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
1366
8f339c3bbdaf
Player::CreateItemInInventory small bugfix from previous change
Grumpy7
parents:
1365
diff
changeset
|
828 return 0; |
0 | 829 } |
830 else | |
831 { | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
832 PutItemArInventoryIndex(uItemID, freeSlot, uSlot); |
1365
b691c96d8e06
Player::FindFreeInventorySlot and Player::CreateItemInInventory refactoring
Grumpy7
parents:
1363
diff
changeset
|
833 result = freeSlot + 1; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
834 this->pInventoryItemList[freeSlot].uItemID = uItemID; |
0 | 835 } |
836 return result; | |
837 } | |
838 // 506128: using guessed type int areWeLoadingTexture; | |
839 | |
840 //----- (00492700) -------------------------------------------------------- | |
841 int Player::HasSkill(unsigned int uSkillType) | |
842 { | |
1374 | 843 if ( uSkillType >= 37 || this->pActiveSkills[uSkillType] ) |
844 { | |
845 return 1; | |
0 | 846 } |
847 else | |
848 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
849 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1167
diff
changeset
|
850 ShowStatusBarString(pTmpBuf.data(), 2u); |
1374 | 851 return 0; |
852 } | |
0 | 853 } |
854 | |
855 //----- (00492745) -------------------------------------------------------- | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
856 void Player::WearItem( unsigned int uItemID ) |
0 | 857 { |
1010 | 858 int item_body_anch; // edi@6 |
859 int item_indx; | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
860 item_indx = FindFreeInventoryListSlot(); |
1010 | 861 |
862 if ( item_indx != -1 ) | |
863 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
864 pInventoryItemList[item_indx].uItemID = uItemID; |
1374 | 865 item_body_anch = pEquipTypeToBodyAnchor[pItemsTable->pItems[uItemID].uEquipType]; |
866 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
|
867 pInventoryItemList[item_indx].uBodyAnchor = item_body_anch + 1; |
0 | 868 } |
869 } | |
870 | |
871 //----- (004927A8) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
872 int Player::AddItem(int index, unsigned int uItemID) |
0 | 873 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
874 if ( index == -1 ) |
0 | 875 { |
1385 | 876 for (int xcoord = 0; xcoord < INVETORYSLOTSWIDTH; xcoord++) |
877 { | |
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
|
878 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) |
0 | 879 { |
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
|
880 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
|
881 { |
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
|
882 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
|
883 } |
0 | 884 } |
1385 | 885 } |
0 | 886 return 0; |
887 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
888 if ( !CanFitItem(index, uItemID) ) |
0 | 889 { |
1754 | 890 pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0); |
0 | 891 return 0; |
892 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
893 return CreateItemInInventory(index, uItemID); |
0 | 894 } |
895 | |
896 //----- (00492826) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
897 int Player::AddItem2(int index, ItemGen *Src) |
0 | 898 { |
899 pItemsTable->SetSpecialBonus(Src); | |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
900 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
901 if ( index == -1 ) |
0 | 902 { |
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
|
903 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
|
904 { |
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
|
905 for (int ycoord = 0; ycoord < INVETORYSLOTSHEIGHT; ycoord++) //TODO: change pInventoryMatrix to 2 dimensional array. |
1385 | 906 { |
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
|
907 if ( CanFitItem(ycoord * INVETORYSLOTSWIDTH + xcoord, Src->uItemID) ) |
0 | 908 { |
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
|
909 return CreateItemInInventory2(ycoord * INVETORYSLOTSWIDTH + xcoord, Src); |
0 | 910 } |
1385 | 911 } |
0 | 912 } |
913 return 0; | |
914 } | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
915 if ( !CanFitItem(index, Src->uItemID) ) |
0 | 916 return 0; |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
917 return CreateItemInInventory2(index, Src); |
0 | 918 } |
919 | |
920 //----- (0049289C) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
921 int Player::CreateItemInInventory2( unsigned int index, ItemGen *Src ) |
0 | 922 { |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
923 signed int freeSlot; // ebx@1 |
0 | 924 int result; // eax@6 |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
925 |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
926 freeSlot = FindFreeInventoryListSlot(); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
927 if ( freeSlot == -1 ) |
0 | 928 { |
929 result = 0; | |
930 } | |
931 else | |
932 { | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
933 PutItemArInventoryIndex(Src->uItemID, freeSlot, index); |
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
934 memcpy(&pInventoryItemList[freeSlot], Src, sizeof(ItemGen)); |
1382
132a6a0d5cef
Player::AddItem2, Player::CreateItemInInventory2 cleanup
Grumpy7
parents:
1374
diff
changeset
|
935 result = freeSlot + 1; |
0 | 936 } |
937 return result; | |
938 } | |
939 // 506128: using guessed type int areWeLoadingTexture; | |
940 | |
941 //----- (0049298B) -------------------------------------------------------- | |
1385 | 942 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
|
943 { |
1014 | 944 Texture *item_texture; // esi@1 |
945 int *pInvPos; // esi@4 | |
946 unsigned int slot_width; // [sp+Ch] [bp-4h]@1 | |
947 unsigned int slot_height; // [sp+18h] [bp+8h]@1 | |
948 | |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
949 item_texture = pIcons_LOD->LoadTexturePtr(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
1014 | 950 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); |
951 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 952 if ( !areWeLoadingTexture ) |
953 { | |
1014 | 954 item_texture->Release(); |
1006 | 955 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 956 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
957 if ( slot_width > 0 ) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
958 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
959 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
960 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
961 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
962 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
|
963 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
964 } |
1014 | 965 } |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
966 pInventoryMatrix[index] = itemListPos + 1; |
0 | 967 } |
278 | 968 |
0 | 969 // 506128: using guessed type int areWeLoadingTexture; |
970 | |
971 //----- (00492A36) -------------------------------------------------------- | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
972 void Player::RemoveItemAtInventoryIndex( unsigned int index ) |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
973 { |
1014 | 974 ItemGen *item_in_slot; // ecx@1 |
975 Texture *item_texture; // esi@1 | |
976 unsigned int slot_height; // ebp@1 | |
977 int *pInvPos; // edx@4 | |
978 unsigned int slot_width; // [sp+14h] [bp+4h]@1 | |
979 | |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
980 item_in_slot = &this->pInventoryItemList[pInventoryMatrix[index]-1]; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
981 item_texture = pIcons_LOD->LoadTexturePtr(item_in_slot->GetIconName(), TEXTURE_16BIT_PALETTE); |
1014 | 982 item_in_slot->Reset(); |
983 slot_width = GetSizeInInventorySlots(item_texture->uTextureWidth); | |
984 slot_height = GetSizeInInventorySlots(item_texture->uTextureHeight); | |
0 | 985 if ( !areWeLoadingTexture ) |
986 { | |
1014 | 987 item_texture->Release(); |
1006 | 988 pIcons_LOD->SyncLoadedFilesCount(); |
0 | 989 } |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
990 if ( slot_width > 0 ) |
1014 | 991 { |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
992 pInvPos = &pInventoryMatrix[index]; |
1383
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
993 for (unsigned int i = 0; i < slot_height; i++) |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
994 { |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
995 memset32(pInvPos, 0, slot_width); |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
996 pInvPos += INVETORYSLOTSWIDTH; |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
997 } |
0a4254e80036
Player::PutItemArInventoryIndex, Player::RemoveItemAtInventoryIndex cleanup, slightly simplified
Grumpy7
parents:
1382
diff
changeset
|
998 } |
0 | 999 } |
1000 // 506128: using guessed type int areWeLoadingTexture; | |
1001 | |
1002 //----- (00490EEE) -------------------------------------------------------- | |
1386 | 1003 int Player::SelectPhrasesTransaction(ItemGen *pItem, int building_type, int BuildID_2Events, int ShopMenuType) //TODO: probably move this somewhere else, not really Player:: stuff |
1004 { | |
1005 unsigned int idemId; // edx@1 | |
1006 signed int equipType; // esi@1 | |
1007 float multiplier; // ST04_4@26 | |
1008 int price; // edi@26 | |
1009 int merchantLevel; // [sp+10h] [bp-8h]@1 | |
1010 int itemValue; | |
1011 | |
1012 merchantLevel = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); | |
1013 idemId = pItem->uItemID; | |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1014 equipType = pItem->GetItemEquipType(); |
1386 | 1015 itemValue = pItem->GetValue(); |
1016 | |
1017 switch (building_type) | |
1018 { | |
1411 | 1019 case BuildingType_WeaponShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1020 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1021 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1022 if (equipType > EQUIP_BOW) |
1386 | 1023 return 4; |
1024 break; | |
1411 | 1025 case BuildingType_ArmorShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1026 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1027 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1028 if ( equipType < EQUIP_ARMOUR || equipType > EQUIP_BOOTS) |
1386 | 1029 return 4; |
1030 break; | |
1411 | 1031 case BuildingType_MagicShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1032 if (idemId >= ITEM_ARTIFACT_HERMES_SANDALS) |
1386 | 1033 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1034 if ( pItemsTable->pItems[idemId].uSkillType != PLAYER_SKILL_MISC ) |
1386 | 1035 return 4; |
1036 break; | |
1411 | 1037 case BuildingType_AlchemistShop: |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1038 if ((idemId >= ITEM_ARTIFACT_HERMES_SANDALS && idemId < ITEM_RECIPE_REJUVENATION) || idemId > ITEM_RECIPE_BODY_RESISTANCE) |
1386 | 1039 return 5; |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1040 if ( !(equipType == EQUIP_REAGENT || equipType == EQUIP_POTION || equipType == EQUIP_MESSAGE_SCROLL)) |
1386 | 1041 return 4; |
1042 break; | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1043 default: |
1545 | 1044 Error("(%u)", building_type); |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1045 break; |
1386 | 1046 } |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1047 if (pItem->IsStolen()) |
1386 | 1048 return 6; |
1049 | |
1050 multiplier = p2DEvents[BuildID_2Events - 1].fPriceMultiplier; | |
1051 switch (ShopMenuType) | |
1052 { | |
1053 case 2: | |
1054 price = GetBuyingPrice(itemValue, multiplier); | |
1055 break; | |
1056 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
|
1057 if (pItem->IsBroken()) |
1386 | 1058 price = 1; |
917 | 1059 else |
1386 | 1060 price = this->GetPriceSell(itemValue, multiplier); |
1061 break; | |
1062 case 4: | |
1063 price = this->GetPriceIdentification(multiplier); | |
1064 break; | |
1065 case 5: | |
1066 price = this->GetPriceRepair(itemValue, multiplier); | |
1387
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1067 break; |
297b6f192232
Player::SelectPhrasesTransaction finished, some constants changed to enum values, removed unused vars
Grumpy7
parents:
1386
diff
changeset
|
1068 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
|
1069 Error("(%u)", ShopMenuType); |
1386 | 1070 break; |
1071 } | |
1072 if ( merchantLevel ) | |
1073 { | |
1074 if (price == itemValue) | |
1075 { | |
1076 return 3; | |
1077 } | |
917 | 1078 else |
1386 | 1079 { |
1080 return 2; | |
1081 } | |
1082 } | |
0 | 1083 else |
1386 | 1084 { |
1085 return 1; | |
1086 } | |
0 | 1087 } |
1088 | |
1089 //----- (0049107D) -------------------------------------------------------- | |
1090 int Player::GetBodybuilding() | |
1091 { | |
1010 | 1092 int v1; // al@1 |
0 | 1093 |
1094 v1 = GetActualSkillLevel(PLAYER_SKILL_BODYBUILDING); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1095 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
|
1096 return multiplier * (v1 & 0x3F); |
0 | 1097 } |
1098 | |
1099 //----- (004910A8) -------------------------------------------------------- | |
607 | 1100 int Player::GetMeditation() |
0 | 1101 { |
1010 | 1102 int v1; // al@1 |
0 | 1103 |
1104 v1 = GetActualSkillLevel(PLAYER_SKILL_MEDITATION); | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1105 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
|
1106 return multiplier * (v1 & 0x3F); |
0 | 1107 } |
1108 | |
1109 //----- (004910D3) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1110 bool Player::CanIdentify( ItemGen *pItem ) |
0 | 1111 { |
1112 unsigned __int16 v2; // ax@1 | |
1113 int v5; // edi@7 | |
652 | 1114 if (CheckHiredNPCSpeciality(Scholar)) |
1115 return true; | |
0 | 1116 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1117 v2 = GetActualSkillLevel(PLAYER_SKILL_ITEM_ID); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1118 if ( (signed int)SkillToMastery(v2) >= 4 ) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1119 return true; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1120 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1121 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
|
1122 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1123 return v5 >= pItemsTable->pItems[pItem->uItemID].uItemID_Rep_St; |
0 | 1124 } |
1125 | |
1126 //----- (00491151) -------------------------------------------------------- | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1127 bool Player::CanRepair( ItemGen *pItem ) |
0 | 1128 { |
1129 unsigned __int16 v2; // ax@1 | |
1130 int v5; // edi@7 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1131 |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1132 ITEM_EQUIP_TYPE equipType = pItem->GetItemEquipType(); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1133 if (CheckHiredNPCSpeciality(Smith) && equipType <= 2 || |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1134 CheckHiredNPCSpeciality(Armorer) && equipType >= 3 && equipType <= 9 || |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1135 CheckHiredNPCSpeciality(Alchemist) && equipType >= 9 ) |
652 | 1136 return true; |
1137 | |
1010 | 1138 v2 = GetActualSkillLevel(PLAYER_SKILL_REPAIR); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1139 if ( (signed int)SkillToMastery(v2) >= 4 ) |
0 | 1140 return true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1141 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1142 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
|
1143 v5 = multiplier * (v2 & 0x3F); |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1144 return v5 >= pItemsTable->pItems[pItem->uItemID].uItemID_Rep_St; |
0 | 1145 } |
1146 | |
1147 //----- (004911F3) -------------------------------------------------------- | |
1148 int Player::GetMerchant() | |
1149 { | |
1150 unsigned __int16 v2; // ax@1 | |
1151 int v5; // edi@1 | |
1152 int v7; // eax@3 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1153 |
607 | 1154 v2 = GetActualSkillLevel(PLAYER_SKILL_MERCHANT); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1155 if ( SkillToMastery(v2) >= 4 ) |
0 | 1156 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1157 |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
1158 v7 = pParty->GetPartyReputation(); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1159 int multiplier = GetMultiplierForSkillLevel(v2, 1, 2, 3, 5); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1160 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1161 if (v5 == 0) |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1162 { |
0 | 1163 return -v7; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1164 } |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1165 return v5 - v7 + 7; |
0 | 1166 } |
1167 | |
1168 //----- (0049125A) -------------------------------------------------------- | |
1169 int Player::GetPerception() | |
1170 { | |
1171 unsigned __int16 v2; // ax@1 | |
1172 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1173 |
1010 | 1174 v2 = GetActualSkillLevel(PLAYER_SKILL_PERCEPTION); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1175 if ( SkillToMastery(v2) >= 4 ) |
0 | 1176 return 10000; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1177 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1178 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
|
1179 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1180 return v5; |
0 | 1181 } |
1182 | |
1183 //----- (004912B0) -------------------------------------------------------- | |
1184 int Player::GetDisarmTrap() | |
1185 { | |
1186 unsigned __int16 v2; // ax@1 | |
1187 int v5; // edi@1 | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1188 |
1010 | 1189 v2 = GetActualSkillLevel(PLAYER_SKILL_TRAP_DISARM); |
0 | 1190 if ( (signed int)SkillToMastery(v2) >= 4 ) |
1191 return 10000; | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1192 |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1193 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
|
1194 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
|
1195 multiplier++; |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1196 v5 = multiplier * (v2 & 0x3F); |
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1197 return v5; |
0 | 1198 } |
1199 | |
1200 //----- (00491317) -------------------------------------------------------- | |
1201 char Player::GetLearningPercent() | |
1202 { | |
1203 int v2; // eax@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_LEARNING); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
1206 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
|
1207 return multiplier * v2 + 9; |
0 | 1208 } |
1209 | |
1210 //----- (0048C6AF) -------------------------------------------------------- | |
1211 Player::Player() | |
1212 { | |
1213 memset(&pEquipment, 0, sizeof(PlayerEquipment)); | |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
1214 pInventoryMatrix.fill(0); |
0 | 1215 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
|
1216 pInventoryItemList[i].Reset(); |
0 | 1217 for (uint i = 0; i < 12; ++i) |
1218 pEquippedItems[i].Reset(); | |
1219 | |
1220 | |
1221 for (uint i = 0; i < 24; ++i) | |
1222 { | |
1223 pPlayerBuffs[i].uSkill = 0; | |
1224 pPlayerBuffs[i].uSkill = 0; | |
1225 pPlayerBuffs[i].uPower = 0; | |
1226 pPlayerBuffs[i].uExpireTime = 0; | |
1227 pPlayerBuffs[i].uCaster = 0; | |
1228 pPlayerBuffs[i].uFlags = 0; | |
1229 } | |
1230 | |
1231 pName[0] = 0; | |
1014 | 1232 uCurrentFace = 0; |
0 | 1233 uVoiceID = 0; |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
1234 pConditions.fill(0); |
0 | 1235 |
1236 field_BB = 0; | |
1237 | |
1238 uMight = uMightBonus = 0; | |
1239 uIntelligence = uIntelligenceBonus = 0; | |
1240 uWillpower = uWillpowerBonus = 0; | |
1241 uEndurance = uEnduranceBonus = 0; | |
1242 uSpeed = uSpeedBonus = 0; | |
1243 uAccuracy = uAccuracyBonus = 0; | |
1244 uLuck = uLuckBonus = 0; | |
1245 uLevel = sLevelModifier = 0; | |
1246 sAgeModifier = 0; | |
1388
60d4885eb107
sACModifier zeroed in player constructor so AC is not always 0(or -some value) ingame
Grumpy7
parents:
1387
diff
changeset
|
1247 sACModifier = 0; |
0 | 1248 |
1019 | 1249 // memset(field_1F5, 0, 30); |
1250 pure_luck_used=0; | |
1251 pure_speed_used=0; | |
1252 pure_intellect_used=0; | |
1253 pure_endurance_used=0; | |
1254 pure_willpower_used=0; | |
1255 pure_accuracy_used=0; | |
1256 pure_might_used=0; | |
0 | 1257 |
1258 sResFireBase = sResFireBonus = 0; | |
1259 sResAirBase = sResAirBonus = 0; | |
1260 sResWaterBase = sResWaterBonus = 0; | |
1261 sResEarthBase = sResEarthBonus = 0; | |
1262 sResMagicBase = sResMagicBonus = 0; | |
1263 sResSpiritBase = sResSpiritBonus = 0; | |
1264 sResMindBase = sResMindBonus = 0; | |
1265 sResBodyBase = sResBodyBonus = 0; | |
1266 sResLightBase = sResLightBonus = 0; | |
1267 sResDarkBase = sResDarkBonus = 0; | |
1268 | |
1269 uTimeToRecovery = 0; | |
1270 | |
1271 uSkillPoints = 0; | |
1272 | |
1273 sHealth = 0; | |
1274 uFullHealthBonus = 0; | |
1275 _health_related = 0; | |
1276 | |
1277 sMana = 0; | |
1278 uFullManaBonus = 0; | |
1279 _mana_related = 0; | |
1280 | |
1281 uQuickSpell = 0; | |
1826 | 1282 memset(pInstalledBeacons.data(), 0, 5 * sizeof(LloydBeacon)); |
0 | 1283 |
1284 _some_attack_bonus = 0; | |
1285 field_1A91 = 0; | |
1286 _melee_dmg_bonus = 0; | |
1287 field_1A93 = 0; | |
1288 _ranged_atk_bonus = 0; | |
1289 field_1A95 = 0; | |
1290 _ranged_dmg_bonus = 0; | |
1291 field_1A97 = 0; | |
1292 | |
130 | 1293 expression = CHARACTER_EXPRESSION_INVALID; |
0 | 1294 uExpressionTimePassed = 0; |
1295 uExpressionTimeLength = 0; | |
1296 | |
1297 uNumDivineInterventionCastsThisDay = 0; | |
1298 uNumArmageddonCasts = 0; | |
1299 uNumFireSpikeCasts = 0; | |
1300 | |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
1301 memset(field_1988, 0, sizeof(field_1988)); |
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
1302 memset(playerEventBits, 0, sizeof(playerEventBits)); |
0 | 1303 |
1304 field_E0 = 0; | |
1305 field_E4 = 0; | |
1306 field_E8 = 0; | |
1307 field_EC = 0; | |
1308 field_F0 = 0; | |
1309 field_F4 = 0; | |
1310 field_F8 = 0; | |
1311 field_FC = 0; | |
1312 field_100 = 0; | |
1313 field_104 = 0; | |
198 | 1314 |
554
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1315 _expression21_animtime = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1316 _expression21_frameset = 0; |
9caf59edb1ee
Cave and Temple load and even doesn't crash (for a while).
Nomad
parents:
521
diff
changeset
|
1317 |
198 | 1318 lastOpenedSpellbookPage = 0; |
0 | 1319 } |
1320 | |
1321 | |
1322 //----- (0048C855) -------------------------------------------------------- | |
1323 int Player::GetBaseStrength() | |
1324 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1325 return this->uMight + GetItemsBonus(CHARACTER_ATTRIBUTE_STRENGTH); |
0 | 1326 } |
1327 | |
1328 //----- (0048C86C) -------------------------------------------------------- | |
1329 int Player::GetBaseIntelligence() | |
1330 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1331 return this->uIntelligence + GetItemsBonus(CHARACTER_ATTRIBUTE_INTELLIGENCE); |
0 | 1332 } |
1333 | |
1334 //----- (0048C883) -------------------------------------------------------- | |
1335 int Player::GetBaseWillpower() | |
1336 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1337 return this->uWillpower + GetItemsBonus(CHARACTER_ATTRIBUTE_WILLPOWER); |
0 | 1338 } |
1339 | |
1340 //----- (0048C89A) -------------------------------------------------------- | |
1341 int Player::GetBaseEndurance() | |
1342 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1343 return this->uEndurance + GetItemsBonus(CHARACTER_ATTRIBUTE_ENDURANCE); |
0 | 1344 } |
1345 | |
1346 //----- (0048C8B1) -------------------------------------------------------- | |
1347 int Player::GetBaseAccuracy() | |
1348 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1349 return this->uAccuracy + GetItemsBonus(CHARACTER_ATTRIBUTE_ACCURACY); |
0 | 1350 } |
1351 | |
1352 //----- (0048C8C8) -------------------------------------------------------- | |
1353 int Player::GetBaseSpeed() | |
1354 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1355 return this->uSpeed + GetItemsBonus(CHARACTER_ATTRIBUTE_SPEED); |
0 | 1356 } |
1357 | |
1358 //----- (0048C8DF) -------------------------------------------------------- | |
1359 int Player::GetBaseLuck() | |
1360 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1361 return this->uLuck + GetItemsBonus(CHARACTER_ATTRIBUTE_LUCK); |
0 | 1362 } |
1363 | |
1364 //----- (0048C8F6) -------------------------------------------------------- | |
1365 int Player::GetBaseLevel() | |
1366 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1367 return this->uLevel + GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL); |
0 | 1368 } |
1369 | |
1370 //----- (0048C90D) -------------------------------------------------------- | |
1371 int Player::GetActualLevel() | |
1372 { | |
1373 return uLevel + sLevelModifier + | |
1374 GetMagicalBonus(CHARACTER_ATTRIBUTE_LEVEL) + | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1375 GetItemsBonus(CHARACTER_ATTRIBUTE_LEVEL); |
0 | 1376 } |
1377 | |
1378 //----- (0048C93C) -------------------------------------------------------- | |
1379 int Player::GetActualMight() | |
1380 { | |
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
|
1381 return GetActualAttribute(CHARACTER_ATTRIBUTE_STRENGTH, &Player::uMight, &Player::uMightBonus); |
0 | 1382 } |
1383 | |
1384 //----- (0048C9C2) -------------------------------------------------------- | |
1385 int Player::GetActualIntelligence() | |
1386 { | |
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
|
1387 return GetActualAttribute(CHARACTER_ATTRIBUTE_INTELLIGENCE, &Player::uIntelligence, &Player::uIntelligenceBonus); |
0 | 1388 } |
1389 | |
1390 //----- (0048CA3F) -------------------------------------------------------- | |
1391 int Player::GetActualWillpower() | |
1392 { | |
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
|
1393 return GetActualAttribute(CHARACTER_ATTRIBUTE_WILLPOWER, &Player::uWillpower, &Player::uWillpowerBonus); |
0 | 1394 } |
1395 | |
1396 //----- (0048CABC) -------------------------------------------------------- | |
1397 int Player::GetActualEndurance() | |
1398 { | |
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
|
1399 return GetActualAttribute(CHARACTER_ATTRIBUTE_ENDURANCE, &Player::uEndurance, &Player::uEnduranceBonus); |
0 | 1400 } |
1401 | |
1402 //----- (0048CB39) -------------------------------------------------------- | |
1403 int Player::GetActualAccuracy() | |
1404 { | |
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
|
1405 return GetActualAttribute(CHARACTER_ATTRIBUTE_ACCURACY, &Player::uAccuracy, &Player::uAccuracyBonus); |
0 | 1406 } |
1407 | |
1408 //----- (0048CBB6) -------------------------------------------------------- | |
1409 int Player::GetActualSpeed() | |
1410 { | |
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
|
1411 return GetActualAttribute(CHARACTER_ATTRIBUTE_SPEED, &Player::uSpeed, &Player::uSpeedBonus); |
0 | 1412 } |
1413 | |
1414 //----- (0048CC33) -------------------------------------------------------- | |
1415 int Player::GetActualLuck() | |
1416 { | |
1036 | 1417 signed int npc_luck_bonus; // [sp+10h] [bp-4h]@1 |
1418 | |
1419 npc_luck_bonus = 0; | |
652 | 1420 if ( CheckHiredNPCSpeciality(Fool) ) |
1036 | 1421 npc_luck_bonus = 5; |
652 | 1422 if ( CheckHiredNPCSpeciality(ChimneySweep) ) |
1036 | 1423 npc_luck_bonus += 20; |
652 | 1424 if ( CheckHiredNPCSpeciality(Psychic) ) |
1036 | 1425 npc_luck_bonus += 10; |
1324 | 1426 |
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
|
1427 return GetActualAttribute(CHARACTER_ATTRIBUTE_LUCK, &Player::uLuck, &Player::uLuckBonus) |
1325 | 1428 + npc_luck_bonus; |
1429 } | |
1430 | |
1431 //----- (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
|
1432 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
|
1433 { |
1324 | 1434 uint uActualAge = this->sAgeModifier + GetBaseAge(); |
1435 uint uAgeingMultiplier = 100; | |
1436 for (uint i = 0; i < 4; ++i) | |
1325 | 1437 { |
1324 | 1438 if (uActualAge >= pAgeingTable[i]) |
1325 | 1439 uAgeingMultiplier = pAgingAttributeModifier[attrId][i]; |
1440 else | |
1441 break; | |
1442 } | |
1443 | |
1980 | 1444 uchar uConditionMult = pConditionAttributeModifier[attrId][GetMajorConditionIdx()]; |
1325 | 1445 int magicBonus = GetMagicalBonus(attrId); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1446 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
|
1447 return uConditionMult * uAgeingMultiplier * this->*attrValue / 100 / 100 |
1325 | 1448 + 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
|
1449 + 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
|
1450 + this->*attrBonus; |
0 | 1451 } |
1452 | |
1453 //----- (0048CCF5) -------------------------------------------------------- | |
1684 | 1454 int Player::GetActualAttack( bool a2 ) |
0 | 1455 { |
1456 int v3; // eax@1 | |
1457 int v4; // edi@1 | |
1458 int v5; // ebx@1 | |
1459 int v6; // ebp@1 | |
1460 | |
1461 v3 = GetActualAccuracy(); | |
1036 | 1462 v4 = GetParameterBonus(v3); |
0 | 1463 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_ATTACK); |
1464 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
|
1465 return v4 + v5 + v6 + GetMagicalBonus(CHARACTER_ATTRIBUTE_ATTACK) + this->_some_attack_bonus; |
0 | 1466 } |
1467 | |
1468 //----- (0048CD45) -------------------------------------------------------- | |
1469 int Player::GetMeleeDamageMinimal() | |
1470 { | |
1471 int v2; // eax@1 | |
1472 int v3; // esi@1 | |
1473 int v4; // esi@1 | |
1474 int v5; // esi@1 | |
1475 signed int result; // eax@1 | |
1036 | 1476 |
0 | 1477 v2 = GetActualMight(); |
1036 | 1478 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1479 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN) + v3; |
0 | 1480 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v4; |
1036 | 1481 result = _melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
1482 if ( result < 1 ) | |
1483 result = 1; | |
0 | 1484 return result; |
1485 } | |
1486 | |
1487 //----- (0048CD90) -------------------------------------------------------- | |
1488 int Player::GetMeleeDamageMaximal() | |
1489 { | |
1490 int v2; // eax@1 | |
1491 int v3; // esi@1 | |
1492 int v4; // esi@1 | |
1493 int v5; // esi@1 | |
1494 int v6; // esi@1 | |
1495 signed int result; // eax@1 | |
1496 | |
1497 v2 = GetActualMight(); | |
1036 | 1498 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1499 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX) + v3; |
0 | 1500 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
|
1501 v6 = this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + v5; |
0 | 1502 result = 1; |
1503 if ( v6 >= 1 ) | |
1504 result = v6; | |
1505 return result; | |
1506 } | |
1507 | |
1508 //----- (0048CDDB) -------------------------------------------------------- | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1509 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
|
1510 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1511 int dmgSum; // esi@62 |
0 | 1512 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
|
1513 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
|
1514 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
|
1515 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1516 offHndWpnDmg = 0; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1517 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
|
1518 if ( IsUnarmed() ) |
0 | 1519 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1520 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
|
1521 } |
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
|
1522 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
|
1523 { |
1989 | 1524 if ( HasItemEquipped(EQUIP_TWO_HANDED) ) |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1525 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1526 ItemGen *mainHandItemGen = this->GetMainHandItem(); |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1527 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
|
1528 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
|
1529 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
|
1530 addOneDice = true; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1531 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
|
1532 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1533 if ( !ignoreOffhand ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1534 { |
1989 | 1535 if ( this->HasItemEquipped(EQUIP_SINGLE_HANDED) ) |
0 | 1536 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1537 ItemGen *offHandItemGen = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uShield - 1]; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1538 if ( offHandItemGen->GetItemEquipType() != EQUIP_SHIELD ) |
0 | 1539 { |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1540 offHndWpnDmg = CalculateMeleeDmgToEnemyWithWeapon(offHandItemGen, uTargetActorID, false); |
0 | 1541 } |
1542 } | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1543 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1544 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1545 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
|
1546 if ( !ignoreSkillBonus ) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1547 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1548 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
|
1549 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
|
1550 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
|
1551 dmgSum += this->_melee_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS) + mightAndSkillbonus; |
0 | 1552 } |
1553 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
|
1554 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
|
1555 result = dmgSum; |
0 | 1556 return result; |
1557 } | |
1558 | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1559 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1560 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
|
1561 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1562 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
|
1563 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
|
1564 if (addOneDice) |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1565 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1566 diceCount++; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1567 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1568 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
|
1569 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
|
1570 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
|
1571 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1572 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
|
1573 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1574 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
|
1575 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
|
1576 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1577 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
|
1578 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
|
1579 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1580 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1581 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1582 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
|
1583 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1584 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1585 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1586 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
|
1587 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1588 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1589 } |
1822 | 1590 else if (MonsterStats::BelongsToSupertype(uTargetActorID, MONSTER_SUPERTYPE_ELF) && ( enchType == 63 || itemId == ITEM_RELIC_OLD_NICK)) |
1591 { | |
1592 totalDmg *= 2; | |
1593 } | |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1594 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
|
1595 { |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1596 totalDmg *= 2; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1597 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1598 } |
2197 | 1599 if ( (signed int)SkillToMastery(this->pActiveSkills[PLAYER_SKILL_DAGGER]) >= 3 |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1600 && 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
|
1601 && 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
|
1602 totalDmg *= 3; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1603 return totalDmg; |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1604 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1605 |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1606 |
0 | 1607 //----- (0048D0B9) -------------------------------------------------------- |
1608 int Player::GetRangedAttack() | |
1609 { | |
1610 int v3; // edi@3 | |
2046 | 1611 //int v4; // eax@4 |
1612 //int v5; // edi@4 | |
0 | 1613 int v6; // edi@4 |
1614 int v7; // edi@4 | |
1615 | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1616 ItemGen* mainHandItem = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1617 if ( mainHandItem != nullptr && ( mainHandItem->uItemID < ITEM_BLASTER || mainHandItem->uItemID > ITEM_LASER_RIFLE )) |
0 | 1618 { |
2046 | 1619 //v4 = GetActualAccuracy(); |
1620 //v5 = GetParameterBonus(GetActualAccuracy()); | |
1621 v6 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + GetParameterBonus(GetActualAccuracy()); | |
0 | 1622 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
|
1623 v3 = this->_ranged_atk_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_ATTACK) + v7; |
0 | 1624 } |
1625 else | |
1626 { | |
1684 | 1627 v3 = GetActualAttack(true); |
0 | 1628 } |
1629 return v3; | |
1630 } | |
1631 | |
1632 //----- (0048D124) -------------------------------------------------------- | |
1633 int Player::GetRangedDamageMin() | |
1634 { | |
1635 int v2; // edi@1 | |
1636 int v3; // edi@1 | |
1637 int v4; // edi@1 | |
1638 int result; // eax@6 | |
1639 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1640 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MIN); |
1040 | 1641 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
|
1642 v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; |
0 | 1643 if ( v4 >= 1 ) |
1644 result = v4; | |
1645 else | |
1646 result = 0; | |
1647 return result; | |
1648 } | |
1649 | |
1650 //----- (0048D191) -------------------------------------------------------- | |
1651 int Player::GetRangedDamageMax() | |
1652 { | |
1653 int v2; // edi@1 | |
1654 int v3; // edi@1 | |
1655 int v4; // edi@1 | |
1656 int result; // eax@6 | |
1657 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1658 v2 = GetItemsBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_MAX); |
1040 | 1659 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
|
1660 v4 = this->_ranged_dmg_bonus + GetMagicalBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS) + v3; |
0 | 1661 if ( v4 >= 1 ) |
1662 result = v4; | |
1663 else | |
1664 result = 0; | |
1665 return result; | |
1666 } | |
1667 | |
1668 //----- (0048D1FE) -------------------------------------------------------- | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1669 int Player::CalculateRangedDamageTo( int a2 ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1670 { |
0 | 1671 ItemGen *v4; // ebx@2 |
1672 unsigned int v5; // edi@2 | |
1673 int v9; // esi@5 | |
1674 int v10; // ebx@6 | |
1675 signed int v15; // [sp+8h] [bp-Ch]@2 | |
1676 int v17; // [sp+10h] [bp-4h]@1 | |
1677 | |
1678 v17 = 0; | |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1679 if ( !HasItemEquipped(EQUIP_BOW) ) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1680 return 0; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1681 v4 = (ItemGen *)&this->pInventoryItemList[this->pEquipment.uBow-1]; |
0 | 1682 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
|
1683 v15 = pItemsTable->pItems[v5].uDamageRoll; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1684 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
|
1685 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1686 int v7 = rand() % v15; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1687 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
|
1688 } |
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1689 v9 = pItemsTable->pItems[v5].uDamageMod + v17; |
0 | 1690 if ( a2 ) |
1691 { | |
377 | 1692 v10 = v4->uSpecEnchantmentType; |
1551
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1693 if ( v10 == 64 && MonsterStats::BelongsToSupertype(a2, MONSTER_SUPERTYPE_UNDEAD)) |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1694 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1695 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1696 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1697 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
|
1698 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1699 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1700 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1701 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
|
1702 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1703 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1704 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1705 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
|
1706 { |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1707 v9 *= 2; |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1708 } |
a9e8d2a7abb5
Player::CalculateRangedDamageTo, finishing cleanup accidentally commited in previous commit
Grumpy7
parents:
1550
diff
changeset
|
1709 } |
1550
cdb7fafede0c
Player::CalculateMeleeDamageTo extracted 2 almost identical sections to a separate function, variable cleanup, changed parameter types
Grumpy7
parents:
1549
diff
changeset
|
1710 return v9 + this->GetSkillBonus(CHARACTER_ATTRIBUTE_RANGED_DMG_BONUS); |
0 | 1711 } |
1712 | |
1713 //----- (0048D2EA) -------------------------------------------------------- | |
1714 char *Player::GetMeleeDamageString() | |
1715 { | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1716 int min_damage; // edi@3 |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1717 int max_damage; // eax@3 |
0 | 1718 |
1719 static char player__getmeleedamagestring_static_buff[40]; // idb | |
1720 | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1721 ItemGen* mainHandItem = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1722 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1723 if (mainHandItem != nullptr && ( mainHandItem->uItemID >= 135 ) && ( mainHandItem->uItemID <= 159 )) |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1724 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1725 strcpy(player__getmeleedamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1726 return player__getmeleedamagestring_static_buff; |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1727 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1728 else if (mainHandItem != nullptr && (mainHandItem->uItemID == ITEM_BLASTER || mainHandItem->uItemID == ITEM_LASER_RIFLE)) |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1729 { |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1730 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1731 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true); |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1732 } |
0 | 1733 else |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1734 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1735 min_damage = GetMeleeDamageMinimal(); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1736 max_damage = GetMeleeDamageMaximal(); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1737 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1738 if ( min_damage == max_damage ) |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1739 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1740 sprintf(player__getmeleedamagestring_static_buff, "%d", min_damage); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1741 } |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1742 else |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1743 { |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1744 sprintf(player__getmeleedamagestring_static_buff, "%d - %d", min_damage, max_damage); |
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1745 } |
1036 | 1746 return player__getmeleedamagestring_static_buff; |
0 | 1747 } |
1748 | |
1749 //----- (0048D396) -------------------------------------------------------- | |
1750 char *Player::GetRangedDamageString() | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1751 { |
1036 | 1752 int min_damage; // edi@3 |
1753 int max_damage; // eax@3 | |
1754 | |
1755 static char player__getrangeddamagestring_static_buff[40]; // idb | |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1756 |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1757 ItemGen* mainHandItem = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1758 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1759 if (mainHandItem != nullptr && ( mainHandItem->uItemID >= 135 ) && ( mainHandItem->uItemID <= 159 )) |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1760 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1761 strcpy(player__getrangeddamagestring_static_buff, pGlobalTXT_LocalizationStrings[595]); //"Wand" |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1762 return player__getrangeddamagestring_static_buff; |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1763 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1764 else if (mainHandItem != nullptr && (mainHandItem->uItemID == ITEM_BLASTER || mainHandItem->uItemID == ITEM_LASER_RIFLE)) |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1765 { |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1766 min_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MIN, true); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
1767 max_damage = GetItemsBonus(CHARACTER_ATTRIBUTE_MELEE_DMG_MAX, true); |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1768 } |
0 | 1769 else |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1770 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1771 min_damage = GetRangedDamageMin(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1772 max_damage = GetRangedDamageMax(); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1773 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1774 if ( max_damage > 0) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1775 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1776 if ( min_damage == max_damage ) |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1777 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1778 sprintf(player__getrangeddamagestring_static_buff, "%d", min_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1779 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1780 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1781 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1782 sprintf(player__getrangeddamagestring_static_buff, "%d - %d", min_damage, max_damage); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1783 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1784 } |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1785 else |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1786 { |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1787 strcpy(player__getrangeddamagestring_static_buff, "N/A"); |
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1788 } |
1036 | 1789 return player__getrangeddamagestring_static_buff; |
1547
778916dfa666
Player::GetRangedDamageString fix + some small chnages
Grumpy7
parents:
1539
diff
changeset
|
1790 } |
0 | 1791 |
1792 //----- (0048D45A) -------------------------------------------------------- | |
1793 bool Player::CanTrainToNextLevel() | |
1794 { | |
1565
58420268d87d
fixing Player::GetMeleeDamageString and Player::CanTrainToNextLevel
Grumpy7
parents:
1564
diff
changeset
|
1795 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
|
1796 int neededExp = ((lvl * (lvl - 1)) / 2 * 1000); |
1564 | 1797 return this->uExperience >= neededExp; |
0 | 1798 } |
1799 | |
1800 //----- (0048D498) -------------------------------------------------------- | |
1801 unsigned int Player::GetExperienceDisplayColor() | |
1802 { | |
1803 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
|
1804 return ui_character_bonus_text_color; |
0 | 1805 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
|
1806 return ui_character_default_text_color; |
0 | 1807 } |
1808 | |
1809 //----- (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
|
1810 int Player::CalculateIncommingDamage( DAMAGE_TYPE dmg_type, int dmg ) |
1561 | 1811 { |
1036 | 1812 int resist_value; // edi@8 |
1813 int player_luck; // eax@21 | |
1814 signed int res_rand_divider; // ebx@2 | |
1815 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
|
1816 |
1560
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1817 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
|
1818 return 0; |
a0cd6465ae0d
Player::CalculateIncommingDamage, liches shouldn't be immune to damage if above 200 resistance to it
Grumpy7
parents:
1559
diff
changeset
|
1819 |
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
|
1820 resist_value = 0; |
1036 | 1821 switch(dmg_type) |
1822 { | |
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
|
1823 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
|
1824 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
|
1825 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
|
1826 case DMGT_EARTH: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); break; |
1036 | 1827 |
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
|
1828 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
|
1829 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
|
1830 case DMGT_BODY: resist_value = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); break; |
1036 | 1831 } |
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
|
1832 |
1036 | 1833 player_luck = GetActualLuck(); |
1834 res_rand_divider = GetParameterBonus(player_luck) + resist_value + 30; | |
1835 | |
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
|
1836 if ( GetParameterBonus(player_luck) + resist_value > 0 ) |
1036 | 1837 { |
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
|
1838 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
|
1839 { |
1036 | 1840 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
|
1841 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
|
1842 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
|
1843 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
|
1844 } |
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
|
1845 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1846 ItemGen* equippedArmor = GetArmorItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1847 if (( dmg_type == DMGT_PHISYCAL ) && ( equippedArmor != nullptr )) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1848 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1849 if (!equippedArmor->IsBroken()) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1850 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1851 armor_skill = equippedArmor->GetPlayerSkillType(); |
1036 | 1852 if ( armor_skill==PLAYER_SKILL_PLATE ) |
0 | 1853 { |
1036 | 1854 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
|
1855 return dmg / 2; |
0 | 1856 } |
1036 | 1857 if (armor_skill==PLAYER_SKILL_CHAIN ) |
0 | 1858 { |
1036 | 1859 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
|
1860 return dmg * 2 / 3; |
0 | 1861 } |
1862 } | |
1036 | 1863 } |
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
|
1864 return dmg; |
0 | 1865 } |
1866 | |
1867 //----- (0048D62C) -------------------------------------------------------- | |
816 | 1868 ITEM_EQUIP_TYPE Player::GetEquippedItemEquipType(ITEM_EQUIP_TYPE uEquipSlot) |
1869 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1870 return GetNthEquippedIndexItem(uEquipSlot)->GetItemEquipType(); |
0 | 1871 } |
1872 | |
1873 //----- (0048D651) -------------------------------------------------------- | |
816 | 1874 PLAYER_SKILL_TYPE Player::GetEquippedItemSkillType(ITEM_EQUIP_TYPE uEquipSlot) |
1875 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1876 return (PLAYER_SKILL_TYPE)GetNthEquippedIndexItem(uEquipSlot)->GetPlayerSkillType(); |
0 | 1877 } |
1878 | |
1879 //----- (0048D676) -------------------------------------------------------- | |
1880 bool Player::IsUnarmed() | |
1881 { | |
1989 | 1882 return !HasItemEquipped(EQUIP_TWO_HANDED) && |
1883 (!HasItemEquipped(EQUIP_SINGLE_HANDED) || GetOffHandItem()->GetItemEquipType() == EQUIP_SHIELD); | |
0 | 1884 } |
1885 | |
1886 //----- (0048D6AA) -------------------------------------------------------- | |
1887 bool Player::HasItemEquipped(ITEM_EQUIP_TYPE uEquipIndex) | |
1888 { | |
1980 | 1889 uint i = pEquipment.pIndices[uEquipIndex]; |
0 | 1890 if (i) |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1891 return !pOwnItems[i - 1].IsBroken(); |
1036 | 1892 else |
1893 return false; | |
0 | 1894 } |
1895 | |
1896 //----- (0048D6D0) -------------------------------------------------------- | |
1897 bool Player::HasEnchantedItemEquipped(int uEnchantment) | |
1898 { | |
1899 for (uint i = 0; i < 16; ++i) | |
1900 { | |
1901 if (HasItemEquipped((ITEM_EQUIP_TYPE)i) && | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1902 GetNthEquippedIndexItem(i)->uSpecEnchantmentType == uEnchantment) |
0 | 1903 return true; |
1904 } | |
1905 return false; | |
1906 } | |
1907 | |
1908 //----- (0048D709) -------------------------------------------------------- | |
1080 | 1909 bool Player::WearsItem( int item_id, ITEM_EQUIP_TYPE equip_type ) |
1563 | 1910 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
1911 return ( HasItemEquipped(equip_type) && GetNthEquippedIndexItem(equip_type)->uItemID == item_id ); |
1563 | 1912 } |
1913 | |
1914 bool Player::WearsItemAnyWhere(int item_id) | |
1915 { | |
1916 for (int i = 0; i < 16; i++) | |
1917 { | |
1918 if (WearsItem(item_id, (ITEM_EQUIP_TYPE) i)) | |
1919 { | |
1920 return true; | |
1921 } | |
1922 } | |
1923 return false; | |
0 | 1924 } |
1925 | |
1926 //----- (0048D76C) -------------------------------------------------------- | |
1686 | 1927 int Player::StealFromShop( ItemGen *itemToSteal, int extraStealDifficulty, int reputation, int a5, int *fineIfFailed ) //returns an int, but is the return value is compared to zero, so might change to bool |
0 | 1928 { |
1929 unsigned __int16 v6; // cx@8 | |
1930 int v7; // edi@8 | |
1931 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
|
1932 unsigned int itemvalue; // esi@8 |
0 | 1933 int v10; // eax@8 |
1686 | 1934 int currMaxItemValue; // edi@12 |
0 | 1935 |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1936 if ( !itemToSteal |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
1937 || this->IsEradicated() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
1938 || this->IsDead() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
1939 || this->IsPertified() |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1940 || this->IsDrunk() |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
1941 || this->IsUnconcious() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
1942 || this->IsAsleep() ) |
0 | 1943 { |
1686 | 1944 return 0; |
0 | 1945 } |
1946 else | |
1947 { | |
2197 | 1948 v6 = this->pActiveSkills[PLAYER_SKILL_STEALING]; |
0 | 1949 v7 = v6 & 0x3F; |
1950 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
|
1951 itemvalue = itemToSteal->GetValue(); |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
1952 v10 = itemToSteal->GetItemEquipType(); |
1989 | 1953 if ( v10 == EQUIP_SINGLE_HANDED || v10 == EQUIP_TWO_HANDED || v10 == EQUIP_BOW ) |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
1954 itemvalue *= 3; |
1686 | 1955 currMaxItemValue = StealingRandomBonuses[rand() % 5] + v7 * StealingMasteryBonuses[v8]; |
1956 *fineIfFailed = 100 * (reputation + extraStealDifficulty) + itemvalue; | |
1957 if (a5) | |
1958 { | |
1959 *fineIfFailed += 500; | |
1960 } | |
0 | 1961 if ( rand() % 100 >= 5 ) |
1962 { | |
1686 | 1963 if ( *fineIfFailed > currMaxItemValue ) |
1964 if (*fineIfFailed - currMaxItemValue < 500) | |
1965 { | |
1966 return 1; | |
1967 } | |
1968 else | |
1969 { | |
1970 return 0; | |
1971 } | |
0 | 1972 else |
1686 | 1973 return 2; |
0 | 1974 } |
1975 else | |
1976 { | |
1686 | 1977 return 0; |
1978 } | |
1979 } | |
0 | 1980 } |
1981 | |
1982 //----- (0048D88B) -------------------------------------------------------- | |
1983 int Player::StealFromActor(unsigned int uActorID, int _steal_perm, int reputation) | |
1984 { | |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1985 Actor *actroPtr; // edi@1 |
0 | 1986 int v7; // ebx@10 |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1987 unsigned int stealingMastery; // esi@10 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1988 int fineIfFailed; // esi@10 |
0 | 1989 int v11; // eax@13 |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1990 bool HasFullItemSlots; // ebx@15 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1991 unsigned __int16 carriedItemId; // si@21 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1992 unsigned int enchBonusSum; // esi@31 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1993 int *enchTypePtr; // eax@34 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1994 ItemGen tempItem; // [sp+8h] [bp-34h]@15 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1995 int currMaxItemValue; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1996 |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1997 actroPtr = &pActors[uActorID]; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1998 if ( !actroPtr |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
1999 || this->IsEradicated() |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2000 || this->IsDead() |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2001 || this->IsPertified() |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2002 || this->IsDrunk() |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2003 || this->IsUnconcious() |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2004 || this->IsAsleep() ) |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2005 { |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2006 return 0; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2007 } |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2008 if ( !(BYTE2(actroPtr->uAttributes) & 0x80) ) |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2009 actroPtr->SetRandomGoldIfTheresNoItem(); |
2197 | 2010 unsigned __int16 v6 = this->pActiveSkills[PLAYER_SKILL_STEALING]; |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2011 v7 = v6 & 0x3F; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2012 stealingMastery = SkillToMastery(v6); |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2013 int v30 = StealingMasteryBonuses[stealingMastery]; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2014 int v29 = StealingRandomBonuses[rand() % 5]; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2015 fineIfFailed = actroPtr->pMonsterInfo.uLevel + 100 * (_steal_perm + reputation); |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2016 currMaxItemValue = v29 + v7 * v30; |
1783 | 2017 if ( rand() % 100 < 5 || fineIfFailed > currMaxItemValue || BYTE2(actroPtr->uAttributes) & 8 ) |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2018 { |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2019 Actor::AggroSurroundingPeasants(uActorID, 1); |
2203 | 2020 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[376], this->pName);//"%s was caught stealing!" |
2021 ShowStatusBarString(pTmpBuf2.data(), 2); | |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2022 return 0; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2023 } |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2024 else |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2025 { |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2026 v11 = rand(); |
1688 | 2027 if ( v11 % 100 >= 70 ) //stealing gold |
2028 { | |
2029 enchBonusSum = 0; | |
2030 for (int i = 0; i < v7; i++) | |
2031 enchBonusSum += rand() % StealingEnchantmentBonusForSkill[stealingMastery] + 1; | |
2276 | 2032 if ( actroPtr->ActorHasItems[3].GetItemEquipType() != EQUIP_GOLD ) |
1688 | 2033 return 2; |
2276 | 2034 enchTypePtr = &actroPtr->ActorHasItems[3].uSpecEnchantmentType; |
1688 | 2035 if ( (int)enchBonusSum >= *enchTypePtr ) |
2036 { | |
2276 | 2037 actroPtr->ActorHasItems[3].uItemID = 0; |
1688 | 2038 *enchTypePtr = 0; |
2039 } | |
2040 else | |
2041 *enchTypePtr -= enchBonusSum; | |
2042 if ( enchBonusSum ) | |
2043 { | |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
2044 pParty->PartyFindsGold(enchBonusSum, 2); |
1688 | 2045 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], this->pName, enchBonusSum); //%stole %d gold |
2046 } | |
2047 else | |
2048 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything | |
2203 | 2049 ShowStatusBarString(pTmpBuf2.data(), 2); |
1688 | 2050 return 2; |
2051 } | |
2052 else if ( v11 % 100 >= 40 ) //stealing an item | |
2053 { | |
2054 tempItem.Reset(); | |
2055 HasFullItemSlots = false; | |
2056 int i; | |
2057 for (i = 0; i < 4; i++) | |
2058 { | |
2276 | 2059 if ( actroPtr->ActorHasItems[i].uItemID != 0 && actroPtr->ActorHasItems[i].GetItemEquipType() != EQUIP_GOLD ) |
1688 | 2060 break; |
2061 } | |
2062 if (i == 4) | |
2063 HasFullItemSlots = true; | |
2064 carriedItemId = actroPtr->uCarriedItemID; | |
2065 if ( carriedItemId != 0 || HasFullItemSlots ) | |
2066 { | |
2067 tempItem.Reset(); | |
2068 if ( carriedItemId != 0 ) | |
0 | 2069 { |
1688 | 2070 actroPtr->uCarriedItemID = 0; |
2071 tempItem.uItemID = carriedItemId; | |
2072 if ( pItemsTable->pItems[carriedItemId].uEquipType == EQUIP_WAND ) | |
2073 tempItem.uNumCharges = rand() % 6 + pItemsTable->pItems[carriedItemId].uDamageMod + 1; | |
2074 else if ( pItemsTable->pItems[carriedItemId].uEquipType == EQUIP_POTION && carriedItemId != ITEM_POTION_BOTTLE) | |
2075 tempItem.uEnchantmentType = 2 * rand() % 4 + 2; | |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2076 } |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2077 else |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2078 { |
2276 | 2079 ItemGen* itemToSteal = &actroPtr->ActorHasItems[rand() % 4]; |
1688 | 2080 memcpy(&tempItem, itemToSteal, sizeof(tempItem)); |
2081 itemToSteal->Reset(); | |
2082 carriedItemId = tempItem.uItemID; | |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2083 } |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2084 if (carriedItemId != 0) // looks odd in current context, but avoids accessing zeroth element of pItemsTable->pItems |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2085 { |
1829
e4e27261d84e
sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents:
1828
diff
changeset
|
2086 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2087 sprintf( |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2088 pTmpBuf2.data(), |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2089 pGlobalTXT_LocalizationStrings[304], // Official //TODO: add a normal "%d stole %d" message |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2090 this->pName, |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2091 pItemsTable->pItems[carriedItemId].pUnidentifiedName); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2092 ShowStatusBarString(pTmpBuf2.data(), 2u); |
1829
e4e27261d84e
sub_421B2C_PlaceInInventory_or_DropPickedItem to Party::sub_421B2C_PlaceInInventory_or_DropPickedItem
Grumpy7
parents:
1828
diff
changeset
|
2093 pParty->sub_421B2C_PlaceInInventory_or_DropPickedItem(); |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2094 memcpy(&pParty->pPickedItem, &tempItem, sizeof(ItemGen)); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2095 pMouse->SetCursorBitmapFromItemID(carriedItemId); |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2096 return 2; |
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2097 } |
0 | 2098 } |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2099 } |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2100 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[377], this->pName); //%s failed to steal anything |
2203 | 2101 ShowStatusBarString(pTmpBuf2.data(), 2); |
1687
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2102 return 2; |
5f01f1ed97f4
Player::StealFromActor cleanup, renamed UIMSG_1B to UIMSG_STEALFROMACTOR
Grumpy7
parents:
1686
diff
changeset
|
2103 } |
0 | 2104 } |
2105 // 4EDEA0: using guessed type int dword_4EDEA0[]; | |
2106 // 4EDEB4: using guessed type int dword_4EDEB4[]; | |
2107 // 4EDEC4: using guessed type int dword_4EDEC4[]; | |
2108 | |
2109 //----- (0048DBB9) -------------------------------------------------------- | |
2110 void Player::Heal(int amount) | |
2111 { | |
1010 | 2112 signed int max_health; // eax@3 |
2113 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2114 if ( !IsEradicated() && !IsDead() ) |
1010 | 2115 { |
2116 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
|
2117 if ( IsZombie() ) |
1010 | 2118 max_health /= 2; |
2119 sHealth += amount; | |
2120 if ( sHealth > max_health ) | |
2121 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
|
2122 if ( IsUnconcious() ) |
1010 | 2123 { |
2124 if ( sHealth > 0 ) | |
2125 { | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2126 SetUnconcious(false); |
0 | 2127 } |
2128 } | |
2129 } | |
2130 } | |
2131 | |
2132 //----- (0048DC1E) -------------------------------------------------------- | |
1036 | 2133 int Player::ReceiveDamage( signed int amount, DAMAGE_TYPE dmg_type ) |
2134 { | |
2135 signed int recieved_dmg; // eax@1 | |
2136 bool broke_armor; | |
2137 | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2138 SetAsleep(false); |
1036 | 2139 recieved_dmg = CalculateIncommingDamage(dmg_type, amount); |
2140 sHealth -= recieved_dmg; | |
2141 broke_armor = sHealth <= -10; | |
2142 if ( sHealth < 1 ) // | |
2143 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2144 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
|
2145 || 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
|
2146 { |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2147 SetCondUnconsciousWithBlockCheck(false); |
0 | 2148 } |
2149 else | |
2150 { | |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
2151 SetCondDeadWithBlockCheck(false); |
1036 | 2152 if ( sHealth > 0 ) |
2153 sHealth = 0; | |
2154 } | |
2155 if (broke_armor ) | |
2156 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2157 ItemGen* equippedArmor = GetArmorItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2158 if ( equippedArmor != nullptr ) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2159 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2160 if ( !(equippedArmor->uAttributes & ITEM_HARDENED)) |
0 | 2161 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2162 equippedArmor->SetBroken(); |
0 | 2163 } |
2164 } | |
2165 } | |
2166 } | |
1036 | 2167 if ( recieved_dmg && CanAct() ) |
187 | 2168 PlaySound(SPEECH_24, 0); |
1036 | 2169 return recieved_dmg; |
0 | 2170 } |
2171 | |
2172 //----- (0048DCF6) -------------------------------------------------------- | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2173 int Player::ReceiveSpecialAttackEffect( int attType, struct Actor *pActor ) |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2174 { |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2175 SPECIAL_ATTACK_TYPE attTypeCast = (SPECIAL_ATTACK_TYPE) attType; |
0 | 2176 signed int v3; // edi@1 |
2177 signed int v4; // ebx@1 | |
2178 int v6; // eax@2 | |
2179 int v8; // eax@8 | |
2180 int v10; // eax@8 | |
2181 int v11; // ebx@8 | |
2182 ItemGen *v13; // eax@9 | |
2183 int v22; // eax@49 | |
2184 signed int v23; // ebx@49 | |
2185 void *v27; // ecx@76 | |
2186 char v46[140]; // [sp+Ch] [bp-94h]@13 | |
2187 unsigned int v47; // [sp+98h] [bp-8h]@1 | |
1692 | 2188 ItemGen* v48; // [sp+9Ch] [bp-4h]@1 |
2189 | |
0 | 2190 v4 = 0; |
2191 v47 = 0; | |
1783 | 2192 v48 = nullptr; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2193 switch ( attTypeCast ) |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2194 { |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2195 case SPECIAL_ATTACK_CURSE: |
0 | 2196 v6 = GetActualWillpower(); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2197 v11 = GetParameterBonus(v6); |
1690 | 2198 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2199 case SPECIAL_ATTACK_WEAK: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2200 case SPECIAL_ATTACK_SLEEP: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2201 case SPECIAL_ATTACK_DRUNK: |
2187 | 2202 case SPECIAL_ATTACK_DISEASE_WEAK: |
2203 case SPECIAL_ATTACK_DISEASE_MEDIUM: | |
2204 case SPECIAL_ATTACK_DISEASE_SEVERE: | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2205 case SPECIAL_ATTACK_UNCONSCIOUS: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2206 case SPECIAL_ATTACK_AGING: |
0 | 2207 v6 = GetActualEndurance(); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2208 v11 = GetParameterBonus(v6); |
1690 | 2209 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2210 case SPECIAL_ATTACK_INSANE: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2211 case SPECIAL_ATTACK_PARALYZED: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2212 case SPECIAL_ATTACK_FEAR: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2213 v11 = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); |
1690 | 2214 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2215 case SPECIAL_ATTACK_PETRIFIED: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2216 v11 = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); |
1690 | 2217 break; |
2187 | 2218 case SPECIAL_ATTACK_POISON_WEAK: |
2219 case SPECIAL_ATTACK_POISON_MEDIUM: | |
2220 case SPECIAL_ATTACK_POISON_SEVERE: | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2221 case SPECIAL_ATTACK_DEAD: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2222 case SPECIAL_ATTACK_ERADICATED: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2223 v11 = GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); |
1690 | 2224 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2225 case SPECIAL_ATTACK_MANA_DRAIN: |
0 | 2226 v8 = GetActualWillpower(); |
2227 v10 = GetActualIntelligence(); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2228 v11 = (GetParameterBonus(v10) + GetParameterBonus(v8)) / 2; |
0 | 2229 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2230 case SPECIAL_ATTACK_BREAK_ANY: |
1692 | 2231 for (int i = 0; i < 138; i++) |
2232 { | |
2233 v13 = &this->pInventoryItemList[i]; | |
2234 if ( v13->uItemID > 0 && v13->uItemID <= 134 && !v13->IsBroken()) | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2235 v46[v4++] = i; |
1692 | 2236 } |
1690 | 2237 if ( !v4 ) |
2238 return 0; | |
1692 | 2239 v48 = &this->pInventoryItemList[v46[rand() % v4]]; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2240 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + v48->GetDamageMod()); |
1690 | 2241 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2242 case SPECIAL_ATTACK_BREAK_ARMOR: |
1692 | 2243 for (int i = 0; i < 16; i++ ) |
0 | 2244 { |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2245 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
0 | 2246 { |
1692 | 2247 if ( i == EQUIP_ARMOUR ) |
2248 v46[v4++] = this->pEquipment.uArmor - 1; | |
1989 | 2249 if ( (i == EQUIP_SINGLE_HANDED || i == EQUIP_TWO_HANDED) && GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i) == EQUIP_SHIELD ) |
1692 | 2250 v46[v4++] = this->pEquipment.pIndices[i] - 1; |
0 | 2251 } |
1692 | 2252 } |
1690 | 2253 if ( !v4 ) |
2254 return 0; | |
1692 | 2255 v48 = &this->pInventoryItemList[v46[rand() % v4]]; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2256 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + v48->GetDamageMod()); |
1690 | 2257 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2258 case SPECIAL_ATTACK_BREAK_WEAPON: |
1692 | 2259 for (int i = 0; i < 16; i++ ) |
0 | 2260 { |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2261 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
0 | 2262 { |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2263 if ( i == EQUIP_BOW ) |
1690 | 2264 v46[v4++] = LOBYTE(this->pEquipment.uBow) - 1; |
1989 | 2265 if ( (i == EQUIP_SINGLE_HANDED || i == EQUIP_TWO_HANDED) |
2266 && (GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i) == EQUIP_SINGLE_HANDED || GetEquippedItemEquipType((ITEM_EQUIP_TYPE)i) == EQUIP_TWO_HANDED) ) | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2267 v46[v4++] = this->pEquipment.pIndices[i] - 1; |
0 | 2268 } |
1692 | 2269 } |
0 | 2270 if ( !v4 ) |
1690 | 2271 return 0; |
1692 | 2272 v48 = &this->pInventoryItemList[v46[rand() % v4]]; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2273 v11 = 3 * (pItemsTable->pItems[v48->uItemID].uMaterial + v48->GetDamageMod()); |
0 | 2274 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2275 case SPECIAL_ATTACK_STEAL: |
1692 | 2276 for ( int i = 0; i < 126; i++ ) |
2277 { | |
2278 int ItemPosInList = this->pInventoryMatrix[i]; | |
2279 if (ItemPosInList > 0) | |
0 | 2280 { |
1692 | 2281 ItemGen* v21 = &this->pInventoryItemList[ItemPosInList - 1]; |
2282 if ( v21->uItemID > 0 && v21->uItemID <= 134 ) | |
0 | 2283 { |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2284 v46[v4++] = i; |
0 | 2285 } |
2286 } | |
1692 | 2287 } |
0 | 2288 if ( !v4 ) |
1690 | 2289 return 0; |
1692 | 2290 v47 = v46[rand() % v4]; |
0 | 2291 v6 = GetActualAccuracy(); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2292 v11 = GetParameterBonus(v6); |
0 | 2293 break; |
2294 default: | |
2295 v11 = 0; | |
2296 break; | |
2297 } | |
2298 v22 = GetActualLuck(); | |
1036 | 2299 v23 = GetParameterBonus(v22) + v11 + 30; |
0 | 2300 if ( rand() % v23 >= 30 ) |
2301 { | |
1690 | 2302 return 0; |
0 | 2303 } |
2304 else | |
2305 { | |
1692 | 2306 for ( v3 = 0; v3 < 4; v3++ ) |
2307 { | |
2308 if ( this == pPlayers[v3 + 1] ) | |
2309 break; | |
2310 } | |
2311 | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2312 switch ( attTypeCast ) |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2313 { |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2314 case SPECIAL_ATTACK_CURSE: |
1692 | 2315 SetCondition(Condition_Cursed, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2316 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2317 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2318 return 1; | |
2319 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2320 case SPECIAL_ATTACK_WEAK: |
1692 | 2321 SetCondition(Condition_Weak, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2322 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2323 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2324 return 1; | |
2325 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2326 case SPECIAL_ATTACK_SLEEP: |
1692 | 2327 SetCondition(Condition_Sleep, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2328 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2329 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2330 return 1; | |
2331 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2332 case SPECIAL_ATTACK_DRUNK: |
1692 | 2333 SetCondition(Condition_Drunk, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2334 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2335 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2336 return 1; | |
2337 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2338 case SPECIAL_ATTACK_INSANE: |
1692 | 2339 SetCondition(Condition_Insane, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2340 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2341 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2342 return 1; | |
2343 break; | |
2187 | 2344 case SPECIAL_ATTACK_POISON_WEAK: |
2345 SetCondition(Condition_Poison_Weak, 1); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2346 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2347 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2348 return 1; |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2349 break; |
2187 | 2350 case SPECIAL_ATTACK_POISON_MEDIUM: |
2351 SetCondition(Condition_Poison_Medium, 1); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2352 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2353 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2354 return 1; |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2355 break; |
2187 | 2356 case SPECIAL_ATTACK_POISON_SEVERE: |
2357 SetCondition(Condition_Poison_Severe, 1); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2358 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2359 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2360 return 1; | |
2361 break; | |
2187 | 2362 case SPECIAL_ATTACK_DISEASE_WEAK: |
2363 SetCondition(Condition_Disease_Weak, 1); | |
1693
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2364 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2365 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2366 return 1; |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2367 break; |
2187 | 2368 case SPECIAL_ATTACK_DISEASE_MEDIUM: |
2369 SetCondition(Condition_Disease_Medium, 1); | |
1693
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2370 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2371 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2372 return 1; |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
2373 break; |
2187 | 2374 case SPECIAL_ATTACK_DISEASE_SEVERE: |
2375 SetCondition(Condition_Disease_Severe, 1); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2376 pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0); |
0 | 2377 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
1690 | 2378 return 1; |
0 | 2379 break; |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2380 case SPECIAL_ATTACK_PARALYZED: |
1692 | 2381 SetCondition(Condition_Paralyzed, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2382 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2383 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2384 return 1; | |
2385 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2386 case SPECIAL_ATTACK_UNCONSCIOUS: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2387 SetCondition(Condition_Unconcious, 1); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2388 pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2389 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2390 return 1; |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2391 break; |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2392 case SPECIAL_ATTACK_DEAD: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2393 SetCondition(Condition_Dead, 1); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2394 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2395 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2396 return 1; |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2397 break; |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2398 case SPECIAL_ATTACK_PETRIFIED: |
1692 | 2399 SetCondition(Condition_Pertified, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2400 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2401 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2402 return 1; | |
2403 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2404 case SPECIAL_ATTACK_ERADICATED: |
1692 | 2405 SetCondition(Condition_Eradicated, 1); |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2406 pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2407 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2408 return 1; | |
2409 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2410 case SPECIAL_ATTACK_BREAK_ANY: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2411 case SPECIAL_ATTACK_BREAK_ARMOR: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2412 case SPECIAL_ATTACK_BREAK_WEAPON: |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2413 if ( !(v48->uAttributes & ITEM_HARDENED) ) |
1690 | 2414 { |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2415 PlaySound(SPEECH_40, 0); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2416 v48->SetBroken(); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2417 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2418 } |
2419 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); | |
2420 return 1; | |
2421 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2422 case SPECIAL_ATTACK_STEAL: |
1690 | 2423 PlaySound(SPEECH_40, 0); |
2276 | 2424 v27 = pActor->ActorHasItems; |
2425 if ( pActor->ActorHasItems[0].uItemID ) | |
1690 | 2426 { |
2276 | 2427 v27 = &pActor->ActorHasItems[1]; |
2428 if ( pActor->ActorHasItems[1].uItemID ) | |
1690 | 2429 { |
2430 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); | |
2431 return 1; | |
2432 } | |
2433 } | |
2434 memcpy(v27, &this->pInventoryItemList[this->pInventoryMatrix[v47]-1], 0x24u); | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2435 RemoveItemAtInventoryIndex(v47); |
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2436 pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2437 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2438 return 1; | |
2439 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2440 case SPECIAL_ATTACK_AGING: |
187 | 2441 PlaySound(SPEECH_42, 0); |
1690 | 2442 ++this->sAgeModifier; |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2443 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2444 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2445 return 1; | |
2446 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2447 case SPECIAL_ATTACK_MANA_DRAIN: |
1690 | 2448 PlaySound(SPEECH_41, 0); |
2449 this->sMana = 0; | |
1691
1c880907575f
Player::_48DCF6 substituted unnecessary vars by their values
Grumpy7
parents:
1690
diff
changeset
|
2450 pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0); |
1690 | 2451 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
2452 return 1; | |
2453 break; | |
1695
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2454 case SPECIAL_ATTACK_FEAR: |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2455 SetCondition(Condition_Fear, 1); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2456 pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2457 pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3); |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2458 return 1; |
33df22a5e376
Player::ReceiveSpecialAttackEffect finishing cleanup, special attack type enum created
Grumpy7
parents:
1694
diff
changeset
|
2459 break; |
0 | 2460 default: |
1690 | 2461 return 0; |
0 | 2462 } |
2463 } | |
2464 } | |
324 | 2465 |
0 | 2466 // 48DCF6: using guessed type char var_94[140]; |
2467 | |
2468 //----- (0048E1A3) -------------------------------------------------------- | |
2469 unsigned int Player::GetSpellSchool(unsigned int uSpellID) | |
2470 { | |
1091 | 2471 return pSpellStats->pInfos[uSpellID].uSchool; |
0 | 2472 } |
2473 | |
2474 //----- (0048E1B5) -------------------------------------------------------- | |
816 | 2475 int Player::GetAttackRecoveryTime(bool bRangedAttack) |
2476 { | |
2477 ItemGen *weapon = nullptr; | |
2478 uint weapon_recovery = base_recovery_times_per_weapon_type[0]; | |
2479 if (bRangedAttack) | |
0 | 2480 { |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2481 if ( HasItemEquipped(EQUIP_BOW) ) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2482 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2483 weapon = GetBowItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2484 weapon_recovery = base_recovery_times_per_weapon_type[weapon->GetPlayerSkillType()]; |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2485 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2486 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2487 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
|
2488 { |
816 | 2489 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
|
2490 } |
1989 | 2491 else if ( HasItemEquipped(EQUIP_TWO_HANDED) ) |
816 | 2492 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2493 weapon = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2494 if (weapon->GetItemEquipType() == EQUIP_WAND) |
816 | 2495 { |
2496 __debugbreak(); // looks like offset in player's inventory and wand_lut much like case in 0042ECB5 | |
2497 __debugbreak(); // looks like wands were two-handed weapons once, or supposed to be. should not get here now | |
2498 weapon_recovery = pSpellDatas[wand_spell_ids[weapon->uItemID - ITEM_WAND_FIRE]].uExpertLevelRecovery; | |
2499 } | |
0 | 2500 else |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2501 weapon_recovery = base_recovery_times_per_weapon_type[weapon->GetPlayerSkillType()]; |
816 | 2502 } |
1989 | 2503 if (HasItemEquipped(EQUIP_SINGLE_HANDED) && GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) != EQUIP_SHIELD) |
1010 | 2504 // ADD: shield check because shield recovery is added later and can be accidentally doubled |
816 | 2505 { |
1717 | 2506 if (base_recovery_times_per_weapon_type[GetOffHandItem()->GetPlayerSkillType()] > weapon_recovery) |
2507 { | |
1731 | 2508 weapon = GetOffHandItem(); |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
2509 weapon_recovery = base_recovery_times_per_weapon_type[weapon->GetPlayerSkillType()]; |
816 | 2510 } |
2511 } | |
2512 | |
2513 uint armour_recovery = 0; | |
0 | 2514 if ( HasItemEquipped(EQUIP_ARMOUR) ) |
2515 { | |
1980 | 2516 uchar armour_skill_type = GetArmorItem()->GetPlayerSkillType(); |
816 | 2517 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
|
2518 float multiplier; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2519 |
816 | 2520 if (armour_skill_type == PLAYER_SKILL_LEATHER) |
2521 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2522 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0, 0, 0); |
816 | 2523 } |
2524 else if (armour_skill_type == PLAYER_SKILL_CHAIN) | |
2525 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2526 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0, 0); |
816 | 2527 } |
2528 else if (armour_skill_type == PLAYER_SKILL_PLATE) | |
2529 { | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2530 multiplier = GetArmorRecoveryMultiplierFromSkillLevel(armour_skill_type, 1.0f, 0.5f, 0.5f, 0); |
0 | 2531 } |
2532 else | |
2533 { | |
1545 | 2534 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
|
2535 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
|
2536 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2537 |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2538 armour_recovery = (uint)(base_armour_recovery * multiplier); |
816 | 2539 } |
2540 | |
2541 uint shield_recovery = 0; | |
1989 | 2542 if (HasItemEquipped(EQUIP_SINGLE_HANDED) && GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) == EQUIP_SHIELD) |
816 | 2543 { |
1980 | 2544 uchar skill_type = GetOffHandItem()->GetPlayerSkillType(); |
816 | 2545 |
2546 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
|
2547 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
|
2548 shield_recovery = (uint)(shield_base_recovery * multiplier); |
816 | 2549 } |
2550 | |
1036 | 2551 uint player_speed_recovery_reduction = GetParameterBonus(GetActualSpeed()), |
816 | 2552 sword_axe_bow_recovery_reduction = 0; |
2553 bool shooting_laser = false; | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2554 if (weapon != nullptr) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2555 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2556 if (GetActualSkillLevel((PLAYER_SKILL_TYPE)weapon->GetPlayerSkillType()) && |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2557 (weapon->GetPlayerSkillType() == PLAYER_SKILL_SWORD || weapon->GetPlayerSkillType() == PLAYER_SKILL_AXE || weapon->GetPlayerSkillType() == PLAYER_SKILL_BOW) ) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2558 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2559 if (SkillToMastery(pActiveSkills[weapon->GetPlayerSkillType()]) >= 2 ) // Expert Sword, Axe & Bow reduce recovery |
1759 | 2560 sword_axe_bow_recovery_reduction = pActiveSkills[weapon->GetPlayerSkillType()] & 0x3F; |
2561 } | |
2562 if (weapon->GetPlayerSkillType() == PLAYER_SKILL_BLASTER) | |
816 | 2563 shooting_laser = true; |
2564 } | |
2565 | |
2566 uint armsmaster_recovery_reduction = 0; | |
2567 if (!bRangedAttack && !shooting_laser) | |
2568 { | |
2569 if (uint armsmaster_level = GetActualSkillLevel(PLAYER_SKILL_ARMSMASTER)) | |
2570 { | |
2571 armsmaster_recovery_reduction = armsmaster_level & 0x3F; | |
2572 if (SkillToMastery(armsmaster_level) >= 4) | |
2573 armsmaster_recovery_reduction *= 2; | |
2574 } | |
2575 } | |
2576 | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2577 uint hasteRecoveryReduction = 0; |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
2578 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
|
2579 hasteRecoveryReduction = 25; |
816 | 2580 |
2581 uint weapon_enchantment_recovery_reduction = 0; | |
2582 if ( weapon ) | |
2583 { | |
2584 if (weapon->uSpecEnchantmentType == 59 || | |
2585 weapon->uSpecEnchantmentType == 41 || | |
2586 weapon->uSpecEnchantmentType == 500) | |
2587 weapon_enchantment_recovery_reduction = 20; | |
2588 } | |
2589 | |
2590 int recovery = weapon_recovery + | |
2591 armour_recovery + | |
2592 shield_recovery | |
2593 - armsmaster_recovery_reduction | |
2594 - weapon_enchantment_recovery_reduction | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2595 - hasteRecoveryReduction |
816 | 2596 - sword_axe_bow_recovery_reduction |
2597 - player_speed_recovery_reduction; | |
2598 | |
2599 if (recovery < 0) | |
2600 recovery = 0; | |
2601 return recovery; | |
0 | 2602 } |
2603 | |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2604 |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2605 //----- new -------------------------------------------------------- |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2606 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
|
2607 { |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2608 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
|
2609 switch (skill_mastery) |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2610 { |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2611 case 1: return mult1; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2612 case 2: return mult2; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2613 case 3: return mult3; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2614 case 4: return mult4; break; |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2615 } |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2616 Error("Unexpected input value: %d", armour_skill_type); |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2617 return 0; |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2618 } |
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
2619 |
0 | 2620 //----- (0048E4F8) -------------------------------------------------------- |
2621 int Player::GetMaxHealth() | |
2622 { | |
2623 int v3; // esi@1 | |
2624 int v4; // esi@1 | |
2625 int v6; // esi@1 | |
2626 | |
1036 | 2627 v3 = GetParameterBonus(GetActualEndurance()); |
135 | 2628 v4 = pBaseHealthPerLevelByClass[classType] * (GetActualLevel() + v3); |
0 | 2629 v6 = uFullHealthBonus |
135 | 2630 + pBaseHealthByClass[classType / 4] |
0 | 2631 + GetSkillBonus(CHARACTER_ATTRIBUTE_HEALTH) |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2632 + GetItemsBonus(CHARACTER_ATTRIBUTE_HEALTH) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2633 return max(1, v6); |
0 | 2634 } |
2635 | |
2636 //----- (0048E565) -------------------------------------------------------- | |
2637 int Player::GetMaxMana() | |
2638 { | |
2639 int v2; // eax@2 | |
2640 int v3; // esi@4 | |
2641 int v4; // eax@5 | |
2642 int v5; // esi@5 | |
2643 int v6; // eax@5 | |
2644 int v7; // esi@6 | |
2645 int v8; // esi@6 | |
2646 int v9; // esi@6 | |
1116 | 2647 |
135 | 2648 switch (classType) |
0 | 2649 { |
1116 | 2650 case PLAYER_CLASS_ROGUE: |
2651 case PLAYER_CLASS_SPY: | |
2652 case PLAYER_CLASS_ASSASSIN: | |
2653 case PLAYER_CLASS_ARCHER: | |
2654 case PLAYER_CLASS_WARRIOR_MAGE: | |
2655 case PLAYER_CLASS_MASTER_ARCHER: | |
2656 case PLAYER_CLASS_SNIPER: | |
2657 case PLAYER_CLASS_SORCERER: | |
2658 case PLAYER_CLASS_WIZARD: | |
2659 case PLAYER_CLASS_ARCHMAGE: | |
2660 case PLAYER_CLASS_LICH: | |
0 | 2661 v2 = GetActualIntelligence(); |
1036 | 2662 v3 = GetParameterBonus(v2); |
1116 | 2663 break; |
2664 case PLAYER_CLASS_INITIATE: | |
2665 case PLAYER_CLASS_MASTER: | |
2666 case PLAYER_CLASS_NINJA: | |
2667 case PLAYER_CLASS_PALADIN: | |
2668 case PLAYER_CLASS_CRUSADER: | |
2669 case PLAYER_CLASS_HERO: | |
2670 case PLAYER_CLASS_VILLIAN: | |
2671 case PLAYER_CLASS_CLERIC: | |
2672 case PLAYER_CLASS_PRIEST: | |
2673 case PLAYER_CLASS_PRIEST_OF_SUN: | |
2674 case PLAYER_CLASS_PRIEST_OF_MOON: | |
0 | 2675 v2 = GetActualWillpower(); |
1036 | 2676 v3 = GetParameterBonus(v2); |
1116 | 2677 break; |
2678 case PLAYER_CLASS_HUNTER: | |
2679 case PLAYER_CLASS_RANGER_LORD: | |
2680 case PLAYER_CLASS_BOUNTY_HUNTER: | |
2681 case PLAYER_CLASS_DRUID: | |
2682 case PLAYER_CLASS_GREAT_DRUID: | |
2683 case PLAYER_CLASS_ARCH_DRUID: | |
2684 case PLAYER_CLASS_WARLOCK: | |
0 | 2685 v4 = GetActualWillpower(); |
1036 | 2686 v5 = GetParameterBonus(v4); |
0 | 2687 v6 = GetActualIntelligence(); |
1036 | 2688 v3 = GetParameterBonus(v6) + v5; |
0 | 2689 break; |
2690 default: | |
1116 | 2691 return 0; |
0 | 2692 break; |
2693 } | |
1116 | 2694 v7 = pBaseManaPerLevelByClass[classType] * (GetActualLevel() + v3); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2695 v8 = GetItemsBonus(CHARACTER_ATTRIBUTE_MANA) + v7; |
1116 | 2696 v9 = uFullManaBonus |
2697 + pBaseManaByClass[classType / 4] | |
2698 + GetSkillBonus(CHARACTER_ATTRIBUTE_MANA) | |
2699 + v8; | |
2700 return max(0,v9); | |
0 | 2701 } |
2702 | |
2703 //----- (0048E656) -------------------------------------------------------- | |
2704 int Player::GetBaseAC() | |
2705 { | |
2706 int v2; // eax@1 | |
2707 int v3; // esi@1 | |
2708 int v4; // esi@1 | |
2709 int v5; // esi@1 | |
2710 | |
2711 v2 = GetActualSpeed(); | |
1036 | 2712 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2713 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3; |
0 | 2714 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2715 return max(0, v5); |
0 | 2716 } |
2717 | |
2718 //----- (0048E68F) -------------------------------------------------------- | |
2719 int Player::GetActualAC() | |
2720 { | |
2721 int v2; // eax@1 | |
2722 int v3; // esi@1 | |
2723 int v4; // esi@1 | |
2724 int v5; // esi@1 | |
2725 int v6; // esi@1 | |
2726 | |
2727 v2 = GetActualSpeed(); | |
1036 | 2728 v3 = GetParameterBonus(v2); |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2729 v4 = GetItemsBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v3; |
0 | 2730 v5 = GetSkillBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v4; |
1594
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2731 v6 = this->sACModifier + GetMagicalBonus(CHARACTER_ATTRIBUTE_AC_BONUS) + v5; |
c0238b60d0f2
Player::GetMaxHealth, GetBaseAC, GetActualAC minor cleanups
Grumpy7
parents:
1593
diff
changeset
|
2732 return max(0, v6); |
0 | 2733 } |
2734 | |
2735 //----- (0048E6DC) -------------------------------------------------------- | |
2736 unsigned int Player::GetBaseAge() | |
2737 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2738 return (unsigned int)(((__int64)(pParty->uTimePlayed * 0.234375) / 60 / 60 / 24) / 7 / 4 / 12 - uBirthYear + game_starting_year); |
0 | 2739 } |
2740 | |
2741 //----- (0048E72C) -------------------------------------------------------- | |
2742 unsigned int Player::GetActualAge() | |
2743 { | |
2744 return this->sAgeModifier + GetBaseAge(); | |
2745 } | |
2746 | |
2747 //----- (0048E73F) -------------------------------------------------------- | |
2748 int Player::GetBaseResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
2749 { | |
2750 int v7; // esi@20 | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2751 int racialBonus = 0; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2752 __int16* resStat; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2753 |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2754 switch (a2) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2755 { |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2756 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2757 resStat = &sResFireBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2758 if (IsRaceGoblin()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2759 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2760 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2761 case CHARACTER_ATTRIBUTE_RESIST_AIR: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2762 resStat = &sResAirBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2763 if (IsRaceGoblin()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2764 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2765 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2766 case CHARACTER_ATTRIBUTE_RESIST_WATER: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2767 resStat = &sResWaterBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2768 if (IsRaceDwarf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2769 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2770 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2771 case CHARACTER_ATTRIBUTE_RESIST_EARTH: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2772 resStat = &sResEarthBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2773 if (IsRaceDwarf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2774 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2775 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2776 case CHARACTER_ATTRIBUTE_RESIST_MIND: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2777 resStat = &sResMindBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2778 if (IsRaceElf()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2779 racialBonus = 10; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2780 break; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2781 case CHARACTER_ATTRIBUTE_RESIST_BODY: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2782 case CHARACTER_ATTRIBUTE_RESIST_SPIRIT: |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2783 resStat = &sResBodyBase; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2784 if (IsRaceHuman()) |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2785 racialBonus = 5; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2786 break; |
1783 | 2787 default: |
2788 Error("Unknown attribute"); | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2789 } |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2790 v7 = GetItemsBonus(a2) + racialBonus; |
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2791 return v7 + *resStat; |
0 | 2792 } |
2793 | |
2794 //----- (0048E7D0) -------------------------------------------------------- | |
2795 int Player::GetActualResistance(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
2796 { | |
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
|
2797 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
|
2798 __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
|
2799 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
|
2800 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
|
2801 |
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
|
2802 int leatherArmorSkillLevel = GetActualSkillLevel(PLAYER_SKILL_LEATHER); |
652 | 2803 if ( CheckHiredNPCSpeciality(Enchanter) ) |
0 | 2804 v10 = 20; |
2805 if ( (a2 == CHARACTER_ATTRIBUTE_RESIST_FIRE | |
2806 || a2 == CHARACTER_ATTRIBUTE_RESIST_AIR | |
2807 || a2 == CHARACTER_ATTRIBUTE_RESIST_WATER | |
2808 || 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
|
2809 && SkillToMastery(leatherArmorSkillLevel) == 4 |
0 | 2810 && HasItemEquipped(EQUIP_ARMOUR) |
2811 && 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
|
2812 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
|
2813 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
|
2814 { |
1783 | 2815 case CHARACTER_ATTRIBUTE_RESIST_FIRE: |
2816 resStat = &sResFireBonus; | |
2817 break; | |
2818 case CHARACTER_ATTRIBUTE_RESIST_AIR: | |
2819 resStat = &sResAirBonus; | |
2820 break; | |
2821 case CHARACTER_ATTRIBUTE_RESIST_WATER: | |
2822 resStat = &sResWaterBonus; | |
2823 break; | |
2824 case CHARACTER_ATTRIBUTE_RESIST_EARTH: | |
2825 resStat = &sResEarthBonus; | |
2826 break; | |
2827 case CHARACTER_ATTRIBUTE_RESIST_MIND: | |
2828 resStat = &sResMindBonus; | |
2829 break; | |
2830 case CHARACTER_ATTRIBUTE_RESIST_BODY: | |
2831 case CHARACTER_ATTRIBUTE_RESIST_SPIRIT: | |
2832 resStat = &sResBodyBonus; | |
2833 break; | |
2834 default: Error("Unexpected attribute"); | |
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
|
2835 } |
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
|
2836 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
|
2837 result = v10 + GetMagicalBonus(a2) + baseRes + *(resStat); |
0 | 2838 return result; |
2839 } | |
2840 | |
2841 //----- (0048E8F5) -------------------------------------------------------- | |
816 | 2842 bool Player::Recover(int dt) |
2843 { | |
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
|
2844 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
|
2845 |
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
|
2846 v3 = (int)(dt * GetSpecialItemBonus(17) * 0.01 + dt); |
816 | 2847 |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
2848 //Log::Warning(L"Recover(dt = %u/%u - %u", dt, (uint)v3, (uint)uTimeToRecovery); |
816 | 2849 |
2850 if (uTimeToRecovery > v3) | |
2851 { | |
2852 uTimeToRecovery -= v3; | |
2853 return true; | |
0 | 2854 } |
2855 else | |
2856 { | |
816 | 2857 uTimeToRecovery = 0; |
2858 viewparams->bRedrawGameUI = true; | |
2859 if (!uActiveCharacter) | |
0 | 2860 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 2861 return false; |
2862 } | |
0 | 2863 } |
2864 | |
2865 //----- (0048E96A) -------------------------------------------------------- | |
816 | 2866 void Player::SetRecoveryTime(signed int rec) |
2867 { | |
1545 | 2868 Assert(rec >= 0); |
816 | 2869 |
2870 if (rec > uTimeToRecovery) | |
2871 uTimeToRecovery = rec; | |
2872 | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2873 if (uActiveCharacter != 0 && pPlayers[uActiveCharacter] == this && !some_active_character) |
0 | 2874 uActiveCharacter = pParty->GetNextActiveCharacter(); |
816 | 2875 |
2876 viewparams->bRedrawGameUI = true; | |
0 | 2877 } |
2878 // 50C0C4: using guessed type int some_active_character; | |
2879 | |
2880 //----- (0048E9B7) -------------------------------------------------------- | |
2881 void Player::RandomizeName() | |
2882 { | |
2883 if (!uExpressionTimePassed) | |
2884 strcpy(pName, pNPCStats->pNPCNames[rand() % pNPCStats->uNumNPCNames[uSex]][uSex]); | |
2885 } | |
2886 | |
2887 //----- (0048E9F4) -------------------------------------------------------- | |
2888 unsigned int Player::GetMajorConditionIdx() | |
2889 { | |
2890 for (uint i = 0; i < 18; ++i) | |
2891 if (pConditions[pConditionImportancyTable[i]] != 0) | |
2892 return pConditionImportancyTable[i]; | |
2893 | |
2894 return 18; | |
2895 } | |
2896 | |
2897 //----- (0048EA1B) -------------------------------------------------------- | |
1036 | 2898 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
|
2899 { |
1036 | 2900 int i; // eax@1 |
2901 i = 0; | |
2902 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
|
2903 { |
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
|
2904 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
|
2905 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
|
2906 ++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
|
2907 } |
1036 | 2908 return parameter_to_bonus_value[i]; |
0 | 2909 } |
2910 | |
2911 //----- (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
|
2912 int Player::GetSpecialItemBonus( int enchantmentId ) |
0 | 2913 { |
1989 | 2914 for (int i = EQUIP_SINGLE_HANDED; i < EQUIP_BOOK; ++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
|
2915 { |
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
|
2916 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
|
2917 { |
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
|
2918 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
|
2919 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2920 if ((GetNthEquippedIndexItem(i)->uSpecEnchantmentType == 17) || (GetNthEquippedIndexItem(i)->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
|
2921 return 50; |
1032 | 2922 } |
1598
11bb463837b1
_48EA46_calc_special_bonus_by_items renamed to GetSpecialItemBonus, forgot to commit actor.cpp
Grumpy7
parents:
1597
diff
changeset
|
2923 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
|
2924 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2925 if (GetNthEquippedIndexItem(i)->uSpecEnchantmentType == 24) //Increased Knockback. |
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
|
2926 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
|
2927 } |
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
|
2928 } |
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
|
2929 } |
1032 | 2930 return 0; |
0 | 2931 } |
2932 | |
2933 //----- (0048EAAE) -------------------------------------------------------- | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
2934 int Player::GetItemsBonus( enum CHARACTER_ATTRIBUTE_TYPE attr, bool getOnlyMainHandDmg /*= false*/ ) |
0 | 2935 { |
2936 int v5; // edi@1 | |
2937 int v9; // eax@49 | |
2938 int v14; // ecx@58 | |
2939 int v15; // eax@58 | |
2940 int v17; // eax@62 | |
2941 int v22; // eax@76 | |
2942 int v25; // ecx@80 | |
2943 int v26; // edi@80 | |
2944 int v32; // eax@98 | |
2945 int v56; // eax@365 | |
2946 signed int v58; // [sp-4h] [bp-20h]@10 | |
2947 int v61; // [sp+10h] [bp-Ch]@1 | |
2948 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
|
2949 ItemGen *currEquippedItem; // [sp+20h] [bp+4h]@101 |
1040 | 2950 bool no_skills; |
0 | 2951 |
2952 v5 = 0; | |
2953 v62 = 0; | |
2954 v61 = 0; | |
1040 | 2955 |
2956 no_skills=false; | |
0 | 2957 switch (attr) |
1599 | 2958 { |
2959 case CHARACTER_ATTRIBUTE_SKILL_ALCHEMY: v58 = PLAYER_SKILL_ALCHEMY; break; | |
2960 case CHARACTER_ATTRIBUTE_SKILL_STEALING: v58 = PLAYER_SKILL_STEALING; break; | |
2961 case CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM: v58 = PLAYER_SKILL_TRAP_DISARM; break; | |
2962 case CHARACTER_ATTRIBUTE_SKILL_ITEM_ID: v58 = PLAYER_SKILL_ITEM_ID; break; | |
2963 case CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID: v58 = PLAYER_SKILL_MONSTER_ID; break; | |
2964 case CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER: v58 = PLAYER_SKILL_ARMSMASTER; break; | |
2965 case CHARACTER_ATTRIBUTE_SKILL_DODGE: v58 = PLAYER_SKILL_DODGE; break; | |
2966 case CHARACTER_ATTRIBUTE_SKILL_UNARMED: v58 = PLAYER_SKILL_UNARMED; break; | |
2967 case CHARACTER_ATTRIBUTE_SKILL_FIRE: v58 = PLAYER_SKILL_FIRE; break; | |
2968 case CHARACTER_ATTRIBUTE_SKILL_AIR: v58 = PLAYER_SKILL_AIR; break; | |
2969 case CHARACTER_ATTRIBUTE_SKILL_WATER: v58 = PLAYER_SKILL_WATER; break; | |
2970 case CHARACTER_ATTRIBUTE_SKILL_EARTH: v58 = PLAYER_SKILL_EARTH; break; | |
2971 case CHARACTER_ATTRIBUTE_SKILL_SPIRIT: v58 = PLAYER_SKILL_SPIRIT; break; | |
2972 case CHARACTER_ATTRIBUTE_SKILL_MIND: v58 = PLAYER_SKILL_MIND; break; | |
2973 case CHARACTER_ATTRIBUTE_SKILL_BODY: v58 = PLAYER_SKILL_BODY; break; | |
2974 case CHARACTER_ATTRIBUTE_SKILL_LIGHT: v58 = PLAYER_SKILL_LIGHT; break; | |
2975 case CHARACTER_ATTRIBUTE_SKILL_DARK: v58 = PLAYER_SKILL_DARK; break; | |
2976 case CHARACTER_ATTRIBUTE_SKILL_MEDITATION: v58 = PLAYER_SKILL_MEDITATION; break; | |
2977 case CHARACTER_ATTRIBUTE_SKILL_BOW: v58 = PLAYER_SKILL_BOW; break; | |
2978 case CHARACTER_ATTRIBUTE_SKILL_SHIELD: v58 = PLAYER_SKILL_SHIELD; break; | |
2979 case CHARACTER_ATTRIBUTE_SKILL_LEARNING: v58 = PLAYER_SKILL_LEARNING; break; | |
2980 default: | |
1040 | 2981 no_skills=true; |
1599 | 2982 } |
1040 | 2983 if (!no_skills) |
1599 | 2984 { |
2985 if ( !this->pActiveSkills[v58] ) | |
2986 return 0; | |
2987 } | |
1040 | 2988 |
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
|
2989 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
|
2990 { |
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
|
2991 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
|
2992 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: |
0 | 2993 if ( HasItemEquipped(EQUIP_BOW) ) |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
2994 v5 = GetBowItem()->GetDamageMod(); |
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
|
2995 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
|
2996 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
|
2997 |
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
|
2998 case CHARACTER_ATTRIBUTE_RANGED_DMG_MIN: |
0 | 2999 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
|
3000 return 0; |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3001 v5 = GetBowItem()->GetDamageMod(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3002 v56 = GetBowItem()->GetDamageDice(); |
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
|
3003 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
|
3004 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
|
3005 |
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
|
3006 case CHARACTER_ATTRIBUTE_RANGED_DMG_MAX: |
0 | 3007 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
|
3008 return 0; |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3009 v5 = GetBowItem()->GetDamageDice() * GetBowItem()->GetDamageRoll(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3010 v56 = GetBowItem()->GetDamageMod(); |
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
|
3011 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
|
3012 |
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
|
3013 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
|
3014 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
|
3015 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
|
3016 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
|
3017 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
|
3018 |
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
|
3019 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
|
3020 if ( IsUnarmed() ) |
0 | 3021 { |
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
|
3022 return 3; |
0 | 3023 } |
3024 else | |
3025 { | |
1989 | 3026 if ( this->HasItemEquipped(EQUIP_TWO_HANDED) ) |
0 | 3027 { |
1989 | 3028 v22 = this->GetEquippedItemEquipType(EQUIP_TWO_HANDED); |
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
|
3029 if ( v22 >= 0 && v22 <= 2) |
0 | 3030 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3031 ItemGen* mainHandItem = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3032 v26 = mainHandItem->GetDamageRoll(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3033 if ( GetOffHandItem() != nullptr || mainHandItem->GetPlayerSkillType() != 4 ) |
0 | 3034 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3035 v25 = mainHandItem->GetDamageDice(); |
0 | 3036 } |
3037 else | |
3038 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3039 v25 = mainHandItem->GetDamageDice() + 1; |
0 | 3040 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3041 v5 = mainHandItem->GetDamageMod() + v25 * v26; |
0 | 3042 } |
3043 } | |
1989 | 3044 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_SINGLE_HANDED) || (GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) < 0 || GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) > 2)) |
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
|
3045 { |
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
|
3046 return v5; |
1040 | 3047 } |
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
|
3048 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
|
3049 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3050 ItemGen* offHandItem = GetOffHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3051 v15 = offHandItem->GetDamageMod(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3052 v14 = offHandItem->GetDamageDice() * offHandItem->GetDamageRoll(); |
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
|
3053 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
|
3054 } |
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
|
3055 } |
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
|
3056 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
|
3057 |
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
|
3058 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
|
3059 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
|
3060 if ( IsUnarmed() ) |
1040 | 3061 { |
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
|
3062 return 0; |
1040 | 3063 } |
1989 | 3064 if ( this->HasItemEquipped(EQUIP_TWO_HANDED) ) |
0 | 3065 { |
1989 | 3066 v17 = this->GetEquippedItemEquipType(EQUIP_TWO_HANDED); |
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
|
3067 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
|
3068 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3069 v5 = GetMainHandItem()->GetDamageMod(); |
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
|
3070 } |
0 | 3071 } |
1989 | 3072 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_SINGLE_HANDED) || (this->GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) < 0) || this->GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) > 2 ) |
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
|
3073 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
|
3074 else |
0 | 3075 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3076 v56 = GetOffHandItem()->GetDamageMod(); |
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
|
3077 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
|
3078 } |
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
|
3079 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
|
3080 |
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
|
3081 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
|
3082 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
|
3083 { |
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
|
3084 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
|
3085 } |
1989 | 3086 if ( this->HasItemEquipped(EQUIP_TWO_HANDED) ) |
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
|
3087 { |
1989 | 3088 v9 = this->GetEquippedItemEquipType(EQUIP_TWO_HANDED); |
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
|
3089 if ( v9 >= 0 && v9 <= 2) |
0 | 3090 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3091 ItemGen* mainHandItem = GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3092 v5 = mainHandItem->GetDamageDice() + |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3093 mainHandItem->GetDamageMod(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3094 if ( GetOffHandItem() == nullptr && mainHandItem->GetPlayerSkillType() == 4) |
0 | 3095 { |
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
|
3096 ++v5; |
0 | 3097 } |
3098 } | |
3099 } | |
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
|
3100 |
1989 | 3101 if ( getOnlyMainHandDmg || !this->HasItemEquipped(EQUIP_SINGLE_HANDED) || (this->GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) < 0) || this->GetEquippedItemEquipType(EQUIP_SINGLE_HANDED) > 2 ) |
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
|
3102 { |
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
|
3103 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
|
3104 } |
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
|
3105 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
|
3106 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3107 ItemGen* offHandItem = GetOffHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3108 v14 = offHandItem->GetDamageMod(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3109 v15 = offHandItem->GetDamageDice(); |
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
|
3110 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
|
3111 } |
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
|
3112 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
|
3113 |
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
|
3114 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
|
3115 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
|
3116 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
|
3117 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
|
3118 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
|
3119 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
|
3120 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
|
3121 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
|
3122 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
|
3123 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
|
3124 |
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
|
3125 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
|
3126 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
|
3127 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
|
3128 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
|
3129 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
|
3130 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
|
3131 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
|
3132 |
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
|
3133 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
|
3134 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
|
3135 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
|
3136 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
|
3137 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
|
3138 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
|
3139 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
|
3140 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
|
3141 |
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
|
3142 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
|
3143 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
|
3144 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
|
3145 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
|
3146 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
|
3147 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
|
3148 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
|
3149 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
|
3150 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
|
3151 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
|
3152 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
|
3153 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
|
3154 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
|
3155 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
|
3156 { |
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
|
3157 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) ) |
1040 | 3158 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3159 currEquippedItem = GetNthEquippedIndexItem(i); |
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
|
3160 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
|
3161 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3162 v32 = currEquippedItem->GetItemEquipType(); |
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
|
3163 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
|
3164 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3165 v5 += currEquippedItem->GetDamageDice() + currEquippedItem->GetDamageMod(); |
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
|
3166 } |
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
|
3167 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3168 if ( pItemsTable->IsMaterialNonCommon(currEquippedItem) |
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
|
3169 && !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
|
3170 { |
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
|
3171 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
|
3172 } |
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
|
3173 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
|
3174 { |
2156 | 3175 if (this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uEnchantmentType - 1 == attr)//if (currEquippedItem->IsRegularEnchanmentForAttribute(attr)) |
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
|
3176 { |
2158 | 3177 if ( attr > CHARACTER_ATTRIBUTE_RESIST_BODY && v5 < currEquippedItem->m_enchantmentStrength )//for skills bonuses |
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
|
3178 v5 = currEquippedItem->m_enchantmentStrength; |
2159 | 3179 else // for resists and attributes bonuses |
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
|
3180 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
|
3181 } |
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
|
3182 } |
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
|
3183 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
|
3184 { |
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 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
|
3186 } |
1040 | 3187 } |
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
|
3188 } |
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
|
3189 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
|
3190 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
|
3191 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
|
3192 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
|
3193 } |
0 | 3194 } |
3195 | |
3196 //----- (0048F73C) -------------------------------------------------------- | |
3197 int Player::GetMagicalBonus(enum CHARACTER_ATTRIBUTE_TYPE a2) | |
3198 { | |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3199 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
|
3200 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
|
3201 |
0 | 3202 switch ( a2 ) |
3203 { | |
1605
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3204 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
|
3205 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
|
3206 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
|
3207 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3208 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
|
3209 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
|
3210 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
|
3211 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3212 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
|
3213 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
|
3214 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
|
3215 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3216 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
|
3217 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
|
3218 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
|
3219 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3220 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
|
3221 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
|
3222 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
|
3223 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3224 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
|
3225 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
|
3226 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
|
3227 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3228 case CHARACTER_ATTRIBUTE_ATTACK: |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3229 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
|
3230 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
|
3231 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3232 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
|
3233 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
|
3234 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
|
3235 break; |
0 | 3236 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
|
3237 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
|
3238 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
|
3239 break; |
0 | 3240 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
|
3241 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
|
3242 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
|
3243 break; |
0 | 3244 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
|
3245 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
|
3246 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
|
3247 break; |
0 | 3248 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
|
3249 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
|
3250 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
|
3251 break; |
0 | 3252 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
|
3253 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
|
3254 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
|
3255 break; |
0 | 3256 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
|
3257 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
|
3258 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
|
3259 break; |
0 | 3260 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
|
3261 v3 = pPlayerBuffs[PLAYER_BUFF_LUCK].uPower; |
1167 | 3262 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
|
3263 break; |
0 | 3264 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
|
3265 v3 = this->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uPower; |
1167 | 3266 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
|
3267 break; |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3268 } |
434b796cdfd3
Player::GetMagicalBonus cleaned up, identified a few player only effect spells used in mm6
Grumpy7
parents:
1604
diff
changeset
|
3269 return v3 + v4; |
0 | 3270 } |
3271 | |
3272 //----- (0048F882) -------------------------------------------------------- | |
1008 | 3273 int Player::GetActualSkillLevel( PLAYER_SKILL_TYPE uSkillType ) |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3274 { |
1064 | 3275 signed int bonus_value; // esi@1 |
3276 unsigned __int16 skill_value; // ax@126 | |
3277 int result; // al@127 | |
353 | 3278 |
1064 | 3279 bonus_value = 0; |
353 | 3280 switch (uSkillType) |
3281 { | |
3282 case PLAYER_SKILL_MONSTER_ID: | |
3283 { | |
652 | 3284 if ( CheckHiredNPCSpeciality(Hunter) ) |
1064 | 3285 bonus_value = 6; |
652 | 3286 if ( CheckHiredNPCSpeciality(Sage) ) |
1064 | 3287 bonus_value += 6; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3288 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MONSTER_ID); |
353 | 3289 } |
3290 break; | |
3291 | |
3292 case PLAYER_SKILL_ARMSMASTER: | |
3293 { | |
652 | 3294 if ( CheckHiredNPCSpeciality(Armsmaster) ) |
1064 | 3295 bonus_value = 2; |
652 | 3296 if ( CheckHiredNPCSpeciality(Weaponsmaster) ) |
1064 | 3297 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3298 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ARMSMASTER); |
353 | 3299 } |
3300 break; | |
3301 | |
3302 case PLAYER_SKILL_STEALING: | |
3303 { | |
652 | 3304 if (CheckHiredNPCSpeciality(Burglar)) |
1064 | 3305 bonus_value = 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3306 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_STEALING); |
353 | 3307 } |
3308 break; | |
3309 | |
3310 | |
3311 case PLAYER_SKILL_ALCHEMY: | |
3312 { | |
652 | 3313 if ( CheckHiredNPCSpeciality(Herbalist) ) |
1064 | 3314 bonus_value = 4; |
652 | 3315 if ( CheckHiredNPCSpeciality(Apothecary) ) |
1064 | 3316 bonus_value += 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3317 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ALCHEMY); |
353 | 3318 } |
3319 break; | |
3320 | |
3321 case PLAYER_SKILL_LEARNING: | |
3322 { | |
652 | 3323 if ( CheckHiredNPCSpeciality(Teacher) ) |
1064 | 3324 bonus_value = 10; |
652 | 3325 if ( CheckHiredNPCSpeciality(Instructor) ) |
1064 | 3326 bonus_value += 15; |
652 | 3327 if ( CheckHiredNPCSpeciality(Scholar) ) |
1064 | 3328 bonus_value += 5; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3329 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LEARNING); |
353 | 3330 } |
3331 break; | |
3332 | |
3333 case PLAYER_SKILL_UNARMED: | |
3334 { | |
652 | 3335 if (CheckHiredNPCSpeciality(Monk) ) |
1064 | 3336 bonus_value = 2; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3337 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_UNARMED); |
353 | 3338 } |
3339 break; | |
3340 | |
3341 case PLAYER_SKILL_DODGE: | |
3342 { | |
652 | 3343 if ( CheckHiredNPCSpeciality(Monk) ) |
1064 | 3344 bonus_value = 2; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3345 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DODGE); |
353 | 3346 } |
3347 break; | |
3348 | |
3349 case PLAYER_SKILL_BOW: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3350 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BOW); |
353 | 3351 break; |
3352 case PLAYER_SKILL_SHIELD: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3353 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SHIELD); |
353 | 3354 break; |
3355 | |
3356 case PLAYER_SKILL_EARTH: | |
652 | 3357 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3358 bonus_value = 2; |
652 | 3359 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3360 bonus_value += 3; |
652 | 3361 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3362 bonus_value += 4; |
353 | 3363 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3364 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3365 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_EARTH); |
353 | 3366 break; |
3367 case PLAYER_SKILL_FIRE: | |
652 | 3368 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3369 bonus_value = 2; |
652 | 3370 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3371 bonus_value += 3; |
652 | 3372 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3373 bonus_value += 4; |
353 | 3374 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3375 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3376 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_FIRE); |
353 | 3377 break; |
3378 case PLAYER_SKILL_AIR: | |
652 | 3379 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3380 bonus_value = 2; |
652 | 3381 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3382 bonus_value += 3; |
652 | 3383 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3384 bonus_value += 4; |
353 | 3385 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3386 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3387 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_AIR); |
353 | 3388 break; |
3389 case PLAYER_SKILL_WATER: | |
652 | 3390 if ( CheckHiredNPCSpeciality(Apprentice) ) |
1064 | 3391 bonus_value = 2; |
652 | 3392 if ( CheckHiredNPCSpeciality(Mystic) ) |
1064 | 3393 bonus_value += 3; |
652 | 3394 if ( CheckHiredNPCSpeciality(Spellmaster) ) |
1064 | 3395 bonus_value += 4; |
353 | 3396 if ( classType == PLAYER_CLASS_WARLOCK && PartyHasDragon() ) |
1064 | 3397 bonus_value += 3; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3398 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_WATER); |
353 | 3399 break; |
3400 case PLAYER_SKILL_SPIRIT: | |
652 | 3401 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3402 bonus_value = 2; |
652 | 3403 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3404 bonus_value += 3; |
652 | 3405 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3406 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3407 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_SPIRIT); |
353 | 3408 break; |
3409 case PLAYER_SKILL_MIND: | |
652 | 3410 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3411 bonus_value = 2; |
652 | 3412 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3413 bonus_value += 3; |
652 | 3414 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3415 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3416 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MIND); |
353 | 3417 break; |
3418 case PLAYER_SKILL_BODY: | |
652 | 3419 if ( CheckHiredNPCSpeciality(Acolyte2) ) |
1064 | 3420 bonus_value = 2; |
652 | 3421 if ( CheckHiredNPCSpeciality(Initiate) ) |
1064 | 3422 bonus_value += 3; |
652 | 3423 if ( CheckHiredNPCSpeciality(Prelate) ) |
1064 | 3424 bonus_value += 4; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3425 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_BODY); |
353 | 3426 break; |
3427 case PLAYER_SKILL_LIGHT: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3428 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_LIGHT); |
353 | 3429 break; |
3430 case PLAYER_SKILL_DARK: | |
3431 { | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3432 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_DARK); |
353 | 3433 } |
3434 break; | |
3435 | |
3436 case PLAYER_SKILL_MERCHANT: | |
3437 { | |
652 | 3438 if ( CheckHiredNPCSpeciality(Trader) ) |
1064 | 3439 bonus_value = 4; |
652 | 3440 if ( CheckHiredNPCSpeciality(Merchant) ) |
1064 | 3441 bonus_value += 6; |
652 | 3442 if ( CheckHiredNPCSpeciality(Gypsy) ) |
1064 | 3443 bonus_value += 3; |
652 | 3444 if ( CheckHiredNPCSpeciality(Duper) ) |
1064 | 3445 bonus_value += 8; |
353 | 3446 } |
3447 break; | |
3448 | |
3449 case PLAYER_SKILL_PERCEPTION: | |
3450 { | |
652 | 3451 if ( CheckHiredNPCSpeciality(Scout) ) |
1064 | 3452 bonus_value = 6; |
652 | 3453 if ( CheckHiredNPCSpeciality(Psychic) ) |
1064 | 3454 bonus_value += 5; |
353 | 3455 } |
3456 break; | |
3457 | |
0 | 3458 case PLAYER_SKILL_ITEM_ID: |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3459 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_ITEM_ID); |
0 | 3460 break; |
3461 case PLAYER_SKILL_MEDITATION: | |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3462 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_MEDITATION); |
353 | 3463 break; |
0 | 3464 case PLAYER_SKILL_TRAP_DISARM: |
353 | 3465 { |
652 | 3466 if ( CheckHiredNPCSpeciality(Tinker) ) |
1064 | 3467 bonus_value = 4; |
652 | 3468 if ( CheckHiredNPCSpeciality(Locksmith) ) |
1064 | 3469 bonus_value += 6; |
652 | 3470 if ( CheckHiredNPCSpeciality(Burglar) ) |
1064 | 3471 bonus_value += 8; |
1595
a52a01aaf439
Player::GetBaseResistance cleanup, setting default parameter to Player::GetItemsBonus
Grumpy7
parents:
1594
diff
changeset
|
3472 bonus_value += GetItemsBonus(CHARACTER_ATTRIBUTE_SKILL_TRAP_DISARM); |
353 | 3473 } |
3474 break; | |
3475 } | |
3476 | |
1064 | 3477 skill_value = pActiveSkills[uSkillType]; |
3478 if ( bonus_value + (skill_value & 0x3F) < 60 ) | |
3479 result = bonus_value + skill_value; | |
0 | 3480 else |
1064 | 3481 result = skill_value & 0xFFFC | 0x3C; //al |
0 | 3482 return result; |
3483 } | |
3484 | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3485 |
0 | 3486 //----- (0048FC00) -------------------------------------------------------- |
1538 | 3487 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
|
3488 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3489 int armsMasterBonus; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3490 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3491 armsMasterBonus = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3492 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
|
3493 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
|
3494 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3495 int multiplier = 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3496 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
|
3497 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3498 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
|
3499 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3500 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
|
3501 { |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3502 multiplier = GetMultiplierForSkillLevel(armmaster_skill, 0, 1, 1, 2); |
1064 | 3503 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3504 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
|
3505 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3506 |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3507 switch(inSkill) |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3508 { |
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
|
3509 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
|
3510 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
|
3511 { |
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
|
3512 int bowSkillLevel = GetActualSkillLevel(PLAYER_SKILL_DODGE); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3513 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
|
3514 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
|
3515 } |
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
|
3516 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
|
3517 break; |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3518 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
|
3519 { |
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
|
3520 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
|
3521 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
|
3522 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
|
3523 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3524 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3525 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
|
3526 { |
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
|
3527 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
|
3528 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
|
3529 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
|
3530 } |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3531 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3532 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
|
3533 { |
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
|
3534 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
|
3535 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
|
3536 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
|
3537 |
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
|
3538 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
|
3539 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3540 ItemGen* currItem = GetNthEquippedIndexItem(j); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3541 if (currItem != nullptr && (!currItem->IsBroken())) |
1538 | 3542 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3543 PLAYER_SKILL_TYPE itemSkillType = (PLAYER_SKILL_TYPE)currItem->GetPlayerSkillType(); |
1976 | 3544 int currArmorSkillLevel = 0; |
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
|
3545 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
|
3546 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
|
3547 { |
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
|
3548 case PLAYER_SKILL_STAFF: |
1976 | 3549 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3550 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
|
3551 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
|
3552 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
|
3553 case PLAYER_SKILL_SPEAR: |
1976 | 3554 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3555 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
|
3556 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
|
3557 case PLAYER_SKILL_SHIELD: |
1976 | 3558 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
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
|
3559 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3560 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
|
3561 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
|
3562 case PLAYER_SKILL_LEATHER: |
1976 | 3563 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
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
|
3564 wearingLeather = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3565 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
|
3566 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
|
3567 case PLAYER_SKILL_CHAIN: |
1976 | 3568 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
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
|
3569 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3570 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
|
3571 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
|
3572 case PLAYER_SKILL_PLATE: |
1976 | 3573 currArmorSkillLevel = GetActualSkillLevel(itemSkillType); |
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
|
3574 wearingArmor = true; |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3575 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
|
3576 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
|
3577 } |
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
|
3578 ACSum += multiplier * (currArmorSkillLevel & 0x3F); |
1538 | 3579 } |
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
|
3580 } |
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
|
3581 |
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
|
3582 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
|
3583 int dodgeMastery = SkillToMastery(dodgeSkillLevel); |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3584 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
|
3585 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
|
3586 { |
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
|
3587 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
|
3588 } |
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
|
3589 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
|
3590 } |
1538 | 3591 break; |
3592 case CHARACTER_ATTRIBUTE_ATTACK: | |
3593 if ( this->IsUnarmed() ) | |
3594 { | |
3595 int unarmedSkill = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
3596 if (!unarmedSkill) | |
3597 { | |
3598 return 0; | |
3599 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3600 int multiplier = GetMultiplierForSkillLevel(unarmedSkill, 0, 1, 2, 2); |
1538 | 3601 return armsMasterBonus + multiplier * (unarmedSkill & 0x3F); |
3602 } | |
3603 for (int i = 0; i < 16; ++i) | |
3604 { | |
3605 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3606 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3607 ItemGen* currItem = GetNthEquippedIndexItem(i); |
1989 | 3608 if ( currItem->GetItemEquipType() <= EQUIP_TWO_HANDED) |
1533 | 3609 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3610 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItem->GetPlayerSkillType(); |
1538 | 3611 int currentItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
3612 if (currItemSkillType == PLAYER_SKILL_BLASTER) | |
3613 { | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3614 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); |
1538 | 3615 return multiplier * (currentItemSkillLevel & 0x3F); |
3616 } | |
3617 else if (currItemSkillType == PLAYER_SKILL_STAFF && this->GetActualSkillLevel(PLAYER_SKILL_UNARMED) > 0) | |
3618 { | |
3619 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
|
3620 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 2, 2); |
1538 | 3621 return multiplier * (unarmedSkillLevel & 0x3F) + armsMasterBonus + (currentItemSkillLevel & 0x3F); |
3622 } | |
3623 else | |
3624 { | |
3625 return armsMasterBonus + (currentItemSkillLevel & 0x3F); | |
3626 } | |
3627 } | |
3628 } | |
3629 } | |
3630 return 0; | |
3631 break; | |
3632 | |
3633 case CHARACTER_ATTRIBUTE_RANGED_ATTACK: | |
3634 for (int i = 0; i < 16; i++) | |
3635 { | |
3636 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3637 { | |
2068 | 3638 ItemGen* currItemPtr = GetNthEquippedIndexItem(i); |
3639 if ( currItemPtr->GetItemEquipType() == EQUIP_TWO_HANDED || currItemPtr->GetItemEquipType() == EQUIP_SINGLE_HANDED ) | |
1538 | 3640 { |
2068 | 3641 PLAYER_SKILL_TYPE currentItemSkillType = (PLAYER_SKILL_TYPE)GetNthEquippedIndexItem(i)->GetPlayerSkillType(); |
3642 int currentItemSkillLevel = this->GetActualSkillLevel(currentItemSkillType); | |
3643 if ( currentItemSkillType == PLAYER_SKILL_BOW ) | |
3644 { | |
3645 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 1, 1, 1); | |
3646 return multiplier * (currentItemSkillLevel & 0x3F); | |
3647 } | |
3648 else if ( currentItemSkillType == PLAYER_SKILL_BLASTER ) | |
3649 { | |
3650 int multiplier = GetMultiplierForSkillLevel(currentItemSkillLevel, 1, 2, 3, 5); | |
3651 return multiplier * (currentItemSkillLevel & 0x3F); | |
3652 } | |
1538 | 3653 } |
3654 } | |
3655 } | |
3656 return 0; | |
3657 break; | |
3658 | |
3659 case CHARACTER_ATTRIBUTE_MELEE_DMG_BONUS: | |
3660 if ( this->IsUnarmed() ) | |
3661 { | |
3662 int unarmedSkillLevel = this->GetActualSkillLevel(PLAYER_SKILL_UNARMED); | |
3663 if ( !unarmedSkillLevel ) | |
3664 { | |
3665 return 0; | |
3666 } | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3667 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 3668 return multiplier * (unarmedSkillLevel & 0x3F); |
3669 } | |
3670 for (int i = 0; i < 16; i++) | |
3671 { | |
3672 if ( this->HasItemEquipped((ITEM_EQUIP_TYPE)i) ) | |
3673 { | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
3674 ItemGen* currItemPtr = GetNthEquippedIndexItem(i); |
1989 | 3675 if ( currItemPtr->GetItemEquipType() == EQUIP_TWO_HANDED || currItemPtr->GetItemEquipType() == EQUIP_SINGLE_HANDED ) |
1538 | 3676 { |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
3677 PLAYER_SKILL_TYPE currItemSkillType = (PLAYER_SKILL_TYPE)currItemPtr->GetPlayerSkillType(); |
1538 | 3678 int currItemSkillLevel = this->GetActualSkillLevel(currItemSkillType); |
3679 int baseSkillBonus; | |
3680 int multiplier; | |
3681 switch (currItemSkillType) | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3682 { |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3683 case PLAYER_SKILL_STAFF: |
1538 | 3684 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
|
3685 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3686 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
|
3687 int multiplier = GetMultiplierForSkillLevel(unarmedSkillLevel, 0, 1, 2, 2); |
1538 | 3688 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
|
3689 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3690 else |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3691 { |
1538 | 3692 return armsMasterBonus; |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3693 } |
1538 | 3694 break; |
3695 | |
3696 case PLAYER_SKILL_DAGGER: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3697 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 1); |
1538 | 3698 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3699 return armsMasterBonus + baseSkillBonus; | |
3700 break; | |
3701 case PLAYER_SKILL_SWORD: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3702 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 0, 0); |
1538 | 3703 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3704 return armsMasterBonus + baseSkillBonus; | |
3705 break; | |
3706 case PLAYER_SKILL_MACE: | |
3707 case PLAYER_SKILL_SPEAR: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3708 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 1, 1, 1); |
1538 | 3709 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3710 return armsMasterBonus + baseSkillBonus; | |
3711 break; | |
3712 case PLAYER_SKILL_AXE: | |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3713 multiplier = GetMultiplierForSkillLevel(currItemSkillLevel, 0, 0, 1, 1); |
1538 | 3714 baseSkillBonus = multiplier * (currItemSkillLevel & 0x3F); |
3715 return armsMasterBonus + baseSkillBonus; | |
3716 break; | |
1535 | 3717 } |
1533 | 3718 } |
1535 | 3719 } |
1538 | 3720 } |
3721 return 0; | |
1534
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3722 break; |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3723 default: |
d4bc1cb9d953
Player::GetSkillBonus put input value in case, removed labels (introduced a bit of code duplicity)
Grumpy7
parents:
1533
diff
changeset
|
3724 return 0; |
1533 | 3725 } |
1537
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3726 } |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3727 |
1553
b98812ead5d9
Get(skillname) functions cleaned up, using GetMultiplierForSkillLevel instead of nested conditions
Grumpy7
parents:
1552
diff
changeset
|
3728 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
|
3729 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3730 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
|
3731 switch (masteryLvl) |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3732 { |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3733 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
|
3734 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
|
3735 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
|
3736 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
|
3737 } |
1545 | 3738 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
|
3739 return 0; |
fed56133bf8a
Player:GetSkillBonus cleanup, multiplier evaluation moved to a separate function, variable clanup, renaming, scope reduction
Grumpy7
parents:
1536
diff
changeset
|
3740 } |
0 | 3741 //----- (00490109) -------------------------------------------------------- |
3742 // faces are: 0 1 2 3 human males | |
3743 // 4 5 6 7 human females | |
3744 // 8 9 elf males | |
3745 // 10 11 elf females | |
3746 // 12 13 dwarf males | |
3747 // 14 15 dwarf females | |
3748 // 16 17 goblin males | |
3749 // 18 19 goblin females | |
3750 // 20 lich male | |
3751 // 21 lich female | |
3752 // 22 underwater suits (unused) | |
3753 // 23 zombie male | |
3754 // 24 zombie female | |
3755 enum CHARACTER_RACE Player::GetRace() | |
3756 { | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3757 if ( uCurrentFace <= 7 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3758 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3759 return CHARACTER_RACE_HUMAN; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3760 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3761 else if ( uCurrentFace <= 11 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3762 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3763 return CHARACTER_RACE_ELF; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3764 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3765 else if ( uCurrentFace <= 15 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3766 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3767 return CHARACTER_RACE_DWARF; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3768 } |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3769 else if ( uCurrentFace <= 19 ) |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3770 { |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3771 return CHARACTER_RACE_GOBLIN; |
0 | 3772 } |
3773 else | |
3774 { | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3775 return CHARACTER_RACE_HUMAN; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3776 } |
0 | 3777 } |
3778 | |
3779 //----- (00490141) -------------------------------------------------------- | |
187 | 3780 PLAYER_SEX Player::GetSexByVoice() |
0 | 3781 { |
3782 switch ( this->uVoiceID ) | |
3783 { | |
3784 case 0u: | |
3785 case 1u: | |
3786 case 2u: | |
3787 case 3u: | |
3788 case 8u: | |
3789 case 9u: | |
3790 case 0xCu: | |
3791 case 0xDu: | |
3792 case 0x10u: | |
3793 case 0x11u: | |
3794 case 0x14u: | |
3795 case 0x17u: | |
187 | 3796 return SEX_MALE; |
3797 | |
0 | 3798 case 4u: |
3799 case 5u: | |
3800 case 6u: | |
3801 case 7u: | |
3802 case 0xAu: | |
3803 case 0xBu: | |
3804 case 0xEu: | |
3805 case 0xFu: | |
3806 case 0x12u: | |
3807 case 0x13u: | |
3808 case 0x15u: | |
3809 case 0x18u: | |
187 | 3810 return SEX_FEMALE; |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
3811 } |
1545 | 3812 Error("(%u)", this->uVoiceID); |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
3813 return SEX_MALE; |
0 | 3814 } |
3815 | |
3816 //----- (00490188) -------------------------------------------------------- | |
3817 void Player::SetInitialStats() | |
3818 { | |
1980 | 3819 CHARACTER_RACE v1 = GetRace(); |
290 | 3820 uMight = StatTable[v1][0].uBaseValue; |
3821 uIntelligence = StatTable[v1][1].uBaseValue; | |
3822 uWillpower = StatTable[v1][2].uBaseValue; | |
3823 uEndurance = StatTable[v1][3].uBaseValue; | |
3824 uAccuracy = StatTable[v1][4].uBaseValue; | |
3825 uSpeed = StatTable[v1][5].uBaseValue; | |
3826 uLuck = StatTable[v1][6].uBaseValue; | |
0 | 3827 } |
3828 | |
3829 //----- (004901FC) -------------------------------------------------------- | |
1021 | 3830 void Player::SetSexByVoice() |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3831 { |
1021 | 3832 switch ( this->uVoiceID) |
0 | 3833 { |
3834 case 0: | |
3835 case 1: | |
3836 case 2: | |
3837 case 3: | |
3838 case 8: | |
3839 case 9: | |
3840 case 0xC: | |
3841 case 0xD: | |
3842 case 0x10: | |
3843 case 0x11: | |
3844 case 0x14: | |
3845 case 0x17: | |
1021 | 3846 this->uSex = SEX_MALE; |
0 | 3847 break; |
3848 case 4: | |
3849 case 5: | |
3850 case 6: | |
3851 case 7: | |
3852 case 0xA: | |
3853 case 0xB: | |
3854 case 0xE: | |
3855 case 0xF: | |
3856 case 0x12: | |
3857 case 0x13: | |
3858 case 0x15: | |
3859 case 0x18: | |
1021 | 3860 this->uSex = SEX_FEMALE; |
0 | 3861 break; |
3862 default: | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
3863 Error("(%u)", this->uVoiceID); |
0 | 3864 break; |
3865 } | |
1021 | 3866 |
0 | 3867 } |
3868 | |
3869 //----- (0049024A) -------------------------------------------------------- | |
135 | 3870 void Player::Reset(PLAYER_CLASS_TYPE cls) |
0 | 3871 { |
3872 sLevelModifier = 0; | |
3873 sAgeModifier = 0; | |
3874 | |
135 | 3875 classType = cls; |
0 | 3876 uLuckBonus = 0; |
3877 uSpeedBonus = 0; | |
3878 uAccuracyBonus = 0; | |
3879 uEnduranceBonus = 0; | |
3880 uWillpowerBonus = 0; | |
3881 uIntelligenceBonus = 0; | |
3882 uMightBonus = 0; | |
3883 uLevel = 1; | |
3884 uExperience = 251 + rand() % 100; | |
3885 uBirthYear = 1147 - rand() % 6; | |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
3886 pActiveSkills.fill(0); |
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
3887 memset(_achieved_awards_bits, 0, sizeof(_achieved_awards_bits)); |
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
3888 memset(&spellbook, 0, sizeof(spellbook)); |
0 | 3889 |
3890 for (uint i = 0; i < 37; ++i) | |
3891 { | |
135 | 3892 if (pSkillAvailabilityPerClass[classType / 4][i] != 2) |
0 | 3893 continue; |
3894 | |
3895 pActiveSkills[i] = 1; | |
3896 | |
3897 switch (i) | |
3898 { | |
886 | 3899 case PLAYER_SKILL_FIRE: |
3900 spellbook.pFireSpellbook.bIsSpellAvailable[0] = true;//its temporary, for test spells | |
894 | 3901 |
3902 extern bool all_magic; | |
3903 if ( all_magic == true ) | |
3904 { | |
3905 pActiveSkills[PLAYER_SKILL_AIR] = 1; | |
3906 pActiveSkills[PLAYER_SKILL_WATER] = 1; | |
3907 pActiveSkills[PLAYER_SKILL_EARTH] = 1; | |
3908 spellbook.pFireSpellbook.bIsSpellAvailable[1] = true; | |
3909 spellbook.pFireSpellbook.bIsSpellAvailable[2] = true; | |
3910 spellbook.pFireSpellbook.bIsSpellAvailable[3] = true; | |
3911 spellbook.pFireSpellbook.bIsSpellAvailable[4] = true; | |
3912 spellbook.pFireSpellbook.bIsSpellAvailable[5] = true; | |
3913 spellbook.pFireSpellbook.bIsSpellAvailable[6] = true; | |
3914 spellbook.pFireSpellbook.bIsSpellAvailable[7] = true; | |
3915 spellbook.pFireSpellbook.bIsSpellAvailable[8] = true; | |
3916 spellbook.pFireSpellbook.bIsSpellAvailable[9] = true; | |
3917 spellbook.pFireSpellbook.bIsSpellAvailable[10] = true; | |
886 | 3918 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; |
569 | 3919 spellbook.pAirSpellbook.bIsSpellAvailable[1] = true; |
3920 spellbook.pAirSpellbook.bIsSpellAvailable[2] = true; | |
3921 spellbook.pAirSpellbook.bIsSpellAvailable[3] = true; | |
3922 spellbook.pAirSpellbook.bIsSpellAvailable[4] = true; | |
3923 spellbook.pAirSpellbook.bIsSpellAvailable[5] = true; | |
3924 spellbook.pAirSpellbook.bIsSpellAvailable[6] = true; | |
3925 spellbook.pAirSpellbook.bIsSpellAvailable[7] = true; | |
3926 spellbook.pAirSpellbook.bIsSpellAvailable[8] = true; | |
3927 spellbook.pAirSpellbook.bIsSpellAvailable[9] = true; | |
3928 spellbook.pAirSpellbook.bIsSpellAvailable[10] = true; | |
3929 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
3930 spellbook.pWaterSpellbook.bIsSpellAvailable[1] = true; | |
3931 spellbook.pWaterSpellbook.bIsSpellAvailable[2] = true; | |
3932 spellbook.pWaterSpellbook.bIsSpellAvailable[3] = true; | |
3933 spellbook.pWaterSpellbook.bIsSpellAvailable[4] = true; | |
3934 spellbook.pWaterSpellbook.bIsSpellAvailable[5] = true; | |
710 | 3935 spellbook.pWaterSpellbook.bIsSpellAvailable[6] = true; |
3936 spellbook.pWaterSpellbook.bIsSpellAvailable[7] = true; | |
3937 spellbook.pWaterSpellbook.bIsSpellAvailable[8] = true; | |
886 | 3938 spellbook.pWaterSpellbook.bIsSpellAvailable[9] = true; |
3939 spellbook.pWaterSpellbook.bIsSpellAvailable[10] = true; | |
894 | 3940 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; |
3941 spellbook.pEarthSpellbook.bIsSpellAvailable[1] = true; | |
3942 spellbook.pEarthSpellbook.bIsSpellAvailable[2] = true; | |
3943 spellbook.pEarthSpellbook.bIsSpellAvailable[3] = true; | |
3944 spellbook.pEarthSpellbook.bIsSpellAvailable[4] = true; | |
3945 spellbook.pEarthSpellbook.bIsSpellAvailable[5] = true; | |
3946 spellbook.pEarthSpellbook.bIsSpellAvailable[6] = true; | |
3947 spellbook.pEarthSpellbook.bIsSpellAvailable[7] = true; | |
3948 spellbook.pEarthSpellbook.bIsSpellAvailable[8] = true; | |
3949 spellbook.pEarthSpellbook.bIsSpellAvailable[9] = true; | |
3950 spellbook.pEarthSpellbook.bIsSpellAvailable[10] = true; | |
3951 } | |
486 | 3952 break; |
886 | 3953 case PLAYER_SKILL_AIR: |
3954 spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; | |
3955 break; | |
3956 case PLAYER_SKILL_WATER: | |
3957 spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; | |
3958 break; | |
3959 case PLAYER_SKILL_EARTH: | |
3960 spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; | |
3961 break; | |
3962 case PLAYER_SKILL_SPIRIT: | |
3963 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; | |
3964 break; | |
3965 case PLAYER_SKILL_MIND: | |
3966 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; | |
3967 break; | |
3968 case PLAYER_SKILL_BODY: | |
3969 spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; | |
894 | 3970 |
3971 if ( all_magic == true ) | |
3972 { | |
3973 pActiveSkills[PLAYER_SKILL_MIND] = 1; | |
3974 pActiveSkills[PLAYER_SKILL_SPIRIT] = 1; | |
3975 spellbook.pBodySpellbook.bIsSpellAvailable[1] = true; | |
3976 spellbook.pBodySpellbook.bIsSpellAvailable[2] = true; | |
3977 spellbook.pBodySpellbook.bIsSpellAvailable[3] = true; | |
3978 spellbook.pBodySpellbook.bIsSpellAvailable[4] = true; | |
3979 spellbook.pBodySpellbook.bIsSpellAvailable[5] = true; | |
3980 spellbook.pBodySpellbook.bIsSpellAvailable[6] = true; | |
3981 spellbook.pBodySpellbook.bIsSpellAvailable[7] = true; | |
3982 spellbook.pBodySpellbook.bIsSpellAvailable[8] = true; | |
3983 spellbook.pBodySpellbook.bIsSpellAvailable[9] = true; | |
3984 spellbook.pBodySpellbook.bIsSpellAvailable[10] = true; | |
924 | 3985 spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; |
894 | 3986 spellbook.pMindSpellbook.bIsSpellAvailable[1] = true; |
3987 spellbook.pMindSpellbook.bIsSpellAvailable[2] = true; | |
3988 spellbook.pMindSpellbook.bIsSpellAvailable[3] = true; | |
3989 spellbook.pMindSpellbook.bIsSpellAvailable[4] = true; | |
3990 spellbook.pMindSpellbook.bIsSpellAvailable[5] = true; | |
3991 spellbook.pMindSpellbook.bIsSpellAvailable[6] = true; | |
3992 spellbook.pMindSpellbook.bIsSpellAvailable[7] = true; | |
3993 spellbook.pMindSpellbook.bIsSpellAvailable[8] = true; | |
3994 spellbook.pMindSpellbook.bIsSpellAvailable[9] = true; | |
3995 spellbook.pMindSpellbook.bIsSpellAvailable[10] = true; | |
924 | 3996 spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; |
894 | 3997 spellbook.pSpiritSpellbook.bIsSpellAvailable[1] = true; |
3998 spellbook.pSpiritSpellbook.bIsSpellAvailable[2] = true; | |
3999 spellbook.pSpiritSpellbook.bIsSpellAvailable[3] = true; | |
4000 spellbook.pSpiritSpellbook.bIsSpellAvailable[4] = true; | |
4001 spellbook.pSpiritSpellbook.bIsSpellAvailable[5] = true; | |
4002 spellbook.pSpiritSpellbook.bIsSpellAvailable[6] = true; | |
4003 spellbook.pSpiritSpellbook.bIsSpellAvailable[7] = true; | |
4004 spellbook.pSpiritSpellbook.bIsSpellAvailable[8] = true; | |
4005 spellbook.pSpiritSpellbook.bIsSpellAvailable[9] = true; | |
4006 spellbook.pSpiritSpellbook.bIsSpellAvailable[10] = true; | |
4007 } | |
569 | 4008 break; |
886 | 4009 case PLAYER_SKILL_LIGHT: |
4010 spellbook.pLightSpellbook.bIsSpellAvailable[0] = true; | |
4011 break; | |
4012 case PLAYER_SKILL_DARK: | |
4013 spellbook.pDarkSpellbook.bIsSpellAvailable[0] = true; | |
4014 break; | |
0 | 4015 } |
4016 } | |
4017 | |
2191 | 4018 memset(&pEquipment, 0, sizeof(PlayerEquipment)); |
4019 pInventoryMatrix.fill(0); | |
4020 for (uint i = 0; i < 126; ++i) | |
4021 pInventoryItemList[i].Reset(); | |
4022 for (uint i = 0; i < 12; ++i) | |
4023 pEquippedItems[i].Reset(); | |
4024 | |
0 | 4025 sHealth = GetMaxHealth(); |
4026 sMana = GetMaxMana(); | |
4027 } | |
4028 | |
4029 //----- (004903C9) -------------------------------------------------------- | |
821 | 4030 PLAYER_SKILL_TYPE Player::GetSkillIdxByOrder(signed int order) |
4031 { | |
1271
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4032 int counter; // edx@5 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4033 bool canBeInactive; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4034 unsigned char requiredValue; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4035 signed int offset; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4036 |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4037 if ( order <= 1 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4038 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4039 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4040 requiredValue = 2; // 2 - primary skill |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4041 offset = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4042 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4043 else if ( order <= 3 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4044 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4045 canBeInactive = false; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4046 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4047 offset = 2; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4048 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4049 else if ( order <= 12 ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4050 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4051 canBeInactive = true; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4052 requiredValue = 1; // 1 - available |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4053 offset = 4; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4054 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4055 else |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4056 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4057 return (PLAYER_SKILL_TYPE)37; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4058 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4059 counter = 0; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4060 for (int i = 0; i < 37; i++) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4061 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4062 if ( (this->pActiveSkills[i] || canBeInactive) && pSkillAvailabilityPerClass[classType / 4][i] == requiredValue ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4063 { |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4064 if ( counter == order - offset ) |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4065 return (PLAYER_SKILL_TYPE)i; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4066 ++counter; |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4067 } |
5a3f48b370d5
Player::GetSkillIdxByOrder cleanup - extracting common branch bodies
Grumpy7
parents:
1270
diff
changeset
|
4068 } |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1407
diff
changeset
|
4069 |
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
|
4070 return (PLAYER_SKILL_TYPE)37; |
0 | 4071 } |
4072 | |
4073 | |
4074 | |
4075 //----- (0049048D) -------------------------------------------------------- | |
4076 //unsigned __int16 PartyCreation_BtnMinusClick(Player *_this, int eAttribute) | |
4077 void Player::DecreaseAttribute(int eAttribute) | |
4078 { | |
4079 int pBaseValue; // ecx@1 | |
4080 int pDroppedStep; // ebx@1 | |
4081 int pStep; // esi@1 | |
4082 int uMinValue; // [sp+Ch] [bp-4h]@1 | |
4083 | |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4084 int raceId = GetRace(); |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4085 pBaseValue = StatTable[raceId][eAttribute].uBaseValue; |
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4086 pDroppedStep = StatTable[raceId][eAttribute].uDroppedStep; |
0 | 4087 uMinValue = pBaseValue - 2; |
1617
8e3c6d7631f1
Player::GetRace cleaned up + removed a few unused vars
Grumpy7
parents:
1605
diff
changeset
|
4088 pStep = StatTable[raceId][eAttribute].uBaseStep; |
1272 | 4089 unsigned short* AttrToChange = nullptr; |
4090 switch ( eAttribute ) | |
4091 { | |
4092 case CHARACTER_ATTRIBUTE_STRENGTH: | |
4093 AttrToChange = &this->uMight; | |
4094 break; | |
4095 case CHARACTER_ATTRIBUTE_INTELLIGENCE: | |
4096 AttrToChange = &this->uIntelligence; | |
4097 break; | |
4098 case CHARACTER_ATTRIBUTE_WILLPOWER: | |
4099 AttrToChange = &this->uWillpower; | |
4100 break; | |
4101 case CHARACTER_ATTRIBUTE_ENDURANCE: | |
4102 AttrToChange = &this->uEndurance; | |
4103 break; | |
4104 case CHARACTER_ATTRIBUTE_ACCURACY: | |
4105 AttrToChange = &this->uAccuracy; | |
4106 break; | |
4107 case CHARACTER_ATTRIBUTE_SPEED: | |
4108 AttrToChange = &this->uSpeed; | |
4109 break; | |
4110 case CHARACTER_ATTRIBUTE_LUCK: | |
4111 AttrToChange = &this->uLuck; | |
4112 break; | |
4113 } | |
4114 if ( *AttrToChange <= pBaseValue ) | |
4115 pStep = pDroppedStep; | |
4116 if ( *AttrToChange - pStep >= uMinValue ) | |
4117 *AttrToChange -= pStep; | |
0 | 4118 } |
4119 | |
4120 //----- (004905F5) -------------------------------------------------------- | |
1458 | 4121 //signed int PartyCreation_BtnPlusClick(Player *this, int eAttribute) |
1273 | 4122 void Player::IncreaseAttribute( int eAttribute ) |
4123 { | |
4124 int raceId; // eax@1 | |
4125 int maxValue; // ebx@1 | |
4126 signed int baseStep; // edi@1 | |
4127 signed int tmp; // eax@17 | |
0 | 4128 signed int result; // eax@18 |
1273 | 4129 int baseValue; // [sp+Ch] [bp-8h]@1 |
4130 signed int droppedStep; // [sp+10h] [bp-4h]@1 | |
4131 unsigned short* statToChange; | |
4132 | |
4133 raceId = GetRace(); | |
4134 maxValue = StatTable[raceId][eAttribute].uMaxValue; | |
4135 baseStep = StatTable[raceId][eAttribute].uBaseStep; | |
4136 baseValue = StatTable[raceId][eAttribute].uBaseValue; | |
4137 droppedStep = StatTable[raceId][eAttribute].uDroppedStep; | |
4138 PlayerCreation_GetUnspentAttributePointCount(); | |
4139 switch ( eAttribute ) | |
4140 { | |
4141 case 0: | |
4142 statToChange = &this->uMight; | |
4143 break; | |
4144 case 1: | |
4145 statToChange = &this->uIntelligence; | |
4146 break; | |
4147 case 2: | |
4148 statToChange = &this->uWillpower; | |
4149 break; | |
4150 case 3: | |
4151 statToChange = &this->uEndurance; | |
4152 break; | |
4153 case 4: | |
4154 statToChange = &this->uAccuracy; | |
4155 break; | |
4156 case 5: | |
4157 statToChange = &this->uSpeed; | |
4158 break; | |
4159 case 6: | |
4160 statToChange = &this->uLuck; | |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
4161 break; |
1273 | 4162 default: |
1545 | 4163 Error("(%u)", eAttribute); |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
4164 break; |
1273 | 4165 } |
4166 if ( *statToChange < baseValue ) | |
4167 { | |
4168 tmp = baseStep; | |
4169 baseStep = droppedStep; | |
4170 droppedStep = tmp; | |
4171 } | |
4172 result = PlayerCreation_GetUnspentAttributePointCount(); | |
4173 if ( result >= droppedStep ) | |
4174 { | |
4175 if ( baseStep + *statToChange <= maxValue ) | |
4176 *statToChange += baseStep; | |
4177 } | |
0 | 4178 } |
4179 | |
4180 //----- (0049070F) -------------------------------------------------------- | |
4181 void Player::Zero() | |
4182 { | |
4183 this->sLevelModifier = 0; | |
4184 this->sACModifier = 0; | |
4185 this->uLuckBonus = 0; | |
4186 this->uAccuracyBonus = 0; | |
4187 this->uSpeedBonus = 0; | |
4188 this->uEnduranceBonus = 0; | |
4189 this->uWillpowerBonus = 0; | |
4190 this->uIntelligenceBonus = 0; | |
4191 this->uMightBonus = 0; | |
4192 this->field_100 = 0; | |
4193 this->field_FC = 0; | |
4194 this->field_F8 = 0; | |
4195 this->field_F4 = 0; | |
4196 this->field_F0 = 0; | |
4197 this->field_EC = 0; | |
4198 this->field_E8 = 0; | |
4199 this->field_E4 = 0; | |
4200 this->field_E0 = 0; | |
766 | 4201 memset(&this->sResFireBonus, 0, 0x16u); |
1274
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4202 this->field_1A97 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4203 this->_ranged_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4204 this->field_1A95 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4205 this->_ranged_atk_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4206 this->field_1A93 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4207 this->_melee_dmg_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4208 this->field_1A91 = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4209 this->_some_attack_bonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4210 this->_mana_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4211 this->uFullManaBonus = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4212 this->_health_related = 0; |
351bc06722f2
Player::_4B807C changed to Player::GetTempleHealCostModifier, cleaned up
Grumpy7
parents:
1273
diff
changeset
|
4213 this->uFullHealthBonus = 0; |
0 | 4214 } |
4215 | |
4216 //----- (004907E7) -------------------------------------------------------- | |
299 | 4217 unsigned int Player::GetStatColor(int uStat) |
0 | 4218 { |
290 | 4219 int attribute_value; // edx@1 |
1393 | 4220 |
4221 int base_attribute_value = StatTable[GetRace()][uStat].uBaseValue; | |
0 | 4222 switch (uStat) |
4223 { | |
4224 case 0: attribute_value = uMight; break; | |
4225 case 1: attribute_value = uIntelligence; break; | |
4226 case 2: attribute_value = uWillpower; break; | |
4227 case 3: attribute_value = uEndurance; break; | |
290 | 4228 case 4: attribute_value = uAccuracy; break; |
4229 case 5: attribute_value = uSpeed; break; | |
0 | 4230 case 6: attribute_value = uLuck; break; |
1783 | 4231 default: Error("Unexpected attribute"); |
0 | 4232 }; |
4233 | |
1393 | 4234 if (attribute_value == base_attribute_value) |
4235 return ui_character_stat_default_color; | |
4236 else if (attribute_value > base_attribute_value) | |
4237 return ui_character_stat_buffed_color; | |
0 | 4238 else |
1393 | 4239 return ui_character_stat_debuffed_color; |
0 | 4240 } |
4241 | |
4242 //----- (004908A8) -------------------------------------------------------- | |
2187 | 4243 bool Player::DiscardConditionIfLastsLongerThan(unsigned int uCondition, signed __int64 uTime) |
4244 { | |
4245 if ( pConditions[uCondition] && (uTime < (signed long long)pConditions[uCondition]) ) | |
1014 | 4246 { |
1393 | 4247 pConditions[uCondition] = 0i64; |
1014 | 4248 return true; |
0 | 4249 } |
4250 else | |
1014 | 4251 return false; |
0 | 4252 } |
4253 | |
4254 //----- (004680ED) -------------------------------------------------------- | |
1019 | 4255 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
|
4256 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4257 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
|
4258 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
|
4259 int v8; // edx@39 |
1838 | 4260 const char *v13; // eax@45 |
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
|
4261 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
|
4262 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
|
4263 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
|
4264 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
|
4265 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
|
4266 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
|
4267 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
|
4268 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
|
4269 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
|
4270 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
|
4271 __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
|
4272 __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
|
4273 __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
|
4274 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
|
4275 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
|
4276 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
|
4277 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
|
4278 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
|
4279 signed int v73; // [sp+24h] [bp-8h]@1 |
1838 | 4280 const char* v74; // [sp+24h] [bp-8h]@23 |
2163 | 4281 //Player *thisb; // [sp+28h] [bp-4h]@1 |
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
|
4282 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
|
4283 |
2163 | 4284 //thisb = this; |
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
|
4285 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
|
4286 v73 = 1; |
2242 | 4287 if ( pParty->bTurnBasedModeOn == true && (pTurnEngine->turn_stage == TE_WAIT || pTurnEngine->turn_stage == TE_MOVEMENT) ) |
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
|
4288 return; |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
4289 if ( pParty->pPickedItem.GetItemEquipType() == EQUIP_REAGENT ) |
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
|
4290 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4291 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
|
4292 { |
2187 | 4293 playerAffected->SetCondition(Condition_Poison_Weak, 1); |
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
|
4294 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4295 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
|
4296 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4297 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
|
4298 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
|
4299 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
|
4300 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
|
4301 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
|
4302 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4303 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
|
4304 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4305 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
|
4306 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
|
4307 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4308 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
|
4309 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4310 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
|
4311 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
|
4312 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
|
4313 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
|
4314 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
|
4315 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4316 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
|
4317 |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4318 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
|
4319 { |
2402 | 4320 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
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
|
4321 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4322 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
|
4323 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4324 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
|
4325 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4326 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; |
2163 | 4327 this->SetRecoveryTime(100); |
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
|
4328 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
|
4329 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4330 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
|
4331 { |
2163 | 4332 this->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
|
4333 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4334 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4335 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
|
4336 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
|
4337 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4338 |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
4339 if ( pParty->pPickedItem.GetItemEquipType() == EQUIP_POTION ) |
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
|
4340 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4341 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
|
4342 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4343 case 221: //Catalyst |
2187 | 4344 playerAffected->SetCondition(Condition_Poison_Weak, 1); |
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
|
4345 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
|
4346 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
|
4347 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
|
4348 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
|
4349 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
|
4350 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
|
4351 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
|
4352 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
|
4353 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
|
4354 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
|
4355 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
|
4356 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
|
4357 playerAffected->PlaySound(SPEECH_36, 0); |
2059 | 4358 playerAffected->sMana = new_mana_val; |
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
|
4359 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
|
4360 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
|
4361 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
|
4362 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
|
4363 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
|
4364 case 225: //Cure Disease |
2187 | 4365 playerAffected->pConditions[Condition_Disease_Severe] = 0i64; |
4366 playerAffected->pConditions[Condition_Disease_Medium] = 0i64; | |
4367 playerAffected->pConditions[Condition_Disease_Weak] = 0i64; | |
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
|
4368 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
|
4369 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
|
4370 case 226: //Cure Poison |
2187 | 4371 playerAffected->pConditions[Condition_Poison_Severe] = 0i64; |
4372 playerAffected->pConditions[Condition_Poison_Medium] = 0i64; | |
4373 playerAffected->pConditions[Condition_Poison_Weak] = 0i64; | |
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
|
4374 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
|
4375 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
|
4376 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
|
4377 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
|
4378 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
|
4379 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
|
4380 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
|
4381 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
|
4382 { |
1021 | 4383 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4384 playerAffected->pPlayerBuffs[PLAYER_BUFF_HASTE].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
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
|
4385 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
|
4386 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4387 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
|
4388 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
|
4389 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4390 playerAffected->pPlayerBuffs[PLAYER_BUFF_HEROISM].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
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
|
4391 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
|
4392 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
|
4393 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
|
4394 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4395 playerAffected->pPlayerBuffs[PLAYER_BUFF_BLESS].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
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
|
4396 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
|
4397 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
|
4398 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
|
4399 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
|
4400 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4401 playerAffected->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4402 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
|
4403 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
|
4404 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
|
4405 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
|
4406 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4407 playerAffected->pPlayerBuffs[PLAYER_BUFF_SHIELD].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4408 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
|
4409 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
|
4410 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
|
4411 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4412 playerAffected->pPlayerBuffs[PLAYER_BUFF_STONESKIN].Apply(pParty->uTimePlayed + v28, 3, 5, 0, 0); |
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
|
4413 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
|
4414 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
|
4415 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
|
4416 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335), |
1822 | 4417 playerAffected->pPlayerBuffs[PLAYER_BUFF_WATER_WALK].Apply(pParty->uTimePlayed +v28, 3, 5, 0, 0); |
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
|
4418 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
|
4419 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
|
4420 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
|
4421 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
|
4422 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
|
4423 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
|
4424 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
|
4425 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
|
4426 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
|
4427 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
|
4428 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
|
4429 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
|
4430 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
|
4431 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
|
4432 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
|
4433 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4434 playerAffected->pPlayerBuffs[PLAYER_BUFF_STRENGTH].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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 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
|
4436 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
|
4437 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
|
4438 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
|
4439 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4440 playerAffected->pPlayerBuffs[PLAYER_BUFF_INTELLIGENCE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4441 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
|
4442 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
|
4443 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
|
4444 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
|
4445 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4446 playerAffected->pPlayerBuffs[PLAYER_BUFF_WILLPOWER].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4447 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
|
4448 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
|
4449 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
|
4450 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
|
4451 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4452 playerAffected->pPlayerBuffs[PLAYER_BUFF_ENDURANCE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4453 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
|
4454 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
|
4455 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
|
4456 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
|
4457 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4458 playerAffected->pPlayerBuffs[PLAYER_BUFF_SPEED].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4459 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
|
4460 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
|
4461 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
|
4462 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
|
4463 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4464 playerAffected->pPlayerBuffs[PLAYER_BUFF_ACCURACY].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4465 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
|
4466 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
|
4467 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
|
4468 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
|
4469 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
|
4470 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
|
4471 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
|
4472 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
|
4473 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
|
4474 v34 = playerAffected->pConditions[Condition_Eradicated]; |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
4475 pConditions.fill(0); |
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
|
4476 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
|
4477 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
|
4478 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
|
4479 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
|
4480 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
|
4481 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
|
4482 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
|
4483 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
|
4484 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
|
4485 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
|
4486 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
|
4487 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
|
4488 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
|
4489 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
|
4490 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
|
4491 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
|
4492 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
|
4493 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
|
4494 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
|
4495 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
|
4496 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4497 playerAffected->pPlayerBuffs[PLAYER_BUFF_LUCK].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4498 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
|
4499 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
|
4500 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
|
4501 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
|
4502 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4503 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_FIRE].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4504 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
|
4505 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
|
4506 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
|
4507 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
|
4508 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4509 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_AIR].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4510 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
|
4511 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
|
4512 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
|
4513 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
|
4514 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4515 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_WATER].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4516 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
|
4517 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
|
4518 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
|
4519 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
|
4520 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4521 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_EARTH].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4522 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
|
4523 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
|
4524 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
|
4525 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
|
4526 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4527 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_MIND].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
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 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
|
4531 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
|
4532 v28 = (signed __int64)((double)(230400 * pParty->pPickedItem.uEnchantmentType) * 0.033333335); |
1822 | 4533 playerAffected->pPlayerBuffs[PLAYER_BUFF_RESIST_BODY].Apply(pParty->uTimePlayed + v28, 0, v50, 0, 0); |
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
|
4534 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
|
4535 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
|
4536 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
|
4537 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
|
4538 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
|
4539 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
|
4540 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
|
4541 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
|
4542 { |
f5b13e6be493
Player::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->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
|
4544 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
|
4545 } |
f5b13e6be493
Player::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 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
|
4549 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
|
4550 { |
f5b13e6be493
Player::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->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
|
4552 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
|
4553 } |
f5b13e6be493
Player::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 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
|
4555 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
|
4556 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
|
4557 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
|
4558 { |
f5b13e6be493
Player::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 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
|
4560 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
|
4561 } |
f5b13e6be493
Player::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->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
|
4563 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
|
4564 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
|
4565 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
|
4566 { |
f5b13e6be493
Player::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 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
|
4568 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
|
4569 } |
f5b13e6be493
Player::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 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
|
4571 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
|
4572 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
|
4573 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
|
4574 { |
f5b13e6be493
Player::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 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
|
4576 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
|
4577 } |
f5b13e6be493
Player::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 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
|
4579 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
|
4580 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
|
4581 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
|
4582 { |
f5b13e6be493
Player::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 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
|
4584 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
|
4585 } |
f5b13e6be493
Player::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 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
|
4589 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
|
4590 { |
f5b13e6be493
Player::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->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
|
4592 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
|
4593 } |
f5b13e6be493
Player::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 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
|
4595 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
|
4596 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
|
4597 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
|
4598 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
|
4599 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
|
4600 |
f5b13e6be493
Player::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 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
|
4602 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
|
4603 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
|
4604 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
|
4605 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
|
4606 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
|
4607 } |
f5b13e6be493
Player::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 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
|
4609 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
|
4610 { |
f5b13e6be493
Player::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 // 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
|
4612 // { |
f5b13e6be493
Player::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 // 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
|
4614 // 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
|
4615 // } |
2402 | 4616 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
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
|
4617 } |
f5b13e6be493
Player::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 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
|
4619 { |
f5b13e6be493
Player::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 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
|
4621 { |
f5b13e6be493
Player::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 pParty->pTurnBasedPlayerRecoveryTimes[player_num-1] = 100; |
2163 | 4623 this->SetRecoveryTime(100); |
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
|
4624 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
|
4625 } |
f5b13e6be493
Player::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 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
|
4627 { |
2163 | 4628 this->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
|
4629 } |
f5b13e6be493
Player::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 } |
f5b13e6be493
Player::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 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
|
4632 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
|
4633 } |
f5b13e6be493
Player::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 |
f5b13e6be493
Player::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 |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
4636 if ( pParty->pPickedItem.GetItemEquipType() == EQUIP_SPELL_SCROLL ) |
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
|
4637 { |
f5b13e6be493
Player::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 if ( pCurrentScreen == SCREEN_CASTING ) |
1032 | 4639 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
|
4640 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
|
4641 { |
f5b13e6be493
Player::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 |
f5b13e6be493
Player::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 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
|
4644 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
|
4645 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
|
4646 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
|
4647 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
|
4648 } |
f5b13e6be493
Player::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 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
|
4650 { |
f5b13e6be493
Player::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 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
|
4652 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
|
4653 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
|
4654 } |
2154 | 4655 |
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
|
4656 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
|
4657 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
|
4658 { |
f5b13e6be493
Player::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 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
|
4660 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
|
4661 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
|
4662 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
|
4663 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
|
4664 _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
|
4665 } |
f5b13e6be493
Player::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 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
|
4667 { |
f5b13e6be493
Player::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 pMouse->RemoveHoldingItem(); |
2402 | 4669 pMessageQueue_50C9E8->AddGUIMessage(UIMSG_SpellScrollUse, scroll_id, player_num - 1); |
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
|
4670 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
|
4671 && (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
|
4672 { |
2402 | 4673 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
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
|
4674 } |
f5b13e6be493
Player::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 } |
f5b13e6be493
Player::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 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
|
4677 } |
f5b13e6be493
Player::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 |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
4679 if ( pParty->pPickedItem.GetItemEquipType() == EQUIP_BOOK ) |
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
|
4680 { |
f5b13e6be493
Player::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 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
|
4682 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
|
4683 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
|
4684 { |
f5b13e6be493
Player::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 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
|
4686 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
|
4687 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 4688 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 4689 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
|
4690 } |
f5b13e6be493
Player::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 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
|
4692 { |
f5b13e6be493
Player::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 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
|
4694 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s" |
2187 | 4695 ShowStatusBarString(pTmpBuf.data(), 2); |
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
|
4696 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 4697 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
|
4698 } |
f5b13e6be493
Player::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 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
|
4700 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
|
4701 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
|
4702 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
|
4703 { |
1032 | 4704 case 0: v67 = 4; break; |
4705 case 1: v67 = 7; break; | |
4706 case 2: v67 = 10; break; | |
4707 case 3: v67 = 11; break; | |
4708 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
|
4709 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
|
4710 } |
1032 | 4711 |
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
|
4712 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
|
4713 { |
f5b13e6be493
Player::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 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
|
4715 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s" |
2187 | 4716 ShowStatusBarString(pTmpBuf.data(), 2); |
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
|
4717 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
|
4718 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
|
4719 } |
2187 | 4720 playerAffected->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400] = 1; |
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
|
4721 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
|
4722 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
|
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 |
f5b13e6be493
Player::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 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
|
4726 { |
f5b13e6be493
Player::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 ( !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
|
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 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
|
4730 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
|
4731 } |
2402 | 4732 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0); |
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
|
4733 } |
f5b13e6be493
Player::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 // 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
|
4735 // { |
f5b13e6be493
Player::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 // 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
|
4737 // { |
f5b13e6be493
Player::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 // 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
|
4739 // 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
|
4740 // 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
|
4741 // } |
f5b13e6be493
Player::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 // 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
|
4743 // { |
f5b13e6be493
Player::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 // 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
|
4745 // } |
f5b13e6be493
Player::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 // } |
f5b13e6be493
Player::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 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
|
4748 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
|
4749 } |
f5b13e6be493
Player::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 |
1709
8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
Grumpy7
parents:
1708
diff
changeset
|
4751 if ( pParty->pPickedItem.GetItemEquipType() == EQUIP_MESSAGE_SCROLL ) |
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
|
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 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
|
4754 { |
f5b13e6be493
Player::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 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
|
4756 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
|
4757 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
|
4758 } |
f5b13e6be493
Player::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 v68 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()]; |
2156 | 4760 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);//That player is %s |
4761 ShowStatusBarString(pTmpBuf.data(), 2); | |
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
|
4762 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
|
4763 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
|
4764 } |
f5b13e6be493
Player::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 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
|
4766 { |
f5b13e6be493
Player::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 (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
|
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 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
|
4770 if ( pParty->uCurrentMonth >= 7 ) |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2355
diff
changeset
|
4771 v74 = nullptr; |
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
|
4772 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
|
4773 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
|
4774 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
|
4775 { |
f5b13e6be493
Player::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 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
|
4777 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
|
4778 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
|
4779 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
|
4780 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
|
4781 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
|
4782 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
|
4783 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
|
4784 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
|
4785 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
|
4786 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
|
4787 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
|
4788 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
|
4789 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
|
4790 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
|
4791 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
|
4792 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
|
4793 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
|
4794 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
|
4795 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
|
4796 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
|
4797 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
|
4798 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
|
4799 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
|
4800 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
|
4801 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
|
4802 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
|
4803 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
|
4804 case 7: |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
4805 pParty->PartyFindsGold(1000 * thisa, 0); |
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
|
4806 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
|
4807 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
|
4808 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
|
4809 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
|
4810 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
|
4811 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
|
4812 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
|
4813 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
|
4814 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
|
4815 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
|
4816 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
|
4817 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
|
4818 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
|
4819 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
|
4820 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
|
4821 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
|
4822 switch (v8) |
1032 | 4823 { |
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
|
4824 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
|
4825 playerAffected->sResFireBase += thisa; |
2156 | 4826 v13 = pGlobalTXT_LocalizationStrings[87];//Fire |
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
|
4827 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
|
4828 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
|
4829 playerAffected->sResAirBase += thisa; |
2156 | 4830 v13 = pGlobalTXT_LocalizationStrings[6];//Air |
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
|
4831 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
|
4832 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
|
4833 playerAffected->sResWaterBase += thisa; |
2156 | 4834 v13 = pGlobalTXT_LocalizationStrings[240];//Water |
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
|
4835 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
|
4836 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
|
4837 playerAffected->sResEarthBase += thisa; |
2156 | 4838 v13 = pGlobalTXT_LocalizationStrings[70];//Earth |
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
|
4839 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
|
4840 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
|
4841 playerAffected->sResMindBase += thisa; |
2156 | 4842 v13 = pGlobalTXT_LocalizationStrings[142];//Mind |
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
|
4843 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
|
4844 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
|
4845 playerAffected->sResBodyBase += thisa; |
2156 | 4846 v13 = pGlobalTXT_LocalizationStrings[29];//Body |
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
|
4847 break; |
1783 | 4848 default: ("Unexpected attribute"); |
4849 return; | |
1021 | 4850 } |
2156 | 4851 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]);//Permanent |
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
|
4852 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
|
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 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
|
4856 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
|
4857 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
|
4858 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
|
4859 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
|
4860 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
|
4861 { |
f5b13e6be493
Player::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 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
|
4863 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
|
4864 } |
f5b13e6be493
Player::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 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
|
4866 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4867 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
|
4868 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
|
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 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
|
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 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
|
4873 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
|
4874 } |
f5b13e6be493
Player::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 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
|
4876 } |
f5b13e6be493
Player::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 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
|
4878 { |
f5b13e6be493
Player::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 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
|
4880 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
|
4881 } |
f5b13e6be493
Player::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 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
|
4883 { |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4884 pAudioPlayer->PlaySound(SOUND_PlayLute, 0, 0, -1, 0, 0, 0, 0); |
1032 | 4885 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
|
4886 } |
f5b13e6be493
Player::UseItem_DrinkPotion_etc some minor edits(brace indentation, a few warnings), commented out 2 sections which never get used
Grumpy7
parents:
1617
diff
changeset
|
4887 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
|
4888 { |
f5b13e6be493
Player::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 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
|
4890 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
|
4891 } |
f5b13e6be493
Player::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 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
|
4893 { |
f5b13e6be493
Player::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 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
|
4895 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
|
4896 } |
f5b13e6be493
Player::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 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
|
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 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
|
4900 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
|
4901 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
|
4902 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
|
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 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
|
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 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
|
4907 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
|
4908 } |
f5b13e6be493
Player::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 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
|
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 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
|
4912 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
|
4913 ShowStatusBarString(pTmpBuf.data(), 2u); |
1032 | 4914 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); |
1021 | 4915 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
|
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 |
f5b13e6be493
Player::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 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
|
4919 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
|
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 } |
0 | 4922 |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4923 bool CmpSkillValue(int valToCompare, int skillValue) |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4924 { |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4925 int v4; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4926 if ( valToCompare <= 63 ) |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4927 v4 = skillValue & 0x3F; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4928 else |
1822 | 4929 v4 = skillValue & skillValue; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4930 return v4 >= valToCompare; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4931 } |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4932 |
0 | 4933 //----- (00449BB4) -------------------------------------------------------- |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4934 bool Player::CompareVariable( enum VariableType VarNum, signed int pValue ) // in some cases this calls only calls v4 >= pValue, which i've changed to return false, since these values are supposed to be positive and v4 was -1 by default |
1731 | 4935 { |
4936 Assert(pValue >= 0, "Compare variable shouldn't have negative arguments"); | |
4937 | |
0 | 4938 signed int v4; // edi@1 |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4939 unsigned __int8 test_bit_value; // eax@25 |
1731 | 4940 unsigned __int8 byteWithRequestedBit; // cl@25 |
0 | 4941 DDM_DLV_Header *v19; // eax@122 |
4942 DDM_DLV_Header *v21; // eax@126 | |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4943 int actStat; // ebx@161 |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4944 int baseStat; // eax@161 |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4945 |
1783 | 4946 |
4947 if ( (signed int)VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_74 ) | |
4948 return (unsigned __int8)stru_5E4C90_MapPersistVars.field_0[VarNum - VAR_MapPersistentVariable_0] > 0; // originally (unsigned __int8)byte_5E4C15[VarNum]; | |
4949 if ( (signed int)VarNum >= VAR_MapPersistentVariable_75 && VarNum <= VAR_MapPersistentVariable_99 ) | |
4950 return (unsigned __int8)stru_5E4C90_MapPersistVars._decor_events[VarNum - VAR_MapPersistentVariable_75] > 0; //not really sure whether the number gets up to 99, but can't ignore the possibility | |
4951 | |
4952 switch ( VarNum ) | |
4953 { | |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4954 case VAR_Sex: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4955 return ( pValue == this->uSex ); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4956 case VAR_Class: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4957 return ( pValue == this->classType ); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4958 case VAR_Race: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4959 return pValue == GetRace(); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4960 case VAR_CurrentHP: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4961 return this->sHealth >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4962 case VAR_MaxHP: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4963 return (this->sHealth >= GetMaxHealth()); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4964 case VAR_CurrentSP: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4965 return this->sMana >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4966 case VAR_MaxSP: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4967 return (this->sMana >= GetMaxMana()); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4968 case VAR_ActualAC: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4969 return GetActualAC() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4970 case VAR_ACModifier: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4971 return this->sACModifier >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4972 case VAR_BaseLevel: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4973 return this->uLevel >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4974 case VAR_LevelModifier: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4975 return this->sLevelModifier >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4976 case VAR_Age: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4977 return GetActualAge() >= (unsigned int)pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4978 case VAR_Award: |
1783 | 4979 return _449B57_test_bit(this->_achieved_awards_bits, pValue); |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4980 case VAR_Experience: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4981 return this->uExperience >= pValue; //TODO change pValue to long long |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4982 case VAR_QBits_QuestsDone: |
1783 | 4983 return _449B57_test_bit(pParty->_quest_bits, pValue); |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4984 case VAR_PlayerItemInHands: |
1919 | 4985 //for (int i = 0; i < 138; i++) |
4986 for (int i = 0; i < 126; i++) | |
0 | 4987 { |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4988 if (pInventoryItemList[i].uItemID == pValue) |
0 | 4989 { |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4990 return true; |
0 | 4991 } |
469 | 4992 } |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4993 return pParty->pPickedItem.uItemID == pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4994 case VAR_Hour: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4995 if ( (long long)(pParty->uTimePlayed * 0.234375) / 60 / 60 % 24 == pValue ) |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4996 return true; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4997 return false; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4998 case VAR_DayOfYear: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
4999 if (((long long)(pParty->uTimePlayed * 0.234375) / 60 / 60) / 24 % 336 + 1 == pValue) |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5000 return true; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5001 return false; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5002 case VAR_DayOfWeek: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5003 if (((long long)(pParty->uTimePlayed * 0.234375) / 60 / 60) / 24 % 7) |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5004 return true; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5005 return false; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5006 case VAR_FixedGold: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5007 return pParty->uNumGold >= (unsigned int)pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5008 case VAR_FixedFood: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5009 return pParty->uNumFoodRations >= (unsigned int)pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5010 case VAR_MightBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5011 return this->uMightBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5012 case VAR_IntellectBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5013 return this->uIntelligenceBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5014 case VAR_PersonalityBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5015 return this->uWillpowerBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5016 case VAR_EnduranceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5017 return this->uEnduranceBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5018 case VAR_SpeedBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5019 return this->uSpeedBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5020 case VAR_AccuracyBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5021 return this->uAccuracyBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5022 case VAR_LuckBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5023 return this->uLuckBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5024 case VAR_BaseMight: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5025 return this->uMight >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5026 case VAR_BaseIntellect: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5027 return this->uIntelligence >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5028 case VAR_BasePersonality: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5029 return this->uWillpower >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5030 case VAR_BaseEndurance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5031 return this->uEndurance >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5032 case VAR_BaseSpeed: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5033 return this->uSpeed >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5034 case VAR_BaseAccuracy: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5035 return this->uAccuracy >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5036 case VAR_BaseLuck: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5037 return this->uLuck >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5038 case VAR_ActualMight: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5039 return GetActualMight() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5040 case VAR_ActualIntellect: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5041 return GetActualIntelligence() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5042 case VAR_ActualPersonality: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5043 return GetActualWillpower() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5044 case VAR_ActualEndurance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5045 return GetActualEndurance() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5046 case VAR_ActualSpeed: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5047 return GetActualSpeed() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5048 case VAR_ActualAccuracy: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5049 return GetActualAccuracy() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5050 case VAR_ActualLuck: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5051 return GetActualLuck() >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5052 case VAR_FireResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5053 return this->sResFireBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5054 case VAR_AirResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5055 return this->sResAirBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5056 case VAR_WaterResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5057 return this->sResWaterBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5058 case VAR_EarthResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5059 return this->sResEarthBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5060 case VAR_SpiritResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5061 return this->sResSpiritBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5062 case VAR_MindResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5063 return this->sResMindBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5064 case VAR_BodyResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5065 return this->sResBodyBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5066 case VAR_LightResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5067 return this->sResLightBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5068 case VAR_DarkResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5069 return this->sResDarkBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5070 case VAR_PhysicalResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5071 Error("Physical resistance isn't used in events"); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5072 return false; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5073 case VAR_MagicResistance: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5074 return this->sResMagicBase >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5075 case VAR_FireResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5076 return this->sResFireBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5077 case VAR_AirResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5078 return this->sResAirBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5079 case VAR_WaterResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5080 return this->sResWaterBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5081 case VAR_EarthResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5082 return this->sResEarthBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5083 case VAR_SpiritResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5084 return this->sResSpiritBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5085 case VAR_MindResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5086 return this->sResMindBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5087 case VAR_BodyResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5088 return this->sResBodyBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5089 case VAR_LightResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5090 return this->sResLightBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5091 case VAR_DarkResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5092 return this->sResDarkBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5093 case VAR_MagicResistanceBonus: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5094 return this->sResMagicBonus >= pValue; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5095 case VAR_StaffSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5096 return CmpSkillValue(pValue, this->skillStaff); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5097 case VAR_SwordSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5098 return CmpSkillValue(pValue, this->skillSword); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5099 case VAR_DaggerSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5100 return CmpSkillValue(pValue, this->skillDagger); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5101 case VAR_AxeSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5102 return CmpSkillValue(pValue, this->skillAxe); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5103 case VAR_SpearSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5104 return CmpSkillValue(pValue, this->skillSpear); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5105 case VAR_BowSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5106 return CmpSkillValue(pValue, this->skillBow); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5107 case VAR_MaceSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5108 return CmpSkillValue(pValue, this->skillMace); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5109 case VAR_BlasterSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5110 return CmpSkillValue(pValue, this->skillBlaster); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5111 case VAR_ShieldSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5112 return CmpSkillValue(pValue, this->skillShield); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5113 case VAR_LeatherSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5114 return CmpSkillValue(pValue, this->skillLeather); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5115 case VAR_SkillChain: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5116 return CmpSkillValue(pValue, this->skillChain); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5117 case VAR_PlateSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5118 return CmpSkillValue(pValue, this->skillPlate); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5119 case VAR_FireSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5120 return CmpSkillValue(pValue, this->skillFire); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5121 case VAR_AirSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5122 return CmpSkillValue(pValue, this->skillAir); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5123 case VAR_WaterSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5124 return CmpSkillValue(pValue, this->skillWater); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5125 case VAR_EarthSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5126 return CmpSkillValue(pValue, this->skillEarth); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5127 case VAR_SpiritSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5128 return CmpSkillValue(pValue, this->skillSpirit); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5129 case VAR_MindSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5130 return CmpSkillValue(pValue, this->skillMind); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5131 case VAR_BodySkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5132 return CmpSkillValue(pValue, this->skillBody); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5133 case VAR_LightSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5134 return CmpSkillValue(pValue, this->skillLight); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5135 case VAR_DarkSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5136 return CmpSkillValue(pValue, this->skillDark); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5137 case VAR_IdentifyItemSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5138 return CmpSkillValue(pValue, this->skillItemId); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5139 case VAR_MerchantSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5140 return CmpSkillValue(pValue, this->skillMerchant); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5141 case VAR_RepairSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5142 return CmpSkillValue(pValue, this->skillRepair); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5143 case VAR_BodybuildingSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5144 return CmpSkillValue(pValue, this->skillBodybuilding); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5145 case VAR_MeditationSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5146 return CmpSkillValue(pValue, this->skillMeditation); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5147 case VAR_PerceptionSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5148 return CmpSkillValue(pValue, this->skillPerception); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5149 case VAR_DiplomacySkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5150 return CmpSkillValue(pValue, this->skillDiplomacy); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5151 case VAR_ThieverySkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5152 Error("Thievery isn't used in events"); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5153 return false; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5154 case VAR_DisarmTrapSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5155 return CmpSkillValue(pValue, this->skillDisarmTrap); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5156 case VAR_DodgeSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5157 return CmpSkillValue(pValue, this->skillDodge); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5158 case VAR_UnarmedSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5159 return CmpSkillValue(pValue, this->skillUnarmed); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5160 case VAR_IdentifyMonsterSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5161 return CmpSkillValue(pValue, this->skillMonsterId); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5162 case VAR_ArmsmasterSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5163 return CmpSkillValue(pValue, this->skillArmsmaster); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5164 case VAR_StealingSkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5165 return CmpSkillValue(pValue, this->skillStealing); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5166 case VAR_AlchemySkill: //wasn't in the original |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5167 return CmpSkillValue(pValue, this->skillAlchemy); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5168 case VAR_LearningSkill: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5169 return CmpSkillValue(pValue, this->skillLearning); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5170 case VAR_Cursed: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5171 return pConditions[Condition_Cursed] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5172 case VAR_Weak: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5173 return pConditions[Condition_Weak] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5174 case VAR_Asleep: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5175 return pConditions[Condition_Sleep] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5176 case VAR_Afraid: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5177 return pConditions[Condition_Fear] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5178 case VAR_Drunk: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5179 return pConditions[Condition_Drunk] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5180 case VAR_Insane: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5181 return pConditions[Condition_Insane] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5182 case VAR_PoisonedGreen: |
2187 | 5183 return pConditions[Condition_Poison_Weak] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5184 case VAR_DiseasedGreen: |
2187 | 5185 return pConditions[Condition_Disease_Weak] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5186 case VAR_PoisonedYellow: |
2187 | 5187 return pConditions[Condition_Poison_Medium] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5188 case VAR_DiseasedYellow: |
2187 | 5189 return pConditions[Condition_Disease_Medium] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5190 case VAR_PoisonedRed: |
2187 | 5191 return pConditions[Condition_Poison_Severe] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5192 case VAR_DiseasedRed: |
2187 | 5193 return pConditions[Condition_Disease_Severe] > 0; |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5194 case VAR_Paralyzed: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5195 return pConditions[Condition_Paralyzed] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5196 case VAR_Unconsious: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5197 return pConditions[Condition_Unconcious] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5198 case VAR_Dead: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5199 return pConditions[Condition_Dead] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5200 case VAR_Stoned: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5201 return pConditions[Condition_Pertified] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5202 case VAR_Eradicated: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5203 return pConditions[Condition_Eradicated] > 0; |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5204 case VAR_MajorCondition: |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5205 v4 = GetMajorConditionIdx(); |
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5206 if ( v4 != 18 ) |
0 | 5207 { |
469 | 5208 return v4 >= pValue; |
5209 } | |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5210 return true; |
1783 | 5211 case VAR_AutoNotes : //TODO: find out why the double subtraction. or whether this is even used |
5212 test_bit_value = 0x80u >> (pValue - 2) % 8; | |
5213 byteWithRequestedBit = pParty->_autonote_bits[(pValue - 2) /8]; | |
5214 return (test_bit_value & byteWithRequestedBit) != 0; | |
5215 case VAR_IsMightMoreThanBase: | |
5216 actStat = GetActualMight(); | |
5217 baseStat = GetBaseStrength(); | |
5218 return (actStat >= baseStat); | |
5219 case VAR_IsIntellectMoreThanBase: | |
5220 actStat = GetActualIntelligence(); | |
5221 baseStat = GetBaseIntelligence(); | |
5222 return (actStat >= baseStat); | |
5223 case VAR_IsPersonalityMoreThanBase: | |
5224 actStat = GetActualWillpower(); | |
5225 baseStat = GetBaseWillpower(); | |
5226 return (actStat >= baseStat); | |
5227 case VAR_IsEnduranceMoreThanBase: | |
5228 actStat = GetActualEndurance(); | |
5229 baseStat = GetBaseEndurance(); | |
5230 return (actStat >= baseStat); | |
5231 case VAR_IsSpeedMoreThanBase: | |
5232 actStat = GetActualSpeed(); | |
5233 baseStat = GetBaseSpeed(); | |
5234 return (actStat >= baseStat); | |
5235 case VAR_IsAccuracyMoreThanBase: | |
5236 actStat = GetActualAccuracy(); | |
5237 baseStat = GetBaseAccuracy(); | |
5238 return (actStat >= baseStat); | |
5239 case VAR_IsLuckMoreThanBase: | |
5240 actStat = GetActualLuck(); | |
5241 baseStat = GetBaseLuck(); | |
5242 return (actStat >= baseStat); | |
5243 case VAR_PlayerBits: | |
5244 test_bit_value = 0x80u >> ((signed __int16)pValue - 1) % 8; | |
1822 | 5245 byteWithRequestedBit = this->playerEventBits[((signed __int16)pValue - 1)/8]; |
1783 | 5246 return ( test_bit_value & byteWithRequestedBit ) != 0; |
5247 case VAR_NPCs2: | |
5248 return pNPCStats->pNewNPCData[pValue].Hired(); | |
5249 case VAR_IsFlying: | |
5250 if ( pParty->bFlying | |
5251 && (pParty->pPartyBuffs[PARTY_BUFF_FLY].uExpireTime> 0) ) | |
5252 return true; | |
5253 return false; | |
5254 case VAR_HiredNPCHasSpeciality: | |
5255 return CheckHiredNPCSpeciality(pValue); | |
5256 case VAR_CircusPrises: //isn't used in MM6 since 0x1D6u is a book of regeneration | |
5257 v4 = 0; | |
5258 for (int playerNum = 0; playerNum < 4; playerNum++) | |
5259 { | |
5260 for (int invPos = 0; invPos < 138; invPos++) | |
5261 { | |
5262 int itemId = pParty->pPlayers[playerNum].pInventoryItemList[invPos].uItemID; | |
5263 switch ( itemId ) | |
5264 { | |
5265 case 0x1D6u: | |
5266 ++v4; | |
5267 break; | |
5268 case 0x1D7u: | |
5269 v4 += 3; | |
5270 break; | |
5271 case 0x1DDu: | |
5272 v4 += 5; | |
5273 break; | |
5274 } | |
5275 } | |
5276 } | |
5277 return v4 >= pValue; | |
5278 case VAR_NumSkillPoints: | |
5279 return this->uSkillPoints >= (unsigned int)pValue; | |
5280 case VAR_MonthIs: | |
5281 return (pParty->uCurrentMonth == (unsigned int)pValue); | |
5282 case VAR_Counter1: | |
5283 case VAR_Counter2: | |
5284 case VAR_Counter3: | |
5285 case VAR_Counter4: | |
5286 case VAR_Counter5: | |
5287 case VAR_Counter6: | |
5288 case VAR_Counter7: | |
5289 case VAR_Counter8: | |
5290 case VAR_Counter9: | |
5291 case VAR_Counter10: | |
5292 if (pParty->PartyTimes.CounterEventValues[VarNum - VAR_Counter1]) //originally (signed __int64)(__PAIR__(*(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44304], *(int *)&stru_AA1058[3].pSounds[8 * VarNum + 44300]) | |
5293 { | |
5294 return (pParty->PartyTimes.CounterEventValues[VarNum - VAR_Counter1] + 460800 * pValue * 0.033333335) <= pParty->uTimePlayed ; | |
5295 } | |
5296 case VAR_ReputationInCurrentLocation: | |
5297 v19 = &pOutdoor->ddm; | |
5298 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5299 v19 = &pIndoor->dlv; | |
5300 return (v19->uReputation >= pValue); | |
5301 case VAR_Unknown1: | |
5302 v21 = &pOutdoor->ddm; | |
5303 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | |
5304 v21 = &pIndoor->dlv; | |
5305 return (v21->field_C_alert == pValue); //yes, equality, not >= | |
5306 case VAR_GoldInBank: | |
5307 return pParty->uNumGoldInBank >= (unsigned int)pValue; | |
5308 case VAR_NumDeaths: | |
5309 return pParty->uNumDeaths >= (unsigned int)pValue; | |
5310 case VAR_NumBounties: | |
5311 return pParty->uNumBountiesCollected >= (unsigned int)pValue; | |
5312 case VAR_PrisonTerms: | |
5313 return pParty->uNumPrisonTerms >= pValue; | |
5314 case VAR_ArenaWinsPage: | |
5315 return (unsigned __int8)pParty->uNumArenaPageWins >= pValue; | |
5316 case VAR_ArenaWinsSquire: | |
5317 return (unsigned __int8)pParty->uNumArenaSquireWins >= pValue; | |
5318 case VAR_ArenaWinsKnight: | |
5319 return (unsigned __int8)pParty->uNumArenaKnightWins >= pValue; | |
5320 case VAR_ArenaWinsLord: | |
5321 return pParty->uNumArenaLordWins >= pValue; | |
5322 case VAR_Invisible: | |
5323 return ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime > 0 ); | |
5324 case VAR_ItemEquipped: | |
5325 for (int i = 0; i < 16; i++) | |
5326 { | |
5327 if ( HasItemEquipped((ITEM_EQUIP_TYPE)i) && GetNthEquippedIndexItem(i)->uItemID == pValue ) | |
5328 { | |
5329 return true; | |
5330 } | |
5331 } | |
5332 return false; | |
5333 } | |
5334 | |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1731
diff
changeset
|
5335 return false; |
0 | 5336 } |
5337 | |
5338 | |
5339 //----- (0044A5CB) -------------------------------------------------------- | |
492 | 5340 void Player::SetVariable(enum VariableType var_type, signed int var_value) |
5341 { | |
0 | 5342 unsigned int v6; // esi@13 |
5343 unsigned int v7; // esi@14 | |
5344 signed int v11; // eax@30 | |
5345 DDM_DLV_Header *v24; // ecx@148 | |
5346 ItemGen item; // [sp+Ch] [bp-28h]@52 | |
1766
110727780974
Player::SetVariable restarting function refatcoring
Grumpy7
parents:
1760
diff
changeset
|
5347 |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5348 |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5349 if ( var_type >= VAR_History_0 && var_type <= VAR_History_28) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5350 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5351 if (!pParty->PartyTimes.HistoryEventTimes[var_type - VAR_History_0]) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5352 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5353 pParty->PartyTimes.HistoryEventTimes[var_type - VAR_History_0] = pParty->uTimePlayed; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5354 if (pStorylineText->StoreLine[var_type - VAR_History_0].pText) |
492 | 5355 { |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5356 bFlashHistoryBook = 1; |
1822 | 5357 PlayAwardSound(); |
0 | 5358 } |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5359 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5360 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5361 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5362 |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5363 if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_99 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5364 { |
1822 | 5365 if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_74 ) |
5366 stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] = (char)var_value; // originally (unsigned __int8)byte_5E4C15[VarNum]; | |
5367 if ( var_type >= VAR_MapPersistentVariable_75 && var_type <= VAR_MapPersistentVariable_99 ) | |
5368 stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] = (unsigned char)var_value; //not really sure whether the number gets up to 99, but can't ignore the possibility | |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5369 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5370 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5371 |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5372 if ( var_type >= VAR_UnknownTimeEvent0 && var_type <= VAR_UnknownTimeEvent19 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5373 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5374 pParty->PartyTimes._s_times[var_type - VAR_UnknownTimeEvent0] = pParty->uTimePlayed; //*(int *)&stru_AA1058[3].pSounds[8 * var_type + 44532] = LODWORD(pParty->uTimePlayed);, *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44536] = HIDWORD(pParty->uTimePlayed |
1822 | 5375 PlayAwardSound(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5376 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5377 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5378 |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5379 switch ( var_type ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5380 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5381 case VAR_Sex: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5382 this->uSex = (PLAYER_SEX)var_value; |
1822 | 5383 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5384 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5385 case VAR_Class: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5386 this->classType = (PLAYER_CLASS_TYPE)var_value; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5387 if ( (PLAYER_CLASS_TYPE)var_value == PLAYER_CLASS_LICH ) |
492 | 5388 { |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5389 for (int i = 0; i < 138; i++) |
0 | 5390 { |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5391 if (this->pOwnItems[i].uItemID == ITEM_LICH_JAR_EMPTY) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5392 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5393 this->pOwnItems[i].uItemID = ITEM_LICH_JAR_FULL; |
1822 | 5394 this->pOwnItems[i].uHolderPlayer = GetPlayerIndex() + 1; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5395 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5396 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5397 if ( this->sResFireBase < 20 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5398 this->sResFireBase = 20; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5399 if ( this->sResAirBase < 20 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5400 this->sResAirBase = 20; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5401 if ( this->sResWaterBase < 20 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5402 this->sResWaterBase = 20; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5403 if ( this->sResEarthBase < 20 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5404 this->sResEarthBase = 20; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5405 this->sResMindBase = 200; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5406 this->sResBodyBase = 200; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5407 v11 = this->GetSexByVoice(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5408 this->uPrevVoiceID = this->uVoiceID; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5409 this->uPrevFace = this->uCurrentFace; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5410 if ( v11 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5411 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5412 this->uCurrentFace = 21; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5413 this->uVoiceID = 21; |
0 | 5414 } |
5415 else | |
5416 { | |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5417 this->uCurrentFace = 20; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5418 this->uVoiceID = 20; |
0 | 5419 } |
1822 | 5420 ReloadPlayerPortraits(GetPlayerIndex(), this->uCurrentFace); |
0 | 5421 } |
1822 | 5422 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5423 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5424 case VAR_CurrentHP: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5425 this->sHealth = var_value; |
1822 | 5426 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5427 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5428 case VAR_MaxHP: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5429 this->sHealth = GetMaxHealth(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5430 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5431 case VAR_CurrentSP: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5432 this->sMana = var_value; |
1822 | 5433 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5434 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5435 case VAR_MaxSP: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5436 this->sMana = GetMaxMana(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5437 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5438 case VAR_ACModifier: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5439 this->sACModifier = (unsigned __int8)var_value; |
1822 | 5440 PlayAwardSound_Anim(); |
0 | 5441 return; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5442 case VAR_BaseLevel: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5443 this->uLevel = (unsigned __int8)var_value; |
1822 | 5444 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5445 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5446 case VAR_LevelModifier: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5447 this->sLevelModifier = (unsigned __int8)var_value; |
1822 | 5448 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5449 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5450 case VAR_Age: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5451 this->sAgeModifier = var_value; |
1766
110727780974
Player::SetVariable restarting function refatcoring
Grumpy7
parents:
1760
diff
changeset
|
5452 return; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5453 case VAR_Award: |
1783 | 5454 if ( !_449B57_test_bit(this->_achieved_awards_bits, var_value) && pAwards[var_value].pText ) |
492 | 5455 { |
1822 | 5456 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5457 this->PlaySound(SPEECH_96, 0); |
0 | 5458 } |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5459 _449B7E_toggle_bit(this->_achieved_awards_bits, var_value, 1u); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5460 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5461 case VAR_Experience: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5462 this->uExperience = var_value; |
1822 | 5463 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5464 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5465 case VAR_QBits_QuestsDone: |
1783 | 5466 if ( !_449B57_test_bit(pParty->_quest_bits, var_value) && pQuestTable[var_value-1] ) |
0 | 5467 { |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5468 bFlashQuestBook = 1; |
1822 | 5469 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, GetPlayerIndex()); |
5470 PlayAwardSound(); | |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5471 this->PlaySound(SPEECH_93, 0); |
0 | 5472 } |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5473 _449B7E_toggle_bit(pParty->_quest_bits, var_value, 1u); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5474 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5475 case VAR_PlayerItemInHands: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5476 item.Reset(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5477 item.uItemID = var_value; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5478 item.uAttributes = 1; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5479 pParty->SetHoldingItem(&item); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5480 if ( var_value >= ITEM_ARTIFACT_PUCK && var_value <= ITEM_RELIC_MEKORIGS_HAMMER ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5481 pParty->pIsArtifactFound[var_value-500] = 1; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5482 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5483 case VAR_FixedGold: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5484 Party::SetGold(var_value); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5485 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5486 case VAR_RandomGold: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5487 v6 = rand() % var_value + 1; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5488 Party::SetGold(v6); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5489 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5490 ShowStatusBarString(pTmpBuf.data(), 2u); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5491 GameUI_DrawFoodAndGold(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5492 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5493 case VAR_FixedFood: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5494 Party::SetFood(var_value); |
1822 | 5495 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5496 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5497 case VAR_RandomFood: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5498 v7 = rand() % var_value + 1; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5499 Party::SetFood(v7); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5500 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5501 ShowStatusBarString(pTmpBuf.data(), 2u); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5502 GameUI_DrawFoodAndGold(); |
1822 | 5503 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5504 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5505 case VAR_BaseMight: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5506 this->uMight = (unsigned __int8)var_value; |
1822 | 5507 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5508 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5509 case VAR_BaseIntellect: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5510 this->uIntelligence = (unsigned __int8)var_value; |
1822 | 5511 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5512 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5513 case VAR_BasePersonality: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5514 this->uWillpower = (unsigned __int8)var_value; |
1822 | 5515 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5516 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5517 case VAR_BaseEndurance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5518 this->uEndurance = (unsigned __int8)var_value; |
1822 | 5519 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5520 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5521 case VAR_BaseSpeed: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5522 this->uSpeed = (unsigned __int8)var_value; |
1822 | 5523 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5524 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5525 case VAR_BaseAccuracy: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5526 this->uAccuracy = (unsigned __int8)var_value; |
1822 | 5527 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5528 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5529 case VAR_BaseLuck: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5530 this->uLuck = (unsigned __int8)var_value; |
1822 | 5531 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5532 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5533 case VAR_MightBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5534 case VAR_ActualMight: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5535 this->uMightBonus = (unsigned __int8)var_value; |
1822 | 5536 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5537 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5538 case VAR_IntellectBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5539 case VAR_ActualIntellect: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5540 this->uIntelligenceBonus = (unsigned __int8)var_value; |
1822 | 5541 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5542 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5543 case VAR_PersonalityBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5544 case VAR_ActualPersonality: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5545 this->uWillpowerBonus = (unsigned __int8)var_value; |
1822 | 5546 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5547 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5548 case VAR_EnduranceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5549 case VAR_ActualEndurance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5550 this->uEnduranceBonus = (unsigned __int8)var_value; |
1822 | 5551 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5552 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5553 case VAR_SpeedBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5554 case VAR_ActualSpeed: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5555 this->uSpeedBonus = (unsigned __int8)var_value; |
1822 | 5556 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5557 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5558 case VAR_AccuracyBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5559 case VAR_ActualAccuracy: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5560 this->uAccuracyBonus = (unsigned __int8)var_value; |
1822 | 5561 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5562 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5563 case VAR_LuckBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5564 case VAR_ActualLuck: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5565 this->uLuckBonus = (unsigned __int8)var_value; |
1822 | 5566 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5567 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5568 case VAR_FireResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5569 this->sResFireBase = (unsigned __int8)var_value; |
1822 | 5570 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5571 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5572 case VAR_AirResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5573 this->sResAirBase = (unsigned __int8)var_value; |
1822 | 5574 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5575 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5576 case VAR_WaterResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5577 this->sResWaterBase = (unsigned __int8)var_value; |
1822 | 5578 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5579 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5580 case VAR_EarthResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5581 this->sResEarthBase = (unsigned __int8)var_value; |
1822 | 5582 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5583 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5584 case VAR_SpiritResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5585 this->sResSpiritBase = (unsigned __int8)var_value; |
1822 | 5586 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5587 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5588 case VAR_MindResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5589 this->sResMindBase = (unsigned __int8)var_value; |
1822 | 5590 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5591 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5592 case VAR_BodyResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5593 this->sResBodyBase = (unsigned __int8)var_value; |
1822 | 5594 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5595 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5596 case VAR_LightResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5597 this->sResLightBase = (unsigned __int8)var_value; |
1822 | 5598 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5599 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5600 case VAR_DarkResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5601 this->sResDarkBase = (unsigned __int8)var_value; |
1822 | 5602 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5603 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5604 case VAR_MagicResistance: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5605 this->sResMagicBase = (unsigned __int8)var_value; |
1822 | 5606 PlayAwardSound_Anim_Face(SPEECH_92); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5607 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5608 case VAR_FireResistanceBonus: |
1766
110727780974
Player::SetVariable restarting function refatcoring
Grumpy7
parents:
1760
diff
changeset
|
5609 this->sResFireBonus = (unsigned __int8)var_value; |
1822 | 5610 PlayAwardSound_Anim_Face(SPEECH_91); |
0 | 5611 return; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5612 case VAR_AirResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5613 this->sResAirBonus = (unsigned __int8)var_value; |
1822 | 5614 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5615 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5616 case VAR_WaterResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5617 this->sResWaterBonus = (unsigned __int8)var_value; |
1822 | 5618 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5619 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5620 case VAR_EarthResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5621 this->sResEarthBonus = (unsigned __int8)var_value; |
1822 | 5622 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5623 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5624 case VAR_SpiritResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5625 this->sResSpiritBonus = (unsigned __int8)var_value; |
1822 | 5626 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5627 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5628 case VAR_MindResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5629 this->sResMindBonus = (unsigned __int8)var_value; |
1822 | 5630 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5631 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5632 case VAR_BodyResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5633 this->sResBodyBonus = (unsigned __int8)var_value; |
1822 | 5634 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5635 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5636 case VAR_LightResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5637 this->sResLightBonus = (unsigned __int8)var_value; |
1822 | 5638 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5639 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5640 case VAR_DarkResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5641 this->sResDarkBonus = (unsigned __int8)var_value; |
1822 | 5642 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5643 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5644 case VAR_PhysicalResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5645 Error("Physical res. bonus not used"); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5646 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5647 case VAR_MagicResistanceBonus: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5648 this->sResMagicBonus = (unsigned __int8)var_value; |
1822 | 5649 PlayAwardSound_Anim_Face(SPEECH_91); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5650 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5651 case VAR_Cursed: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5652 this->SetCondition(Condition_Cursed, 1); |
1822 | 5653 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5654 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5655 case VAR_Weak: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5656 this->SetCondition(Condition_Weak, 1); |
1822 | 5657 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5658 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5659 case VAR_Asleep: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5660 this->SetCondition(Condition_Sleep, 1); |
1822 | 5661 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5662 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5663 case VAR_Afraid: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5664 this->SetCondition(Condition_Fear, 1); |
1822 | 5665 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5666 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5667 case VAR_Drunk: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5668 this->SetCondition(Condition_Drunk, 1); |
1822 | 5669 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5670 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5671 case VAR_Insane: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5672 this->SetCondition(Condition_Insane, 1); |
1822 | 5673 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5674 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5675 case VAR_PoisonedGreen: |
2187 | 5676 this->SetCondition(Condition_Poison_Weak, 1); |
1822 | 5677 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5678 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5679 case VAR_DiseasedGreen: |
2187 | 5680 this->SetCondition(Condition_Disease_Weak, 1); |
1822 | 5681 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5682 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5683 case VAR_PoisonedYellow: |
2187 | 5684 this->SetCondition(Condition_Poison_Medium, 1); |
1822 | 5685 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5686 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5687 case VAR_DiseasedYellow: |
2187 | 5688 this->SetCondition(Condition_Disease_Medium, 1); |
1822 | 5689 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5690 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5691 case VAR_PoisonedRed: |
2187 | 5692 this->SetCondition(Condition_Poison_Severe, 1); |
1822 | 5693 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5694 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5695 case VAR_DiseasedRed: |
2187 | 5696 this->SetCondition(Condition_Disease_Severe, 1); |
1822 | 5697 PlayAwardSound_Anim(); |
1770 | 5698 return; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5699 case VAR_Paralyzed: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5700 this->SetCondition(Condition_Paralyzed, 1); |
1822 | 5701 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5702 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5703 case VAR_Unconsious: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5704 this->SetCondition(Condition_Unconcious, 1); |
1822 | 5705 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5706 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5707 case VAR_Dead: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5708 this->SetCondition(Condition_Dead, 1); |
1822 | 5709 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5710 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5711 case VAR_Stoned: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5712 this->SetCondition(Condition_Pertified, 1); |
1822 | 5713 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5714 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5715 case VAR_Eradicated: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5716 this->SetCondition(Condition_Eradicated, 1); |
1822 | 5717 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5718 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5719 case VAR_MajorCondition: |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
5720 pConditions.fill(0); |
1822 | 5721 PlayAwardSound_Anim(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5722 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5723 case VAR_AutoNotes: |
1783 | 5724 if ( !_449B57_test_bit(pParty->_autonote_bits, var_value) && pAutonoteTxt[var_value-1].pText ) |
1776
0f273c459f78
Player::SetVariable PlaySound and SetPlayerBuffAnim labels restored to original state
Grumpy7
parents:
1775
diff
changeset
|
5725 { |
1822 | 5726 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, GetPlayerIndex()); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5727 this->PlaySound(SPEECH_96, 0); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5728 bFlashAutonotesBook = 1; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5729 _506568_autonote_type = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; |
1776
0f273c459f78
Player::SetVariable PlaySound and SetPlayerBuffAnim labels restored to original state
Grumpy7
parents:
1775
diff
changeset
|
5730 } |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5731 _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u); |
1822 | 5732 PlayAwardSound(); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5733 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5734 case VAR_PlayerBits: |
1822 | 5735 _449B7E_toggle_bit((unsigned char *)playerEventBits, var_value, 1u); |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5736 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5737 case VAR_NPCs2: |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1792
diff
changeset
|
5738 pParty->hirelingScrollPosition = 0; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5739 LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5740 pParty->CountHirelings(); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5741 viewparams->bRedrawGameUI = true; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5742 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5743 case VAR_NumSkillPoints: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5744 this->uSkillPoints = var_value; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5745 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5746 case VAR_Counter1: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5747 case VAR_Counter2: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5748 case VAR_Counter3: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5749 case VAR_Counter4: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5750 case VAR_Counter5: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5751 case VAR_Counter6: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5752 case VAR_Counter7: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5753 case VAR_Counter8: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5754 case VAR_Counter9: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5755 case VAR_Counter10: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5756 pParty->PartyTimes.CounterEventValues[var_type - VAR_Counter1] = pParty->uTimePlayed; // *(int *)&stru_AA1058[3].pSounds[8 * var_type + 44300] = LODWORD(pParty->uTimePlayed);*(int *)&stru_AA1058[3].pSounds[8 * var_type + 44304] = HIDWORD(pParty->uTimePlayed); |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5757 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5758 case VAR_ReputationInCurrentLocation: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5759 v24 = &pOutdoor->ddm; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5760 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5761 v24 = &pIndoor->dlv; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5762 v24->uReputation = var_value; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5763 if ( var_value > 10000 ) |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5764 v24->uReputation = 10000; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5765 return; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5766 case VAR_GoldInBank: |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5767 pParty->uNumGoldInBank = var_value; |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5768 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5769 case VAR_NumDeaths: |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5770 pParty->uNumDeaths = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5771 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5772 case VAR_NumBounties: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5773 pParty->uNumBountiesCollected = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5774 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5775 case VAR_PrisonTerms: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5776 pParty->uNumPrisonTerms = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5777 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5778 case VAR_ArenaWinsPage: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5779 pParty->uNumArenaPageWins = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5780 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5781 case VAR_ArenaWinsSquire: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5782 pParty->uNumArenaSquireWins = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5783 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5784 case VAR_ArenaWinsKnight: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5785 pParty->uNumArenaKnightWins = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5786 return; |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5787 case VAR_ArenaWinsLord: |
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5788 pParty->uNumArenaLordWins = var_value; |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5789 return; |
1782 | 5790 case VAR_StaffSkill: |
1822 | 5791 SetSkillByEvent(&Player::skillStaff, var_value); |
1782 | 5792 return; |
5793 case VAR_SwordSkill: | |
1822 | 5794 SetSkillByEvent(&Player::skillSword, var_value); |
1782 | 5795 return; |
5796 case VAR_DaggerSkill: | |
1822 | 5797 SetSkillByEvent(&Player::skillDagger, var_value); |
1782 | 5798 return; |
5799 case VAR_AxeSkill: | |
1822 | 5800 SetSkillByEvent(&Player::skillAxe, var_value); |
1782 | 5801 return; |
5802 case VAR_SpearSkill: | |
1822 | 5803 SetSkillByEvent(&Player::skillSpear, var_value); |
1782 | 5804 return; |
5805 case VAR_BowSkill: | |
1822 | 5806 SetSkillByEvent(&Player::skillBow, var_value); |
1782 | 5807 return; |
5808 case VAR_MaceSkill: | |
1822 | 5809 SetSkillByEvent(&Player::skillMace, var_value); |
1782 | 5810 return; |
5811 case VAR_BlasterSkill: | |
1822 | 5812 SetSkillByEvent(&Player::skillBlaster, var_value); |
1782 | 5813 return; |
5814 case VAR_ShieldSkill: | |
1822 | 5815 SetSkillByEvent(&Player::skillShield, var_value); |
1782 | 5816 return; |
5817 case VAR_LeatherSkill: | |
1822 | 5818 SetSkillByEvent(&Player::skillLeather, var_value); |
1782 | 5819 return; |
5820 case VAR_SkillChain: | |
1822 | 5821 SetSkillByEvent(&Player::skillChain, var_value); |
1782 | 5822 return; |
5823 case VAR_PlateSkill: | |
1822 | 5824 SetSkillByEvent(&Player::skillPlate, var_value); |
1782 | 5825 return; |
5826 case VAR_FireSkill: | |
1822 | 5827 SetSkillByEvent(&Player::skillFire, var_value); |
1782 | 5828 return; |
5829 case VAR_AirSkill: | |
1822 | 5830 SetSkillByEvent(&Player::skillAir, var_value); |
1782 | 5831 return; |
5832 case VAR_WaterSkill: | |
1822 | 5833 SetSkillByEvent(&Player::skillWater, var_value); |
1782 | 5834 return; |
5835 case VAR_EarthSkill: | |
1822 | 5836 SetSkillByEvent(&Player::skillEarth, var_value); |
1782 | 5837 return; |
5838 case VAR_SpiritSkill: | |
1822 | 5839 SetSkillByEvent(&Player::skillSpirit, var_value); |
1782 | 5840 return; |
5841 case VAR_MindSkill: | |
1822 | 5842 SetSkillByEvent(&Player::skillMind, var_value); |
1782 | 5843 return; |
5844 case VAR_BodySkill: | |
1822 | 5845 SetSkillByEvent(&Player::skillBody, var_value); |
1782 | 5846 return; |
5847 case VAR_LightSkill: | |
1822 | 5848 SetSkillByEvent(&Player::skillLight, var_value); |
1782 | 5849 return; |
5850 case VAR_DarkSkill: | |
1822 | 5851 SetSkillByEvent(&Player::skillDark, var_value); |
1782 | 5852 return; |
5853 case VAR_IdentifyItemSkill: | |
1822 | 5854 SetSkillByEvent(&Player::skillItemId, var_value); |
1782 | 5855 return; |
5856 case VAR_MerchantSkill: | |
1822 | 5857 SetSkillByEvent(&Player::skillMerchant, var_value); |
1782 | 5858 return; |
5859 case VAR_RepairSkill: | |
1822 | 5860 SetSkillByEvent(&Player::skillRepair, var_value); |
1782 | 5861 return; |
5862 case VAR_BodybuildingSkill: | |
1822 | 5863 SetSkillByEvent(&Player::skillBodybuilding, var_value); |
1782 | 5864 return; |
5865 case VAR_MeditationSkill: | |
1822 | 5866 SetSkillByEvent(&Player::skillMeditation, var_value); |
1782 | 5867 return; |
5868 case VAR_PerceptionSkill: | |
1822 | 5869 SetSkillByEvent(&Player::skillPerception, var_value); |
1782 | 5870 return; |
5871 case VAR_DiplomacySkill: | |
1822 | 5872 SetSkillByEvent(&Player::skillDiplomacy, var_value); |
1782 | 5873 return; |
5874 case VAR_ThieverySkill: | |
5875 Error ("Thieving unsupported"); | |
5876 return; | |
5877 case VAR_DisarmTrapSkill: | |
1822 | 5878 SetSkillByEvent(&Player::skillDisarmTrap, var_value); |
1782 | 5879 return; |
5880 case VAR_DodgeSkill: | |
1822 | 5881 SetSkillByEvent(&Player::skillDodge, var_value); |
1782 | 5882 return; |
5883 case VAR_UnarmedSkill: | |
1822 | 5884 SetSkillByEvent(&Player::skillUnarmed, var_value); |
1782 | 5885 return; |
5886 case VAR_IdentifyMonsterSkill: | |
1822 | 5887 SetSkillByEvent(&Player::skillMonsterId, var_value); |
1782 | 5888 return; |
5889 case VAR_ArmsmasterSkill: | |
1822 | 5890 SetSkillByEvent(&Player::skillArmsmaster, var_value); |
1782 | 5891 return; |
5892 case VAR_StealingSkill: | |
1822 | 5893 SetSkillByEvent(&Player::skillStealing, var_value); |
1782 | 5894 return; |
5895 case VAR_AlchemySkill: | |
1822 | 5896 SetSkillByEvent(&Player::skillAlchemy, var_value); |
1782 | 5897 return; |
5898 case VAR_LearningSkill: | |
1822 | 5899 SetSkillByEvent(&Player::skillLearning, var_value); |
1782 | 5900 return; |
5901 } | |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5902 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5903 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5904 |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5905 //----- (new function) -------------------------------------------------------- |
1822 | 5906 void Player::PlayAwardSound() |
5907 { | |
5908 int playerIndex = GetPlayerIndex(); | |
5909 signed int v25 = 8 * playerIndex + 400; | |
5910 LOBYTE(v25) = PID(OBJECT_Player,playerIndex - 112); | |
1259
d6e5b6b76612
Player::SetVariable cleanup - removing unused variables and function calls with them, some case shuffling
Grumpy7
parents:
1258
diff
changeset
|
5911 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
|
5912 } |
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5913 |
1782 | 5914 //----- (new function) -------------------------------------------------------- |
1822 | 5915 void Player::PlayAwardSound_Anim() |
5916 { | |
5917 int playerIndex = GetPlayerIndex(); | |
5918 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, playerIndex); | |
5919 PlayAwardSound(); | |
1782 | 5920 } |
5921 | |
5922 //----- (new function) -------------------------------------------------------- | |
1822 | 5923 void Player::PlayAwardSound_Anim_Face( PlayerSpeech speech ) |
1782 | 5924 { |
5925 this->PlaySound(speech, 0); | |
1822 | 5926 PlayAwardSound_Anim(); |
1782 | 5927 } |
5928 | |
5929 //----- (new function) -------------------------------------------------------- | |
1822 | 5930 void Player::SetSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 skillValue ) |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5931 { |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5932 unsigned __int16 currSkillValue = this->*skillToSet; |
1822 | 5933 if ( skillValue > 63 ) //the original had the condition reversed which was probably wrong |
5934 { | |
5935 this->*skillToSet = skillValue | currSkillValue & 63; | |
1780
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5936 } |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5937 else |
01b3c314e9be
Player::SetVariable moved most of the conditions into a switch
Grumpy7
parents:
1779
diff
changeset
|
5938 { |
1822 | 5939 this->*skillToSet = skillValue | currSkillValue & 0xC0; |
5940 } | |
5941 int playerIndex = GetPlayerIndex(); | |
5942 pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, playerIndex); | |
5943 PlayAwardSound(); | |
1258
eb1a22f7dfef
Player::SetVariable cleanup - removed some labels at the cost of 2 extra small functions
Grumpy7
parents:
1251
diff
changeset
|
5944 } |
0 | 5945 |
5946 //----- (0044AFFB) -------------------------------------------------------- | |
310 | 5947 void Player::AddVariable(enum VariableType var_type, signed int val) |
0 | 5948 { |
5949 int v6; // eax@15 | |
5950 unsigned int v7; // esi@18 | |
5951 DDM_DLV_Header *v27; // eax@153 | |
5952 ItemGen item; // [sp+Ch] [bp-2Ch]@45 | |
310 | 5953 |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5954 if ( var_type >= VAR_Counter1 && var_type <= VAR_Counter10) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5955 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5956 pParty->PartyTimes.CounterEventValues[var_type - VAR_Counter1] = pParty->uTimePlayed; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5957 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5958 } |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5959 |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5960 if ( var_type >= VAR_UnknownTimeEvent0 && var_type <= VAR_UnknownTimeEvent19 ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5961 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5962 pParty->PartyTimes._s_times[var_type - VAR_UnknownTimeEvent0] = pParty->uTimePlayed; |
1822 | 5963 PlayAwardSound(); |
1788 | 5964 return; |
0 | 5965 } |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5966 |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5967 if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_99 ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5968 { |
1822 | 5969 |
5970 if ( var_type >= VAR_MapPersistentVariable_0 && var_type <= VAR_MapPersistentVariable_74 ) | |
5971 { | |
5972 if (255 - val > stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0]) | |
5973 stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] += val; | |
5974 else | |
5975 stru_5E4C90_MapPersistVars.field_0[var_type - VAR_MapPersistentVariable_0] = 255; | |
5976 } | |
5977 if ( (signed int)var_type >= VAR_MapPersistentVariable_75 && var_type <= VAR_MapPersistentVariable_99 ) | |
5978 { | |
5979 if (255 - val > stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75]) | |
5980 stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] += val; | |
5981 else | |
5982 stru_5E4C90_MapPersistVars._decor_events[var_type - VAR_MapPersistentVariable_75] = 255; | |
5983 } | |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5984 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5985 } |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5986 |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5987 if ( var_type >= VAR_History_0 && var_type <= VAR_History_28) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5988 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5989 if (!pParty->PartyTimes.HistoryEventTimes[var_type - VAR_History_0]) |
0 | 5990 { |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5991 pParty->PartyTimes.HistoryEventTimes[var_type - VAR_History_0] = pParty->uTimePlayed; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5992 if (pStorylineText->StoreLine[var_type - VAR_History_0].pText = 0) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5993 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5994 bFlashHistoryBook = 1; |
1822 | 5995 PlayAwardSound(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5996 } |
0 | 5997 } |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5998 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
5999 } |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6000 |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6001 switch ( var_type ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6002 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6003 case VAR_RandomGold: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6004 if ( val == 0 ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6005 val = 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6006 v6 = rand(); |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
6007 pParty->PartyFindsGold(v6 % val + 1, 1); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6008 GameUI_DrawFoodAndGold(); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6009 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6010 case VAR_RandomFood: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6011 if ( val == 0 ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6012 val = 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6013 v7 = rand() % val + 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6014 Party::GiveFood(v7); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6015 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6016 ShowStatusBarString(pTmpBuf.data(), 2u); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6017 GameUI_DrawFoodAndGold(); |
1822 | 6018 PlayAwardSound(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6019 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6020 case VAR_Sex: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6021 this->uSex = (PLAYER_SEX)val; |
1822 | 6022 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6023 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6024 case VAR_Class: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6025 this->classType = (PLAYER_CLASS_TYPE)val; |
1822 | 6026 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6027 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6028 case VAR_CurrentHP: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6029 this->sHealth = min(this->sHealth + val, this->GetMaxHealth() ); |
1822 | 6030 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6031 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6032 case VAR_MaxHP: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6033 this->_health_related = 0; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6034 this->uFullHealthBonus = 0; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6035 this->sHealth = this->GetMaxHealth(); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6036 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6037 case VAR_CurrentSP: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6038 this->sMana = min(this->sMana + val, this->GetMaxMana() ); |
1822 | 6039 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6040 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6041 case VAR_MaxSP: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6042 this->_mana_related = 0; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6043 this->uFullManaBonus = 0; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6044 this->sMana = GetMaxMana(); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6045 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6046 case VAR_ACModifier: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6047 this->sACModifier = min(this->sACModifier + val, 255); |
1822 | 6048 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6049 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6050 case VAR_BaseLevel: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6051 this->uLevel = min(this->uLevel + val, 255); |
1822 | 6052 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6053 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6054 case VAR_LevelModifier: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6055 this->sLevelModifier = min(this->sLevelModifier + val, 255); |
1822 | 6056 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6057 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6058 case VAR_Age: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6059 this->sAgeModifier += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6060 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6061 case VAR_Award: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6062 if (_449B57_test_bit(this->_achieved_awards_bits, val) && pAwards[val].pText ) |
310 | 6063 { |
1822 | 6064 PlayAwardSound_Anim97_Face(SPEECH_96); |
0 | 6065 } |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6066 _449B7E_toggle_bit(this->_achieved_awards_bits, val, 1); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6067 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6068 case VAR_Experience: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6069 this->uExperience = min(this->uExperience + val, 4000000000i64); |
1822 | 6070 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6071 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6072 case VAR_QBits_QuestsDone: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6073 if ( !_449B57_test_bit(pParty->_quest_bits, val) && pQuestTable[val] ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6074 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6075 bFlashQuestBook = 1; |
1822 | 6076 PlayAwardSound_Anim97_Face(SPEECH_93); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6077 } |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6078 _449B7E_toggle_bit(pParty->_quest_bits, val, 1); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6079 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6080 case VAR_PlayerItemInHands: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6081 item.Reset(); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6082 item.uAttributes = 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6083 item.uItemID = val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6084 if ( val >= ITEM_ARTIFACT_PUCK && val <= ITEM_RELIC_MEKORIGS_HAMMER ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6085 pParty->pIsArtifactFound[val-500] = 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6086 else if ( val >= ITEM_WAND_FIRE && val <= ITEM_WAND_INCENERATION ) |
0 | 6087 { |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6088 item.uNumCharges = rand() % 6 + item.GetDamageMod() + 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6089 item.uMaxCharges = LOBYTE(item.uNumCharges); |
0 | 6090 } |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6091 pParty->SetHoldingItem(&item); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6092 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6093 case VAR_FixedGold: |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1827
diff
changeset
|
6094 pParty->PartyFindsGold(val, 1); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6095 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6096 case VAR_BaseMight: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6097 this->uMight = min(this->uMight + val, 255); |
1822 | 6098 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6099 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6100 case VAR_BaseIntellect: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6101 this->uIntelligence = min(this->uIntelligence + val, 255); |
1822 | 6102 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6103 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6104 case VAR_BasePersonality: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6105 this->uWillpower = min(this->uWillpower + val, 255); |
1822 | 6106 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6107 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6108 case VAR_BaseEndurance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6109 this->uEndurance = min(this->uEndurance + val, 255); |
1822 | 6110 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6111 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6112 case VAR_BaseSpeed: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6113 this->uSpeed = min(this->uSpeed + val, 255); |
1822 | 6114 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6115 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6116 case VAR_BaseAccuracy: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6117 this->uAccuracy = min(this->uAccuracy + val, 255); |
1822 | 6118 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6119 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6120 case VAR_BaseLuck: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6121 this->uLuck = min(this->uLuck + val, 255); |
1822 | 6122 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6123 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6124 case VAR_FixedFood: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6125 Party::GiveFood(val); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6126 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6127 ShowStatusBarString(pTmpBuf.data(), 2u); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6128 if ( pParty->uNumFoodRations > 0xFFFF ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6129 Party::SetFood(0xFFFFu); |
1822 | 6130 PlayAwardSound(); |
1788 | 6131 return; |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6132 case VAR_MightBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6133 case VAR_ActualMight: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6134 this->uMightBonus = min(this->uMightBonus + val, 255); |
1822 | 6135 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6136 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6137 case VAR_IntellectBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6138 case VAR_ActualIntellect: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6139 this->uIntelligenceBonus = min(this->uIntelligenceBonus + val, 255); |
1822 | 6140 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6141 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6142 case VAR_PersonalityBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6143 case VAR_ActualPersonality: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6144 this->uWillpowerBonus = min(this->uWillpowerBonus + val, 255); |
1822 | 6145 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6146 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6147 case VAR_EnduranceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6148 case VAR_ActualEndurance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6149 this->uEnduranceBonus = min(this->uEnduranceBonus + val, 255); |
1822 | 6150 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6151 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6152 case VAR_SpeedBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6153 case VAR_ActualSpeed: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6154 this->uSpeedBonus = min(this->uSpeedBonus + val, 255); |
1822 | 6155 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6156 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6157 case VAR_AccuracyBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6158 case VAR_ActualAccuracy: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6159 this->uAccuracyBonus = min(this->uAccuracyBonus + val, 255); |
1822 | 6160 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6161 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6162 case VAR_LuckBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6163 case VAR_ActualLuck: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6164 this->uLuckBonus = min(this->uLuckBonus + val, 255); |
1822 | 6165 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6166 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6167 case VAR_FireResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6168 this->sResFireBase = min(this->sResFireBase + val, 255); |
1822 | 6169 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6170 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6171 case VAR_AirResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6172 this->sResAirBase = min(this->sResAirBase + val, 255); |
1822 | 6173 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6174 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6175 case VAR_WaterResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6176 this->sResWaterBase = min(this->sResWaterBase + val, 255); |
1822 | 6177 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6178 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6179 case VAR_EarthResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6180 this->sResEarthBase = min(this->sResEarthBase + val, 255); |
1822 | 6181 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6182 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6183 case VAR_SpiritResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6184 this->sResSpiritBase = min(this->sResSpiritBase + val, 255); |
1822 | 6185 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6186 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6187 case VAR_MindResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6188 this->sResMindBase = min(this->sResMindBase + val, 255); |
1822 | 6189 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6190 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6191 case VAR_BodyResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6192 this->sResBodyBase = min(this->sResBodyBase + val, 255); |
1822 | 6193 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6194 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6195 case VAR_LightResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6196 this->sResLightBase = min(this->sResLightBase + val, 255); |
1822 | 6197 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6198 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6199 case VAR_DarkResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6200 this->sResDarkBase = min(this->sResDarkBase + val, 255); |
1822 | 6201 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6202 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6203 case VAR_MagicResistance: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6204 this->sResMagicBase = min(this->sResMagicBase + val, 255); |
1822 | 6205 PlayAwardSound_Anim97_Face(SPEECH_92); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6206 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6207 case VAR_FireResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6208 this->sResFireBonus = min(this->sResFireBonus + val, 255); |
1822 | 6209 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6210 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6211 case VAR_AirResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6212 this->sResAirBonus = min(this->sResAirBonus + val, 255); |
1822 | 6213 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6214 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6215 case VAR_WaterResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6216 this->sResWaterBonus = min(this->sResWaterBonus + val, 255); |
1822 | 6217 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6218 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6219 case VAR_EarthResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6220 this->sResEarthBonus = min(this->sResEarthBonus + val, 255); |
1822 | 6221 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6222 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6223 case VAR_SpiritResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6224 this->sResSpiritBonus = min(this->sResSpiritBonus + val, 255); |
1822 | 6225 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6226 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6227 case VAR_MindResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6228 this->sResMindBonus = min(this->sResMindBonus + val, 255); |
1822 | 6229 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6230 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6231 case VAR_BodyResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6232 this->sResBodyBonus = min(this->sResBodyBonus + val, 255); |
1822 | 6233 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6234 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6235 case VAR_LightResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6236 this->sResLightBonus = min(this->sResLightBonus + val, 255); |
1822 | 6237 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6238 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6239 case VAR_DarkResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6240 this->sResDarkBonus = min(this->sResDarkBonus + val, 255); |
1822 | 6241 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6242 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6243 case VAR_MagicResistanceBonus: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6244 this->sResMagicBonus = min(this->sResMagicBonus + val, 255); |
1822 | 6245 PlayAwardSound_Anim97_Face(SPEECH_91); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6246 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6247 case VAR_Cursed: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6248 this->SetCondition(Condition_Cursed, 1); |
1822 | 6249 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6250 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6251 case VAR_Weak: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6252 this->SetCondition(Condition_Weak, 1); |
1822 | 6253 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6254 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6255 case VAR_Asleep: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6256 this->SetCondition(Condition_Sleep, 1); |
1822 | 6257 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6258 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6259 case VAR_Afraid: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6260 this->SetCondition(Condition_Fear, 1); |
1822 | 6261 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6262 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6263 case VAR_Drunk: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6264 this->SetCondition(Condition_Drunk, 1); |
1822 | 6265 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6266 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6267 case VAR_Insane: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6268 this->SetCondition(Condition_Insane, 1); |
1822 | 6269 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6270 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6271 case VAR_PoisonedGreen: |
2187 | 6272 this->SetCondition(Condition_Poison_Weak, 1); |
1822 | 6273 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6274 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6275 case VAR_DiseasedGreen: |
2187 | 6276 this->SetCondition(Condition_Disease_Weak, 1); |
1822 | 6277 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6278 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6279 case VAR_PoisonedYellow: |
2187 | 6280 this->SetCondition(Condition_Poison_Medium, 1); |
1822 | 6281 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6282 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6283 case VAR_DiseasedYellow: |
2187 | 6284 this->SetCondition(Condition_Disease_Medium, 1); |
1822 | 6285 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6286 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6287 case VAR_PoisonedRed: |
2187 | 6288 this->SetCondition(Condition_Poison_Severe, 1); |
1822 | 6289 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6290 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6291 case VAR_DiseasedRed: |
2187 | 6292 this->SetCondition(Condition_Disease_Severe, 1); |
1822 | 6293 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6294 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6295 case VAR_Paralyzed: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6296 this->SetCondition(Condition_Paralyzed, 1); |
1822 | 6297 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6298 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6299 case VAR_Unconsious: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6300 this->SetCondition(Condition_Unconcious, 1); |
1822 | 6301 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6302 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6303 case VAR_Dead: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6304 this->SetCondition(Condition_Dead, 1); |
1822 | 6305 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6306 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6307 case VAR_Stoned: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6308 this->SetCondition(Condition_Pertified, 1); |
1822 | 6309 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6310 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6311 case VAR_Eradicated: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6312 this->SetCondition(Condition_Eradicated, 1); |
1822 | 6313 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6314 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6315 case VAR_MajorCondition : |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
6316 pConditions.fill(0); |
1822 | 6317 PlayAwardSound_Anim97(); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6318 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6319 case VAR_AutoNotes: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6320 if ( !_449B57_test_bit(pParty->_autonote_bits, val) && pAutonoteTxt[val].pText ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6321 { |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6322 this->PlaySound(SPEECH_96, 0); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6323 bFlashAutonotesBook = 1; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6324 _506568_autonote_type = pAutonoteTxt[val].eType; |
1822 | 6325 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, GetPlayerIndex()); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6326 } |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6327 _449B7E_toggle_bit(pParty->_autonote_bits, val, 1); |
1822 | 6328 PlayAwardSound(); |
0 | 6329 return; |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6330 case VAR_PlayerBits: |
1822 | 6331 _449B7E_toggle_bit((unsigned char *)this->playerEventBits, val, 1u); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6332 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6333 case VAR_NPCs2: |
1793
4dee76d79c78
dword_5B65CC to npcIdToDismissAfterDialogue, Party::field_709 to Party::hirelingScrollPosition
Grumpy7
parents:
1792
diff
changeset
|
6334 pParty->hirelingScrollPosition = 0; |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6335 LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6336 pParty->CountHirelings(); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6337 viewparams->bRedrawGameUI = true; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6338 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6339 case VAR_NumSkillPoints: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6340 this->uSkillPoints += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6341 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6342 case VAR_ReputationInCurrentLocation: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6343 v27 = &pOutdoor->ddm; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6344 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6345 v27 = &pIndoor->dlv; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6346 v27->uReputation += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6347 if ( v27->uReputation > 10000 ) |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6348 v27->uReputation = 10000; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6349 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6350 case VAR_GoldInBank: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6351 pParty->uNumGoldInBank += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6352 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6353 case VAR_NumDeaths: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6354 pParty->uNumDeaths += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6355 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6356 case VAR_NumBounties: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6357 pParty->uNumBountiesCollected += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6358 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6359 case VAR_PrisonTerms: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6360 pParty->uNumPrisonTerms += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6361 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6362 case VAR_ArenaWinsPage: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6363 pParty->uNumArenaPageWins += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6364 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6365 case VAR_ArenaWinsSquire: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6366 pParty->uNumArenaSquireWins += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6367 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6368 case VAR_ArenaWinsKnight: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6369 pParty->uNumArenaKnightWins += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6370 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6371 case VAR_ArenaWinsLord: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6372 pParty->uNumArenaLordWins += val; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6373 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6374 case VAR_StaffSkill: |
1822 | 6375 AddSkillByEvent(&Player::skillStaff, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6376 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6377 case VAR_SwordSkill: |
1822 | 6378 AddSkillByEvent(&Player::skillSword, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6379 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6380 case VAR_DaggerSkill: |
1822 | 6381 AddSkillByEvent(&Player::skillDagger, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6382 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6383 case VAR_AxeSkill: |
1822 | 6384 AddSkillByEvent(&Player::skillAxe, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6385 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6386 case VAR_SpearSkill: |
1822 | 6387 AddSkillByEvent(&Player::skillSpear, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6388 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6389 case VAR_BowSkill: |
1822 | 6390 AddSkillByEvent(&Player::skillBow, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6391 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6392 case VAR_MaceSkill: |
1822 | 6393 AddSkillByEvent(&Player::skillMace, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6394 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6395 case VAR_BlasterSkill: |
1822 | 6396 AddSkillByEvent(&Player::skillBlaster, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6397 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6398 case VAR_ShieldSkill: |
1822 | 6399 AddSkillByEvent(&Player::skillShield, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6400 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6401 case VAR_LeatherSkill: |
1822 | 6402 AddSkillByEvent(&Player::skillLeather, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6403 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6404 case VAR_SkillChain: |
1822 | 6405 AddSkillByEvent(&Player::skillChain, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6406 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6407 case VAR_PlateSkill: |
1822 | 6408 AddSkillByEvent(&Player::skillPlate, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6409 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6410 case VAR_FireSkill: |
1822 | 6411 AddSkillByEvent(&Player::skillFire, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6412 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6413 case VAR_AirSkill: |
1822 | 6414 AddSkillByEvent(&Player::skillAir, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6415 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6416 case VAR_WaterSkill: |
1822 | 6417 AddSkillByEvent(&Player::skillWater, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6418 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6419 case VAR_EarthSkill: |
1822 | 6420 AddSkillByEvent(&Player::skillEarth, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6421 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6422 case VAR_SpiritSkill: |
1822 | 6423 AddSkillByEvent(&Player::skillSpirit, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6424 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6425 case VAR_MindSkill: |
1822 | 6426 AddSkillByEvent(&Player::skillMind, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6427 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6428 case VAR_BodySkill: |
1822 | 6429 AddSkillByEvent(&Player::skillBody, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6430 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6431 case VAR_LightSkill: |
1822 | 6432 AddSkillByEvent(&Player::skillLight, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6433 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6434 case VAR_DarkSkill: |
1822 | 6435 AddSkillByEvent(&Player::skillDark, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6436 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6437 case VAR_IdentifyItemSkill: |
1822 | 6438 AddSkillByEvent(&Player::skillItemId, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6439 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6440 case VAR_MerchantSkill: |
1822 | 6441 AddSkillByEvent(&Player::skillMerchant, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6442 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6443 case VAR_RepairSkill: |
1822 | 6444 AddSkillByEvent(&Player::skillRepair, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6445 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6446 case VAR_BodybuildingSkill: |
1822 | 6447 AddSkillByEvent(&Player::skillBodybuilding, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6448 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6449 case VAR_MeditationSkill: |
1822 | 6450 AddSkillByEvent(&Player::skillMeditation, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6451 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6452 case VAR_PerceptionSkill: |
1822 | 6453 AddSkillByEvent(&Player::skillPerception, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6454 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6455 case VAR_DiplomacySkill: |
1822 | 6456 AddSkillByEvent(&Player::skillDiplomacy, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6457 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6458 case VAR_ThieverySkill: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6459 Error ("Thieving unsupported"); |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6460 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6461 case VAR_DisarmTrapSkill: |
1822 | 6462 AddSkillByEvent(&Player::skillDisarmTrap, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6463 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6464 case VAR_DodgeSkill: |
1822 | 6465 AddSkillByEvent(&Player::skillDodge, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6466 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6467 case VAR_UnarmedSkill: |
1822 | 6468 AddSkillByEvent(&Player::skillUnarmed, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6469 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6470 case VAR_IdentifyMonsterSkill: |
1822 | 6471 AddSkillByEvent(&Player::skillMonsterId, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6472 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6473 case VAR_ArmsmasterSkill: |
1822 | 6474 AddSkillByEvent(&Player::skillArmsmaster, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6475 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6476 case VAR_StealingSkill: |
1822 | 6477 AddSkillByEvent(&Player::skillStealing, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6478 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6479 case VAR_AlchemySkill: |
1822 | 6480 AddSkillByEvent(&Player::skillAlchemy, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6481 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6482 case VAR_LearningSkill: |
1822 | 6483 AddSkillByEvent(&Player::skillLearning, val); |
1792
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6484 return; |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6485 default: |
3155be890554
Player::AddVariable moving everything to a switch, cleaning up, finishing
Grumpy7
parents:
1791
diff
changeset
|
6486 return; |
0 | 6487 } |
6488 } | |
6489 | |
1791 | 6490 //----- (new function) -------------------------------------------------------- |
1822 | 6491 void Player::PlayAwardSound_Anim97() |
6492 { | |
6493 int playerIndex = GetPlayerIndex(); | |
6494 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, playerIndex); | |
6495 PlayAwardSound(); | |
1791 | 6496 } |
6497 | |
6498 //----- (new function) -------------------------------------------------------- | |
1822 | 6499 void Player::PlayAwardSound_Anim97_Face( PlayerSpeech speech ) |
1791 | 6500 { |
6501 this->PlaySound(speech, 0); | |
1822 | 6502 PlayAwardSound_Anim97(); |
1791 | 6503 } |
6504 | |
6505 //----- (new function) -------------------------------------------------------- | |
1822 | 6506 void Player::AddSkillByEvent( unsigned __int16 Player::* skillToSet, unsigned __int16 addSkillValue ) |
1791 | 6507 { |
6508 if ( addSkillValue > 63 ) | |
6509 { | |
6510 this->*skillToSet = (unsigned __int8)addSkillValue | this->*skillToSet & 63; | |
6511 } | |
6512 else | |
6513 { | |
6514 this->*skillToSet = min(this->*skillToSet + addSkillValue, 60) | this->*skillToSet & 0xC0; | |
6515 } | |
1822 | 6516 PlayAwardSound_Anim97(); |
1791 | 6517 return; |
6518 } | |
0 | 6519 |
6520 //----- (0044B9C4) -------------------------------------------------------- | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6521 void Player::SubtractVariable( enum VariableType VarNum, signed int pValue ) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6522 { |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6523 DDM_DLV_Header *locationHeader; // eax@90 |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6524 int randGold; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6525 int randFood; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6526 int npcIndex; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6527 |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6528 if ( VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_99 ) |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6529 { |
1822 | 6530 if ( VarNum >= VAR_MapPersistentVariable_0 && VarNum <= VAR_MapPersistentVariable_74 ) |
6531 { | |
6532 stru_5E4C90_MapPersistVars.field_0[VarNum - VAR_MapPersistentVariable_0] -= pValue; | |
6533 } | |
6534 if ( (signed int)VarNum >= VAR_MapPersistentVariable_75 && VarNum <= VAR_MapPersistentVariable_99 ) | |
6535 { | |
6536 stru_5E4C90_MapPersistVars._decor_events[VarNum - VAR_MapPersistentVariable_75] -= pValue; | |
6537 } | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6538 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6539 } |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6540 |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6541 switch (VarNum) |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6542 { |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6543 case VAR_CurrentHP: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6544 ReceiveDamage((signed int)pValue, DMGT_PHISYCAL); |
1822 | 6545 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6546 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6547 case VAR_CurrentSP: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6548 this->sMana = max(this->sMana - pValue, 0); |
1822 | 6549 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6550 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6551 case VAR_ACModifier: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6552 this->sACModifier -= (unsigned __int8)pValue; |
1822 | 6553 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6554 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6555 case VAR_BaseLevel: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6556 this->uLevel -= (unsigned __int8)pValue; |
1822 | 6557 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6558 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6559 case VAR_LevelModifier: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6560 this->sLevelModifier -= (unsigned __int8)pValue; |
1822 | 6561 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6562 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6563 case VAR_Age: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6564 this->sAgeModifier -= (signed __int16)pValue; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6565 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6566 case VAR_Award: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6567 _449B7E_toggle_bit(this->_achieved_awards_bits, (signed __int16)pValue, 0); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6568 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6569 case VAR_Experience: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6570 this->uExperience -= pValue; |
1822 | 6571 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6572 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6573 case VAR_QBits_QuestsDone: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6574 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6575 this->PlaySound(SPEECH_96, 0); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6576 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6577 case VAR_PlayerItemInHands: |
2025 | 6578 for ( uint i = 0; i < 16; ++i ) |
6579 { | |
6580 int id_ = this->pEquipment.pIndices[i]; | |
6581 if ( id_ > 0 ) | |
6582 { | |
6583 if ( this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID == pValue ) | |
6584 { | |
6585 this->pEquipment.pIndices[i] = 0; | |
6586 } | |
6587 } | |
6588 } | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6589 for (int i = 0; i < 126; i++) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6590 { |
2025 | 6591 int id_ = this->pInventoryMatrix[i]; |
6592 if ( id_ > 0 ) | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6593 { |
2025 | 6594 if ( this->pInventoryItemList[id_ - 1].uItemID == pValue ) |
6595 { | |
6596 RemoveItemAtInventoryIndex(i); | |
6597 return; | |
6598 } | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6599 } |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6600 } |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6601 if ( pParty->pPickedItem.uItemID == pValue ) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6602 { |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6603 pMouse->RemoveHoldingItem(); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6604 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6605 } |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6606 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6607 case VAR_FixedGold: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6608 if ( (unsigned int)pValue > pParty->uNumGold ) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6609 { |
1825
23deb6b09c8c
cancelEventProcessing to dword_5B65C4_cancelEventProcessing
Grumpy7
parents:
1822
diff
changeset
|
6610 dword_5B65C4_cancelEventProcessing = 1; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6611 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6612 } |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6613 Party::TakeGold((unsigned int)pValue); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6614 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6615 case VAR_RandomGold: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6616 randGold = rand() % (signed int)pValue + 1; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6617 if ( (unsigned int)randGold > pParty->uNumGold ) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6618 randGold = pParty->uNumGold; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6619 Party::TakeGold(randGold); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6620 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], randGold); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6621 ShowStatusBarString(pTmpBuf.data(), 2); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6622 GameUI_DrawFoodAndGold(); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6623 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6624 case VAR_FixedFood: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6625 Party::TakeFood((unsigned int)pValue); |
1822 | 6626 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6627 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6628 case VAR_RandomFood: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6629 randFood = rand() % (signed int)pValue + 1; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6630 if ( (unsigned int)randFood > pParty->uNumFoodRations ) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6631 randFood = pParty->uNumFoodRations; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6632 Party::TakeFood(randFood); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6633 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], randFood); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6634 ShowStatusBarString(pTmpBuf.data(), 2u); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6635 GameUI_DrawFoodAndGold(); |
1822 | 6636 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6637 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6638 case VAR_MightBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6639 case VAR_ActualMight: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6640 this->uMightBonus -= (unsigned __int16)pValue; |
1822 | 6641 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6642 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6643 case VAR_IntellectBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6644 case VAR_ActualIntellect: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6645 this->uIntelligenceBonus -= (unsigned __int16)pValue; |
1822 | 6646 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6647 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6648 case VAR_PersonalityBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6649 case VAR_ActualPersonality: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6650 this->uWillpowerBonus -= (unsigned __int16)pValue; |
1822 | 6651 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6652 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6653 case VAR_EnduranceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6654 case VAR_ActualEndurance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6655 this->uEnduranceBonus -= (unsigned __int16)pValue; |
1822 | 6656 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6657 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6658 case VAR_SpeedBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6659 case VAR_ActualSpeed: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6660 this->uSpeedBonus -= (unsigned __int16)pValue; |
1822 | 6661 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6662 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6663 case VAR_AccuracyBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6664 case VAR_ActualAccuracy: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6665 this->uAccuracyBonus -= (unsigned __int16)pValue; |
1822 | 6666 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6667 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6668 case VAR_LuckBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6669 case VAR_ActualLuck: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6670 this->uLuckBonus -= (unsigned __int16)pValue; |
1822 | 6671 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6672 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6673 case VAR_BaseMight: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6674 this->uMight -= (unsigned __int16)pValue; |
1822 | 6675 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6676 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6677 case VAR_BaseIntellect: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6678 this->uIntelligence -= (unsigned __int16)pValue; |
1822 | 6679 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6680 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6681 case VAR_BasePersonality: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6682 this->uWillpower -= (unsigned __int16)pValue; |
1822 | 6683 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6684 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6685 case VAR_BaseEndurance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6686 this->uEndurance -= (unsigned __int16)pValue; |
1822 | 6687 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6688 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6689 case VAR_BaseSpeed: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6690 this->uSpeed -= (unsigned __int16)pValue; |
1822 | 6691 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6692 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6693 case VAR_BaseAccuracy: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6694 this->uAccuracy -= (unsigned __int16)pValue; |
1822 | 6695 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6696 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6697 case VAR_BaseLuck: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6698 this->uLuck -= (unsigned __int16)pValue; |
1822 | 6699 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6700 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6701 case VAR_FireResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6702 this->sResFireBase -= (signed __int16)pValue; |
1822 | 6703 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6704 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6705 case VAR_AirResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6706 this->sResAirBase -= (signed __int16)pValue; |
1822 | 6707 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6708 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6709 case VAR_WaterResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6710 this->sResWaterBase -= (signed __int16)pValue; |
1822 | 6711 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6712 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6713 case VAR_EarthResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6714 this->sResEarthBase -= (signed __int16)pValue; |
1822 | 6715 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6716 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6717 case VAR_SpiritResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6718 this->sResSpiritBase -= (signed __int16)pValue; |
1822 | 6719 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6720 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6721 case VAR_MindResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6722 this->sResMindBase -= (signed __int16)pValue; |
1822 | 6723 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6724 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6725 case VAR_BodyResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6726 this->sResBodyBase -= (signed __int16)pValue; |
1822 | 6727 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6728 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6729 case VAR_LightResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6730 this->sResLightBase -= (signed __int16)pValue; |
1822 | 6731 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6732 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6733 case VAR_DarkResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6734 this->sResDarkBase -= (signed __int16)pValue; |
1822 | 6735 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6736 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6737 case VAR_MagicResistance: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6738 this->sResMagicBase -= (signed __int16)pValue; |
1822 | 6739 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6740 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6741 case VAR_FireResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6742 this->sResFireBonus -= (signed __int16)pValue; |
1822 | 6743 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6744 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6745 case VAR_AirResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6746 this->sResAirBonus -= (signed __int16)pValue; |
1822 | 6747 this->PlayAwardSound_Anim98_Face(SPEECH_92); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6748 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6749 case VAR_WaterResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6750 this->sResWaterBonus -= (signed __int16)pValue; |
1822 | 6751 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6752 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6753 case VAR_EarthResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6754 this->sResEarthBonus -= (signed __int16)pValue; |
1822 | 6755 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6756 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6757 case VAR_SpiritResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6758 this->sResSpiritBonus -= (signed __int16)pValue; |
1822 | 6759 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6760 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6761 case VAR_MindResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6762 this->sResMindBonus -= (signed __int16)pValue; |
1822 | 6763 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6764 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6765 case VAR_BodyResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6766 this->sResBodyBonus -= (signed __int16)pValue; |
1822 | 6767 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6768 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6769 case VAR_LightResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6770 this->sResLightBonus -= (signed __int16)pValue; |
1822 | 6771 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6772 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6773 case VAR_DarkResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6774 this->sResDarkBonus -= (signed __int16)pValue; |
1822 | 6775 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6776 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6777 case VAR_MagicResistanceBonus: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6778 this->sResMagicBonus -= (signed __int16)pValue; |
1822 | 6779 this->PlayAwardSound_Anim98_Face(SPEECH_91); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6780 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6781 case VAR_StaffSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6782 this->skillStaff -= (unsigned __int8)pValue; |
1822 | 6783 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6784 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6785 case VAR_SwordSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6786 this->skillSword -= (unsigned __int8)pValue; |
1822 | 6787 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6788 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6789 case VAR_DaggerSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6790 this->skillDagger -= (unsigned __int8)pValue; |
1822 | 6791 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6792 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6793 case VAR_AxeSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6794 this->skillAxe -= (unsigned __int8)pValue; |
1822 | 6795 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6796 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6797 case VAR_SpearSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6798 this->skillSpear -= (unsigned __int8)pValue; |
1822 | 6799 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6800 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6801 case VAR_BowSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6802 this->skillBow -= (unsigned __int8)pValue; |
1822 | 6803 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6804 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6805 case VAR_MaceSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6806 this->skillMace -= (unsigned __int8)pValue; |
1822 | 6807 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6808 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6809 case VAR_BlasterSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6810 this->skillBlaster -= (unsigned __int8)pValue; |
1822 | 6811 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6812 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6813 case VAR_ShieldSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6814 this->skillShield -= (unsigned __int8)pValue; |
1822 | 6815 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6816 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6817 case VAR_LeatherSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6818 this->skillLearning -= (unsigned __int8)pValue; |
1822 | 6819 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6820 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6821 case VAR_SkillChain: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6822 this->skillChain -= (unsigned __int8)pValue; |
1822 | 6823 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6824 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6825 case VAR_PlateSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6826 this->skillPlate -= (unsigned __int8)pValue; |
1822 | 6827 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6828 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6829 case VAR_FireSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6830 this->skillFire -= (unsigned __int8)pValue; |
1822 | 6831 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6832 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6833 case VAR_AirSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6834 this->skillAir -= (unsigned __int8)pValue; |
1822 | 6835 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6836 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6837 case VAR_WaterSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6838 this->skillWater -= (unsigned __int8)pValue; |
1822 | 6839 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6840 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6841 case VAR_EarthSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6842 this->skillEarth -= (unsigned __int8)pValue; |
1822 | 6843 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6844 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6845 case VAR_SpiritSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6846 this->skillSpirit -= (unsigned __int8)pValue; |
1822 | 6847 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6848 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6849 case VAR_MindSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6850 this->skillMind -= (unsigned __int8)pValue; |
1822 | 6851 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6852 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6853 case VAR_BodySkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6854 this->skillBody -= (unsigned __int8)pValue; |
1822 | 6855 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6856 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6857 case VAR_LightSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6858 this->skillLight -= (unsigned __int8)pValue; |
1822 | 6859 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6860 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6861 case VAR_DarkSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6862 this->skillDark -= (unsigned __int8)pValue; |
1822 | 6863 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6864 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6865 case VAR_IdentifyItemSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6866 this->skillItemId -= (unsigned __int8)pValue; |
1822 | 6867 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6868 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6869 case VAR_MerchantSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6870 this->skillMerchant -= (unsigned __int8)pValue; |
1822 | 6871 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6872 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6873 case VAR_RepairSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6874 this->skillRepair -= (unsigned __int8)pValue; |
1822 | 6875 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6876 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6877 case VAR_BodybuildingSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6878 this->skillBodybuilding -= (unsigned __int8)pValue; |
1822 | 6879 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6880 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6881 case VAR_MeditationSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6882 this->skillMeditation -= (unsigned __int8)pValue; |
1822 | 6883 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6884 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6885 case VAR_PerceptionSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6886 this->skillPerception -= (unsigned __int8)pValue; |
1822 | 6887 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6888 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6889 case VAR_DiplomacySkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6890 this->skillDiplomacy -= (unsigned __int8)pValue; |
1822 | 6891 PlayAwardSound_Anim98(); |
6892 return; | |
6893 case VAR_ThieverySkill: | |
6894 Error ("Thieving unsupported"); | |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6895 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6896 case VAR_DisarmTrapSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6897 this->skillDisarmTrap -= (unsigned __int8)pValue; |
1822 | 6898 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6899 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6900 case VAR_DodgeSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6901 this->skillDodge -= (unsigned __int8)pValue; |
1822 | 6902 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6903 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6904 case VAR_UnarmedSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6905 this->skillUnarmed -= (unsigned __int8)pValue; |
1822 | 6906 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6907 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6908 case VAR_IdentifyMonsterSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6909 this->skillMonsterId -= (unsigned __int8)pValue; |
1822 | 6910 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6911 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6912 case VAR_ArmsmasterSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6913 this->skillArmsmaster -= (unsigned __int8)pValue; |
1822 | 6914 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6915 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6916 case VAR_StealingSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6917 this->skillStealing -= (unsigned __int8)pValue; |
1822 | 6918 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6919 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6920 case VAR_AlchemySkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6921 this->skillAlchemy -= (unsigned __int8)pValue; |
1822 | 6922 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6923 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6924 case VAR_LearningSkill: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6925 this->skillLearning -= (unsigned __int8)pValue; |
1822 | 6926 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6927 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6928 case VAR_Cursed: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6929 this->pConditions[Condition_Cursed] = 0; |
1822 | 6930 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6931 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6932 case VAR_Weak: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6933 this->pConditions[Condition_Weak] = 0; |
1822 | 6934 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6935 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6936 case VAR_Asleep: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6937 this->pConditions[Condition_Sleep] = 0; |
1822 | 6938 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6939 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6940 case VAR_Afraid: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6941 this->pConditions[Condition_Fear] = 0; |
1822 | 6942 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6943 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6944 case VAR_Drunk: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6945 this->pConditions[Condition_Drunk] = 0; |
1822 | 6946 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6947 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6948 case VAR_Insane: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6949 this->pConditions[Condition_Insane] = 0; |
1822 | 6950 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6951 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6952 case VAR_PoisonedGreen: |
2187 | 6953 this->pConditions[Condition_Poison_Weak] = 0; |
1822 | 6954 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6955 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6956 case VAR_DiseasedGreen: |
2187 | 6957 this->pConditions[Condition_Disease_Weak] = 0; |
1822 | 6958 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6959 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6960 case VAR_PoisonedYellow: |
2187 | 6961 this->pConditions[Condition_Poison_Medium] = 0; |
1822 | 6962 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6963 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6964 case VAR_DiseasedYellow: |
2187 | 6965 this->pConditions[Condition_Disease_Medium] = 0; |
1822 | 6966 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6967 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6968 case VAR_PoisonedRed: |
2187 | 6969 this->pConditions[Condition_Poison_Severe] = 0; |
1822 | 6970 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6971 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6972 case VAR_DiseasedRed: |
2187 | 6973 this->pConditions[Condition_Disease_Severe] = 0; |
1822 | 6974 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6975 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6976 case VAR_Paralyzed: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6977 this->pConditions[Condition_Paralyzed] = 0; |
1822 | 6978 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6979 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6980 case VAR_Unconsious: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6981 this->pConditions[Condition_Unconcious] = 0; |
1822 | 6982 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6983 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6984 case VAR_Dead: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6985 this->pConditions[Condition_Dead] = 0; |
1822 | 6986 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6987 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6988 case VAR_Stoned: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6989 this->pConditions[Condition_Pertified] = 0; |
1822 | 6990 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6991 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6992 case VAR_Eradicated: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6993 this->pConditions[Condition_Eradicated] = 0; |
1822 | 6994 PlayAwardSound_Anim98(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6995 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6996 case VAR_AutoNotes: |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6997 _449B7E_toggle_bit(pParty->_autonote_bits, pValue - 1, 0); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
6998 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
6999 case VAR_NPCs2: |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7000 npcIndex = 0; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7001 GetNewNPCData(sDialogue_SpeakingActorNPC_ID, &npcIndex); |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7002 if ( npcIndex == pValue ) |
0 | 7003 { |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7004 npcIdToDismissAfterDialogue = pValue; |
0 | 7005 } |
7006 else | |
7007 { | |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7008 npcIdToDismissAfterDialogue = 0; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7009 pParty->hirelingScrollPosition = 0; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7010 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7011 pParty->CountHirelings(); |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7012 viewparams->bRedrawGameUI = true; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7013 } |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7014 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7015 case VAR_HiredNPCHasSpeciality: |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7016 for (unsigned int i = 0; i < pNPCStats->uNumNewNPCs; i++) |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7017 { |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7018 if (pNPCStats->pNewNPCData[i].uProfession == pValue) |
0 | 7019 { |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7020 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
0 | 7021 } |
7022 } | |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7023 if ( pParty->pHirelings[0].uProfession == pValue ) |
1868
351b4ff10ac1
changed some memsets to fills in player.cpp, party.cpp and changing to sizeof(varName)
Grumpy7
parents:
1861
diff
changeset
|
7024 memset(&pParty->pHirelings[0], 0, sizeof(NPCData)); |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7025 if ( pParty->pHirelings[1].uProfession == pValue ) |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7026 memset(&pParty->pHirelings[1], 0, sizeof(NPCData)); |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7027 pParty->hirelingScrollPosition = 0; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7028 pParty->CountHirelings(); |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7029 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7030 case VAR_NumSkillPoints: |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7031 if ((unsigned int)pValue <= this->uSkillPoints) |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7032 { |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7033 this->uSkillPoints -= pValue; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7034 } |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7035 else |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7036 { |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7037 this->uSkillPoints = 0; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7038 } |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7039 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7040 case VAR_ReputationInCurrentLocation: |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7041 locationHeader = &pOutdoor->ddm; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7042 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7043 locationHeader = &pIndoor->dlv; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7044 locationHeader->uReputation -= pValue; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7045 if (locationHeader->uReputation < -10000) |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7046 locationHeader->uReputation = -10000; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7047 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7048 case VAR_GoldInBank: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7049 if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7050 { |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7051 pParty->uNumGoldInBank -= (unsigned int)pValue; |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7052 } |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7053 else |
0 | 7054 { |
1825
23deb6b09c8c
cancelEventProcessing to dword_5B65C4_cancelEventProcessing
Grumpy7
parents:
1822
diff
changeset
|
7055 dword_5B65C4_cancelEventProcessing = 1; |
605 | 7056 } |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7057 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7058 case VAR_NumDeaths: |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7059 pParty->uNumDeaths -= (unsigned int)pValue; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7060 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7061 case VAR_NumBounties: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7062 pParty->uNumBountiesCollected -= (unsigned int)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7063 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7064 case VAR_PrisonTerms: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7065 pParty->uNumPrisonTerms -= (int)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7066 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7067 case VAR_ArenaWinsPage: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7068 pParty->uNumArenaPageWins -= (char)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7069 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7070 case VAR_ArenaWinsSquire: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7071 pParty->uNumArenaSquireWins -= (char)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7072 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7073 case VAR_ArenaWinsKnight: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7074 pParty->uNumArenaKnightWins -= (char)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7075 return; |
1819
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7076 case VAR_ArenaWinsLord: |
1641ab7f21ec
Player::SubtractVariable moving everything to one switch
Grumpy7
parents:
1818
diff
changeset
|
7077 pParty->uNumArenaLordWins -= (char)pValue; |
1820
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7078 return; |
af7f08135ffb
Player::SubtractVariable changing return val to void, finishing cleanup
Grumpy7
parents:
1819
diff
changeset
|
7079 } |
0 | 7080 } |
7081 // 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
|
7082 // 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
|
7083 |
1818 | 7084 //----- (new function) -------------------------------------------------------- |
1822 | 7085 void Player::PlayAwardSound_Anim98() |
7086 { | |
7087 int playerIndex = GetPlayerIndex(); | |
7088 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, playerIndex); | |
7089 PlayAwardSound(); | |
1818 | 7090 } |
7091 | |
7092 //----- (new function) -------------------------------------------------------- | |
1822 | 7093 void Player::PlayAwardSound_Anim98_Face( PlayerSpeech speech ) |
1818 | 7094 { |
7095 this->PlaySound(speech, 0); | |
1822 | 7096 PlayAwardSound_Anim98(); |
1818 | 7097 } |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7098 |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7099 //----- (00467E7F) -------------------------------------------------------- |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7100 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
|
7101 { |
1822 | 7102 int itemAnchor; // ebx@1 |
7103 int itemInvLocation; // edx@1 | |
7104 int freeSlot; // eax@3 | |
1619 | 7105 ItemGen tempPickedItem; // [sp+Ch] [bp-30h]@1 |
7106 | |
7107 tempPickedItem.Reset(); | |
1822 | 7108 itemAnchor = pEquipTypeToBodyAnchor[uEquipType]; |
2156 | 7109 itemInvLocation = pPlayers[uActiveCharacter]->pEquipment.pIndices[itemAnchor]; |
7110 if ( itemInvLocation )//ïåðåîäåòüñÿ â äðóãóþ âåùü | |
1619 | 7111 { |
7112 memcpy(&tempPickedItem, &pParty->pPickedItem, sizeof(tempPickedItem)); | |
2156 | 7113 pPlayers[uActiveCharacter]->pInventoryItemList[itemInvLocation - 1].uBodyAnchor = 0; |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7114 pParty->pPickedItem.Reset(); |
2156 | 7115 pParty->SetHoldingItem(&pPlayers[uActiveCharacter]->pInventoryItemList[itemInvLocation - 1]); |
1822 | 7116 tempPickedItem.uBodyAnchor = itemAnchor + 1; |
2156 | 7117 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[itemInvLocation - 1], &tempPickedItem, sizeof(ItemGen)); |
7118 pPlayers[uActiveCharacter]->pEquipment.pIndices[itemAnchor] = itemInvLocation; | |
7119 } | |
7120 else//îäåòü âåùü | |
7121 { | |
7122 freeSlot = pPlayers[uActiveCharacter]->FindFreeInventoryListSlot(); | |
1822 | 7123 if (freeSlot >= 0) |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7124 { |
1822 | 7125 pParty->pPickedItem.uBodyAnchor = itemAnchor + 1; |
2156 | 7126 memcpy(&pPlayers[uActiveCharacter]->pInventoryItemList[freeSlot], &pParty->pPickedItem, sizeof(ItemGen)); |
7127 pPlayers[uActiveCharacter]->pEquipment.pIndices[itemAnchor] = freeSlot + 1; | |
1276
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7128 pMouse->RemoveHoldingItem(); |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7129 } |
f11651288371
changed sub_467E7F_EquipBody to Player::EquipBody, some more header file stuff
Grumpy7
parents:
1275
diff
changeset
|
7130 } |
1295 | 7131 } |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7132 |
1295 | 7133 //----- (0049387A) -------------------------------------------------------- |
1459 | 7134 int CycleCharacter(bool backwards) |
1295 | 7135 { |
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
|
7136 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
|
7137 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
|
7138 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
|
7139 |
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
|
7140 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
|
7141 { |
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
|
7142 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
|
7143 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
|
7144 { |
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
|
7145 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
|
7146 } |
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
|
7147 } |
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
|
7148 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
|
7149 } |
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
|
7150 |
1297 | 7151 //----- (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
|
7152 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
|
7153 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7154 if (GetArmorItem() == nullptr || GetArmorItem()->uItemID != 604) |
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
|
7155 { |
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
|
7156 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
|
7157 } |
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
|
7158 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
|
7159 } |
1432 | 7160 |
1297 | 7161 //----- (0043EE15) -------------------------------------------------------- |
1822 | 7162 bool Player::HasItem( unsigned int uItemID, bool checkHeldItem ) |
7163 { | |
7164 if ( !checkHeldItem || pParty->pPickedItem.uItemID != uItemID ) | |
1297 | 7165 { |
7166 for ( uint i = 0; i < 126; ++i ) | |
7167 { | |
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
|
7168 if ( this->pInventoryMatrix[i] > 0 ) |
1384
b51332ab228f
changed a few member variables in Player to slightly less confusing names
Grumpy7
parents:
1383
diff
changeset
|
7169 { |
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
|
7170 if ( (unsigned int)this->pInventoryItemList[this->pInventoryMatrix[i] - 1].uItemID == uItemID ) |
1297 | 7171 return true; |
7172 } | |
7173 } | |
7174 for ( uint i = 0; i < 16; ++i ) | |
7175 { | |
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
|
7176 if ( this->pEquipment.pIndices[i] ) |
1297 | 7177 { |
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
|
7178 if ( (unsigned int)this->pInventoryItemList[this->pEquipment.pIndices[i] - 1].uItemID == uItemID ) |
1297 | 7179 return true; |
7180 } | |
7181 } | |
1822 | 7182 return false; |
7183 } | |
7184 else | |
7185 { | |
7186 return true; | |
7187 } | |
1297 | 7188 } |
7189 //----- (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
|
7190 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
|
7191 { |
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
|
7192 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
|
7193 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
|
7194 |
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
|
7195 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
|
7196 { |
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
|
7197 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
|
7198 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
|
7199 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
|
7200 { |
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
|
7201 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
|
7202 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
|
7203 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
|
7204 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
|
7205 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
|
7206 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
|
7207 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
|
7208 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
|
7209 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
|
7210 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
|
7211 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
|
7212 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
|
7213 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
|
7214 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
|
7215 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
|
7216 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
|
7217 } |
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
|
7218 } |
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
|
7219 return false; |
1297 | 7220 } |
7221 //----- (0043ED6F) -------------------------------------------------------- | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7222 bool IsDwarfPresentInParty(bool a1) |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7223 { |
1297 | 7224 for (uint i = 0; i < 4; ++i) |
7225 { | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7226 CHARACTER_RACE race = pParty->pPlayers[i].GetRace(); |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7227 |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7228 if (race == CHARACTER_RACE_DWARF && a1) |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7229 return true; |
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7230 else if (race != CHARACTER_RACE_DWARF && !a1) |
1297 | 7231 return true; |
7232 } | |
7233 return false; | |
7234 } | |
1647
511cd6dd1048
_43ED6F_check_party_races to IsDwarfPresentInParty
Grumpy7
parents:
1620
diff
changeset
|
7235 |
1297 | 7236 //----- (00439FCB) -------------------------------------------------------- |
2006 | 7237 void __fastcall DamagePlayerFromMonster(unsigned int uObjID, int dmgSource, Vec3_int_ *pPos, signed int a4) |
1681 | 7238 { |
1649 | 7239 Player *playerPtr; // ebx@3 |
7240 Actor *actorPtr; // esi@3 | |
1681 | 7241 int spellId; // eax@38 |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7242 signed int recvdMagicDmg; // eax@139 |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7243 int v72[4]; // [sp+30h] [bp-24h]@164 |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7244 int healthBeforeRecvdDamage; // [sp+48h] [bp-Ch]@3 |
1297 | 7245 unsigned int uActorID; // [sp+4Ch] [bp-8h]@1 |
1681 | 7246 |
7247 uActorID = PID_ID(uObjID); | |
7248 if ( PID_TYPE(uObjID) != 2) | |
1297 | 7249 { |
1649 | 7250 playerPtr = &pParty->pPlayers[a4]; |
1681 | 7251 actorPtr = &pActors[uActorID]; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7252 healthBeforeRecvdDamage = playerPtr->sHealth; |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7253 if ( PID_TYPE(uObjID) != 3 || !actorPtr->ActorHitOrMiss(playerPtr) ) |
1297 | 7254 return; |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7255 ItemGen* equippedArmor = playerPtr->GetArmorItem(); |
1681 | 7256 SoundID soundToPlay; |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7257 if ( !equippedArmor |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7258 || equippedArmor->IsBroken() |
1649 | 7259 || |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7260 (equippedArmor->GetPlayerSkillType() != PLAYER_SKILL_CHAIN |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7261 && equippedArmor->GetPlayerSkillType() != PLAYER_SKILL_PLATE |
1649 | 7262 ) |
7263 ) | |
1297 | 7264 { |
1681 | 7265 int randVal = rand() % 4; |
7266 switch (randVal) | |
1297 | 7267 { |
1681 | 7268 case 0 : soundToPlay = (SoundID)108; break; |
7269 case 1 : soundToPlay = (SoundID)109; break; | |
7270 case 2 : soundToPlay = (SoundID)110; break; | |
7271 case 3 : soundToPlay = (SoundID)44; break; | |
1783 | 7272 default: Error("Unexpected sound value"); |
1297 | 7273 } |
7274 } | |
7275 else | |
7276 { | |
1681 | 7277 int randVal = rand() % 4; |
7278 switch (randVal) | |
1297 | 7279 { |
1681 | 7280 case 0 : soundToPlay = (SoundID)105; break; |
7281 case 1 : soundToPlay = (SoundID)106; break; | |
7282 case 2 : soundToPlay = (SoundID)107; break; | |
7283 case 3 : soundToPlay = (SoundID)45; break; | |
1783 | 7284 default: Error("Unexpected sound value"); |
1297 | 7285 } |
1648 | 7286 } |
1681 | 7287 pAudioPlayer->PlaySound(soundToPlay, PID(OBJECT_Player,a4 + 80), 0, -1, 0, 0, 0, 0); |
1876 | 7288 int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource); |
1949 | 7289 if ( actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 ) |
1649 | 7290 { |
1949 | 7291 __int16 spellPower = actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uPower; |
1681 | 7292 if ( spellPower ) |
7293 dmgToReceive /= (signed int)spellPower; | |
7294 } | |
1682 | 7295 int damageType; |
1875
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1868
diff
changeset
|
7296 switch (dmgSource) |
1648 | 7297 { |
1682 | 7298 case 0: damageType = actorPtr->pMonsterInfo.uAttack1Type; |
1648 | 7299 break; |
1682 | 7300 case 1: damageType = actorPtr->pMonsterInfo.uAttack2Type; |
1648 | 7301 break; |
1681 | 7302 case 2: spellId = actorPtr->pMonsterInfo.uSpell1ID; |
1682 | 7303 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); |
1648 | 7304 break; |
1681 | 7305 case 3: spellId = actorPtr->pMonsterInfo.uSpell2ID; |
1682 | 7306 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); |
1648 | 7307 break; |
1682 | 7308 case 4: damageType = actorPtr->pMonsterInfo.field_3C_some_special_attack; |
1648 | 7309 break; |
7310 default: | |
1682 | 7311 case 5: damageType = 4; //yes, the original just assigned the value 4 |
1648 | 7312 break; |
7313 } | |
2061 | 7314 if ( !(dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DAMAGE) ) |
1297 | 7315 { |
1682 | 7316 dmgToReceive = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType); |
1822 | 7317 if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime > 0 ) |
1297 | 7318 { |
1681 | 7319 int actorState = actorPtr->uAIState; |
7320 if ( actorState != Dying && actorState != Dead) | |
1297 | 7321 { |
2293
b0f10ef66e00
stru319::CalcMagicalDamageToActor moved to Actor class
Grumpy7
parents:
2292
diff
changeset
|
7322 int reflectedDamage = actorPtr->CalcMagicalDamageToActor((DAMAGE_TYPE)damageType, dmgToReceive); |
1681 | 7323 actorPtr->sCurrentHP -= reflectedDamage; |
7324 if ( reflectedDamage >= 0 ) | |
1297 | 7325 { |
1649 | 7326 if ( actorPtr->sCurrentHP >= 1 ) |
1297 | 7327 { |
1682 | 7328 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 | 7329 Actor::AggroSurroundingPeasants(uActorID, 1); |
7330 } | |
7331 else | |
7332 { | |
2154 | 7333 if ( pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].bQuestMonster & 1 && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS) |
1297 | 7334 { |
1681 | 7335 int splatRadius = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * actorPtr->uActorRadius : actorPtr->uActorRadius; |
7336 pDecalBuilder->AddBloodsplat(actorPtr->vPosition.x, actorPtr->vPosition.y, actorPtr->vPosition.z, 1.0, 0.0, 0.0, (float)splatRadius, 0, 0); | |
1297 | 7337 } |
1648 | 7338 Actor::Die(uActorID); |
7339 Actor::ApplyFineForKillingPeasant(uActorID); | |
7340 Actor::AggroSurroundingPeasants(uActorID, 1); | |
1649 | 7341 if ( actorPtr->pMonsterInfo.uExp ) |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
7342 pParty->GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); |
1681 | 7343 int speechToPlay = SPEECH_51; |
1648 | 7344 if ( rand() % 100 < 20 ) |
1681 | 7345 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; |
7346 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); | |
1297 | 7347 } |
7348 } | |
7349 } | |
7350 } | |
2061 | 7351 if ( !(dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DAMAGE) |
1693
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7352 && actorPtr->pMonsterInfo.uSpecialAttackType |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7353 && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackLevel ) |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7354 { |
1694
5ead2688a227
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect second attempt
Grumpy7
parents:
1693
diff
changeset
|
7355 playerPtr->ReceiveSpecialAttackEffect(actorPtr->pMonsterInfo.uSpecialAttackType, actorPtr); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7356 } |
1297 | 7357 } |
7358 if ( !pParty->bTurnBasedModeOn ) | |
7359 { | |
1681 | 7360 int actEndurance = playerPtr->GetActualEndurance(); |
7361 int recoveryTime = (int)((20 - playerPtr->GetParameterBonus(actEndurance)) * flt_6BE3A4_debug_recmod1 * 2.133333333333333); | |
7362 playerPtr->SetRecoveryTime(recoveryTime); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7363 } |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7364 int yellThreshold = playerPtr->GetMaxHealth() / 4; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7365 if ( yellThreshold < playerPtr->sHealth && yellThreshold >= healthBeforeRecvdDamage && playerPtr->sHealth > 0 ) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7366 { |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7367 playerPtr->PlaySound(SPEECH_48, 0); |
1297 | 7368 } |
7369 viewparams->bRedrawGameUI = 1; | |
7370 return; | |
7371 } | |
1648 | 7372 else |
7373 { | |
1681 | 7374 SpriteObject* v37 = &pSpriteObjects[uActorID]; |
7375 int uActorType = PID_TYPE(v37->spell_caster_pid); | |
7376 int uActorID = PID_ID(v37->spell_caster_pid); | |
7377 if ( uActorType == 2 ) | |
7378 { | |
7379 Player *playerPtr; // eax@81 | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7380 if ( a4 != -1 ) |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7381 { |
1681 | 7382 playerPtr = &pParty->pPlayers[a4]; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7383 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7384 else |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7385 { |
1822 | 7386 int activePlayerCounter = 0; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7387 for (int i = 1; i <= 4; i++) |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7388 { |
1822 | 7389 if (pPlayers[i]->CanAct()) |
7390 { | |
7391 v72[activePlayerCounter] = i; | |
7392 activePlayerCounter++; | |
7393 } | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7394 } |
1822 | 7395 if ( activePlayerCounter ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7396 { |
2006 | 7397 playerPtr = &pParty->pPlayers[v72[rand() % activePlayerCounter] - 1];//&stru_AA1058[3].pSounds[6972 * *(&v72 + rand() % v74) + 40552]; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7398 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7399 } |
1681 | 7400 int v68; |
7401 int v69; | |
7402 if ( uActorType != OBJECT_Player || v37->spell_id != SPELL_BOW_ARROW) | |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7403 { |
1681 | 7404 int playerMaxHp = playerPtr->GetMaxHealth(); |
7405 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
|
7406 v69 = LOBYTE(pSpellStats->pInfos[v37->spell_id].uSchool); |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7407 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7408 else |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7409 { |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7410 v68 = pParty->pPlayers[uActorID].CalculateRangedDamageTo(0); |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7411 v69 = 0; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7412 } |
1681 | 7413 playerPtr->ReceiveDamage(v68, (DAMAGE_TYPE)v69); |
2182 | 7414 if ( uActorType == OBJECT_Player && !_A750D8_player_speech_timer ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7415 { |
2182 | 7416 _A750D8_player_speech_timer = 256i64; |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7417 PlayerSpeechID = SPEECH_44; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7418 uSpeakingCharacter = uActorID + 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7419 } |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7420 return; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7421 } |
1681 | 7422 else if ( uActorType == 3 ) |
7423 { | |
7424 Actor *actorPtr = &pActors[uActorID]; | |
1648 | 7425 if ( a4 == -1 ) |
1911 | 7426 a4 = stru_50C198.which_player_to_attack(actorPtr); |
1681 | 7427 Player *playerPtr = &pParty->pPlayers[a4]; |
1876 | 7428 int dmgToReceive = actorPtr->_43B3E0_CalcDamage(dmgSource); |
1681 | 7429 unsigned __int16 spriteType = v37->uType; |
1648 | 7430 if ( v37->uType == 545 ) |
1297 | 7431 { |
1681 | 7432 __int16 skillLevel = playerPtr->GetActualSkillLevel(PLAYER_SKILL_UNARMED); |
7433 if ( SkillToMastery(skillLevel) >= 4 && rand() % 100 < (skillLevel & 0x3F) ) | |
1648 | 7434 { |
1681 | 7435 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[637], playerPtr->pName); |
1648 | 7436 ShowStatusBarString(pTmpBuf.data(), 2u); |
1681 | 7437 playerPtr->PlaySound(SPEECH_6, 0); |
1648 | 7438 return; |
7439 } | |
1297 | 7440 } |
1681 | 7441 else if ( spriteType == 555 |
7442 || spriteType == 510 | |
7443 || spriteType == 500 | |
7444 || spriteType == 515 | |
7445 || spriteType == 505 | |
7446 || spriteType == 530 | |
7447 || spriteType == 525 | |
7448 || spriteType == 520 | |
7449 || spriteType == 535 | |
7450 || spriteType == 540 ) | |
1297 | 7451 { |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7452 if ( !actorPtr->ActorHitOrMiss(playerPtr) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7453 return; |
1822 | 7454 if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime > 0 ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7455 dmgToReceive >>= 1; |
1681 | 7456 if ( playerPtr->HasEnchantedItemEquipped(36) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7457 dmgToReceive >>= 1; |
1681 | 7458 if ( playerPtr->HasEnchantedItemEquipped(69) ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7459 dmgToReceive >>= 1; |
1681 | 7460 if ( playerPtr->HasItemEquipped(EQUIP_ARMOUR) |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7461 && playerPtr->GetArmorItem()->uItemID == ITEM_ARTIFACT_GOVERNORS_ARMOR ) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7462 dmgToReceive >>= 1; |
1989 | 7463 if ( playerPtr->HasItemEquipped(EQUIP_TWO_HANDED)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7464 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7465 ItemGen* mainHandItem = playerPtr->GetMainHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7466 if ( mainHandItem->uItemID == ITEM_RELIC_KELEBRIM || mainHandItem->uItemID == ITEM_ARTIFACT_ELFBANE || (mainHandItem->GetItemEquipType() == EQUIP_SHIELD && SkillToMastery(playerPtr->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7467 dmgToReceive >>= 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7468 } |
1989 | 7469 if ( playerPtr->HasItemEquipped(EQUIP_SINGLE_HANDED)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7470 { |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7471 ItemGen* offHandItem = playerPtr->GetOffHandItem(); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7472 if ( offHandItem->uItemID == ITEM_RELIC_KELEBRIM || offHandItem->uItemID == ITEM_ARTIFACT_ELFBANE || (offHandItem->GetItemEquipType() == EQUIP_SHIELD && SkillToMastery(playerPtr->pActiveSkills[PLAYER_SKILL_SHIELD]) == 4)) |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7473 dmgToReceive >>= 1; |
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7474 } |
1648 | 7475 } |
1949 | 7476 if ( actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uExpireTime > 0 ) |
1648 | 7477 { |
1949 | 7478 int spellPower = actorPtr->pActorBuffs[ACTOR_BUFF_SHRINK].uPower; |
1681 | 7479 if ( spellPower ) |
7480 dmgToReceive /= (signed int)spellPower; | |
1648 | 7481 } |
1681 | 7482 int damageType; |
1875
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1868
diff
changeset
|
7483 switch(dmgSource) |
1648 | 7484 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7485 case 0: |
1681 | 7486 damageType = actorPtr->pMonsterInfo.uAttack1Type; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7487 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7488 case 1: |
1681 | 7489 damageType = actorPtr->pMonsterInfo.uAttack2Type; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7490 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7491 case 2: |
1681 | 7492 spellId = actorPtr->pMonsterInfo.uSpell1ID; |
7493 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7494 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7495 case 3: |
1681 | 7496 spellId = actorPtr->pMonsterInfo.uSpell2ID; |
7497 damageType = LOBYTE(pSpellStats->pInfos[spellId].uSchool); | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7498 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7499 case 4: |
1681 | 7500 damageType = actorPtr->pMonsterInfo.field_3C_some_special_attack; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7501 break; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7502 case 5: |
1681 | 7503 damageType = 4; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7504 break; |
1648 | 7505 } |
2061 | 7506 if ( !(dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DAMAGE) ) |
1648 | 7507 { |
1681 | 7508 int reflectedDmg = playerPtr->ReceiveDamage(dmgToReceive, (DAMAGE_TYPE)damageType); |
1822 | 7509 if ( playerPtr->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime > 0 ) |
1297 | 7510 { |
1681 | 7511 unsigned __int16 actorState = actorPtr->uAIState; |
7512 if ( actorState != Dying && actorState != Dead) | |
1297 | 7513 { |
2293
b0f10ef66e00
stru319::CalcMagicalDamageToActor moved to Actor class
Grumpy7
parents:
2292
diff
changeset
|
7514 recvdMagicDmg = actorPtr->CalcMagicalDamageToActor((DAMAGE_TYPE)damageType, reflectedDmg); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7515 actorPtr->sCurrentHP -= recvdMagicDmg; |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7516 if ( recvdMagicDmg >= 0 ) |
1297 | 7517 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7518 if ( actorPtr->sCurrentHP >= 1 ) |
1297 | 7519 { |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7520 Actor::AI_Stun(uActorID, PID(OBJECT_Player,a4), 0); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7521 Actor::AggroSurroundingPeasants(uActorID, 1); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7522 } |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7523 else |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7524 { |
2154 | 7525 if ( pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].bQuestMonster & 1 && pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) |
1297 | 7526 { |
1681 | 7527 int splatRadius = byte_4D864C && BYTE2(pGame->uFlags) & 8 ? 10 * actorPtr->uActorRadius : actorPtr->uActorRadius; |
7528 pDecalBuilder->AddBloodsplat(actorPtr->vPosition.x, actorPtr->vPosition.y, actorPtr->vPosition.z, 1.0, 0.0, 0.0, (float)splatRadius, 0, 0); | |
1297 | 7529 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7530 Actor::Die(uActorID); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7531 Actor::ApplyFineForKillingPeasant(uActorID); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7532 Actor::AggroSurroundingPeasants(uActorID, 1); |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7533 if ( actorPtr->pMonsterInfo.uExp ) |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
7534 pParty->GivePartyExp(pMonsterStats->pInfos[actorPtr->pMonsterInfo.uID].uExp); |
1681 | 7535 int speechToPlay = SPEECH_51; |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7536 if ( rand() % 100 < 20 ) |
1681 | 7537 speechToPlay = actorPtr->pMonsterInfo.uHP >= 100 ? 2 : 1; |
7538 playerPtr->PlaySound((PlayerSpeech)speechToPlay, 0); | |
1297 | 7539 } |
7540 } | |
7541 } | |
7542 } | |
7543 } | |
1875
1d9e4b50bc7c
Actor::_43B3E0_CalcDamage cleaned up, fixed actor buff enums and added 2 values
Grumpy7
parents:
1868
diff
changeset
|
7544 if ( !dmgSource |
2061 | 7545 && !(dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DAMAGE) |
1693
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7546 && actorPtr->pMonsterInfo.uSpecialAttackType |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7547 && rand() % 100 < actorPtr->pMonsterInfo.uLevel * actorPtr->pMonsterInfo.uSpecialAttackLevel ) |
861ede68187a
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect, some case reordering, fixing getting only disease3 instead of disease1 and ignoring disease2 and 3, uSpecialAttack to uSpecialAttackType, uSpecialAttackType to uSpecialAttackLevel
Grumpy7
parents:
1692
diff
changeset
|
7548 { |
1694
5ead2688a227
Player::_48DCF6 renamed to Player::ReceiveSpecialAttackEffect second attempt
Grumpy7
parents:
1693
diff
changeset
|
7549 playerPtr->ReceiveSpecialAttackEffect(actorPtr->pMonsterInfo.uSpecialAttackType, actorPtr); |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7550 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7551 if ( !pParty->bTurnBasedModeOn ) |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7552 { |
1681 | 7553 int actEnd = playerPtr->GetActualEndurance(); |
7554 int recTime = (int)((20 - playerPtr->GetParameterBonus(actEnd)) | |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7555 * flt_6BE3A4_debug_recmod1 |
1657
51a74615d956
DamagePlayerFromMonster continuing cleanup, part 3
Grumpy7
parents:
1656
diff
changeset
|
7556 * 2.133333333333333); |
1681 | 7557 playerPtr->SetRecoveryTime(recTime); |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7558 } |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7559 return; |
1648 | 7560 } |
1656
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7561 else |
56847118d50c
DamagePlayerFromMonster continuing cleanup, part 2
Grumpy7
parents:
1649
diff
changeset
|
7562 { |
1648 | 7563 return; |
7564 } | |
1297 | 7565 } |
7566 } | |
7567 //----- (00421EA6) -------------------------------------------------------- | |
1683 | 7568 void Player::OnInventoryLeftClick() |
7569 { | |
1822 | 7570 signed int inventoryXCoord; // ecx@2 |
7571 int inventoryYCoord; // eax@2 | |
1682 | 7572 int invMatrixIndex; // eax@2 |
1822 | 7573 unsigned int enchantedItemPos; // eax@7 |
1682 | 7574 unsigned int pickedItemId; // esi@12 |
7575 unsigned int invItemIndex; // eax@12 | |
1822 | 7576 unsigned int itemPos; // eax@18 |
1682 | 7577 ItemGen tmpItem; // [sp+Ch] [bp-3Ch]@1 |
1297 | 7578 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 |
7579 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
2156 | 7580 CastSpellInfo *pSpellInfo; |
1297 | 7581 |
7582 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) | |
7583 { | |
7584 pMouse->GetClickPos(&pX, &pY); | |
1822 | 7585 inventoryYCoord = (pY - 17) / 32; |
7586 inventoryXCoord = (pX - 14) / 32; | |
7587 invMatrixIndex = inventoryXCoord + (INVETORYSLOTSWIDTH * inventoryYCoord); | |
7588 if ( inventoryYCoord >= 0 && inventoryYCoord < INVETORYSLOTSHEIGHT && inventoryXCoord >= 0 && inventoryXCoord < INVETORYSLOTSWIDTH) | |
1682 | 7589 { |
1822 | 7590 if ( _50C9A0_IsEnchantingInProgress ) |
1297 | 7591 { |
1822 | 7592 enchantedItemPos = this->GetItemIDAtInventoryIndex(&invMatrixIndex); |
7593 if ( enchantedItemPos ) | |
1297 | 7594 { |
2156 | 7595 /* *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; |
1822 | 7596 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; |
7597 *((int *)pGUIWindow_Settings->ptr_1C + 3) = enchantedItemPos - 1; | |
2156 | 7598 *((short *)pGUIWindow_Settings->ptr_1C + 3) = invMatrixIndex;*/ |
7599 pSpellInfo = (CastSpellInfo *)pGUIWindow_Settings->ptr_1C; | |
7600 pSpellInfo->uFlags &= 0x7F; | |
7601 pSpellInfo->uPlayerID_2 = uActiveCharacter - 1; | |
7602 pSpellInfo->spell_target_pid = enchantedItemPos - 1; | |
7603 pSpellInfo->field_6 = invMatrixIndex; | |
1822 | 7604 ptr_50C9A4_ItemToEnchant = &this->pInventoryItemList[enchantedItemPos-1]; |
7605 _50C9A0_IsEnchantingInProgress = 0; | |
7606 if ( pMessageQueue_50CBD0->uNumMessages ) | |
7607 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
7608 pMouse->SetCursorBitmap("MICON1"); | |
7609 _50C9D0_AfterEnchClickEventId = 113; | |
7610 _50C9D4_AfterEnchClickEventSecondParam = 0; | |
7611 _50C9D8_AfterEnchClickEventTimeout = 256; | |
7612 } | |
7613 return; | |
7614 } | |
7615 if ( ptr_50C9A4_ItemToEnchant ) | |
7616 return; | |
7617 pickedItemId = pParty->pPickedItem.uItemID; | |
7618 invItemIndex = this->GetItemIDAtInventoryIndex(&invMatrixIndex); | |
7619 if (!pickedItemId) | |
7620 { | |
7621 if ( !invItemIndex ) | |
7622 return; | |
7623 else | |
7624 { | |
7625 memcpy(&pParty->pPickedItem, &this->pInventoryItemList[invItemIndex-1], sizeof(pParty->pPickedItem)); | |
7626 this->RemoveItemAtInventoryIndex(invMatrixIndex); | |
7627 pickedItemId = pParty->pPickedItem.uItemID; | |
7628 pMouse->SetCursorBitmap(pItemsTable->pItems[pickedItemId].pIconName); | |
1297 | 7629 return; |
7630 } | |
1822 | 7631 } |
7632 else | |
7633 { | |
7634 if ( invItemIndex ) | |
1297 | 7635 { |
1822 | 7636 ItemGen* invItemPtr = &this->pInventoryItemList[invItemIndex-1]; |
7637 memcpy(&tmpItem, invItemPtr, sizeof(tmpItem)); | |
7638 this->RemoveItemAtInventoryIndex(invMatrixIndex); | |
7639 int emptyIndex = this->AddItem2(invMatrixIndex, &pParty->pPickedItem); | |
7640 if ( !emptyIndex ) | |
1682 | 7641 { |
1822 | 7642 emptyIndex = this->AddItem2(-1, &pParty->pPickedItem); |
7643 if ( !emptyIndex ) | |
7644 { | |
7645 this->PutItemArInventoryIndex(tmpItem.uItemID, invItemIndex - 1, invMatrixIndex); | |
7646 memcpy(invItemPtr, &tmpItem, sizeof(ItemGen)); | |
7647 return; | |
7648 } | |
1682 | 7649 } |
1822 | 7650 memcpy(&pParty->pPickedItem, &tmpItem, sizeof(ItemGen)); |
7651 pMouse->SetCursorBitmap(pParty->pPickedItem.GetIconName()); | |
7652 return; | |
1297 | 7653 } |
1682 | 7654 else |
1297 | 7655 { |
1822 | 7656 itemPos = this->AddItem(invMatrixIndex, pickedItemId); |
7657 if ( itemPos ) | |
1297 | 7658 { |
1822 | 7659 memcpy(&this->pInventoryItemList[itemPos-1], &pParty->pPickedItem, sizeof(ItemGen)); |
7660 pMouse->RemoveHoldingItem(); | |
1682 | 7661 return; |
7662 } | |
1822 | 7663 itemPos = this->AddItem(-1, pickedItemId); |
7664 if ( itemPos ) | |
1682 | 7665 { |
1822 | 7666 memcpy(&this->pInventoryItemList[itemPos-1], &pParty->pPickedItem, sizeof(ItemGen)); |
7667 pMouse->RemoveHoldingItem(); | |
7668 return; | |
1297 | 7669 } |
7670 } | |
7671 } | |
7672 } | |
7673 } | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7674 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7675 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7676 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7677 bool Player::IsWeak() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7678 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7679 return pConditions[Condition_Weak] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7680 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7681 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7682 bool Player::IsDead() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7683 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7684 return pConditions[Condition_Dead] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7685 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7686 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7687 bool Player::IsEradicated() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7688 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7689 return pConditions[Condition_Eradicated] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7690 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7691 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7692 bool Player::IsZombie() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7693 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7694 return pConditions[Condition_Zombie] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7695 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7696 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7697 bool Player::IsCursed() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7698 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7699 return pConditions[Condition_Cursed] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7700 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7701 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7702 bool Player::IsPertified() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7703 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7704 return pConditions[Condition_Pertified] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7705 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7706 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7707 bool Player::IsUnconcious() |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7708 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7709 return pConditions[Condition_Unconcious] != 0; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7710 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7711 |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7712 bool Player::IsAsleep() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7713 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7714 return pConditions[Condition_Sleep] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7715 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7716 |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7717 bool Player::IsParalyzed() |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7718 { |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7719 return pConditions[Condition_Paralyzed] != 0; |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7720 } |
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7721 |
1685
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7722 bool Player::IsDrunk() |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7723 { |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7724 return pConditions[Condition_Drunk] != 0; |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7725 } |
2a309997c42f
Player::StealFromShop started cleanup, fixing a few errors caused by not commiting everything
Grumpy7
parents:
1684
diff
changeset
|
7726 |
2185 | 7727 void Player::SetCursed( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7728 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7729 pConditions[Condition_Cursed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7730 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7731 |
2185 | 7732 void Player::SetWeak( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7733 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7734 pConditions[Condition_Weak] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7735 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7736 |
2185 | 7737 void Player::SetAsleep( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7738 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7739 pConditions[Condition_Sleep] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7740 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7741 |
2185 | 7742 void Player::SetAfraid( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7743 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7744 pConditions[Condition_Fear] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7745 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7746 |
2185 | 7747 void Player::SetDrunk( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7748 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7749 pConditions[Condition_Drunk] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7750 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7751 |
2185 | 7752 void Player::SetInsane( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7753 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7754 pConditions[Condition_Insane] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7755 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7756 |
2187 | 7757 void Player::SetPoisonWeak( unsigned long long state ) |
7758 { | |
7759 pConditions[Condition_Poison_Weak] = state; | |
7760 } | |
7761 | |
7762 void Player::SetDiseaseWeak( unsigned long long state ) | |
7763 { | |
7764 pConditions[Condition_Disease_Weak] = state; | |
7765 } | |
7766 | |
7767 void Player::SetPoisonMedium( unsigned long long state ) | |
7768 { | |
7769 pConditions[Condition_Poison_Medium] = state; | |
7770 } | |
7771 | |
7772 void Player::SetDiseaseMedium( unsigned long long state ) | |
7773 { | |
7774 pConditions[Condition_Disease_Medium] = state; | |
7775 } | |
7776 | |
7777 void Player::SetPoisonSevere( unsigned long long state ) | |
7778 { | |
7779 pConditions[Condition_Poison_Severe] = state; | |
7780 } | |
7781 | |
7782 void Player::SetDiseaseSevere( unsigned long long state ) | |
7783 { | |
7784 pConditions[Condition_Disease_Severe] = state; | |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7785 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7786 |
2185 | 7787 void Player::SetParalyzed( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7788 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7789 pConditions[Condition_Paralyzed] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7790 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7791 |
2185 | 7792 void Player::SetUnconcious( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7793 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7794 pConditions[Condition_Unconcious] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7795 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7796 |
2185 | 7797 void Player::SetDead( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7798 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7799 pConditions[Condition_Dead] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7800 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7801 |
2185 | 7802 void Player::SetPertified( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7803 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7804 pConditions[Condition_Pertified] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7805 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7806 |
2185 | 7807 void Player::SetEradicated( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7808 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7809 pConditions[Condition_Eradicated] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7810 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7811 |
2185 | 7812 void Player::SetZombie( unsigned long long state ) |
1361
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7813 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7814 pConditions[Condition_Zombie] = state; |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7815 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7816 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7817 void Player::SetCondWeakWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7818 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7819 SetCondition(Condition_Weak, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7820 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7821 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7822 void Player::SetCondInsaneWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7823 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7824 SetCondition(Condition_Insane, blockable); |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7825 } |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7826 |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7827 void Player::SetCondDeadWithBlockCheck( int blockable ) |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7828 { |
b3ac17fd12de
Moved condition checking to a separate class, extracted it from player::SetCondition
Grumpy7
parents:
1360
diff
changeset
|
7829 SetCondition(Condition_Dead, blockable); |
1362
d6cf8ead9242
Condition checking functions slightly renamed, some final changes in Player::SetCondition
Grumpy7
parents:
1361
diff
changeset
|
7830 } |
1567
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
7831 |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
7832 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
|
7833 { |
9f8b3e904e14
Player::ReceiveDamage, very small edits; prepended "Is" to item functions returning bool values (broken, indetified, stolen)
Grumpy7
parents:
1565
diff
changeset
|
7834 SetCondition(Condition_Dead, blockable); |
1593
5658d0f3b5ee
Player::GetAttackRecoveryTime removing label, fixing shield skill being ignored, fixing haste being ignored
Grumpy7
parents:
1568
diff
changeset
|
7835 } |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7836 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7837 ItemGen* Player::GetOffHandItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7838 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7839 return GetItem(&PlayerEquipment::uShield); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7840 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7841 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7842 ItemGen* Player::GetMainHandItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7843 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7844 return GetItem(&PlayerEquipment::uMainHand); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7845 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7846 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7847 ItemGen* Player::GetBowItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7848 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7849 return GetItem(&PlayerEquipment::uBow); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7850 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7851 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7852 ItemGen* Player::GetArmorItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7853 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7854 return GetItem(&PlayerEquipment::uArmor); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7855 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7856 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7857 ItemGen* Player::GetHelmItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7858 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7859 return GetItem(&PlayerEquipment::uHelm); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7860 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7861 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7862 ItemGen* Player::GetBeltItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7863 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7864 return GetItem(&PlayerEquipment::uBelt); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7865 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7866 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7867 ItemGen* Player::GetCloakItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7868 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7869 return GetItem(&PlayerEquipment::uCloak); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7870 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7871 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7872 ItemGen* Player::GetGloveItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7873 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7874 return GetItem(&PlayerEquipment::uGlove); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7875 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7876 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7877 ItemGen* Player::GetBootItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7878 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7879 return GetItem(&PlayerEquipment::uBoot); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7880 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7881 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7882 ItemGen* Player::GetAmuletItem() |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7883 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7884 return GetItem(&PlayerEquipment::uAmulet); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7885 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7886 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7887 ItemGen* Player::GetNthRingItem(int ringNum) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7888 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7889 return GetNthEquippedIndexItem(ringNum + 10); |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7890 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7891 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7892 ItemGen* Player::GetNthEquippedIndexItem(int index) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7893 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7894 if (this->pEquipment.pIndices[index] == 0) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7895 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7896 return nullptr; |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7897 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7898 return &this->pInventoryItemList[this->pEquipment.pIndices[index] - 1]; |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7899 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7900 |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7901 ItemGen* Player::GetItem(unsigned int PlayerEquipment::* itemPos) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7902 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7903 if (this->pEquipment.*itemPos == 0) |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7904 { |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7905 return nullptr; |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7906 } |
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
7907 return &this->pInventoryItemList[this->pEquipment.*itemPos - 1]; |
1822 | 7908 } |
7909 | |
7910 int Player::GetPlayerIndex() | |
7911 { | |
7912 int uPlayerIdx = 0; | |
7913 if ( this == pPlayers[1] ) | |
7914 uPlayerIdx = 0; | |
7915 else if( this == pPlayers[2] ) | |
7916 uPlayerIdx = 1; | |
7917 else if ( this == pPlayers[3] ) | |
7918 uPlayerIdx = 2; | |
7919 else if ( this == pPlayers[4] ) | |
7920 uPlayerIdx = 3; | |
1827
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
7921 else |
0c75c3e7e436
cleaned up part of party.cpp, renamed byte_AE3368 to playerAlreadyPicked + 3 vars after it, moved them to party.cpp, some player.cpp bugfixes
Grumpy7
parents:
1826
diff
changeset
|
7922 Error("Unexpected player pointer"); |
1826 | 7923 return uPlayerIdx; |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7924 } |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7925 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7926 //----- (004272F5) -------------------------------------------------------- |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7927 bool Player::PlayerHitOrMiss(Actor *pActor, int a3, int a4) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7928 { |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7929 signed int naturalArmor; // esi@1 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7930 signed int armorBuff; // edi@1 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7931 int effectiveActorArmor; // esi@8 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7932 int attBonus; // eax@9 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7933 int v9; // edx@11 |
2334 | 7934 // unsigned __int8 v12; // sf@13 |
7935 // unsigned __int8 v13; // of@13 | |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7936 int attPositiveMod; // edx@14 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7937 int attNegativeMod; // eax@14 |
2334 | 7938 // signed int result; // eax@17 |
2291
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7939 |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7940 naturalArmor = pActor->pMonsterInfo.uAC; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7941 armorBuff = 0; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7942 if ( pActor->pActorBuffs[ACTOR_BUFF_SOMETHING_THAT_HALVES_AC].uExpireTime > 0 ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7943 naturalArmor /= 2; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7944 if ( pActor->pActorBuffs[ACTOR_BUFF_HOUR_OF_POWER].uExpireTime > 0 ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7945 armorBuff = pActor->pActorBuffs[ACTOR_BUFF_SHIELD].uPower; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7946 if ( pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uExpireTime > 0 && pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower > armorBuff ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7947 armorBuff = pActor->pActorBuffs[ACTOR_BUFF_STONESKIN].uPower; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7948 effectiveActorArmor = armorBuff + naturalArmor; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7949 if ( a3 ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7950 attBonus = this->GetRangedAttack(); |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7951 else |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7952 attBonus = this->GetActualAttack(false); |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7953 v9 = rand() % (effectiveActorArmor + 2 * attBonus + 30); |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7954 attPositiveMod = a4 + v9; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7955 if ( a3 == 2 ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7956 { |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7957 attNegativeMod = ((effectiveActorArmor + 15) / 2) + effectiveActorArmor + 15; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7958 } |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7959 else if ( a3 == 3 ) |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7960 { |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7961 attNegativeMod = 2 * effectiveActorArmor + 30; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7962 } |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7963 else |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7964 { |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7965 attNegativeMod = effectiveActorArmor + 15; |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7966 } |
69661f22ff03
stru319::PlayerHitOrMiss moved to Player class, cleaned up a bit, stru319::ActorHitOrMiss moved to Actor class, cleaned up a bit
Grumpy7
parents:
2276
diff
changeset
|
7967 return (attPositiveMod > attNegativeMod); |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7968 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7969 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7970 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7971 //----- (0042ECB5) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7972 void Player::_42ECB5_PlayerAttacksActor() |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7973 { |
2334 | 7974 // char *v5; // eax@8 |
7975 // unsigned int v9; // ecx@21 | |
7976 // char *v11; // eax@26 | |
7977 // unsigned int v12; // eax@47 | |
7978 // SoundID v24; // [sp-4h] [bp-40h]@58 | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7979 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7980 //result = pParty->pPlayers[uActiveCharacter-1].CanAct(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7981 Player* player = &pParty->pPlayers[uActiveCharacter - 1]; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7982 if (!player->CanAct()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7983 return; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7984 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7985 CastSpellInfoHelpers::_427D48(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7986 //v3 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7987 if (pParty->Invisible()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7988 pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].Reset(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7989 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7990 //v31 = player->pEquipment.uBow; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7991 int bow_idx = player->pEquipment.uBow; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7992 if (bow_idx && player->pInventoryItemList[bow_idx - 1].IsBroken()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7993 bow_idx = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7994 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7995 //v32 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7996 int wand_item_id = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7997 //v33 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7998 //v4 = v1->pEquipment.uMainHand; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
7999 int laser_weapon_item_id = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8000 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8001 int main_hand_idx = player->pEquipment.uMainHand; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8002 if (main_hand_idx) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8003 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8004 ItemGen* item = &player->pInventoryItemList[main_hand_idx - 1]; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8005 //v5 = (char *)v1 + 36 * v4; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8006 if (!item->IsBroken()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8007 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8008 //v28b = &v1->pInventoryItems[v4].uItemID; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8009 //v6 = v1->pInventoryItems[v4].uItemID;//*((int *)v5 + 124); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8010 if (item->GetItemEquipType() == EQUIP_WAND) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8011 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8012 if (item->uNumCharges <= 0) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8013 player->pEquipment.uMainHand = 0; // wand discharged - unequip |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8014 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8015 wand_item_id = item->uItemID;//*((int *)v5 + 124); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8016 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8017 else if (item->uItemID == ITEM_BLASTER || item->uItemID == ITEM_LASER_RIFLE) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8018 laser_weapon_item_id = item->uItemID;//*((int *)v5 + 124); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8019 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8020 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8021 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8022 //v30 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8023 //v29 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8024 //v28 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8025 //v7 = pMouse->uPointingObjectID; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8026 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8027 int target_pid = pMouse->uPointingObjectID; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8028 int target_type = PID_TYPE(target_pid), |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8029 target_id = PID_ID(target_pid); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8030 if (target_type != OBJECT_Actor || !pActors[target_id].CanAct()) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8031 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8032 target_pid = stru_50C198.FindClosestActor(5120, 0, 0); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8033 target_type = PID_TYPE(target_pid); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8034 target_id = PID_ID(target_pid); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8035 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8036 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8037 Actor* actor = &pActors[target_id]; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8038 int actor_distance = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8039 if (target_type == OBJECT_Actor) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8040 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8041 int distance_x = actor->vPosition.x - pParty->vPosition.x, |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8042 distance_y = actor->vPosition.y - pParty->vPosition.y, |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8043 distance_z = actor->vPosition.z - pParty->vPosition.z; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8044 actor_distance = integer_sqrt(distance_x * distance_x + distance_y * distance_y + distance_z * distance_z) - actor->uActorRadius; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8045 if (actor_distance < 0) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8046 actor_distance = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8047 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8048 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8049 bool shooting_bow = false, |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8050 shotting_laser = false, |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8051 shooting_wand = false, |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8052 melee_attack = false; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8053 if (laser_weapon_item_id) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8054 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8055 shotting_laser = true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8056 _42777D_CastSpell_UseWand_ShootArrow(SPELL_LASER_PROJECTILE, uActiveCharacter - 1, 0, 0, uActiveCharacter + 8); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8057 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8058 else if (wand_item_id) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8059 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8060 shooting_wand = true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8061 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8062 int main_hand_idx = player->pEquipment.uMainHand; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8063 _42777D_CastSpell_UseWand_ShootArrow(wand_spell_ids[player->pInventoryItemList[main_hand_idx - 1].uItemID - ITEM_WAND_FIRE], uActiveCharacter - 1, 8, 0, uActiveCharacter + 8); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8064 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8065 if (!--player->pInventoryItemList[main_hand_idx - 1].uNumCharges) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8066 player->pEquipment.uMainHand = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8067 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8068 else if (target_type == OBJECT_Actor && actor_distance <= 407.2) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8069 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8070 melee_attack = true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8071 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8072 Vec3_int_ a3; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8073 a3.x = actor->vPosition.x - pParty->vPosition.x; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8074 a3.y = actor->vPosition.y - pParty->vPosition.y; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8075 a3.z = actor->vPosition.z - pParty->vPosition.z; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8076 Vec3_int_::Normalize(&a3.x, &a3.y, &a3.z); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8077 |
2338
1e865e8690ba
Moving some function declarations from unsorted subs to Actor.h and SpriteObject.h
Grumpy7
parents:
2336
diff
changeset
|
8078 Actor::DamageMonsterFromParty(PID(OBJECT_Player, uActiveCharacter - 1), target_id, &a3); |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8079 if (player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_TWO_HANDED) || player->WearsItem(ITEM_ARTIFACT_SPLITTER, EQUIP_SINGLE_HANDED)) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8080 _42FA66_do_explosive_impact(actor->vPosition.x, actor->vPosition.y, actor->vPosition.z + actor->uActorHeight / 2, 0, 512, uActiveCharacter); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8081 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8082 else if (bow_idx) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8083 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8084 shooting_bow = true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8085 _42777D_CastSpell_UseWand_ShootArrow(SPELL_BOW_ARROW, uActiveCharacter - 1, 0, 0, 0); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8086 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8087 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8088 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8089 melee_attack = true; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8090 ; // actor out of range or no actor; no ranged weapon so melee attacking air |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8091 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8092 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8093 if (!pParty->bTurnBasedModeOn && melee_attack) // wands, bows & lasers will add recovery while shooting spell effect |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8094 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8095 int recovery = player->GetAttackRecoveryTime(false); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8096 if (recovery < 30 ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8097 recovery = 30; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8098 player->SetRecoveryTime(flt_6BE3A4_debug_recmod1 * (double)recovery * 2.133333333333333); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8099 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8100 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8101 int v34 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8102 if (shooting_wand) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8103 return; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8104 else if (shooting_bow) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8105 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8106 v34 = 5; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8107 player->PlaySound(SPEECH_50, 0); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8108 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8109 if (shotting_laser) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8110 v34 = 7; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8111 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8112 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8113 int main_hand_idx = player->pEquipment.uMainHand; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8114 if (player->HasItemEquipped(EQUIP_TWO_HANDED)) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8115 v34 = player->pInventoryItemList[main_hand_idx - 1].GetPlayerSkillType(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8116 pTurnEngine->ApplyPlayerAction(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8117 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8118 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8119 switch (v34) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8120 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8121 case 0: pAudioPlayer->PlaySound(SOUND_81, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8122 case 1: pAudioPlayer->PlaySound(SOUND_84, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8123 case 2: pAudioPlayer->PlaySound(SOUND_85, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8124 case 3: pAudioPlayer->PlaySound(SOUND_78, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8125 case 4: pAudioPlayer->PlaySound(SOUND_80, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8126 case 5: pAudioPlayer->PlaySound(SOUND_71, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8127 case 6: pAudioPlayer->PlaySound(SOUND_83, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8128 case 7: pAudioPlayer->PlaySound(SOUND_67, 0, 0, -1, 0, 0, 0, 0); break; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8129 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8130 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8131 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8132 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8133 //----- (0042FA66) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8134 void Player::_42FA66_do_explosive_impact(int a1, int a2, int a3, int a4, __int16 a5, signed int a6) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8135 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8136 unsigned __int16 v9; // ax@5 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8137 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8138 SpriteObject a1a; // [sp+Ch] [bp-74h]@1 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8139 //SpriteObject::SpriteObject(&a1a); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8140 a1a.uType = 600; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8141 a1a.stru_24.Reset(); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8142 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8143 a1a.spell_id = SPELL_FIRE_FIREBALL; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8144 a1a.spell_level = 8; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8145 a1a.spell_skill = 3; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8146 v9 = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8147 for ( uint i = 0; i < pObjectList->uNumObjects; ++i ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8148 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8149 if ( a1a.uType == pObjectList->pObjects[i].uObjectID ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8150 v9 = i; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8151 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8152 a1a.uObjectDescID = v9; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8153 a1a.vPosition.x = a1; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8154 a1a.vPosition.y = a2; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8155 a1a.vPosition.z = a3; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8156 a1a.uAttributes = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8157 a1a.uSectorID = pIndoor->GetSector(a1, a2, a3); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8158 a1a.uSpriteFrameID = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8159 a1a.spell_target_pid = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8160 a1a.field_60_distance_related_prolly_lod = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8161 a1a.uFacing = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8162 a1a.uSoundID = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8163 if ( a6 >= 1 || a6 <= 4 ) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8164 a1a.spell_caster_pid = PID(OBJECT_Player, a6 - 1); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8165 else |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8166 a1a.spell_caster_pid = 0; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8167 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8168 int id = a1a.Create(0, 0, 0, 0); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8169 if (id != -1) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8170 AttackerInfo.Add(PID(OBJECT_Item, id), a5, SLOWORD(a1a.vPosition.x), SLOWORD(a1a.vPosition.y), |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2293
diff
changeset
|
8171 SLOWORD(a1a.vPosition.z), 0, 0); |
2355 | 8172 } |
8173 | |
8174 //----- (00458244) -------------------------------------------------------- | |
8175 unsigned int SkillToMastery( unsigned int skill_value ) | |
8176 { | |
8177 switch (skill_value & 0x1C0) | |
8178 { | |
8179 case 0x100: return 4; // Grandmaster | |
8180 case 0x80: return 3; // Master | |
8181 case 0x40: return 2; // Expert | |
8182 case 0x00: return 1; // Normal | |
8183 } | |
8184 assert(false); | |
8185 return 0; | |
1714
bafc79e65a4d
Item getter functions to reduce the number of ugly array accesses, fixing a bug with Player::setrecoverytime
Grumpy7
parents:
1710
diff
changeset
|
8186 } |