mob
var
attack_lock=0
client
Center()
if(usr.attack_lock==0)
if(usr.Equipped=="Saber (Single)")
for(var/mob/M as mob in oview(1))
if(M.dead==0)
if(M.Is_Enemy==1)
var/damage=usr.apwr-M.dpwr
if(damage<=0)
usr<<"You attack [M] but do no damage."
return
else
usr<<"You attack [M] for [damage] damage."
M<<"[usr] attacks you for [damage] damage."
M.Hp-=damage
if(istype(M,/mob/Enemy/Elite_Jedi_Pupil2))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
if(istype(M,/mob/Enemy/Elite_Sith_Pupil2))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
usr.Death(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
return
else
return
if(usr.Equipped=="Saber (Double)")
for(var/mob/M as mob in oview(1))
if(M.dead==0)
if(M.Is_Enemy==1)
var/damage=usr.apwr-M.dpwr
if(damage<=0)
usr<<"You attack [M] but do no damage."
return
else
usr<<"You attack [M] for [damage] damage."
M<<"[usr] attacks you for [damage] damage."
M.Hp-=damage
if(istype(M,/mob/Enemy/Elite_Jedi_Pupil))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
if(istype(M,/mob/Enemy/Elite_Sith_Pupil))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
usr.Death(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
return
else
return
if(usr.Equipped=="Dagger")
for(var/mob/M as mob in oview(1))
if(M.dead==0)
if(M.Is_Enemy==1)
var/damage=usr.apwr-M.dpwr
if(damage<=0)
usr<<"You attack [M] but do no damage."
return
else
usr<<"You attack [M] for [damage] damage."
M<<"[usr] attacks you for [damage] damage."
M.Hp-=damage
if(istype(M,/mob/Enemy/Elite_Jedi_Pupil))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
if(istype(M,/mob/Enemy/Elite_Sith_Pupil))
usr.Death4(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
usr.Death(M)
usr.attack_lock=1
sleep(10)
usr.attack_lock=0
else
return
else
return
else
return
Problem description:
ok my problem with that is; if someone holds down the center key it hits very fast, well i fixed that with the attack_lock well if you hold down the center button even after you away from the monsters (A.I. they die) when they come back to life you get messages saying you've attacked that monster and you get the exp if they die, i tried to fix that with the if(M.dead==1) but to no prevail that just makes it wait until they are alive again, down below is my deathcheck (one of them anyways) and my 'ghetto-fied' respawn codes
mob
proc
Death(mob/M)
if(!M.client)
if(M.Hp<=0)
if(istype(M,/mob/Enemy/Volks_Slave))
src.exp+=50*M.level
src.levelup()
M.respawn3()
return
if(istype(M,/mob/Enemy/Jedi_Pupil))
src.exp+=10*M.level
src.levelup()
src.Defeted_pupil=1
src<<"You feel as if you can go home now..."
M.respawn2()
return
if(istype(M,/mob/Enemy/Sith_Pupil))
src.exp+=10*M.level
src.levelup()
src.Defeted_pupil=1
src<<"You feel as if you can go home now..."
M.respawn2()
return
else
src.exp+=10*M.level
src.levelup()
M.respawn()
return
else
return
if(M.client)
if(M.Hp<=0)
src<<"You killed Player [M]."
alert("Player [src] has killed you.","Death",M)
world<<"[src] has killed [M]."
src.exp+=5*M.level
src.levelup()
M.loc=locate(/area/Respawn)
M.Hp=M.mHp
mob
proc
respawn()
walk_to(src,src,0,0)
src.dead=1
src.invisibility=1
src.density=0
src.locked=1
sleep(600)
src.x=src.Ox
src.y=src.Oy
src.z=src.Oz
src.dead=0
src.locked=0
src.invisibility=0
src.density=1
src.Hp=src.mHp
now my next matter is a bit different, more of a developer how-to but here it is; how do i add in sound? i mean i have a music file (mp3) and i added src<<sound('musicfile.mp3') and byond accepted it BUT when i went to login (thats where the sound part is implemented) alas no sound at all, help me out please
I apreciate any/all help given ^__^
Also im not new ive been here for quite a long while i have read the dm guide several times, but i havent worked dm in like.. *thinks back* half a year so i sorta lost a few things ^__^