Sha256: a394b11b9a4766c189ed61d236b259f4a48f1e6e60e94bcf8a723762c33370c4

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require_relative 'm-job'

class Mob < Job
    attr_reader :name
    attr_accessor :gold, :balance, :weapon, :armour, :achievements, :hp, :str, :dex, :int, :lck, :agi
    
    def raceGen
        @racePick = rand(1..3)
        case @racePick
            when 1 
                elf
            when 2 
                human
            when 3 
                dwarf
        end
    end

    def jobGen
        @jobPick = rand(1..4)
        case @jobPick
            when 1 
                mage
            when 2
                knight
            when 3 
                rogue
            when 4
                ranger
        end
    end

    def nameGen
        race_array = ['Elven', 'Human', 'Dwarven']
        job_array = ['Mage','Knight','Rogue','Ranger']
        @name = race_array[@racePick - 1] + " " + job_array[@jobPick - 1]
    end

    def elf
        super
    end

    def human
        super
    end

    def dwarf
        super
    end

    def god
        super
    end

    def beast
        super
    end
    
    def mage
        super
    end

    def knight
        super
    end

    def rogue
        super
    end

    def ranger
        super
    end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lotrd-0.1.6 lib/lotrd/m-mob.rb
lotrd-0.1.5 lib/lotrd/m-mob.rb