punch
name = "punch"
desc = "Unleashes an melee attack"
template = "punch high or low, mob in view"
category = "combat"
alias = list("p")
function(adverb, mob/M)
if("high")
mb_msgout("<font color=red><b>You bring back your fist and prepare to attack [M.Name]!</font>")
M << mb_msgout("<font color=red><b>[usr.Name] brings back their fist!</font>")
mb_msgout("<font color=red><b>[usr.Name] bring back their fist and prepare to attack [M.Name]!</font>",view())
var/damage = round(usr.PowerLevel - M.PowerLevel + M.PowerLevel / 16)
sleep(15)
if(damage < 1) damage = round(usr.PowerLevel / 50) //checks if user has too low of damage
if(M.IsParryHigh == 1) damage = 0
if(M.IsParryHigh == 1) M.BlockedYes = 1
M.PowerLevel -= damage
mb_msgout("<font color=red><b>[usr.Name] has punched you for <font color=lime>[jru_Commafy(damage)]</font><font color=red><b>!</font>",view())
M.Death() // checks if victim powerlevel is below 0 to determine death
if("low")
mb_msgout("<font color=red><b>You bring back your fist and prepare to attack [M.Name]!</font>")
M << mb_msgout("<font color=red><b>[usr.Name] brings back their fist!</font>")
mb_msgout("<font color=red><b>[usr.Name] bring back their fist and prepare to attack [M.Name]!</font>",view())
var/damage = round(usr.PowerLevel - M.PowerLevel + M.PowerLevel / 16)
sleep(15)
if(damage < 1) damage = round(usr.PowerLevel / 50) //checks if user has too low of damage
if(M.IsParryLow == 1) damage = 0
if(M.IsParryLow == 1) M.BlockedYes = 1
M.PowerLevel -= damage
mb_msgout("<font color=red><b>[usr.Name] has punched you for <font color=lime>[jru_Commafy(damage)]</font><font color=red><b>!</font>",view())
M.Death() // checks if victim powerlevel is below 0 to determine death
else
return mb_msgout("What?")
Problem description:
Command works but not against mobs/players it just prints out
Usage: punch high or low [target]
any ideas D:?