Problem... Probably some newbie mistake of mine. in Developer Help
|
|
Red_Warrior
icon = 'troops.dmi'
icon_state = "p1w"
var
ATK=3
RNG=1
AC=9
W=1
type2 = "troop"
Click(mob/a)
if(player2==usr.key)
return
if(turn==1)
switch(alert("Issue an Order","Which order do you want to issue?","Move","Attack","Cancel"))
if("Move")
var/select=input("What direction?","Choose a direction.") in list ("North","South","East","West")
if(select=="North")
for(var/mob/o in world)if(o==src)step(o,NORTH)
Turn()
if(select=="South")
for(var/mob/o in world)if(o==src)step(o,SOUTH)
Turn()
if(select=="East")
for(var/mob/o in world)if(o==src)step(o,EAST)
Turn()
if(select=="West")
for(var/mob/o in world)if(o==src)step(o,WEST)
Turn()
if("Attack")
for(var/mob/m in oview(1)) if(type2=="troop")
usr << "[m] and [src]."
if(m.Owner==1)
usr << "You can't attack that."
return
world << "[src] attacks [m]!"
var/roll = rand(1,20)
world << "[src] rolls a [roll]."
roll = roll + src.ATK
if(roll<=m:AC)
world << "[src] misses."
Turn()
world << "[src] hits [m], and inflicts one wound."
m:W--
if(m:W==0)
m:Death()
Turn()
The problem here is that the troop will move just fine, however... It won't attack other troops in its oview, it'll only attack invisible usrs. Help?
|
No use colon operator. Ungh.
No conflate usr with player. Ungh!
Lummox JR