comparison Player.cpp @ 1205:8c02e6f74b29

arrays to std::arrays phase 2 - mm7_data.h converted
author Grumpy7
date Sun, 09 Jun 2013 00:30:48 +0200
parents 15ad868d972f
children 96a81634669e
comparison
equal deleted inserted replaced
1204:832f09144726 1205:8c02e6f74b29
1429 { 1429 {
1430 result = 1; 1430 result = 1;
1431 } 1431 }
1432 else 1432 else
1433 { 1433 {
1434 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[67], this->pName); 1434 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[67], this->pName);
1435 ShowStatusBarString(pTmpBuf, 2u); 1435 ShowStatusBarString(pTmpBuf.data(), 2u);
1436 result = 0; 1436 result = 0;
1437 } 1437 }
1438 return result; 1438 return result;
1439 } 1439 }
1440 1440
3442 v5->array_000234[3].uItemID = 0; 3442 v5->array_000234[3].uItemID = 0;
3443 if ( v19 ) 3443 if ( v19 )
3444 { 3444 {
3445 party_finds_gold(v19, 2); 3445 party_finds_gold(v19, 2);
3446 v22 = v19; 3446 v22 = v19;
3447 v23 = pTmpBuf2; 3447 v23 = pTmpBuf2.data();
3448 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[302], v31->pName, v22); 3448 sprintf(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[302], v31->pName, v22);
3449 LABEL_43: 3449 LABEL_43:
3450 ShowStatusBarString(v23, 2u); 3450 ShowStatusBarString(v23, 2u);
3451 return _steal_perma; 3451 return _steal_perma;
3452 } 3452 }
3453 } 3453 }
3491 ((ItemGen *)v18)->Reset(); 3491 ((ItemGen *)v18)->Reset();
3492 v16 = v27.uItemID; 3492 v16 = v27.uItemID;
3493 } 3493 }
3494 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 3494 sub_421B2C_PlaceInInventory_or_DropPickedItem();
3495 sprintf( 3495 sprintf(
3496 pTmpBuf2, 3496 pTmpBuf2.data(),
3497 pGlobalTXT_LocalizationStrings[304], 3497 pGlobalTXT_LocalizationStrings[304],
3498 v31->pName, 3498 v31->pName,
3499 pItemsTable->pItems[v16].pUnidentifiedName); 3499 pItemsTable->pItems[v16].pUnidentifiedName);
3500 ShowStatusBarString(pTmpBuf2, 2u); 3500 ShowStatusBarString(pTmpBuf2.data(), 2u);
3501 sub_421B2C_PlaceInInventory_or_DropPickedItem(); 3501 sub_421B2C_PlaceInInventory_or_DropPickedItem();
3502 memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem)); 3502 memcpy(&pParty->pPickedItem, &v27, sizeof(pParty->pPickedItem));
3503 pMouse->SetCursorBitmapFromItemID(v16); 3503 pMouse->SetCursorBitmapFromItemID(v16);
3504 return _steal_perma; 3504 return _steal_perma;
3505 } 3505 }
3506 } 3506 }
3507 } 3507 }
3508 v26 = (int)v31->pName; 3508 v26 = (int)v31->pName;
3509 v25 = pGlobalTXT_LocalizationStrings[377]; 3509 v25 = pGlobalTXT_LocalizationStrings[377];
3510 } 3510 }
3511 v23 = pTmpBuf2; 3511 v23 = pTmpBuf2.data();
3512 sprintfex(pTmpBuf2, v25, v26); 3512 sprintfex(pTmpBuf2.data(), v25, v26);
3513 goto LABEL_43; 3513 goto LABEL_43;
3514 } 3514 }
3515 return 0; 3515 return 0;
3516 } 3516 }
3517 // 4EDEA0: using guessed type int dword_4EDEA0[]; 3517 // 4EDEA0: using guessed type int dword_4EDEA0[];
6745 6745
6746 } 6746 }
6747 else 6747 else
6748 { 6748 {
6749 v68 = pParty->pPickedItem.GetDisplayName(); 6749 v68 = pParty->pPickedItem.GetDisplayName();
6750 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" 6750 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
6751 ShowStatusBarString(pTmpBuf, 2); 6751 ShowStatusBarString(pTmpBuf.data(), 2);
6752 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 6752 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
6753 return; 6753 return;
6754 } 6754 }
6755 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0); 6755 pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0);
6756 6756
7037 v3->PlaySound(SPEECH_36, 0); 7037 v3->PlaySound(SPEECH_36, 0);
7038 break; 7038 break;
7039 7039
7040 default: 7040 default:
7041 v68 = pParty->pPickedItem.GetDisplayName(); 7041 v68 = pParty->pPickedItem.GetDisplayName();
7042 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way" 7042 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
7043 ShowStatusBarString(pTmpBuf, 2u); 7043 ShowStatusBarString(pTmpBuf.data(), 2u);
7044 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7044 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7045 return; 7045 return;
7046 } 7046 }
7047 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0); 7047 pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0);
7048 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null) 7048 if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
7081 return; 7081 return;
7082 if ( !pParty->pPlayers[player_num-1].CanAct() ) 7082 if ( !pParty->pPlayers[player_num-1].CanAct() )
7083 { 7083 {
7084 7084
7085 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7085 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7086 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68); 7086 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);
7087 ShowStatusBarString(pTmpBuf, 2u); 7087 ShowStatusBarString(pTmpBuf.data(), 2u);
7088 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7088 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7089 return; 7089 return;
7090 } 7090 }
7091 if ( bUnderwater == 1 ) 7091 if ( bUnderwater == 1 )
7092 { 7092 {
7125 v15 = pParty->pPickedItem.uItemID - 400; 7125 v15 = pParty->pPickedItem.uItemID - 400;
7126 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2; 7126 v72 = v3->spellbook.bHaveSpell[pParty->pPickedItem.uItemID-400];//(char *)&v3->pConditions[0] + pParty->pPickedItem.uItemID + 2;
7127 if ( v72 ) 7127 if ( v72 )
7128 { 7128 {
7129 v66 = pParty->pPickedItem.GetDisplayName(); 7129 v66 = pParty->pPickedItem.GetDisplayName();
7130 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell" 7130 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell"
7131 ShowStatusBarString(pTmpBuf, 2u); 7131 ShowStatusBarString(pTmpBuf.data(), 2u);
7132 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7132 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7133 return; 7133 return;
7134 } 7134 }
7135 if ( !pParty->pPlayers[player_num-1].CanAct() ) 7135 if ( !pParty->pPlayers[player_num-1].CanAct() )
7136 { 7136 {
7137 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7137 v66 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7138 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s" 7138 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s"
7139 ShowStatusBarString(pTmpBuf, 2u); 7139 ShowStatusBarString(pTmpBuf.data(), 2u);
7140 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7140 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7141 return; 7141 return;
7142 } 7142 }
7143 v16 = v15 % 11 + 1; 7143 v16 = v15 % 11 + 1;
7144 v17 = v3->pActiveSkills[v15 / 11 + 12]; 7144 v17 = v3->pActiveSkills[v15 / 11 + 12];
7154 } 7154 }
7155 7155
7156 if ( v16 > v67 || !v17 ) 7156 if ( v16 > v67 || !v17 )
7157 { 7157 {
7158 v22 = pParty->pPickedItem.GetDisplayName(); 7158 v22 = pParty->pPickedItem.GetDisplayName();
7159 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s" 7159 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[381], v22); //"You don't have the skill to learn %s"
7160 ShowStatusBarString(pTmpBuf, 2u); 7160 ShowStatusBarString(pTmpBuf.data(), 2u);
7161 v3->PlaySound((PlayerSpeech)20, 0); 7161 v3->PlaySound((PlayerSpeech)20, 0);
7162 return; 7162 return;
7163 } 7163 }
7164 // v72 = 1; 7164 // v72 = 1;
7165 v3->PlaySound(SPEECH_21, 0); 7165 v3->PlaySound(SPEECH_21, 0);
7201 CreateMsgScrollWindow(pParty->pPickedItem.uItemID); 7201 CreateMsgScrollWindow(pParty->pPickedItem.uItemID);
7202 v3->PlaySound(SPEECH_37, 0); 7202 v3->PlaySound(SPEECH_37, 0);
7203 return; 7203 return;
7204 } 7204 }
7205 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()]; 7205 v68 = aCharacterConditionNames[v3->GetMajorConditionIdx()];
7206 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[382], v68); 7206 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);
7207 ShowStatusBarString(pTmpBuf, 2u); 7207 ShowStatusBarString(pTmpBuf.data(), 2u);
7208 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7208 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7209 return; 7209 return;
7210 } 7210 }
7211 else 7211 else
7212 { 7212 {
7219 v74 = aAttributeNames[pParty->uCurrentMonth]; 7219 v74 = aAttributeNames[pParty->uCurrentMonth];
7220 switch ( pParty->uCurrentMonth ) 7220 switch ( pParty->uCurrentMonth )
7221 { 7221 {
7222 case 0: 7222 case 0:
7223 v3->uMight += thisa; 7223 v3->uMight += thisa;
7224 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7224 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7225 break; 7225 break;
7226 case 1: 7226 case 1:
7227 v3->uIntelligence += thisa; 7227 v3->uIntelligence += thisa;
7228 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7228 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7229 break; 7229 break;
7230 case 2: 7230 case 2:
7231 v3->uWillpower += thisa; 7231 v3->uWillpower += thisa;
7232 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7232 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7233 break; 7233 break;
7234 case 3: 7234 case 3:
7235 v3->uEndurance += thisa; 7235 v3->uEndurance += thisa;
7236 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7236 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7237 break; 7237 break;
7238 case 4: 7238 case 4:
7239 v3->uAccuracy += thisa; 7239 v3->uAccuracy += thisa;
7240 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7240 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7241 break; 7241 break;
7242 case 5: 7242 case 5:
7243 v3->uSpeed += thisa; 7243 v3->uSpeed += thisa;
7244 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7244 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7245 break; 7245 break;
7246 case 6: 7246 case 6:
7247 v3->uLuck += thisa; 7247 v3->uLuck += thisa;
7248 sprintf(pTmpBuf, "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent" 7248 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v74, pGlobalTXT_LocalizationStrings[121]);//"Permanent"
7249 break; 7249 break;
7250 case 7: 7250 case 7:
7251 party_finds_gold(1000 * thisa, 0); 7251 party_finds_gold(1000 * thisa, 0);
7252 sprintf(pTmpBuf, "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold" 7252 sprintf(pTmpBuf.data(), "+%u %s", 1000 * thisa, pGlobalTXT_LocalizationStrings[97]);//"Gold"
7253 break; 7253 break;
7254 case 8: 7254 case 8:
7255 Party::GiveFood(5 * thisa); 7255 Party::GiveFood(5 * thisa);
7256 sprintf(pTmpBuf, "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food" 7256 sprintf(pTmpBuf.data(), "+%u %s",5 * thisa , pGlobalTXT_LocalizationStrings[653]);//"Food"
7257 break; 7257 break;
7258 case 9u: 7258 case 9u:
7259 v3->uSkillPoints += 2 * thisa; 7259 v3->uSkillPoints += 2 * thisa;
7260 sprintf(pTmpBuf, "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]); 7260 sprintf(pTmpBuf.data(), "+%u %s", 2 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_SKILL_POINTS]);
7261 break; 7261 break;
7262 case 10: 7262 case 10:
7263 v3->uExperience += 2500 * thisa; 7263 v3->uExperience += 2500 * thisa;
7264 sprintf(pTmpBuf, "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]); 7264 sprintf(pTmpBuf.data(), "+%u %s", 2500 * thisa, pGlobalTXT_LocalizationStrings[LOCSTR_EXPIRIENCE]);
7265 break; 7265 break;
7266 case 11: 7266 case 11:
7267 v8 = rand() % 6; 7267 v8 = rand() % 6;
7268 switch (v8) 7268 switch (v8)
7269 { 7269 {
7290 case 5: 7290 case 5:
7291 v3->sResBodyBase += thisa; 7291 v3->sResBodyBase += thisa;
7292 v13 = pGlobalTXT_LocalizationStrings[29]; 7292 v13 = pGlobalTXT_LocalizationStrings[29];
7293 break; 7293 break;
7294 } 7294 }
7295 sprintf(pTmpBuf, "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]); 7295 sprintf(pTmpBuf.data(), "+%u %s %s", thisa, v13, pGlobalTXT_LocalizationStrings[121]);
7296 break; 7296 break;
7297 7297
7298 } 7298 }
7299 ShowStatusBarString(pTmpBuf, 2u); 7299 ShowStatusBarString(pTmpBuf.data(), 2u);
7300 pMouse->RemoveHoldingItem(); 7300 pMouse->RemoveHoldingItem();
7301 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1); 7301 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, player_num - 1);
7302 v3->PlaySound(SPEECH_93, 0); 7302 v3->PlaySound(SPEECH_93, 0);
7303 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0); 7303 pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
7304 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 ) 7304 if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
7353 } 7353 }
7354 else 7354 else
7355 { 7355 {
7356 7356
7357 v68 = pParty->pPickedItem.GetDisplayName(); 7357 v68 = pParty->pPickedItem.GetDisplayName();
7358 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way" 7358 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way"
7359 ShowStatusBarString(pTmpBuf, 2u); 7359 ShowStatusBarString(pTmpBuf.data(), 2u);
7360 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0); 7360 pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
7361 return; 7361 return;
7362 } 7362 }
7363 7363
7364 pMouse->RemoveHoldingItem(); 7364 pMouse->RemoveHoldingItem();
8045 switch ( var_type ) 8045 switch ( var_type )
8046 { 8046 {
8047 case VAR_RandomGold: 8047 case VAR_RandomGold:
8048 v6 = rand() % var_value + 1; 8048 v6 = rand() % var_value + 1;
8049 Party::SetGold(v6); 8049 Party::SetGold(v6);
8050 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold 8050 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold
8051 ShowStatusBarString(pTmpBuf, 2u); 8051 ShowStatusBarString(pTmpBuf.data(), 2u);
8052 GameUI_DrawFoodAndGold(); 8052 GameUI_DrawFoodAndGold();
8053 return; 8053 return;
8054 case VAR_RandomFood: 8054 case VAR_RandomFood:
8055 v7 = rand() % var_value + 1; 8055 v7 = rand() % var_value + 1;
8056 Party::SetFood(v7); 8056 Party::SetFood(v7);
8057 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food 8057 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food
8058 ShowStatusBarString(pTmpBuf, 2u); 8058 ShowStatusBarString(pTmpBuf.data(), 2u);
8059 GameUI_DrawFoodAndGold(); 8059 GameUI_DrawFoodAndGold();
8060 goto LABEL_124; 8060 goto LABEL_124;
8061 case VAR_Sex: 8061 case VAR_Sex:
8062 this->uSex = (PLAYER_SEX)var_value; 8062 this->uSex = (PLAYER_SEX)var_value;
8063 goto LABEL_124; 8063 goto LABEL_124;
8479 case VAR_RandomFood: 8479 case VAR_RandomFood:
8480 if ( !val ) 8480 if ( !val )
8481 val = 1; 8481 val = 1;
8482 v7 = rand() % val + 1; 8482 v7 = rand() % val + 1;
8483 Party::GiveFood(v7); 8483 Party::GiveFood(v7);
8484 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food 8484 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], v7);// You find %lu food
8485 ShowStatusBarString(pTmpBuf, 2u); 8485 ShowStatusBarString(pTmpBuf.data(), 2u);
8486 GameUI_DrawFoodAndGold(); 8486 GameUI_DrawFoodAndGold();
8487 goto _play_sound; 8487 goto _play_sound;
8488 case VAR_Sex: 8488 case VAR_Sex:
8489 Dst->uSex = (PLAYER_SEX)val; 8489 Dst->uSex = (PLAYER_SEX)val;
8490 goto _play_anim_and_exit; 8490 goto _play_anim_and_exit;
8609 case VAR_BaseLuck: 8609 case VAR_BaseLuck:
8610 v18 = (__int16 *)&Dst->uLuck; 8610 v18 = (__int16 *)&Dst->uLuck;
8611 goto LABEL_82; 8611 goto LABEL_82;
8612 case VAR_FixedFood: 8612 case VAR_FixedFood:
8613 Party::GiveFood(val); 8613 Party::GiveFood(val);
8614 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[502], val); 8614 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val);
8615 ShowStatusBarString(pTmpBuf, 2u); 8615 ShowStatusBarString(pTmpBuf.data(), 2u);
8616 if ( pParty->uNumFoodRations > 0xFFFF ) 8616 if ( pParty->uNumFoodRations > 0xFFFF )
8617 Party::SetFood(0xFFFFu); 8617 Party::SetFood(0xFFFFu);
8618 goto _play_sound; 8618 goto _play_sound;
8619 case VAR_MightBonus: 8619 case VAR_MightBonus:
8620 goto LABEL_62; 8620 goto LABEL_62;
9119 case VAR_RandomGold: 9119 case VAR_RandomGold:
9120 v6 = rand() % (signed int)pValue + 1; 9120 v6 = rand() % (signed int)pValue + 1;
9121 if ( v6 > pParty->uNumGold ) 9121 if ( v6 > pParty->uNumGold )
9122 v6 = pParty->uNumGold; 9122 v6 = pParty->uNumGold;
9123 Party::TakeGold(v6); 9123 Party::TakeGold(v6);
9124 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[503], v6); 9124 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[503], v6);
9125 ShowStatusBarString(pTmpBuf, 2); 9125 ShowStatusBarString(pTmpBuf.data(), 2);
9126 GameUI_DrawFoodAndGold(); 9126 GameUI_DrawFoodAndGold();
9127 return result; 9127 return result;
9128 case VAR_RandomFood: 9128 case VAR_RandomFood:
9129 v7 = rand() % (signed int)pValue + 1; 9129 v7 = rand() % (signed int)pValue + 1;
9130 if ( v7 > pParty->uNumFoodRations ) 9130 if ( v7 > pParty->uNumFoodRations )
9131 v7 = pParty->uNumFoodRations; 9131 v7 = pParty->uNumFoodRations;
9132 Party::TakeFood(v7); 9132 Party::TakeFood(v7);
9133 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[504], v7); 9133 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[504], v7);
9134 ShowStatusBarString(pTmpBuf, 2u); 9134 ShowStatusBarString(pTmpBuf.data(), 2u);
9135 GameUI_DrawFoodAndGold(); 9135 GameUI_DrawFoodAndGold();
9136 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4); 9136 pGame->pStru6Instance->SetPlayerBuffAnim(0x98u, v4);
9137 v8 = 8 * v4 + 400; 9137 v8 = 8 * v4 + 400;
9138 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112); 9138 LOBYTE(v8) = PID(OBJECT_Player,v4 - 112);
9139 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0); 9139 pAudioPlayer->PlaySound(SOUND_20001, v8, 0, -1, 0, 0, 0, 0);