Class: Kobold

Inherits:
Mobs
  • Object
show all
Defined in:
lib/mobs.rb

Instance Attribute Summary

Attributes inherited from Mobs

#agi, #armor, #buff_drink, #buff_food, #coin, #cur_hp, #cur_mana, #dmg, #dodge, #hp, #int, #lvl, #mana, #name, #str, #xp

Instance Method Summary collapse

Constructor Details

#initialize(str = 12, agi = 8, int = 8, dmg = 5, armor = 5, hp = 6, cur_hp = 6, dodge = 10, mana = 2, cur_mana = 2, xp = 150, lvl = 1, coin = 2, name = "Kobold") ⇒ Kobold

Returns a new instance of Kobold.



159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
# File 'lib/mobs.rb', line 159

def initialize(str=12, agi=8, int=8, dmg=5, armor=5, hp=6, cur_hp=6, dodge=10, mana=2, cur_mana=2, xp=150, lvl=1, coin=2, name="Kobold")
  kobold_type = dice(10)
  case
  when (1..5).include?(kobold_type)
    # no change, you just get the generic kobold
  when (6..9).include?(kobold_type)
    # this one has double the chance to dodge as a regular kobold
    agi      = 16
    dmg      = 6
    armor    = 6
    dodge    = 20
    xp       = 300
    coin     = 4
    name     = "Kobold Thief"
  when kobold_type == 10
    # kobold mini boss!
    str      = 16
    agi      = 12
    dmg      = 8
    armor    = 8
    hp       = 10
    cur_hp   = 10
    xp       = 400
    coin     = 5
    name     = "Kobold Berserker"
  end
  super(str,agi,int,dmg,armor,hp,cur_hp,dodge,mana,cur_mana,xp,lvl,coin,name)
end