mob
verb
Attack(mob/M as mob in oview(1))
var/damage = rand(1,15)
usr << "You attacked [M] for [damage] HP!"
if(src.client)
src << "[M] attacked you for [damage] HP!"
M.hp -= damage
usr.deathcheck(M)
if(src.client)
M.exp+=rand(50,300)
M.Levelup()
else
return ..()
proc
deathcheck(mob/M as mob)
if(M.hp <= 0)
if(M.client)
M.loc = locate(1,1,1)
M.hp = M.maxhp
M << "[src] killed you!"
else
M.hp = 100
usr << "You killed [M]!"
M.loc = locate(rand(1,world.maxx),rand(1,world.maxy),rand(1,world.maxz))
proc
attackplayer()
for(var/mob/M in oview(1))
if(get_step_away(src,M,1))
if(M.client)
continue
else
src.Attack(M)
else
return ..()
spawn(20) attackplayer()
move()
for(var/mob/M in oview())
if(get_step_away(src,M,3))
if(!M.client)
continue
else
walk_to(src,M,1,2)
else
continue
Levelup()
if(src.exp >= src.maxexp)
src.lvl++
src.exp = 0
src.maxexp*=2
src<<"You gained a level!"
src.Statup()
Statup()
src.maxhp+=20
src.hp=src.maxhp
src.strexp+=rand(50,300)
src.defexp+=rand(50,300)
src<<"Your stats increase!"
if(strexp == src.strmaxexp)
Strup()
if(defexp == src.defmaxexp)
Defup()
Strup()
if(src.strexp >= src.strmaxexp)
src.str++
src.strexp = 0
src.strmaxexp*=2
src.str += 1
src << "You gained a Strength Level!"
Defup()
if(src.defexp >= src.defmaxexp)
src.def++
src.defexp = 0
src.defmaxexp*=2
src.def += 1
src << "You gained a Defence Level!"
New()
attackplayer()
move()
Problem description:For some reason whenever I get in and start to attack a monster it says i got the same amt of hp taken away as the monster did.. i get no errors when i compile.. I do not know the problem I have been trying to figure it out.. But I don't know.
Thanks
ShimmyShine
Change that usr to M