Code:
Enemy_Two //PURE AGRESSIVE TYPE PLAYER/MONSTER ONLY
icon='Test Monster.dmi'
icon_state = "2"
density = 1
luminosity = 2
HP = 10
MaxHP = 10
MeleeChance = 100
KillRate = 10
AttackRange = 1
Attack_List = list("Normal","Side to Side","Half Rotation","Full Rotation","Pause")
MoveRate = 1
RunChance = 0
SpellChance = 0
Charging = 0
Spell_Picked = 0
Element_Resistance = list("Fire" = 0, "Ice" = 0,"Thunder" = 0, "Aero" = 0, \
"Venom" = 0, "Drain" = 0, "Earth" = 0)
Behavoir() //Pure melee Behavoir
..()
for(var/mob/Base/M in view(1)) // goes on up until view(6), can attack either the Player or Other enemies.
world << 1
if(prob(MeleeChance))
Attack(M, AttackRange, Attack_List, src)//Range - 1
return
else
if(prob(RunChance))
walk_away(M, src, MoveRate, 0)
return
else return
world << "Called return"
return
client/Move()
// . = ..()
// if(.)
var/mob/Base/PC/M = usr
if(M.InDungeon)
if(M.Stamina_Step == M.Stamina_Reduc_Rate)
M.Stamina -= 1 //LATER ADD REMOVAL FROM DUNGEON
else M.Stamina_Step += 1
M.Apply_Effects(M, M.Effect_List)
else //Normal
..()
for(var/mob/Base/Enemy/E in Enemy_List)
E.Behavoir()
Problem description:
This is a single-player game. :p
The Behavoir() is called whenever the Player is in a dungeon.
But within the Dungeon, where ever I am, the monster always says I'm within a range of 1 and calls the Attack proc, (the Attack() is normal because it's MeleeChance is 100%) It could be on a different Z-level altogether and still return a range of 1. The Enemies are loaded into a var/list for easy access.
Before I had changed the coding, I had the monsters loaded into a list that the Player held, this bug happened, so I moved the list to a world thing. An idea I have of the cause would be that since I've coated every Z-level in an area/Darkness (for luminosity darkness) it would show the player as close by somehow, but thats quite far-fetched.
If anyone has any ideas, I'll gladly listen.
Use view(1,src)