Class: Skeleton

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 = 10, int = 8, dmg = 5, armor = 6, hp = 8, cur_hp = 8, dodge = 5, mana = 0, cur_mana = 0, xp = 200, lvl = 1, coin = 3, name = "Skeleton") ⇒ Skeleton

Returns a new instance of Skeleton.



192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/mobs.rb', line 192

def initialize(str=12, agi=10, int=8, dmg=5, armor=6, hp=8, cur_hp=8, dodge=5, mana=0, cur_mana=0, xp=200, lvl=1, coin=3, name="Skeleton")
  skeleton_type = dice(10)
  case
  when (1..5).include?(skeleton_type)
    # no change, you just get the generic skeleton
  when (6..9).include?(skeleton_type)
    # this feller is considerably tougher
    str      = 16
    dmg      = 6
    armor    = 8
    hp       = 10
    cur_hp   = 10
    xp       = 300
    coin     = 3
    name     = "Skeletal Knight"
  when skeleton_type == 10
    # skeleton mini boss!
    str      = 14
    agi      = 14
    dmg      = 8
    armor    = 8
    hp       = 10
    cur_hp   = 10
    dodge    = 10
    xp       = 400
    coin     = 5
    name     = "Skeleton of Geoff"
  end
  super(str,agi,int,dmg,armor,hp,cur_hp,dodge,mana,cur_mana,xp,lvl,coin,name)
end