ID:271392
 
ok I have a simple question, how do I show an amount of ANYTHING i'm looking for it cuz when a person attacks

usr << "You attack [M] for damage!"

between the for and damge I put my ammount, but how?
Teh_Zero wrote:
ok I have a simple question, how do I show an amount of ANYTHING i'm looking for it cuz when a person attacks

usr << "You attack [M] for damage!"

between the for and damge I put my ammount, but how?

You'd do it the very same way you did with M.

mob/proc/Attack(mob/target)
if(!target) return // simple safety check
var/damage = max(DamageFormula(src,target), target.hp)
src << "You attack [target] for [damage] damage!"
target << "[src] attacks you for [damage] damage!"
// now check if M has died, and tell it who the killer is
target.DeathCheck(src)

// in any death check, src must always be the victim
mob/proc/DeathCheck(mob/killer)
if(hp <= 0)
killer << "You have killed [src]."
src << "[killer] kills you."
if(client) // call a proc to respawn players
Respawn()
else // delete monsters
del(src)


I did Attack() as a proc because it means that now your monster AI can call the very same proc that players' verbs do to inflict damage.

Lummox JR
view() << "<font size=1>[usr] attacks [M] for [damage]!"

Like that