mob
NPC
Monster
Blue_Slime
name="Blue Jelly"//Name of mob
player=0
icon='monsters.dmi'//Mob's icon
icon_state="blue jelly"//Mob's icon state
Hp=14//Hit points
MaxHp=14//Maximum hit points
Goldgive=5//Gold
Exp_give=2//Experience
Str=5//Attack
Def=2//Defense
monsterattack="blue sludge"//Move enemy does
Bump(mob/M)
if(istype(M,/mob))
if(M.player==1)
var/damage = rand(1,usr.Str)
damage-=M.Def // Lets define a new var thats only for THIS verb... Its called damage and damage is a random number between 1 and 3
if(damage>0)
M << "[usr] attacks you for [damage] damage!" //Output this message to the victim, incase they are a PC and want to know they are being attacked
M.Hp -= damage //Subtract how much damage he did from the mobs HP
M.Death()
else
M<<"[usr] Missed!"
Giant_Moth
name="Moth"//Name of mob
player=0
icon='monsters.dmi'//Mob's icon
icon_state="moth"//Mob's icon state
Hp=14//Hit points
MaxHp=14//Maximum hit points
Goldgive=5//Gold
Exp_give=2//Experience
Str=5//Attack
Def=2//Defense
monsterattack="flutter"//Move enemy does
Bump(mob/M)
if(istype(M,/mob))
if(M.player==1)
var/damage = rand(1,usr.Str)
damage-=M.Def // Lets define a new var thats only for THIS verb... Its called damage and damage is a random number between 1 and 3
if(damage>0)
M << "[usr] attacks you for [damage] damage!" //Output this message to the victim, incase they are a PC and want to know they are being attacked
M.Hp -= damage //Subtract how much damage he did from the mobs HP
M.Death()
else
M<<"[usr] Missed!"
problem im having is..when it is compiled, the moth monster's icon shows for both the moth and the slime.
i know it might fix it if i have the monsters in seprate icon packs. but that would flood my list of icons with lots of single stated icons and take a long while to do.
any idea whats going on here?
Actually, you're using usr in Bump() too, which is a big no-no. Thankfully, in this instance, you can use src instead of usr because src is the owner of the Bump() proc. Also, you can just use one of those Bump() procs as the /mob/NPC/Monster/Bump() proc (as opposed to making the same Bump() for every Monster) and delete the other. =)