- (void) collectBountyFor:(ShipEntity *)other
{
if (other == nil || [other isSubEntity]) return;
OOCreditsQuantity score = 10 * [other bounty];
OOScanClass killClass = [other scanClass]; // **tgape** change (+line)
BOOL killAward = [other countsAsKill];
if ([other isPolice]) // oops, we shot a copper!
{
legalStatus |= 64;
}
if (![UNIVERSE strict]) // only mess with the scores if we're not in 'strict' mode
{
BOOL killIsCargo = ((killClass == CLASS_CARGO) && ([other commodityAmount] > 0));
if ((killIsCargo) || (killClass == CLASS_BUOY) || (killClass == CLASS_ROCK))
{
// EMMSTRAN: no killaward (but full bounty) for tharglets?
if (![other hasRole:@"tharglet"]) // okay, we'll count tharglets as proper kills
{
score /= 10; // reduce bounty awarded
killAward = NO; // don't award a kill
}
}
}
credits += score;
if (score > 9)
{
NSString *bonusMsg = [NSString stringWithFormat:DESC(@"bounty-@-total-@"), OOCredits(score), OOCredits(credits)];
[UNIVERSE addDelayedMessage:bonusMsg forCount:6 afterDelay:0.15];
}
... <rest of method>
}
See what happens? The message is triggered only if the score of the target is higher than 9. But for boulders and asteroids, because they are scan class CLASS_ROCK, we enter in the part where it sets the kill to not-a-kill. In doing so, the score is divided by 10. For asteroids this is fine because the resulting score is 10, which is higher than 9 so the message triggers. For boulders though, the score gets set back to 5, so the message is skipped.
You're right. Seems I was confused by the fact that BountyScanner.oxp displays a boulder's bounty. I'm usually paying more attention to the display next to the target reticle than to the consoleMessage. Thus I assumed that with my normal commander the commsMessage was displayed when shooting a boulder. This assumption was wrong.
...Which means that I have to revise Railgun.oxp, because I scripted it to display the commsMessage also for boulders, because of my incorrect general assumption.