Skip to content

Commit

Permalink
Plug a couple holes so OZs aren't revealed early.
Browse files Browse the repository at this point in the history
  • Loading branch information
tdooner committed Apr 11, 2012
1 parent c546f61 commit 720fdd1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion app/models/registration.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/views/squad/show.html.haml
Expand Up @@ -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
Expand Down

0 comments on commit 720fdd1

Please sign in to comment.