Class: Goblin
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 = 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") ⇒ Goblin
constructor
A new instance of Goblin.
Constructor Details
#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") ⇒ Goblin
Returns a new instance of Goblin.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# 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 |