//Rough Attack
mob/verb/Attack(mob/M as mob in get_step(src,src.dir))
set category = "Fighting"
var/damage = usr.Str*1.5-M.Def/3
if(usr.canbeattacked)
//M.parryrate()
usr<<output("<font color=red>Battle AI:</font> <font color=white>You attacked [M] for [damage]!</font>","chat")
M<<output("<font color=red>Battle AI:</font> <font color=white>You were attacked by [usr] for [damage]!</font>","chat")
oview(8)<<output("<font color=red>Battle AI:</font> <font color=white>[M] was hit by [usr] for [damage]!</font>","chat")
M.HealthP -= damage
M.deathcheck(usr)
else
usr<<output("<font color=red>Battle AI:</font> <font color=white>You cannot attack this player, he is probally dead.</font>","chat")
return
// Rough Deathcheck
mob/proc/deathcheck()
if(usr.HealthP <= 0)
usr<<output("<font color=red>Death AI:</font> <font color=white>You died and will be respawned in a little bit.</font>","chat")
usr.freeze = 1
usr.icon_state = "Dead"
usr.canbeattacked = 0
sleep(100)
usr.loc = locate(1,1,1)
usr.freeze = 0
usr.icon_state = ""
usr.HealthP = usr.StamP
usr.canbeattacked = 1
//Test dummy
mob
test
name = "Test Dummy"
icon = 'Tall Male.dmi'
HealthP=20
Def=1
Problem description: When I attack the test dummy its HealthP goes to 0 but it isnt dieing.
For example, your Attack verb has an argument: (mob/M as mob in get_step(src,src.dir)). M is a mob in one step ahead of src.
You have usr as an argument when calling M.deathcheck(). Pointless.
2. usr abuse. When you're calling M.deathcheck() in the Attack verb, usr is the one who attacked, not M. usr is inherited through verbs/procs. Use src instead, that's what it's for.
3. You don't need to use output() for default outputs. Just set the "chat" output control as the default by checking the Default checkbox in the skin editor.
4. return at the end of a proc is pointless. Procs automatically return . at the end of the proc. "." is a built-in variable for procs containing the default return value.
5. Please, use tabs instead of spaces for indentation. It's a lot easier to read.