Skip to content

Commit 7ba7cc2

Browse files
committed
Resolves #136 - *points_lost_on_death* can now be used for bestscore games
1 parent 1e2f26e commit 7ba7cc2

File tree

5 files changed

+16
-2
lines changed

5 files changed

+16
-2
lines changed

SBA_Serv/GUI/ObjWrappers/ShipWrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def draw(self, surface, flags, sp=None):
3434

3535
yoff = 0
3636
steer = self._worldobj.commandQueue.containstype(SteerCommand)
37-
if steer:
37+
if steer and steer.orgdeg != 0:
3838
if steer.orgdeg > 0:
3939
steer = -math.sin(steer.percent() * math.pi)
4040
else:

SBA_Serv/Game/Game.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,17 @@ def player_died(self, player, gone):
481481
player.deaths += 1
482482
if self._points_lost_on_death > 0:
483483
player.update_score(-self._points_lost_on_death)
484+
485+
if self._primary_victory == "bestscore":
486+
# we need to subtract/add to bestscore in stead
487+
if self._primary_victory_high:
488+
player.bestscore -= self._points_lost_on_death
489+
if player.bestscore < 0:
490+
player.bestscore = 0
491+
else:
492+
player.bestscore += self._points_lost_on_death
493+
if player.bestscore > self._points_initial:
494+
player.bestscore = self._points_initial
484495

485496
if self._reset_score_on_death:
486497
self._player_reset_score(player)

SBA_Serv/buildnum

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1123
1+
1124

SBA_Serv/game_thehungerbaubles.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ spawn_time_max = 15
4545
[Game]
4646
game = TheHungerBaubles
4747
reset_score_on_death = true
48+
points_lost_on_death = 4
4849
primary_victory_attr = bestscore
4950
secondary_victory_attr = collected
5051

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@ v1.2 : Planned - May 2016 [Season 5] - The Hunger Baubles
3131
* Spawn Manager fixed to only look at specific Type for evaluating min/max not Subclasses.
3232
* Added option for Torpedoes to be effected by gravity **pull_weapon**
3333
* Added **enable_commands** [Server] config option.
34+
* *points_lost_on_death* can be used in bestscore games.
3435
* Split 'explodable' from 'gravitable' for Entities, two separate object flags now.
3536
* Can click ships in tracking mode to switch tracking to the clicked ship.
3637
* Separated option for 'showip' in Application settings to decouple from showing statistics, no longer always show IP in Debug mode.
3738
* 3 New Ship Graphics
39+
* SteerCommand now shown visually with a 'bank'
3840
* Fixed issue with LowerEnergyScoopCommand and Dragons
3941
* Add Microsoft Message Analyzer Log Parser Support
4042
* **Breaking Changes:**

0 commit comments

Comments
 (0)