var
str = 5
Damage = str
mob
verb
Attack()
set category = "Combat"
usr.random = rand(1,2)
if(usr.random == 1)
Damage -= src.hp
usr << "[src] hit you for [Damage] Damage!"
view(usr) << "[usr] hit [src] for [Damage] Damage!"
Etc:
Alright, at first it looked like nothing was wrong with it.
But after a few tests on an NPC [with only Five HP, and the default attack strength being Five...] it actually took away from the Attackers HP besides the Victim. If you could find out the problem it would be much appreciated!
(There originally was a "You missed!" section of the Verb, but it decided to not work! >:|)
Take a look at sections 3 and 5 there.
Since you're not using arguments or setting accessibility, src is the same as the usr (the verb belongs to the mob used by the player, who uses it).
Two options:
set src in oview(1). You will then be using the enemies attack verb instead of the players, so src will be the enemy.
attack(mob/M as mob in oview(1)) The verb will still belong to the player, so src will still be the same, but M will be the mob. damage -= M.hp