Mercurial > mm7
comparison Player.cpp @ 501:6fa3ff8ef729
SubtractVariables
author | Ritor1 |
---|---|
date | Fri, 01 Mar 2013 17:37:47 +0600 |
parents | 59649750a054 |
children | 7c86030324a5 |
comparison
equal
deleted
inserted
replaced
500:63b171359be2 | 501:6fa3ff8ef729 |
---|---|
1742 unsigned int v8; // ebp@1 | 1742 unsigned int v8; // ebp@1 |
1743 void *v9; // edx@4 | 1743 void *v9; // edx@4 |
1744 unsigned int uSlota; // [sp+14h] [bp+4h]@1 | 1744 unsigned int uSlota; // [sp+14h] [bp+4h]@1 |
1745 | 1745 |
1746 pIndices = &this->pInventoryIndices[uSlot]; | 1746 pIndices = &this->pInventoryIndices[uSlot]; |
1747 | |
1748 v3 = &this->pInventoryItems[*pIndices-1]; | 1747 v3 = &this->pInventoryItems[*pIndices-1]; |
1749 v4 = v3->uItemID; | 1748 v4 = v3->uItemID; |
1750 v3->Reset(); | 1749 v3->Reset(); |
1751 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4].pIconName, TEXTURE_16BIT_PALETTE); | 1750 v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4].pIconName, TEXTURE_16BIT_PALETTE); |
1752 v6 = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); | 1751 v6 = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); |
8891 case VAR_QBits_QuestsDone: | 8890 case VAR_QBits_QuestsDone: |
8892 if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_quest_bits[((signed __int16)val - 1) >> 3]) | 8891 if ( !((unsigned __int8)(0x80u >> ((signed __int16)val - 1) % 8) & pParty->_quest_bits[((signed __int16)val - 1) >> 3]) |
8893 //&& (&dword_722F10)[4 * val] ) | 8892 //&& (&dword_722F10)[4 * val] ) |
8894 && pQuestTable[val-1] ) | 8893 && pQuestTable[val-1] ) |
8895 { | 8894 { |
8896 v17 = pPlayers[uPlayerIdx + 1]; | 8895 //v17 = pPlayers[uPlayerIdx + 1]; |
8897 bFlashQuestBook = 1; | 8896 bFlashQuestBook = 1; |
8898 v34 = 1; | 8897 v34 = 1; |
8899 v3 = 1; | 8898 v3 = 1; |
8900 v17->PlaySound(SPEECH_93, 0); | 8899 pPlayers[uPlayerIdx + 1]->PlaySound(SPEECH_93, 0); |
8901 } | 8900 } |
8902 v15 = (char *)pParty->_quest_bits; | 8901 v15 = (char *)pParty->_quest_bits; |
8903 LABEL_44: | 8902 LABEL_44: |
8904 _449B7E_toggle_bit((unsigned char *)v15, val, 1u); | 8903 _449B7E_toggle_bit((unsigned char *)v15, val, 1u); |
8905 goto LABEL_173; | 8904 goto LABEL_173; |
9277 | 9276 |
9278 | 9277 |
9279 | 9278 |
9280 | 9279 |
9281 //----- (0044B9C4) -------------------------------------------------------- | 9280 //----- (0044B9C4) -------------------------------------------------------- |
9282 void Player::SubtractVariable(enum VariableType var, void *a3) | 9281 bool Player::SubtractVariable(enum VariableType VarNum, signed int pValue) |
9283 { | 9282 { |
9284 unsigned int v3; // ebx@1 | 9283 unsigned int v3; // ebx@1 |
9285 signed int v4; // esi@1 | 9284 signed int v4; // esi@1 |
9286 enum VariableType v5; // eax@8 | 9285 bool result; // eax@8 |
9287 int v6; // esi@11 | 9286 int v6; // esi@11 |
9288 int v7; // edi@14 | 9287 int v7; // edi@14 |
9289 signed int v8; // eax@17 | 9288 signed int v8; // eax@17 |
9290 char *v9; // eax@20 | 9289 char *v9; // eax@20 |
9291 char v10; // sf@20 | 9290 char v10; // sf@20 |
9292 char *v11; // ecx@26 | 9291 char *v11; // ecx@26 |
9293 char *v12; // ecx@27 | 9292 char *v12; // ecx@27 |
9294 __int64 v13; // qax@27 | 9293 __int64 v13; // qax@27 |
9295 unsigned __int8 v14; // cf@27 | 9294 unsigned __int8 v14; // cf@27 |
9296 char *v15; // edx@29 | 9295 int *v15; // edx@29 |
9297 char *v16; // eax@90 | 9296 char *v16; // eax@90 |
9298 char *v17; // ecx@94 | 9297 char *v17; // ecx@94 |
9299 void *v18; // esi@97 | 9298 int v18; // esi@97 |
9300 signed int v19; // edx@97 | 9299 signed int v19; // edx@97 |
9301 char *v20; // ecx@98 | 9300 char *v20; // ecx@98 |
9302 int v21; // eax@100 | 9301 int v21; // eax@100 |
9303 __int16 v22; // dx@112 | 9302 __int16 v22; // dx@112 |
9304 int v23; // [sp-8h] [bp-14h]@45 | 9303 int v23; // [sp-8h] [bp-14h]@45 |
9322 goto LABEL_8; | 9321 goto LABEL_8; |
9323 v24 = 3; | 9322 v24 = 3; |
9324 } | 9323 } |
9325 v4 = v24; | 9324 v4 = v24; |
9326 LABEL_8: | 9325 LABEL_8: |
9327 v5 = var; | 9326 result = false; |
9328 if ( (signed int)var > 222 ) | 9327 if ( (signed int)VarNum > 222 ) |
9329 { | 9328 { |
9330 if ( (signed int)var <= 307 ) | 9329 if ( (signed int)VarNum <= 307 ) |
9331 { | 9330 { |
9332 if ( var == 307 ) | 9331 if ( VarNum == 307 ) |
9333 { | 9332 { |
9334 pParty->uNumDeaths -= (unsigned int)a3; | 9333 pParty->uNumDeaths -= (unsigned int)pValue; |
9335 return; | 9334 return pValue; |
9336 } | 9335 } |
9337 if ( var == 223 ) | 9336 if ( VarNum == 223 ) |
9338 { | 9337 { |
9339 v11 = (char *)pParty->_autonote_bits; | 9338 v11 = (char *)pParty->_autonote_bits; |
9340 v22 = (short)a3 - 1; | 9339 v22 = (short)pValue - 1; |
9341 } | 9340 } |
9342 else | 9341 else |
9343 { | 9342 { |
9344 if ( var != 231 ) | 9343 if ( VarNum != 231 ) |
9345 { | 9344 { |
9346 switch ( var ) | 9345 switch ( VarNum ) |
9347 { | 9346 { |
9348 case 232: | 9347 case 232: |
9349 var = (VariableType)0; | 9348 VarNum = (VariableType)0; |
9350 GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&var); | 9349 GetNewNPCData(uDialogue_SpeakingActorNPC_ID, (int)&VarNum); |
9351 dword_5B65CC = 0; | 9350 result = (bool) pValue; |
9352 if ( (void *)var == a3 ) | 9351 dword_5B65CC = 0; |
9352 if ( (int)VarNum == pValue ) | |
9353 { | 9353 { |
9354 dword_5B65CC = (int)a3; | 9354 dword_5B65CC = (int)pValue; |
9355 } | 9355 } |
9356 else | 9356 else |
9357 { | 9357 { |
9358 pParty->field_709 = 0; | 9358 pParty->field_709 = 0; |
9359 LOBYTE(pNPCStats->pNewNPCData[(int)a3].uFlags) &= 0x7Fu; | 9359 LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; |
9360 sub_44A56A(); | 9360 sub_44A56A(); |
9361 viewparams->bRedrawGameUI = 1; | 9361 viewparams->bRedrawGameUI = 1; |
9362 } | 9362 } |
9363 break; | 9363 break; |
9364 case 241: | 9364 case 241: |
9365 v18 = a3; | 9365 v18 = pValue; |
9366 v19 = 0; | 9366 v19 = 0; |
9367 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | 9367 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) |
9368 { | 9368 { |
9369 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; | 9369 v20 = (char *)&pNPCStats->pNewNPCData[0].uFlags; |
9370 do | 9370 do |
9371 { | 9371 { |
9372 if ( *((void **)v20 + 4) == v18 ) | 9372 if ( *((void **)v20 + 4) == (void *)v18 ) |
9373 { | 9373 { |
9374 v21 = *(int *)v20; | 9374 v21 = *(int *)v20; |
9375 if ( (char)*(int *)v20 < 0 ) | 9375 if ( (char)*(int *)v20 < 0 ) |
9376 { | 9376 { |
9377 LOBYTE(v21) = v21 & 0x7F; | 9377 LOBYTE(v21) = v21 & 0x7F; |
9381 ++v19; | 9381 ++v19; |
9382 v20 += 76; | 9382 v20 += 76; |
9383 } | 9383 } |
9384 while ( v19 < (signed int)pNPCStats->uNumNewNPCs ); | 9384 while ( v19 < (signed int)pNPCStats->uNumNewNPCs ); |
9385 } | 9385 } |
9386 if ( (void *)pParty->pHirelings[0].uProfession == v18 ) | 9386 if ( pParty->pHirelings[0].uProfession == v18 ) |
9387 memset(pParty->pHirelings, 0, 0x4Cu); | 9387 memset(pParty->pHirelings, 0, 0x4Cu); |
9388 if ( (void *)pParty->pHirelings[1].uProfession == v18 ) | 9388 if ( pParty->pHirelings[1].uProfession == v18 ) |
9389 memset(&pParty->pHirelings[1], 0, 0x4Cu); | 9389 memset(&pParty->pHirelings[1], 0, 0x4Cu); |
9390 pParty->field_709 = 0; | 9390 pParty->field_709 = 0; |
9391 sub_44A56A(); | 9391 sub_44A56A(); |
9392 break; | 9392 break; |
9393 case 243: | 9393 case 243: |
9394 v17 = (char *)&this->uSkillPoints; | 9394 v17 = (char *)&this->uSkillPoints; |
9395 if ( (unsigned int)a3 <= *(int *)v17 ) | 9395 result = *v17; |
9396 *(int *)v17 -= (int)a3; | 9396 if ( (unsigned int)pValue <= *(int *)v17 ) |
9397 { | |
9398 *(int *)v17 -= (int)pValue; | |
9399 result = v17; | |
9400 } | |
9397 else | 9401 else |
9398 *(int *)v17 = 0; | 9402 *(int *)v17 = 0; |
9399 break; | 9403 break; |
9400 case 275: | 9404 case 275: |
9401 v16 = (char *)&pOutdoor->ddm; | 9405 v16 = (char *)&pOutdoor->ddm; |
9402 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) | 9406 if ( uCurrentlyLoadedLevelType != LEVEL_Outdoor ) |
9403 v16 = (char *)&pIndoor->dlv; | 9407 v16 = (char *)&pIndoor->dlv; |
9404 *((int *)v16 + 2) -= (int)a3; | 9408 *((int *)v16 + 2) -= (int)pValue; |
9405 if ( *((int *)v16 + 2) < -10000 ) | 9409 if ( *((int *)v16 + 2) < -10000 ) |
9406 *((int *)v16 + 2) = -10000; | 9410 *((int *)v16 + 2) = -10000; |
9407 break; | 9411 break; |
9408 case 306: | 9412 case 306: |
9409 if ( (unsigned int)a3 <= pParty->uNumGoldInBank ) | 9413 result = VarNum - 306; |
9410 pParty->uNumGoldInBank -= (unsigned int)a3; | 9414 if ( (unsigned int)pValue <= pParty->uNumGoldInBank ) |
9415 { | |
9416 result = (bool)pValue; | |
9417 pParty->uNumGoldInBank -= (unsigned int)pValue; | |
9418 } | |
9411 else | 9419 else |
9412 LABEL_88: | 9420 LABEL_88: |
9413 dword_5B65C4 = 1; | 9421 dword_5B65C4 = 1; |
9414 break; | 9422 break; |
9415 } | 9423 } |
9416 return; | 9424 return result; |
9417 } | 9425 } |
9418 v11 = this->field_1A50; | 9426 v11 = this->field_1A50; |
9419 LABEL_112: | 9427 LABEL_112: |
9420 v22 = (signed __int16)a3; | 9428 v22 = (signed __int16)pValue; |
9421 } | 9429 } |
9422 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); | 9430 _449B7E_toggle_bit((unsigned char *)v11, v22, 0); |
9423 return; | 9431 return result; |
9424 } | 9432 } |
9425 switch ( var ) | 9433 switch ( VarNum ) |
9426 { | 9434 { |
9427 case 308: | 9435 case 308: |
9428 pParty->uNumBountiesCollected -= (unsigned int)a3; | 9436 result = (bool)pValue; |
9437 pParty->uNumBountiesCollected -= (unsigned int)pValue; | |
9429 break; | 9438 break; |
9430 case 309: | 9439 case 309: |
9431 pParty->uNumPrisonTerms -= (int)a3; | 9440 result = (bool)pValue; |
9441 pParty->uNumPrisonTerms -= (int)pValue; | |
9432 break; | 9442 break; |
9433 case 310: | 9443 case 310: |
9434 pParty->uNumArenaPageWins -= (char)a3; | 9444 result = (bool)pValue; |
9445 pParty->uNumArenaPageWins -= (char)pValue; | |
9435 break; | 9446 break; |
9436 case 311: | 9447 case 311: |
9437 pParty->uNumArenaSquireWins -= (char)a3; | 9448 result = (bool)pValue; |
9449 pParty->uNumArenaSquireWins -= (char)pValue; | |
9438 break; | 9450 break; |
9439 case 312: | 9451 case 312: |
9440 pParty->uNumArenaKnightWins -= (char)a3; | 9452 result = (bool)pValue; |
9453 pParty->uNumArenaKnightWins -= (char)pValue; | |
9441 break; | 9454 break; |
9442 case 313: | 9455 case 313: |
9443 pParty->uNumArenaLordWins -= (char)a3; | 9456 result = (bool)pValue; |
9457 pParty->uNumArenaLordWins -= (char)pValue; | |
9444 break; | 9458 break; |
9445 } | 9459 } |
9446 } | 9460 } |
9447 else | 9461 else |
9448 { | 9462 { |
9449 if ( (signed int)var >= 123 ) | 9463 if ( (signed int)VarNum >= 123 ) |
9450 { | 9464 { |
9451 byte_5E4C15[var] -= (char)a3; | 9465 byte_5E4C15[VarNum] -= (char)pValue; |
9452 } | 9466 } |
9453 else | 9467 else |
9454 { | 9468 { |
9455 switch ( var ) | 9469 switch ( VarNum ) |
9456 { | 9470 { |
9457 case VAR_RandomGold: | 9471 case VAR_RandomGold: |
9458 v6 = rand() % (signed int)a3 + 1; | 9472 v6 = rand() % (signed int)pValue + 1; |
9459 if ( v6 > pParty->uNumGold ) | 9473 if ( v6 > pParty->uNumGold ) |
9460 v6 = pParty->uNumGold; | 9474 v6 = pParty->uNumGold; |
9461 Party::TakeGold(v6); | 9475 Party::TakeGold(v6); |
9462 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6); | 9476 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6); |
9463 ShowStatusBarString(pTmpBuf, 2u); | 9477 ShowStatusBarString(pTmpBuf, 2u); |
9464 GameUI_DrawFoodAndGold(); | 9478 GameUI_DrawFoodAndGold(); |
9465 return; | 9479 return result; |
9466 case VAR_RandomFood: | 9480 case VAR_RandomFood: |
9467 v7 = rand() % (signed int)a3 + 1; | 9481 v7 = rand() % (signed int)pValue + 1; |
9468 if ( v7 > pParty->uNumFoodRations ) | 9482 if ( v7 > pParty->uNumFoodRations ) |
9469 v7 = pParty->uNumFoodRations; | 9483 v7 = pParty->uNumFoodRations; |
9470 Party::TakeFood(v7); | 9484 Party::TakeFood(v7); |
9471 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[504], v7); | 9485 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[504], v7); |
9472 ShowStatusBarString(pTmpBuf, 2u); | 9486 ShowStatusBarString(pTmpBuf, 2u); |
9473 GameUI_DrawFoodAndGold(); | 9487 GameUI_DrawFoodAndGold(); |
9474 goto LABEL_17; | 9488 goto LABEL_17; |
9475 default: | 9489 default: |
9476 return; | 9490 return result; |
9477 case VAR_CurrentHP: | 9491 case VAR_CurrentHP: |
9478 ReceiveDamage((signed int)a3, 4); | 9492 ReceiveDamage((signed int)pValue, 4); |
9479 goto LABEL_17; | 9493 goto LABEL_17; |
9480 case VAR_CurrentSP: | 9494 case VAR_CurrentSP: |
9481 v9 = (char *)&this->sMana; | 9495 v9 = (char *)&this->sMana; |
9482 v10 = this->sMana - (signed int)a3 < 0; | 9496 v10 = this->sMana - (signed int)pValue < 0; |
9483 *(int *)v9 -= (int)a3; | 9497 *(int *)v9 -= (int)pValue; |
9484 if ( v10 ) | 9498 if ( v10 ) |
9485 *(int *)v9 = 0; | 9499 *(int *)v9 = 0; |
9486 goto LABEL_17; | 9500 goto LABEL_17; |
9487 case VAR_ACModifier: | 9501 case VAR_ACModifier: |
9488 this->sACModifier -= (unsigned __int8)a3; | 9502 this->sACModifier -= (unsigned __int8)pValue; |
9489 goto LABEL_17; | 9503 goto LABEL_17; |
9490 case VAR_BaseLevel: | 9504 case VAR_BaseLevel: |
9491 this->uLevel -= (unsigned __int8)a3; | 9505 this->uLevel -= (unsigned __int8)pValue; |
9492 goto LABEL_17; | 9506 goto LABEL_17; |
9493 case VAR_LevelModifier: | 9507 case VAR_LevelModifier: |
9494 this->sLevelModifier -= (unsigned __int8)a3; | 9508 this->sLevelModifier -= (unsigned __int8)pValue; |
9495 goto LABEL_17; | 9509 goto LABEL_17; |
9496 case VAR_Age: | 9510 case VAR_Age: |
9497 this->sAgeModifier -= (signed __int16)a3; | 9511 this->sAgeModifier -= (signed __int16)pValue; |
9498 return; | 9512 return result; |
9499 case VAR_Award: | 9513 case VAR_Award: |
9500 v11 = this->_guilds_member_bits; | 9514 v11 = this->_guilds_member_bits; |
9501 goto LABEL_112; | 9515 goto LABEL_112; |
9502 case VAR_Experience: | 9516 case VAR_Experience: |
9503 v12 = (char *)&this->uExperience; | 9517 v12 = (char *)&this->uExperience; |
9504 v13 = (signed int)a3; | 9518 v13 = (signed int)pValue; |
9505 v14 = *(int *)v12 < (unsigned int)a3; | 9519 v14 = *(int *)v12 < (unsigned int)pValue; |
9506 *(int *)v12 -= (int)a3; | 9520 *(int *)v12 -= (int)pValue; |
9507 *((int *)v12 + 1) -= v14 + HIDWORD(v13); | 9521 *((int *)v12 + 1) -= v14 + HIDWORD(v13); |
9508 goto LABEL_17; | 9522 goto LABEL_17; |
9509 case VAR_QBits_QuestsDone: | 9523 case VAR_QBits_QuestsDone: |
9510 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)a3, 0); | 9524 _449B7E_toggle_bit(pParty->_quest_bits, (__int16)pValue, 0); |
9511 pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); | 9525 pPlayers[v4 + 1]->PlaySound(SPEECH_96, 0); |
9512 return; | 9526 return true; |
9513 case VAR_PlayerItemInHands: | 9527 case VAR_PlayerItemInHands: |
9514 v15 = (char *)this->pInventoryIndices; | 9528 v15 = this->pInventoryIndices; |
9515 break; | 9529 break; |
9516 case VAR_FixedGold: | 9530 case VAR_FixedGold: |
9517 if ( (unsigned int)a3 > pParty->uNumGold ) | 9531 if ( (unsigned int)pValue > pParty->uNumGold ) |
9518 goto LABEL_88; | 9532 goto LABEL_88; |
9519 Party::TakeGold((unsigned int)a3); | 9533 Party::TakeGold((unsigned int)pValue); |
9520 return; | 9534 return result; |
9521 case VAR_MightBonus: | 9535 case VAR_MightBonus: |
9522 case VAR_ActualMight: | 9536 case VAR_ActualMight: |
9523 this->uMightBonus -= (unsigned __int16)a3; | 9537 this->uMightBonus -= (unsigned __int16)pValue; |
9524 goto LABEL_72; | 9538 goto LABEL_72; |
9525 case VAR_IntellectBonus: | 9539 case VAR_IntellectBonus: |
9526 case VAR_ActualIntellect: | 9540 case VAR_ActualIntellect: |
9527 this->uIntelligenceBonus -= (unsigned __int16)a3; | 9541 this->uIntelligenceBonus -= (unsigned __int16)pValue; |
9528 goto LABEL_72; | 9542 goto LABEL_72; |
9529 case VAR_PersonalityBonus: | 9543 case VAR_PersonalityBonus: |
9530 case VAR_ActualPersonality: | 9544 case VAR_ActualPersonality: |
9531 this->uWillpowerBonus -= (unsigned __int16)a3; | 9545 this->uWillpowerBonus -= (unsigned __int16)pValue; |
9532 goto LABEL_72; | 9546 goto LABEL_72; |
9533 case VAR_EnduranceBonus: | 9547 case VAR_EnduranceBonus: |
9534 case VAR_ActualEndurance: | 9548 case VAR_ActualEndurance: |
9535 this->uEnduranceBonus -= (unsigned __int16)a3; | 9549 this->uEnduranceBonus -= (unsigned __int16)pValue; |
9536 goto LABEL_72; | 9550 goto LABEL_72; |
9537 case VAR_SpeedBonus: | 9551 case VAR_SpeedBonus: |
9538 case VAR_ActualSpeed: | 9552 case VAR_ActualSpeed: |
9539 this->uSpeedBonus -= (unsigned __int16)a3; | 9553 this->uSpeedBonus -= (unsigned __int16)pValue; |
9540 goto LABEL_72; | 9554 goto LABEL_72; |
9541 case VAR_AccuracyBonus: | 9555 case VAR_AccuracyBonus: |
9542 case VAR_ActualAccuracy: | 9556 case VAR_ActualAccuracy: |
9543 this->uAccuracyBonus -= (unsigned __int16)a3; | 9557 this->uAccuracyBonus -= (unsigned __int16)pValue; |
9544 goto LABEL_72; | 9558 goto LABEL_72; |
9545 case VAR_LuckBonus: | 9559 case VAR_LuckBonus: |
9546 case VAR_ActualLuck: | 9560 case VAR_ActualLuck: |
9547 this->uLuckBonus -= (unsigned __int16)a3; | 9561 this->uLuckBonus -= (unsigned __int16)pValue; |
9548 goto LABEL_72; | 9562 goto LABEL_72; |
9549 case VAR_BaseMight: | 9563 case VAR_BaseMight: |
9550 this->uMight -= (unsigned __int16)a3; | 9564 this->uMight -= (unsigned __int16)pValue; |
9551 goto LABEL_45; | 9565 goto LABEL_45; |
9552 case VAR_BaseIntellect: | 9566 case VAR_BaseIntellect: |
9553 this->uIntelligence -= (unsigned __int16)a3; | 9567 this->uIntelligence -= (unsigned __int16)pValue; |
9554 goto LABEL_45; | 9568 goto LABEL_45; |
9555 case VAR_BasePersonality: | 9569 case VAR_BasePersonality: |
9556 this->uWillpower -= (unsigned __int16)a3; | 9570 this->uWillpower -= (unsigned __int16)pValue; |
9557 goto LABEL_45; | 9571 goto LABEL_45; |
9558 case VAR_BaseEndurance: | 9572 case VAR_BaseEndurance: |
9559 this->uEndurance -= (unsigned __int16)a3; | 9573 this->uEndurance -= (unsigned __int16)pValue; |
9560 goto LABEL_45; | 9574 goto LABEL_45; |
9561 case VAR_BaseSpeed: | 9575 case VAR_BaseSpeed: |
9562 this->uSpeed -= (unsigned __int16)a3; | 9576 this->uSpeed -= (unsigned __int16)pValue; |
9563 goto LABEL_45; | 9577 goto LABEL_45; |
9564 case VAR_BaseAccuracy: | 9578 case VAR_BaseAccuracy: |
9565 this->uAccuracy -= (unsigned __int16)a3; | 9579 this->uAccuracy -= (unsigned __int16)pValue; |
9566 goto LABEL_45; | 9580 goto LABEL_45; |
9567 case VAR_BaseLuck: | 9581 case VAR_BaseLuck: |
9568 this->uLuck -= (unsigned __int16)a3; | 9582 this->uLuck -= (unsigned __int16)pValue; |
9569 goto LABEL_45; | 9583 goto LABEL_45; |
9570 case VAR_FireResistance: | 9584 case VAR_FireResistance: |
9571 this->sResFireBase -= (signed __int16)a3; | 9585 this->sResFireBase -= (signed __int16)pValue; |
9572 goto LABEL_45; | 9586 goto LABEL_45; |
9573 case VAR_AirResistance: | 9587 case VAR_AirResistance: |
9574 this->sResAirBase -= (signed __int16)a3; | 9588 this->sResAirBase -= (signed __int16)pValue; |
9575 goto LABEL_45; | 9589 goto LABEL_45; |
9576 case VAR_WaterResistance: | 9590 case VAR_WaterResistance: |
9577 this->sResWaterBase -= (signed __int16)a3; | 9591 this->sResWaterBase -= (signed __int16)pValue; |
9578 goto LABEL_45; | 9592 goto LABEL_45; |
9579 case VAR_EarthResistance: | 9593 case VAR_EarthResistance: |
9580 this->sResEarthBase -= (signed __int16)a3; | 9594 this->sResEarthBase -= (signed __int16)pValue; |
9581 goto LABEL_45; | 9595 goto LABEL_45; |
9582 case VAR_SpiritResistance: | 9596 case VAR_SpiritResistance: |
9583 this->sResSpiritBase -= (signed __int16)a3; | 9597 this->sResSpiritBase -= (signed __int16)pValue; |
9584 goto LABEL_45; | 9598 goto LABEL_45; |
9585 case VAR_MindResistance: | 9599 case VAR_MindResistance: |
9586 this->sResMindBase -= (signed __int16)a3; | 9600 this->sResMindBase -= (signed __int16)pValue; |
9587 goto LABEL_45; | 9601 goto LABEL_45; |
9588 case VAR_BodyResistance: | 9602 case VAR_BodyResistance: |
9589 this->sResBodyBase -= (signed __int16)a3; | 9603 this->sResBodyBase -= (signed __int16)pValue; |
9590 goto LABEL_45; | 9604 goto LABEL_45; |
9591 case VAR_LightResistance: | 9605 case VAR_LightResistance: |
9592 this->sResLightBase -= (signed __int16)a3; | 9606 this->sResLightBase -= (signed __int16)pValue; |
9593 goto LABEL_45; | 9607 goto LABEL_45; |
9594 case VAR_DarkResistance: | 9608 case VAR_DarkResistance: |
9595 this->sResDarkBase -= (signed __int16)a3; | 9609 this->sResDarkBase -= (signed __int16)pValue; |
9596 goto LABEL_45; | 9610 goto LABEL_45; |
9597 case VAR_MagicResistance: | 9611 case VAR_MagicResistance: |
9598 this->sResMagicBase -= (signed __int16)a3; | 9612 this->sResMagicBase -= (signed __int16)pValue; |
9599 goto LABEL_45; | 9613 goto LABEL_45; |
9600 case VAR_FireResistanceBonus: | 9614 case VAR_FireResistanceBonus: |
9601 this->sResFireBonus -= (signed __int16)a3; | 9615 this->sResFireBonus -= (signed __int16)pValue; |
9602 goto LABEL_45; | 9616 goto LABEL_45; |
9603 case VAR_AirResistanceBonus: | 9617 case VAR_AirResistanceBonus: |
9604 this->sResAirBonus -= (signed __int16)a3; | 9618 this->sResAirBonus -= (signed __int16)pValue; |
9605 LABEL_45: | 9619 LABEL_45: |
9606 v25 = 0; | 9620 v25 = 0; |
9607 v23 = 92; | 9621 v23 = 92; |
9608 goto LABEL_73; | 9622 goto LABEL_73; |
9609 case VAR_WaterResistanceBonus: | 9623 case VAR_WaterResistanceBonus: |
9610 this->sResWaterBonus -= (signed __int16)a3; | 9624 this->sResWaterBonus -= (signed __int16)pValue; |
9611 goto LABEL_72; | 9625 goto LABEL_72; |
9612 case VAR_EarthResistanceBonus: | 9626 case VAR_EarthResistanceBonus: |
9613 this->sResEarthBonus -= (signed __int16)a3; | 9627 this->sResEarthBonus -= (signed __int16)pValue; |
9614 goto LABEL_72; | 9628 goto LABEL_72; |
9615 case VAR_SpiritResistanceBonus: | 9629 case VAR_SpiritResistanceBonus: |
9616 this->sResSpiritBonus -= (signed __int16)a3; | 9630 this->sResSpiritBonus -= (signed __int16)pValue; |
9617 goto LABEL_72; | 9631 goto LABEL_72; |
9618 case VAR_MindResistanceBonus: | 9632 case VAR_MindResistanceBonus: |
9619 this->sResMindBonus -= (signed __int16)a3; | 9633 this->sResMindBonus -= (signed __int16)pValue; |
9620 goto LABEL_72; | 9634 goto LABEL_72; |
9621 case VAR_BodyResistanceBonus: | 9635 case VAR_BodyResistanceBonus: |
9622 this->sResBodyBonus -= (signed __int16)a3; | 9636 this->sResBodyBonus -= (signed __int16)pValue; |
9623 goto LABEL_72; | 9637 goto LABEL_72; |
9624 case VAR_LightResistanceBonus: | 9638 case VAR_LightResistanceBonus: |
9625 this->sResLightBonus -= (signed __int16)a3; | 9639 this->sResLightBonus -= (signed __int16)pValue; |
9626 goto LABEL_72; | 9640 goto LABEL_72; |
9627 case VAR_DarkResistanceBonus: | 9641 case VAR_DarkResistanceBonus: |
9628 this->sResDarkBonus -= (signed __int16)a3; | 9642 this->sResDarkBonus -= (signed __int16)pValue; |
9629 goto LABEL_72; | 9643 goto LABEL_72; |
9630 case VAR_MagicResistanceBonus: | 9644 case VAR_MagicResistanceBonus: |
9631 this->sResMagicBonus -= (signed __int16)a3; | 9645 this->sResMagicBonus -= (signed __int16)pValue; |
9632 LABEL_72: | 9646 LABEL_72: |
9633 v25 = 0; | 9647 v25 = 0; |
9634 v23 = SPEECH_91; | 9648 v23 = SPEECH_91; |
9635 LABEL_73: | 9649 LABEL_73: |
9636 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); | 9650 pPlayers[v4 + 1]->PlaySound((PlayerSpeech)v23, v25); |
9637 goto LABEL_17; | 9651 goto LABEL_17; |
9638 case VAR_FixedFood: | 9652 case VAR_FixedFood: |
9639 Party::TakeFood((unsigned int)a3); | 9653 Party::TakeFood((unsigned int)pValue); |
9640 goto LABEL_17; | 9654 goto LABEL_17; |
9641 case VAR_StaffSkill: | 9655 case VAR_StaffSkill: |
9642 case VAR_SwordSkill: | 9656 case VAR_SwordSkill: |
9643 case VAR_DaggerSkill: | 9657 case VAR_DaggerSkill: |
9644 case VAR_AxeSkill: | 9658 case VAR_AxeSkill: |
9666 case VAR_MeditationSkill: | 9680 case VAR_MeditationSkill: |
9667 case VAR_PerceptionSkill: | 9681 case VAR_PerceptionSkill: |
9668 case VAR_DiplomacySkill: | 9682 case VAR_DiplomacySkill: |
9669 case VAR_DisarmTrapSkill: | 9683 case VAR_DisarmTrapSkill: |
9670 case VAR_LearningSkill: | 9684 case VAR_LearningSkill: |
9671 *((short *)&this->pConditions[16] + var) -= (unsigned __int8)a3; | 9685 *((short *)&this->pConditions[16] + VarNum) -= (unsigned __int8)pValue; |
9672 goto LABEL_17; | 9686 goto LABEL_17; |
9673 case VAR_Cursed: | 9687 case VAR_Cursed: |
9674 case VAR_Weak: | 9688 case VAR_Weak: |
9675 case VAR_Asleep: | 9689 case VAR_Asleep: |
9676 case VAR_Afraid: | 9690 case VAR_Afraid: |
9685 case VAR_Paralyzed: | 9699 case VAR_Paralyzed: |
9686 case VAR_Unconsious: | 9700 case VAR_Unconsious: |
9687 case VAR_Dead: | 9701 case VAR_Dead: |
9688 case VAR_Stoned: | 9702 case VAR_Stoned: |
9689 case VAR_Eradicated: | 9703 case VAR_Eradicated: |
9690 *((int *)this + 2 * var - 210) = 0; | 9704 *((int *)this + 2 * VarNum - 210) = 0; |
9691 *((int *)this + 2 * v5 - 209) = 0; | 9705 *((int *)this + 2 * result - 209) = 0; |
9692 LABEL_17: | 9706 LABEL_17: |
9693 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); | 9707 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); |
9694 v8 = 8 * v4 + 400; | 9708 v8 = 8 * v4 + 400; |
9695 LOBYTE(v8) = (8 * v4 - 112) | 4; | 9709 LOBYTE(v8) = (8 * v4 - 112) | 4; |
9696 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); | 9710 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); |
9697 return; | 9711 return result; |
9698 } | 9712 } |
9699 do | 9713 //do |
9700 { | 9714 for (v3 = 1; v3 < 126; v3++) |
9701 if ( *(void **)&this->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * *(int *)v15 + 5] == a3 ) | 9715 { |
9716 if ( *(&this->pInventoryItems[pInventoryIndices[v3] - 1].uItemID) == pValue )//pValue = ItemID, pInventoryItems[3] = 222 | |
9702 { | 9717 { |
9703 RemoveItemAtInventoryIndex(v3); | 9718 RemoveItemAtInventoryIndex(v3);// &this->pInventoryIndices[puSlot], pInventoryIndices[1] = 4 |
9704 return; | 9719 return true; |
9705 } | 9720 } |
9706 ++v3; | 9721 //++v3; |
9707 v15 += 4; | 9722 //v15 ++; |
9708 } | 9723 } |
9709 while ( (signed int)v3 < 126 ); | 9724 //while ( (signed int)v3 < 126 ); |
9710 if ( (void *)pParty->pPickedItem.uItemID == a3 ) | 9725 if ( pParty->pPickedItem.uItemID == pValue ) |
9711 pMouse->RemoveHoldingItem(); | 9726 { |
9727 pMouse->RemoveHoldingItem(); | |
9728 return true; | |
9729 } | |
9730 return false; | |
9712 } | 9731 } |
9713 } | 9732 } |
9714 } | 9733 } |
9715 // 5B65C4: using guessed type int dword_5B65C4; | 9734 // 5B65C4: using guessed type int dword_5B65C4; |
9716 // 5B65CC: using guessed type int dword_5B65CC; | 9735 // 5B65CC: using guessed type int dword_5B65CC; |