comparison Actor.cpp @ 1873:a53bd0511de2

Actor::ApplyFineForKillingPeasant cleaned up
author Grumpy7
date Thu, 17 Oct 2013 07:46:11 +0200
parents e26d8d15ef30
children a6276dda8804
comparison
equal deleted inserted replaced
1872:661ea35def76 1873:a53bd0511de2
1297 } 1297 }
1298 1298
1299 //----- (00438CF3) -------------------------------------------------------- 1299 //----- (00438CF3) --------------------------------------------------------
1300 void Actor::ApplyFineForKillingPeasant(unsigned int uActorID) 1300 void Actor::ApplyFineForKillingPeasant(unsigned int uActorID)
1301 { 1301 {
1302 unsigned int v1; // esi@1 1302 if ( uLevelMapStatsID == 0 || !pActors[uActorID].IsPeasant())
1303 unsigned int v2; // edi@2
1304 char v3; // bl@3
1305 //char *v4; // ecx@16
1306 //signed int v5; // eax@18
1307 Player **ppPlayers; // esi@20
1308
1309 v1 = uLevelMapStatsID;
1310 if ( !uLevelMapStatsID || !pActors[uActorID].IsPeasant())
1311 return; 1303 return;
1312 1304
1313 v2 = uActorID; 1305 if ( (uLevelMapStatsID == 6 || uLevelMapStatsID == 7) && pParty->IsPartyEvil()) //celeste and bracada
1314 v3 = 1; 1306 return;
1315 if ( v1 != 5 ) 1307
1316 { 1308 if ( (uLevelMapStatsID == 5 || uLevelMapStatsID == 8) && pParty->IsPartyGood()) // the pit and deyja
1317 if ( v1 == 6 || v1 == 7 ) 1309 return;
1318 { 1310
1319 pParty->IsPartyGood(); //the binary file contains this call. if someone finds out whether it's supposed to be here or not, feel free to apply the appropriate change 1311 pParty->uFine += 100 * (pMapStats->pInfos[uLevelMapStatsID]._steal_perm + pActors[uActorID].pMonsterInfo.uLevel + pParty->GetPartyReputation());
1320 if ( pParty->IsPartyEvil() ) 1312 if ( pParty->uFine < 0 )
1321 return; 1313 pParty->uFine = 0;
1322 goto LABEL_12; 1314 if ( pParty->uFine > 4000000 )
1323 } 1315 pParty->uFine = 4000000;
1324 if ( v1 != 8 ) 1316
1325 goto LABEL_12; 1317 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
1326 } 1318 {
1327 if ( pParty->IsPartyGood() ) 1319 if (pOutdoor->ddm.uReputation < 10000)
1328 v3 = 0; 1320 pOutdoor->ddm.uReputation++;
1329 if ( pParty->IsPartyEvil() ) 1321 }
1330 v3 = 1; 1322 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1331 if ( v3 ) 1323 {
1332 { 1324 if (pIndoor->dlv.uReputation < 10000)
1333 LABEL_12: 1325 pIndoor->dlv.uReputation++;
1334 pParty->uFine += 100 * (pMapStats->pInfos[uLevelMapStatsID]._steal_perm + pActors[v2].pMonsterInfo.uLevel + pParty->GetPartyReputation()); 1326 }
1335 if ( pParty->uFine < 0 ) 1327 else assert(false);
1336 pParty->uFine = 0; 1328
1337 if ( pParty->uFine > 4000000 ) 1329 if ( pParty->uFine )
1338 pParty->uFine = 4000000; 1330 {
1339 1331 for ( int i = 1; i <= 4; i++)
1340 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) 1332 {
1341 { 1333 if ( !_449B57_test_bit(pPlayers[i]->_achieved_awards_bits, 1) )
1342 if (pOutdoor->ddm.uReputation < 10000) 1334 _449B7E_toggle_bit(pPlayers[i]->_achieved_awards_bits, 1, 1u);
1343 pOutdoor->ddm.uReputation++; 1335 }
1344 }
1345 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
1346 {
1347 if (pIndoor->dlv.uReputation < 10000)
1348 pIndoor->dlv.uReputation++;
1349 }
1350 else assert(false);
1351
1352 ppPlayers = &pPlayers[1];
1353 do
1354 {
1355 if ( pParty->uFine )
1356 {
1357 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)(*ppPlayers)->_achieved_awards_bits, 1) )
1358 _449B7E_toggle_bit((unsigned char *)(*ppPlayers)->_achieved_awards_bits, 1, 1u);
1359 }
1360 ++ppPlayers;
1361 }
1362 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] );
1363 } 1336 }
1364 } 1337 }
1365 1338
1366 //----- (0043AE80) -------------------------------------------------------- 1339 //----- (0043AE80) --------------------------------------------------------
1367 void Actor::AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3) 1340 void Actor::AddBloodsplatOnDamageOverlay(unsigned int uActorID, int a2, signed int a3)