mob/enemy/thief
HP = 10
Def = 2
icon = 'thief.dmi'
dir = EAST
density = 1
exp = 20
proc
doattack(mob/player/M in oview(5))
var/dmg = 5 - M.Def
while(M.HP)
if(M.HP == 0 )
M.Deathcheck()
break
flick("attack",usr)
sleep(2)
s_damage(M,dmg,"FFFFFF")
flick("gethit",M)
view(4) << "dekuhhit.wav"
M.HP = M.HP - dmg
M.Deathcheck()
sleep(20)
var/mob/M
doattack(M)
ID:149249
Jun 10 2002, 6:13 am
|
|
here is a much better way to put it
mob/enemy/thief HP = 10 Def = 2 icon = 'thief.dmi' dir = EAST density = 1 exp = 20 proc doattack()//changed this for(var/mob/M in oview(5))//this var/dmg = 5 - M.Def flick("attack",src) sleep(2) s_damage(M,dmg,"FFFFFF") flick("gethit",M) view(4) << "dekuhhit.wav" M.HP -= dmg//this M.Deathcheck()//why did u have 2 death checks I removed the top one but there was an error in it, in your death check make sure it is usr.hp <= 0 up there it was M.hp == 0 needs to be <= sleep(20) New()//this doattack()//this |
In response to Buzzyboy
|
|
s_damage(M,dmg,"FFFFFF") If you're using an HTML colour code, you need the "#" symbol. s_damage supports either literal colours, like: "yellow" or HTML colour codes, like: "#99FFCC" Notice the same is true for real HTML: <font color="yellow"><FONT COLOR="YELLOW"></font> <font color="#99FFCC"><FONT COLOR="#99FFCC"></font> |
In response to Netshark010101
|
|
Still wont attack put code in compliled with no errors but the mob wont attack.
|
In response to Netshark010101
|
|
here is a much better way to put it
mob/enemy/thief HP = 10 Def = 2 icon = 'thief.dmi' dir = EAST density = 1 exp = 20 proc doattack()//changed this for(var/mob/M in oview(5))//this var/dmg = 5 - M.Def flick("attack",src) sleep(2) s_damage(M,dmg,"#FFFFFF") flick("gethit",M) view(4) << "dekuhhit.wav" M.HP -= dmg//this M.Deathcheck()//why did u have 2 death checks I removed the top one but there was an error in it, in your death check make sure it is usr.hp <= 0 up there it was M.hp == 0 needs to be <= sleep(20) New()//this doattack()//this Entered this code but still the mob wont fight back. Thanks spuzzum for clearing up the s_damage problem. |
In response to Dekuh
|
|
doattack() doesn't seem to be called at all.
|
proc
doattack(mob/player/M in oview(5))
var/dmg = 5 - M.Def
while(M.HP)
if(M.HP == 0 )
M.Deathcheck()
break
flick("attack",usr)
sleep(2)
s_damage(M,dmg,"FFFFFF")
flick("gethit",M)
view(4) << "dekuhhit.wav"
M.HP -=dmg//This is the problem here
M.Deathcheck()
sleep(20)
var/mob/M
doattack(M)