Module: PlayerGen
- Defined in:
- lib/lotrd/c-playergen.rb
Class Method Summary collapse
Class Method Details
.job(input) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/lotrd/c-playergen.rb', line 40 def job(input) case input when 1 @player.mage when 2 @player.knight when 3 @player.rogue when 4 @player.ranger else system 'clear' puts "Invalid input. Please select a valid option (1-4)." sleep(3) system 'clear' ::NewPlayer.jobOptions end File.open('m-playerdata.yml', 'w') {|file| File.write('m-playerdata.yml', @player.to_yaml)} end |
.playerName(input) ⇒ Object
7 8 9 |
# File 'lib/lotrd/c-playergen.rb', line 7 def playerName(input) @player = Player.new(input) end |
.race(input) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/lotrd/c-playergen.rb', line 11 def race(input) case input when 1 @player.elf when 2 @player.human when 3 @player.dwarf when 666 system 'clear' puts 'Number of the Beast acknowledged. BEAST MODE ACTIVATED.' sleep(3) system 'clear' @player.beast when 777 system 'clear' puts 'Holiest number acknowledged. GOD MODE ACTIVATED.' sleep(3) system 'clear' @player.god else system 'clear' puts "Invalid input. Please select a valid option (1-3)." sleep(3) system 'clear' ::NewPlayer.raceOptions end end |