Permalink
Browse files

Plug a couple holes so OZs aren't revealed early.

  • Loading branch information...
1 parent c546f61 commit 720fdd16b575d7db93056f536ac0764529c58764 @tdooner tdooner committed Apr 11, 2012
Showing with 10 additions and 2 deletions.
  1. +9 −1 app/models/registration.rb
  2. +1 −1 app/views/squad/show.html.haml
@@ -41,6 +41,14 @@ def time_survived
return [0, tag.datetime - real_begins].max unless tag.nil?
return [0, Game.now(self.game) - real_begins].max
end
+ def display_time_survived
+ if self.is_oz && !self.game.ozs_revealed?
+ real_begins = self.game.game_begins - self.game.utc_offset
+ return [0, Game.now(self.game) - real_begins].max
+ else
+ return self.time_survived()
+ end
+ end
def killing_tag
# Each human should have only one killing tag. (That is, the tag that turned them
@@ -118,7 +126,7 @@ def state_history
deceased_time = self.game.game_ends
if self.is_oz
zombie_time = self.game.game_begins
- deceased_time = [self.game.game_begins, self.most_recent_feed].max + 48.hours
+ deceased_time = [self.game.game_begins, self.most_recent_feed].max + 48.hours if self.game.ozs_revealed?
end
if not tag.nil?
zombie_time = tag.datetime + 1.hour
@@ -11,7 +11,7 @@
-@squad.registrations.each do |r|
%tr
%td=r.person.name
- %td=(r.time_survived/1.hour).round
+ %td=(r.display_time_survived/1.hour).round
%td=r.tagged.length
%td=r.display_score
%div.clear

0 comments on commit 720fdd1

Please sign in to comment.