Module: StudioGame::GameTurn

Defined in:
lib/studio_game/game_turn.rb

Class Method Summary collapse

Class Method Details

.take_turn(player) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/studio_game/game_turn.rb', line 8

def self.take_turn(player)

  #roll the die one time
  die = Die.new

  # based on the die roll the player either takes a hit, gets skipped, or
  # gets w00ted
  case die.roll
  when 1..2
    player.blam
  when 3..4
    puts "#{player.name} was skipped"
  else
    player.w00t
  end

  # pick a random treasure and give it to the player
  player.found_treasure(TreasureTrove.random)

end