ID:147989
 
obj
red
Click()
if(usr.team == "red")
if(src.Value =="S")
for(var/turf/O in world) //loops through all stones
if(O.x == src.x || O.y == src.y)
new/obj/hl(O.loc)
O.hled = 1
hl
icon = 'highl.dmi'
var/turf/O
var/obj/hl/H
Click(H)
walk_to(H,O,0)
for(O in world)
if(O.hled == 1)
del(O)




ok its suppose to highlight where u can move, and spies can move all the way in any direction , this code is suppose to make that happen

next is a join bug, when i use it it makes me join both teams :/
mob
verb
join()
if(usr.joined == 0)
usr.joined = 1
if(red == 0)
usr.team = "red"
world << "[usr] joined red team!"
red = 1
see_invisible = 2
see_invisible = 4
if(blue == 0)
usr.team = "blue"
usr.turn = 1
world << "[usr] joined blue team"
blue = 1
see_invisible = 1
see_invisible = 3
else
usr << "you cannot join a game thats full"
else
usr << "you already joined"

the see invisible is for making it look like ur oppenents pieces are facing them, and u can only see urs(that part works)

[edit]
mob
verb
join()
if(usr.joined == 0)
usr.joined = 1
if(red == 0 && blue != 1)
usr.team = "red"
world << "[usr] joined red team!"
red = 1
see_invisible = 2
see_invisible = 4
if(blue == 0 && red !=1)
usr.team = "blue"
usr.turn = 1
world << "[usr] joined blue team"
blue = 1
see_invisible = 1
see_invisible = 3
else
usr << "you already joined"
fixed the join part w/ help from Vermolius
the see invisible is for making it look like ur oppenents pieces are facing them, and u can only see urs(that part works)

Nope, it does not. The way you're using see_invisible will merely make all pieces visible to one team, and some visible to the other.
see_invisible = 2
see_invisible = 4
The first line is useless because you change the var again in the next line.

What you're trying to do can only be done with /image.

fixed the join part w/ help from Vermolius

No offense to Vermolius, but that's an ugly fix. The easiest thing to do would have been to just put in an "else" in your original code.
// the blue!=1 part was bogus; it's redundant
if(!red)
usr.team = "red"
world << "[usr] joined red team!"
red = 1
// here's where the else comes in
else if(!blue)
usr.team = "blue"
usr.turn = 1
world << "[usr] joined blue team"
blue = 1
Overall though the whole system here is problematic. You'd be better off keeping a list of colors and players assigned to them. (I'm working from the assumption though that team play isn't really what you want, in spite of the joining messages you used; the rest of your code is suited to individual play.)
var/list/colors = list("red", "blue")
var/list/playerqueue = list()

mob
var/color

verb/join()
// I'm going to use src here instead of usr, so you can call this
// as a proc if you want to set up a player queue.
if(color) // this var replaces team; you don't seem to have a team game
src << "You are already the [color] player."
return
for(var/c in colors)
if(!colors[c])
color = c
colors[c] = src
world << "[name] is the [c] player."
break
if(!color) // couldn't assign to a color
if(!(src in playerqueue))
world << "[name] is [playerqueue.len+1]\th in the queue."
playerqueue += src
// if a color was picked, show images for each stone
else if(client)
for(var/obj/stone/O)
if(O.color == color)
O.ShowImage(client)

obj/stone
var/color
var/image/im // create this in New() or something

proc/ShowImage(client/C)
if(C && im) C.images += im
That's a rough overview of a much better way to do this.

Lummox JR
In response to Lummox JR
TY!