mob
proc/HitPlayer(var/mob/player/M,var/mob/enemies/E)
var/damage = round(src.Str)-(M.End)
if(damage>=0)
Miss()
return
if(prob(90))
M.HP -= damage
M << "The [src] has attacked you for [damage] damage!"
checkdeadplayer(M,src)
else Miss()
proc/Miss(mob/player/M)
M << "The [src] has missed you!"
proc/checkdeadplayer(var/mob/player/M,var/mob/enemies/E)
if(M.HP <= 0)
usr << "You were killed by the [E]"
usr.loc = locate(/turf/teleports/storymap)
M.HP = M.MaxHP
M.MP = M.MaxMP
mob/enemies
Bump(atom/M)
if(istype(M,/mob/player)) // If they run into the player
HitPlayer()
icon = 'monsters.dmi'
layer = MOB_LAYER-1
slime
icon_state = "slime"
name = "Slime"
areaGroup = "Enemy"
HP = 10
MP = 0
Str = 3
End = 2
Spd = 2
Lck = 2
Int = 0
Exp = 3
Speed = 15
New()
..()
spawn(1)Wander(Speed)
Problem description:
The slime wanders, and attacks when a player is stumbled upon. That world all fine and well. The issue is that when the slime bumps the player I get a runtime error claiming it can't read a null.Str. I've tried adjusting notation (src, var/enemeies/E, etc)
Any tips? This is frustrating >.>