Enemy
icon = 'Unknown.dmi'
hp = new(200,200)
str = new(33,33)
def = new(8,8)
New()
. = ..()
AI()
proc
AI()
while(src)
var/c = 0
for(var/mob/M in oview(5,src))
if(M.client)
c = 1
if(c)
for(var/mob/M in oview(5,src))
if(M.client)
step_towards(src,M)
else
walk(src,0)
sleep(3)
Bump(mob/M)
if(src.canattack)
src.canattack = 0
spawn( rand(3, 5) ) canattack = 1
var/dmg = round( (rand(src.str.val * 0.8, src.str.val * 1.2) ) - (rand(M.def.val * 0.5, M.def.val * 1.1) ) )
if(dmg <= 0) view() << "<i>[src] misses [M]!"
else
M.hp.val -= dmg
view() << "<i>[src] attacked [M] for [dmg] damage!"
M.Death(src)
Problem description:k, that works, but thats the ONLY enemy that works.
Ultimate
icon = 'ZKR.dmi'
hp = new(500,500)
str = new(40,40)
def = new(8,8)
New()
. = ..()
AI()
proc
AI()
while(src)
var/c = 0
for(var/mob/M in oview(5,src))
if(M.client)
c = 1
if(c)
for(var/mob/M in oview(5,src))
if(M.client)
step_towards(src,M)
else
walk(src,0)
sleep(3)
Bump(mob/M)
if(src.canattack)
src.canattack = 0
spawn( rand(3, 5) ) canattack = 1
var/dmg = round( (rand(src.str.val * 0.8, src.str.val * 1.2) ) - (rand(M.def.val * 0.5, M.def.val * 1.1) ) )
if(dmg <= 0) view() << "<i>[src] misses [M]!"
else
M.hp.val -= dmg
view() << "<i>[src] attacked [M] for [dmg] damage!"
M.Death(src)
This one doesn't work, neither does any of my other enemies besides Enemy. I don't get it. When ever there health goes to 0, they still live and health goes down to negative. Can anyone help me?
(I used resource for the enemy, and edited it to make the others)