ID:262214
 
Code:
atom/moveable
var
maxpower
power
defense
health

mob
icon='whitemale.dmi'
icon_state="whitemale"
maxpower=10
power=5
health=8
defense=3
mob/meanie
icon='meanie.dmi'
icon_state="meanie"
maxpower=10
power=5
health=8
defense=3

mob/meanie/verb/attack()
damage = rand(usr.maxpower,usr.power)
src.health-=[damage]


Problem description:

I ned to know
a how to make a better battle system
b how to work my damage variable
can you help me
Well, first of all, your attack verb makes the meanie attack itself. Useful for rabid enraged attacks, not so much for normal attacks. src is definitely not the variable you want there. Try passing some target into the verb, like

mob/meanie/verbs/attack(/atom/movable/M in oview())
damage = rand(power, maxpower)
M.health -=damage


Hope that helps some.
In response to Neo Skye
thx ill try it...