Sha256: 7b7b9a1213185de7c4a094789759834245810a9a684014d64dd496a1e6db2b59

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

require_relative '../model/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.9 lib/lotrd/model/mob.rb
lotrd-0.1.8 lib/lotrd/model/mob.rb