Sha256: c1d5b0838cf5fade7f470f24f0db08df0f8669b84d7b1ca4757ee452dbafac5f

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

require_relative '../view/newplayer'
require_relative '../model/player'
require_relative '../model/race'
require_relative '../model/job'

module PlayerGen
    def playerName(input)
        @player = Player.new(input)
    end

    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

        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('lib/lotrd/model/playerdata.yml', 'w') {|file| File.write('lib/lotrd/model/playerdata.yml', @player.to_yaml)}
            end
    module_function :race, 
                    :job, 
                    :playerName
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lotrd-0.1.8 lib/lotrd/controller/playergen.rb