Module: GameTurn

Defined in:
lib/game/game_turn.rb

Class Method Summary collapse

Class Method Details

.rollObject



6
7
8
9
# File 'lib/game/game_turn.rb', line 6

def self.roll
  die = StudioGame::Die.new
  die.roll
end

.take_turn(player) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/game/game_turn.rb', line 11

def self.take_turn(player)
  case roll
    when 1..2
      player.blam 
    when 3
      # nop 
    else
      player.w00t
  end  
  item = StudioGame::TreasureTrove.get_treasure
  player.found_item(item)    
  puts "#{player.name} found a #{item.name} worth #{item.value} points!"  
end