Mercurial > mm7
comparison Player.cpp @ 1789:4d70df78baca
Player::AddVariable majority of labels
author | Grumpy7 |
---|---|
date | Thu, 03 Oct 2013 08:06:29 +0200 |
parents | ebde8e43839c |
children | 5ace90f129d3 |
comparison
equal
deleted
inserted
replaced
1788:ebde8e43839c | 1789:4d70df78baca |
---|---|
6222 case VAR_FixedGold: | 6222 case VAR_FixedGold: |
6223 party_finds_gold(val, 1); | 6223 party_finds_gold(val, 1); |
6224 return; | 6224 return; |
6225 case VAR_BaseMight: | 6225 case VAR_BaseMight: |
6226 v18 = (__int16 *)&this->uMight; | 6226 v18 = (__int16 *)&this->uMight; |
6227 goto LABEL_82; | 6227 *v18 += val; |
6228 if ( *v18 > 255 ) | |
6229 *v18 = 255; | |
6230 this->PlaySound(SPEECH_92, 0); | |
6231 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6232 PlayAwardSound(uPlayerIdx); | |
6233 return; | |
6228 case VAR_BaseIntellect: | 6234 case VAR_BaseIntellect: |
6229 v18 = (__int16 *)&this->uIntelligence; | 6235 v18 = (__int16 *)&this->uIntelligence; |
6230 goto LABEL_82; | 6236 *v18 += val; |
6237 if ( *v18 > 255 ) | |
6238 *v18 = 255; | |
6239 this->PlaySound(SPEECH_92, 0); | |
6240 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6241 PlayAwardSound(uPlayerIdx); | |
6242 return; | |
6231 case VAR_BasePersonality: | 6243 case VAR_BasePersonality: |
6232 v18 = (__int16 *)&this->uWillpower; | 6244 v18 = (__int16 *)&this->uWillpower; |
6233 goto LABEL_82; | 6245 *v18 += val; |
6246 if ( *v18 > 255 ) | |
6247 *v18 = 255; | |
6248 this->PlaySound(SPEECH_92, 0); | |
6249 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6250 PlayAwardSound(uPlayerIdx); | |
6251 return; | |
6234 case VAR_BaseEndurance: | 6252 case VAR_BaseEndurance: |
6235 v18 = (__int16 *)&this->uEndurance; | 6253 v18 = (__int16 *)&this->uEndurance; |
6236 goto LABEL_82; | 6254 *v18 += val; |
6255 if ( *v18 > 255 ) | |
6256 *v18 = 255; | |
6257 this->PlaySound(SPEECH_92, 0); | |
6258 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6259 PlayAwardSound(uPlayerIdx); | |
6260 return; | |
6237 case VAR_BaseSpeed: | 6261 case VAR_BaseSpeed: |
6238 v18 = (__int16 *)&this->uSpeed; | 6262 v18 = (__int16 *)&this->uSpeed; |
6239 goto LABEL_82; | 6263 *v18 += val; |
6264 if ( *v18 > 255 ) | |
6265 *v18 = 255; | |
6266 this->PlaySound(SPEECH_92, 0); | |
6267 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6268 PlayAwardSound(uPlayerIdx); | |
6269 return; | |
6240 case VAR_BaseAccuracy: | 6270 case VAR_BaseAccuracy: |
6241 v18 = (__int16 *)&this->uAccuracy; | 6271 v18 = (__int16 *)&this->uAccuracy; |
6242 goto LABEL_82; | 6272 *v18 += val; |
6273 if ( *v18 > 255 ) | |
6274 *v18 = 255; | |
6275 this->PlaySound(SPEECH_92, 0); | |
6276 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6277 PlayAwardSound(uPlayerIdx); | |
6278 return; | |
6243 case VAR_BaseLuck: | 6279 case VAR_BaseLuck: |
6244 v18 = (__int16 *)&this->uLuck; | 6280 v18 = (__int16 *)&this->uLuck; |
6245 goto LABEL_82; | 6281 *v18 += val; |
6282 if ( *v18 > 255 ) | |
6283 *v18 = 255; | |
6284 this->PlaySound(SPEECH_92, 0); | |
6285 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6286 PlayAwardSound(uPlayerIdx); | |
6287 return; | |
6246 case VAR_FixedFood: | 6288 case VAR_FixedFood: |
6247 Party::GiveFood(val); | 6289 Party::GiveFood(val); |
6248 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); | 6290 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[502], val); |
6249 ShowStatusBarString(pTmpBuf.data(), 2u); | 6291 ShowStatusBarString(pTmpBuf.data(), 2u); |
6250 if ( pParty->uNumFoodRations > 0xFFFF ) | 6292 if ( pParty->uNumFoodRations > 0xFFFF ) |
6270 } | 6312 } |
6271 return; | 6313 return; |
6272 } | 6314 } |
6273 LABEL_62: | 6315 LABEL_62: |
6274 v19 = (__int16 *)&this->uMightBonus; | 6316 v19 = (__int16 *)&this->uMightBonus; |
6275 goto LABEL_113; | 6317 *v19 += val; |
6318 if ( *v19 > 255 ) | |
6319 *v19 = 255; | |
6320 v31 = 0; | |
6321 this->PlaySound(SPEECH_91, v31); | |
6322 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6323 PlayAwardSound(uPlayerIdx); | |
6324 return; | |
6276 } | 6325 } |
6277 if ( var_type <= VAR_FireResistanceBonus ) | 6326 if ( var_type <= VAR_FireResistanceBonus ) |
6278 { | 6327 { |
6279 if ( var_type != VAR_FireResistanceBonus ) | 6328 if ( var_type != VAR_FireResistanceBonus ) |
6280 { | 6329 { |
6281 switch ( var_type ) | 6330 switch ( var_type ) |
6282 { | 6331 { |
6283 case VAR_ActualIntellect: | 6332 case VAR_ActualIntellect: |
6284 LABEL_66: | 6333 LABEL_66: |
6285 v19 = (__int16 *)&this->uIntelligenceBonus; | 6334 v19 = (__int16 *)&this->uIntelligenceBonus; |
6286 goto LABEL_113; | 6335 *v19 += val; |
6336 if ( *v19 > 255 ) | |
6337 *v19 = 255; | |
6338 v31 = 0; | |
6339 this->PlaySound(SPEECH_91, v31); | |
6340 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6341 PlayAwardSound(uPlayerIdx); | |
6342 return; | |
6287 case VAR_ActualPersonality: | 6343 case VAR_ActualPersonality: |
6288 LABEL_67: | 6344 LABEL_67: |
6289 v19 = (__int16 *)&this->uWillpowerBonus; | 6345 v19 = (__int16 *)&this->uWillpowerBonus; |
6290 goto LABEL_113; | 6346 *v19 += val; |
6347 if ( *v19 > 255 ) | |
6348 *v19 = 255; | |
6349 v31 = 0; | |
6350 this->PlaySound(SPEECH_91, v31); | |
6351 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6352 PlayAwardSound(uPlayerIdx); | |
6353 return; | |
6291 case VAR_ActualEndurance: | 6354 case VAR_ActualEndurance: |
6292 LABEL_68: | 6355 LABEL_68: |
6293 v19 = (__int16 *)&this->uEnduranceBonus; | 6356 v19 = (__int16 *)&this->uEnduranceBonus; |
6294 goto LABEL_113; | 6357 *v19 += val; |
6358 if ( *v19 > 255 ) | |
6359 *v19 = 255; | |
6360 v31 = 0; | |
6361 this->PlaySound(SPEECH_91, v31); | |
6362 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6363 PlayAwardSound(uPlayerIdx); | |
6364 return; | |
6295 case VAR_ActualSpeed: | 6365 case VAR_ActualSpeed: |
6296 LABEL_69: | 6366 LABEL_69: |
6297 v19 = (__int16 *)&this->uSpeedBonus; | 6367 v19 = (__int16 *)&this->uSpeedBonus; |
6298 goto LABEL_113; | 6368 *v19 += val; |
6369 if ( *v19 > 255 ) | |
6370 *v19 = 255; | |
6371 v31 = 0; | |
6372 this->PlaySound(SPEECH_91, v31); | |
6373 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6374 PlayAwardSound(uPlayerIdx); | |
6375 return; | |
6299 case VAR_ActualAccuracy: | 6376 case VAR_ActualAccuracy: |
6300 LABEL_70: | 6377 LABEL_70: |
6301 v19 = (__int16 *)&this->uAccuracyBonus; | 6378 v19 = (__int16 *)&this->uAccuracyBonus; |
6302 goto LABEL_113; | 6379 *v19 += val; |
6380 if ( *v19 > 255 ) | |
6381 *v19 = 255; | |
6382 v31 = 0; | |
6383 this->PlaySound(SPEECH_91, v31); | |
6384 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6385 PlayAwardSound(uPlayerIdx); | |
6386 return; | |
6303 case VAR_ActualLuck: | 6387 case VAR_ActualLuck: |
6304 LABEL_71: | 6388 LABEL_71: |
6305 v19 = (__int16 *)&this->uLuckBonus; | 6389 v19 = (__int16 *)&this->uLuckBonus; |
6306 goto LABEL_113; | 6390 *v19 += val; |
6391 if ( *v19 > 255 ) | |
6392 *v19 = 255; | |
6393 v31 = 0; | |
6394 this->PlaySound(SPEECH_91, v31); | |
6395 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6396 PlayAwardSound(uPlayerIdx); | |
6397 return; | |
6307 case VAR_FireResistance: | 6398 case VAR_FireResistance: |
6308 v18 = &this->sResFireBase; | 6399 v18 = &this->sResFireBase; |
6309 goto LABEL_82; | 6400 *v18 += val; |
6401 if ( *v18 > 255 ) | |
6402 *v18 = 255; | |
6403 this->PlaySound(SPEECH_92, 0); | |
6404 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6405 PlayAwardSound(uPlayerIdx); | |
6406 return; | |
6310 case VAR_AirResistance: | 6407 case VAR_AirResistance: |
6311 v18 = &this->sResAirBase; | 6408 v18 = &this->sResAirBase; |
6312 goto LABEL_82; | 6409 *v18 += val; |
6410 if ( *v18 > 255 ) | |
6411 *v18 = 255; | |
6412 this->PlaySound(SPEECH_92, 0); | |
6413 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6414 PlayAwardSound(uPlayerIdx); | |
6415 return; | |
6313 case VAR_WaterResistance: | 6416 case VAR_WaterResistance: |
6314 v18 = &this->sResWaterBase; | 6417 v18 = &this->sResWaterBase; |
6315 goto LABEL_82; | 6418 *v18 += val; |
6419 if ( *v18 > 255 ) | |
6420 *v18 = 255; | |
6421 this->PlaySound(SPEECH_92, 0); | |
6422 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6423 PlayAwardSound(uPlayerIdx); | |
6424 return; | |
6316 case VAR_EarthResistance: | 6425 case VAR_EarthResistance: |
6317 v18 = &this->sResEarthBase; | 6426 v18 = &this->sResEarthBase; |
6318 goto LABEL_82; | 6427 *v18 += val; |
6428 if ( *v18 > 255 ) | |
6429 *v18 = 255; | |
6430 this->PlaySound(SPEECH_92, 0); | |
6431 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6432 PlayAwardSound(uPlayerIdx); | |
6433 return; | |
6319 case VAR_SpiritResistance: | 6434 case VAR_SpiritResistance: |
6320 v18 = &this->sResSpiritBase; | 6435 v18 = &this->sResSpiritBase; |
6321 goto LABEL_82; | 6436 *v18 += val; |
6437 if ( *v18 > 255 ) | |
6438 *v18 = 255; | |
6439 this->PlaySound(SPEECH_92, 0); | |
6440 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6441 PlayAwardSound(uPlayerIdx); | |
6442 return; | |
6322 case VAR_MindResistance: | 6443 case VAR_MindResistance: |
6323 v18 = &this->sResMindBase; | 6444 v18 = &this->sResMindBase; |
6324 goto LABEL_82; | 6445 *v18 += val; |
6446 if ( *v18 > 255 ) | |
6447 *v18 = 255; | |
6448 this->PlaySound(SPEECH_92, 0); | |
6449 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6450 PlayAwardSound(uPlayerIdx); | |
6451 return; | |
6325 case VAR_BodyResistance: | 6452 case VAR_BodyResistance: |
6326 v18 = &this->sResBodyBase; | 6453 v18 = &this->sResBodyBase; |
6327 goto LABEL_82; | 6454 *v18 += val; |
6455 if ( *v18 > 255 ) | |
6456 *v18 = 255; | |
6457 this->PlaySound(SPEECH_92, 0); | |
6458 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6459 PlayAwardSound(uPlayerIdx); | |
6460 return; | |
6328 case VAR_LightResistance: | 6461 case VAR_LightResistance: |
6329 v18 = &this->sResLightBase; | 6462 v18 = &this->sResLightBase; |
6330 goto LABEL_82; | 6463 *v18 += val; |
6464 if ( *v18 > 255 ) | |
6465 *v18 = 255; | |
6466 this->PlaySound(SPEECH_92, 0); | |
6467 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6468 PlayAwardSound(uPlayerIdx); | |
6469 return; | |
6331 case VAR_DarkResistance: | 6470 case VAR_DarkResistance: |
6332 v18 = &this->sResDarkBase; | 6471 v18 = &this->sResDarkBase; |
6333 goto LABEL_82; | 6472 *v18 += val; |
6473 if ( *v18 > 255 ) | |
6474 *v18 = 255; | |
6475 this->PlaySound(SPEECH_92, 0); | |
6476 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6477 PlayAwardSound(uPlayerIdx); | |
6478 return; | |
6334 case VAR_MagicResistance: | 6479 case VAR_MagicResistance: |
6335 v18 = &this->sResMagicBase; | 6480 v18 = &this->sResMagicBase; |
6336 LABEL_82: | |
6337 *v18 += val; | 6481 *v18 += val; |
6338 if ( *v18 > 255 ) | 6482 if ( *v18 > 255 ) |
6339 *v18 = 255; | 6483 *v18 = 255; |
6340 this->PlaySound(SPEECH_92, 0); | 6484 this->PlaySound(SPEECH_92, 0); |
6341 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | 6485 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); |
6345 return; | 6489 return; |
6346 } | 6490 } |
6347 return; | 6491 return; |
6348 } | 6492 } |
6349 v19 = &this->sResFireBonus; | 6493 v19 = &this->sResFireBonus; |
6350 LABEL_113: | |
6351 *v19 += val; | 6494 *v19 += val; |
6352 if ( *v19 > 255 ) | 6495 if ( *v19 > 255 ) |
6353 *v19 = 255; | 6496 *v19 = 255; |
6354 v31 = 0; | 6497 v31 = 0; |
6355 this->PlaySound(SPEECH_91, v31); | 6498 this->PlaySound(SPEECH_91, v31); |
6384 if ( var_type != 62 ) | 6527 if ( var_type != 62 ) |
6385 return; | 6528 return; |
6386 v19 = &this->sResMindBonus; | 6529 v19 = &this->sResMindBonus; |
6387 break; | 6530 break; |
6388 } | 6531 } |
6389 goto LABEL_113; | 6532 *v19 += val; |
6533 if ( *v19 > 255 ) | |
6534 *v19 = 255; | |
6535 v31 = 0; | |
6536 this->PlaySound(SPEECH_91, v31); | |
6537 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6538 PlayAwardSound(uPlayerIdx); | |
6539 return; | |
6390 } | 6540 } |
6391 if ( var_type == VAR_LightResistanceBonus ) | 6541 if ( var_type == VAR_LightResistanceBonus ) |
6392 { | 6542 { |
6393 v19 = &this->sResLightBonus; | 6543 v19 = &this->sResLightBonus; |
6394 goto LABEL_113; | 6544 *v19 += val; |
6545 if ( *v19 > 255 ) | |
6546 *v19 = 255; | |
6547 v31 = 0; | |
6548 this->PlaySound(SPEECH_91, v31); | |
6549 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6550 PlayAwardSound(uPlayerIdx); | |
6551 return; | |
6395 } | 6552 } |
6396 if ( var_type == VAR_DarkResistanceBonus ) | 6553 if ( var_type == VAR_DarkResistanceBonus ) |
6397 { | 6554 { |
6398 v19 = &this->sResDarkBonus; | 6555 v19 = &this->sResDarkBonus; |
6399 goto LABEL_113; | 6556 *v19 += val; |
6557 if ( *v19 > 255 ) | |
6558 *v19 = 255; | |
6559 v31 = 0; | |
6560 this->PlaySound(SPEECH_91, v31); | |
6561 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6562 PlayAwardSound(uPlayerIdx); | |
6563 return; | |
6400 } | 6564 } |
6401 if ( var_type == VAR_MagicResistanceBonus ) | 6565 if ( var_type == VAR_MagicResistanceBonus ) |
6402 { | 6566 { |
6403 v19 = &this->sResMagicBonus; | 6567 v19 = &this->sResMagicBonus; |
6404 goto LABEL_113; | 6568 *v19 += val; |
6569 if ( *v19 > 255 ) | |
6570 *v19 = 255; | |
6571 v31 = 0; | |
6572 this->PlaySound(SPEECH_91, v31); | |
6573 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6574 PlayAwardSound(uPlayerIdx); | |
6575 return; | |
6405 } | 6576 } |
6406 if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill ) | 6577 if ( var_type <= VAR_MagicResistanceBonus || var_type > VAR_DiplomacySkill ) |
6407 return; | 6578 return; |
6408 } | 6579 } |
6409 goto LABEL_106; | 6580 if ( val <= 63 ) |
6581 { | |
6582 *((short *)&this->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&this->pConditions[16] + 2 * var_type) & 63; | |
6583 } | |
6584 else | |
6585 { | |
6586 v20 = (char *)&this->pConditions[16] + 2 * var_type; | |
6587 v21 = *(short *)v20; | |
6588 v22 = (unsigned __int8)val + (v21 & 63); | |
6589 if ( v22 > 60 ) | |
6590 LOWORD(v22) = 60; | |
6591 LOBYTE(v21) = v21 & 0xC0; | |
6592 *(short *)v20 = v22 | v21; | |
6593 } | |
6594 pGame->pStru6Instance->SetPlayerBuffAnim(0x97u, uPlayerIdx); | |
6595 PlayAwardSound(uPlayerIdx); | |
6596 return; | |
6410 } | 6597 } |
6411 if ( var_type == VAR_LearningSkill ) | 6598 if ( var_type == VAR_LearningSkill ) |
6412 { | 6599 { |
6413 LABEL_106: | |
6414 if ( val <= 63 ) | 6600 if ( val <= 63 ) |
6415 { | 6601 { |
6416 *((short *)&this->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&this->pConditions[16] + 2 * var_type) & 63; | 6602 *((short *)&this->pConditions[16] + var_type) = (unsigned __int8)val | *((char *)&this->pConditions[16] + 2 * var_type) & 63; |
6417 } | 6603 } |
6418 else | 6604 else |