mob
proc
Wander()
if(usr.client)//Makes it so you don't wander
return
else
walk_rand(src,8)//The enemy randomly will walk
MonRun()
spawn(10)
Wander()
MonRun()
if(usr.client)
return
else
for(var/mob/M in oview(5,usr))
if(M.client)
if(get_dist(usr,M) <= 5 && usr.Health < usr.Maxhealth/2)
walk_away(usr,M,5,7)
else
MonWalk()
else
continue
MonWalk()
if(usr.client)
return 0
else
for(var/mob/M in oview(5,usr))
if(M.client)
if(get_dist(usr,M) <= 5)
walk_to(usr,M,1,7)
MonCheck(M)
break
else
continue
else
continue
MonCheck(var/mob/Player/)
if(get_dist(usr,Player) <= 1 && get_step(usr,src.dir))
if(!usr.client)
sleep(5)
if(Player.dead)
usr.Wander()
else
usr.Attack(Player)
else
return
mob
verb
Attack()
set category = "Combat"
for(var/mob/M in get_step(usr,usr.dir))//This makes it so you have to be facing your opponent to attack
if(!M.client)//Checks to see if the opponent is a npc or player
if(M.mon)//Checks to see if the opponent is an enemy
if(!M.dead)//Checks to see if the enemy is dead or not
var/dmg = usr.Attack - M.Defense
usr<<"You did [dmg] damage to [M]"
M.Health -= dmg
if(M.Health <= 0)
usr.Exp += M.ExpG
usr.Gold += M.GoldG
usr<<"<b>You gained [M.ExpG] exp and [M.GoldG] gold!!!!</b>"
usr.LevelUp()
del(M)
return ..()
proc
LevelUp()
if(usr.Exp >= usr.Maxexp)
usr.Level += 1
var/s = rand(1,3)
usr.Attack += s
var/d = rand(1,5)
usr.Defense += d
var/e = rand(25,50)
usr.Maxexp += e
usr<<"<b>You leveled up</b>"
usr<<"You gained [s] Attack"
usr<<"You gained [d] Defense"
usr.Exp = 0
Problem description:
you can attack the mobs but they don't fight back and you can't attack other players.