Class: GiantRat
Overview
Opponents below
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
-
#initialize(str = 12, agi = 10, int = 4, dmg = 5, armor = 6, hp = 8, cur_hp = 8, dodge = 5, mana = 0, cur_mana = 0, xp = 150, lvl = 1, coin = 1, name = "Giant Rat") ⇒ GiantRat
constructor
A new instance of GiantRat.
Constructor Details
#initialize(str = 12, agi = 10, int = 4, dmg = 5, armor = 6, hp = 8, cur_hp = 8, dodge = 5, mana = 0, cur_mana = 0, xp = 150, lvl = 1, coin = 1, name = "Giant Rat") ⇒ GiantRat
Returns a new instance of GiantRat.
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/mobs.rb', line 91 def initialize(str=12, agi=10, int=4, dmg=5, armor=6, hp=8, cur_hp=8, dodge=5, mana=0, cur_mana=0, xp=150, lvl=1, coin=1, name="Giant Rat") rat_type = dice(10) case when (1..5).include?(rat_type) # no change, you just get the generic giant rat when (6..9).include?(rat_type) # this feller is much harder to defeat str = 14 dmg = 6 hp = 10 cur_hp = 10 dodge = 10 xp = 250 coin = 2 name = "ROUS" when rat_type == 10 # Giant rat mini boss! str = 16 dmg = 8 hp = 12 cur_hp = 12 dodge = 15 xp = 400 coin = 4 name = "Nuck Chorris" end super(str,agi,int,dmg,armor,hp,cur_hp,dodge,mana,cur_mana,xp,lvl,coin,name) end |