Flexible Turn System:
Battle_Control_Basic
var
list
team_a = new
team_b = new
both_teams = new
New(list/playersa,list/playersb)
//place players on respective teams.
both_teams.Add(team_a, team_b)
for(var/mob/m in playersa)
team_a += m
for(var/mob/m in playersb)
team_b += m
//decide which players of either team goes first.
var/list/turn_order = new //determines what order turns are in
var/mob_with_lowest_speed
var/copy_of_both_teams = both_teams
while(turn_order.len < both_teams)
for(var/mob/m in copy_of_both_teams)
if(!mob_with_lowest_speed || m.speed < mob_with_lowest_speed)
mob_with_lowest_speed = m
turn_order += mob_with_lowest_speed
copy_of_both_teams -= mob_with_lowest_speed
mob_with_lowest_speed = null
//run through again determining order of players...
//now that team turn taking is determined, initiate turns in that order
turn_initiate(turn_order)
proc
turn_initiate(list/turn_order)
//to be continued....
Is this effective?
Also, how should I go from here?
'both_teams.Add(team_a, team_b)' should either be after the for loops, or it should be listing playersa/b.
'var/copy_of_both_teams = both_teams' should be defined as a list, and then have both_teams added to it. Otherwise BYOND gets flunky and treats them as the same list.
'while(turn_order.len < both_teams)' I'd do as while(copy_of_both_teams.len), but it should work like you have it.
mob_with_lowest_speed should be defined as a mob, and 'if(... m.speed < mob_with_lowest_speed)' should be checking their speed, not the actual mob.
It would probably be better to have turn_order defined on the datum, instead of passing it around.