ID:165515
 
My turn system doesn't work properly, i'm trying to figure out a way to define player 1 2 3 and 4.That way, I can easily call on them at anytime. This is the closest I can get:

mob
Login()
world<<"[src.name] has logged in"
loc = locate(/turf/start)
icon = 'tank.dmi'
..()
start_battle()

var
letter[]
A
B
C
D
player
count = 0
turn
move = "move"
mob
proc
start_battle()
var/mob/M
for(M in view())
M.count++
if(M.count==0)
M<<"You cannot play against yourself"
return 0
if(M.count==1)
M<<"You are now player one"
M.turn=1
M.move = "done"
if(M.count==2)
M<<"You are now player two"
M.turn=2
M.move = "done"
if(M.count==3)
M<<"You are now player three"
M.turn=3
M.move = "done"
if(M.count==4)
M<<"You are now player four"
M.turn=4
M.move = "done"
if(M.turn==1)
M<<"It is now your turn"
M.move=5


turf
start
turf
ground
icon = 'dirt.dmi'
mob
Move()
if(move=="done")
src<<"It it currently not your turn"
else if(move=="move") ..()
else if(move<=0)
src<<"You are out of moves, click *end turn* to end your turn."
switch(alert(src,"End turn?","END","Yes","No"))
if("Yes")
var/mob/M
M.turn="over"
for(M in view())
if(M.turn==1)
M<<"It is now your turn"
world<<"It is now [M]'s turn"
M.move=5
if(M.turn==2)
M<<"It is now your turn"
world<<"It is now [M]'s turn"
M.move=5
else
src.move--
src<<"You have [src.move] move\s left."
..()
mob
test_dummy
icon = 'tank.dmi'
New()
walk_around()
proc
walk_around()
for()
sleep(2)
walk_rand(src)
This belongs in code problems.