.Click(mob/M as mob in view())
if(!usr.turn)
usr << "It is not your turn yet!"
return
if(usr.colour == 1)
new /obj/Stones/Black(src)
if(usr.colour == 2)
new /obj/Stones/White(src)
usr.turn = 0
M.turn = 1
Problem description:
Likely just some small, obvious, yet still overlooked thing I'm missing. All the same, I can't figure it out. It works for the most part, except the bit I'm trying to accomplish with the last line. I'm trying to change turns, but it only ends your turn, without beginning your opponent's. What am I doing wrong here?
In Click(), usr is the person doing the clicking, and src is what's being clicked. You can override Click() under specific datums to define specific behavior.
In your case, I imagine you want the turn to change when a piece is placed (via clicking on a tile), so you'd want to store the opponent in a variable somewhere and utilize that variable when trying to reference the opponent in cases where you haven't directly interacted with them.