Arrows
North
icon_state = "N"
screen_loc = "2,3"
Click()
..()
if(usr.Turn == 1)
var/mob/Units/A = usr.Selected_Unit
if(A && A.MovePoints != 0)//Moves unit
A.Move(get_step(A,NORTH),NORTH)
spawn(1)
walk(A,0)
A.MovePoints --
for(var/mob/Units/M in A.dir) //Checks for hostile units in your units dir
if(M.owner != A.owner)
var/W = input(A.owner,"Combat has broke out! What shall you do?") in list("Attack","Skill")
switch(W)
if("Attack")
M.overlays += image('Atts.dmi',"Sword")
var/PFC = rand(1,6) //Probability for critical
if(PFC <= 2)
var/Damage = round(A.Strength*2 - M.Defence-5)
M.Damage(M,Damage)
else
var/Damage = round(A.Strength - M.Defence)
M.Damage(M,Damage)
spawn(3)
M.overlays -= image('Atts.dmi',"Sword")
if(!A)
world.log << "Error. [A]([A.owner]) doesn't exist."
if(A.MovePoints == 0)
usr << "[A] has no more movement points left."
else
usr << "It's not your turn!"
Problem description:
For some reason, if there is a hostile unit in your selected unit's direction, nothing happens. I made a simple proc to browse the units variables, and I am the owner, but nothing pops up.. Any help on why?