class Goblin

Public Class Methods

new(str=10, agi=10, int=8, dmg=4, armor=6, hp=6, cur_hp=6, dodge=15, mana=2, cur_mana=2, xp=100, lvl=1, coin=1, name="Goblin") click to toggle source
Calls superclass method Mobs::new
# File lib/mobs.rb, line 124
def initialize(str=10, agi=10, int=8, dmg=4, armor=6, hp=6, cur_hp=6, dodge=15, mana=2, cur_mana=2, xp=100, lvl=1, coin=1, name="Goblin")
  # Should probably create a method that does the below
  goblin_type = dice(10)
  case
  when (1..5).include?(goblin_type)
    # no change, you just get the generic goblin
  when (6..9).include?(goblin_type)
    # this feller is stronger, but less nimble
    str      = 16
    dmg      = 6
    armor    = 8
    hp       = 8
    cur_hp   = 8
    dodge    = 10
    xp       = 200
    coin     = 2
    name     = "Goblin Warrior"
  when goblin_type == 10
    # Mini boss goblin!
    str      = 16
    dmg      = 8
    armor    = 10
    hp       = 10
    cur_hp   = 10
    xp       = 300
    coin     = 3
    name     = "Goblin Chief"
  end
  super(str,agi,int,dmg,armor,hp,cur_hp,dodge,mana,cur_mana,xp,lvl,coin,name)
end