mob/Monster/Tentomon
icon = 'tentomon.dmi'
icon_state = "rookie"
density = 1
HP = 150 // its power
Str = 15
Def = 2
Exp = 100//ow much exp it gives
Money = 100
var/attacking = 0
var/mob/player/P // it is way easyer it type P then to type mob/player all the time :)
New()
. = ..()
spawn()//starts to do the next command
Wander()
proc/Wander()
while(src)//makes sure it is doing it
var/Found = FALSE// flase is the same as 0 and ture means 1, just did diferent for a while XD
for(P in oview(5,src))//if the player is within 5 steps.
step_towards(src,P)//steps towards the player
Found = TRUE
break // makes it so it wont just leave the person it is chasing and go after something else
if(Found != TRUE)
step_rand(src)//steps randomly for a while
sleep(10)
sleep(5)
Bump(mob/M)
if(istype(M,/mob/player))
var/lo = roll(6,20)
Attack(M)
if(lo == 7)
Shocker(M)
proc/Attack(mob/M)
if(!attacking)
attacking = 1
spawn(15)
attacking = 0
flick("attack",src)//shows the mnster attacking. OPTION :)
sleep(15)
var/damage = rand(1,Str) - round(rand(M.Def*0.6,M.Def*1.25))
if(damage <= 0)
damage = 1
M.HP -= damage
M.DeathCheck()
view(src) << "[src] attacks [M]!"//tell people who and what got attacked
view(src) << "[damage] damage!"// says how much damage
proc/Shocker(mob/M)
if(!attacking)
attacking = 1
spawn(5)
attacking = 0
flick("shock",src)//shows the mnster attacking. OPTION :)
sleep(15)
M.mov = 0
Move(loc,dir)
if(M.mov == 0) return 0
return..()
Problem description:
Try to make the mob/M unavaible to move but I get "monsters.dm:385:error: proc definition not allowed inside another proc" on "if(M.mov == 0) return 0"
This is a fix from getting a compile error but not sure if it'll do what you want it to though.
(Oh is the move suppose to make the target unable to move? Should work then but you might want to add a spawn() M.mov = 1 so the person can move after set time)