Class: Dungeon

Inherits:
Object
  • Object
show all
Defined in:
lib/places.rb

Instance Method Summary collapse

Constructor Details

#initializeDungeon

can go here from town, will spawn random encounters, etc.



62
63
64
65
# File 'lib/places.rb', line 62

def initialize
  puts # formatting
  puts "You have entered the dungeon! DUM DUM DUM!!"
end

Instance Method Details

#choicesObject



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/places.rb', line 67

def choices
  move = 0
  load_data
  until move == "2"
    begin
      puts # formatting
      puts bar_top
      puts stat_bar(@player.name, @player.xp, @player.lvl, @player.coin, @player.cur_hp, @player.cur_mana)
      puts bar_low
      puts # formatting
      puts "Now #{@player.name}, what will you do next?"
      puts "[1]. Go deeper into the dungeon."
      puts "[2]. Return to town."
      prompt; move = gets.chomp
    end while not (move == "1" or move == "2")
    case
    when move == "1"
      puts # formatting
      puts "You walk further into the dark, dank, dirty, dungeon,"
      puts "smirking slightly at your awesome alliteration ability."
      puts # formatting
      random_encounter
    when move == "2"
      save_data
      return
    end
  end
end