From 1498c4b7706d7e7a2ba77c3f5dc9b3ecae2eb15f Mon Sep 17 00:00:00 2001 From: dybal Date: Wed, 16 Dec 2020 10:54:28 -0300 Subject: [PATCH 1/2] doesn't increase the player's score when he destroys a derelict, but increases it if the target decides to abandon ship when hit. --- src/Core/Entities/PlayerEntity.m | 4 ++++ src/Core/Entities/ShipEntity.m | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 84ebfe0f2..681ec14ab 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -6788,6 +6788,10 @@ - (void) collectBountyFor:(ShipEntity *)other NSString *bonusMessage = OOExpandKey(@"bounty-awarded", score, credits); [UNIVERSE addDelayedMessage:bonusMessage forCount:6 afterDelay:0.15]; } + + if ([other isUnpiloted]) { + killAward = NO; + } if (killAward) { diff --git a/src/Core/Entities/ShipEntity.m b/src/Core/Entities/ShipEntity.m index 2ade638f1..91f0016bd 100644 --- a/src/Core/Entities/ShipEntity.m +++ b/src/Core/Entities/ShipEntity.m @@ -13296,7 +13296,12 @@ - (void) takeEnergyDamage:(double)amount from:(Entity *)ent becauseOf:(Entity *) } if ((energy < maxEnergy *0.125 || (energy < 64 && energy < amount*2)) && [self hasEscapePod] && (ranrot_rand() & 3) == 0) // 25% chance he gets to an escape pod { - [self abandonShip]; + if ([self abandonShip]) { + if (hunter == PLAYER) { + NSUInteger kills = [hunter score]; + [hunter setScore:(kills+1)]; + } + } } } } From 44115fcfd1f291c453f60b2dc83a3145af4625fa Mon Sep 17 00:00:00 2001 From: dybal Date: Wed, 16 Dec 2020 12:47:45 -0300 Subject: [PATCH 2/2] changes isUnPiloted to isHulk to avoid excluding kills of thargoid robot fighters --- src/Core/Entities/PlayerEntity.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Entities/PlayerEntity.m b/src/Core/Entities/PlayerEntity.m index 681ec14ab..0b7a9f5d5 100644 --- a/src/Core/Entities/PlayerEntity.m +++ b/src/Core/Entities/PlayerEntity.m @@ -6789,7 +6789,7 @@ - (void) collectBountyFor:(ShipEntity *)other [UNIVERSE addDelayedMessage:bonusMessage forCount:6 afterDelay:0.15]; } - if ([other isUnpiloted]) { + if ([other isHulk]) { killAward = NO; }