Skip to content

Commit

Permalink
Resolves #136 - *points_lost_on_death* can now be used for bestscore …
Browse files Browse the repository at this point in the history
…games
  • Loading branch information
hawkerm committed Jun 7, 2016
1 parent 1e2f26e commit 7ba7cc2
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion SBA_Serv/GUI/ObjWrappers/ShipWrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def draw(self, surface, flags, sp=None):

yoff = 0
steer = self._worldobj.commandQueue.containstype(SteerCommand)
if steer:
if steer and steer.orgdeg != 0:
if steer.orgdeg > 0:
steer = -math.sin(steer.percent() * math.pi)
else:
Expand Down
11 changes: 11 additions & 0 deletions SBA_Serv/Game/Game.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,17 @@ def player_died(self, player, gone):
player.deaths += 1
if self._points_lost_on_death > 0:
player.update_score(-self._points_lost_on_death)

if self._primary_victory == "bestscore":
# we need to subtract/add to bestscore in stead
if self._primary_victory_high:
player.bestscore -= self._points_lost_on_death
if player.bestscore < 0:
player.bestscore = 0
else:
player.bestscore += self._points_lost_on_death
if player.bestscore > self._points_initial:
player.bestscore = self._points_initial

if self._reset_score_on_death:
self._player_reset_score(player)
Expand Down
2 changes: 1 addition & 1 deletion SBA_Serv/buildnum
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1123
1124
1 change: 1 addition & 0 deletions SBA_Serv/game_thehungerbaubles.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ spawn_time_max = 15
[Game]
game = TheHungerBaubles
reset_score_on_death = true
points_lost_on_death = 4
primary_victory_attr = bestscore
secondary_victory_attr = collected

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

0 comments on commit 7ba7cc2

Please sign in to comment.