From 951f9527500edb12775d4d10e4b404bc9fb18d08 Mon Sep 17 00:00:00 2001 From: Daniel Stordy Date: Wed, 11 Jan 2012 12:54:14 +0000 Subject: [PATCH 1/2] Finish the game on last player eliminated. --- webapp/conquest/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/webapp/conquest/models.py b/webapp/conquest/models.py index bc35427..a6ff652 100644 --- a/webapp/conquest/models.py +++ b/webapp/conquest/models.py @@ -305,6 +305,10 @@ def attack_action(self, request): old_owner_data = self.basegameplayer_set.filter('play_index', old_owner).get() old_owner_data.eliminated = True old_owner_data.put() + if self.basegameplayer_set.filter('eliminate =', True).count(2) <= 1: + action.new_state = 'finished' + self.state = 'finished' + action.origin = origin action.destination = destination From e02a1790718a7f617da3c90570df991ae484e3db Mon Sep 17 00:00:00 2001 From: Thomas Grainger Date: Wed, 11 Jan 2012 12:57:43 +0000 Subject: [PATCH 2/2] hidden debug code --- webapp/static/play.css | 2 +- webapp/templates/play.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/static/play.css b/webapp/static/play.css index 167cae0..714897d 100755 --- a/webapp/static/play.css +++ b/webapp/static/play.css @@ -36,6 +36,6 @@ ul#player-list { box-shadow: 3px 3px 4px #000; } - +.debug {display:none} .avatar {padding-top:6px; padding-left:5px;} .nickname {} diff --git a/webapp/templates/play.html b/webapp/templates/play.html index b2fccd8..7c007db 100644 --- a/webapp/templates/play.html +++ b/webapp/templates/play.html @@ -89,7 +89,7 @@ {% endblock %} {% block sidebar %} -
+

Debug

Game State