proc
FightFinish(mob/A,mob/B)
begin
if(A.hp <= 0 && A.tourny == 1) /// YOU MIGHT HAVE TO CHANGE THIS INCASE YOUR HP VAR IS DIFF, see: your death proc for more info
world<<"<font color = white><font face = 'Comic Sans MS'>[B] has won against [A]!"
B.Battle = 0
A.Battle = 0
Entries.Remove(A)
A.hp = A.maxhp
A.loc = locate(1,3,1)
B.loc=locate(10,107,3)
Tournament_AI()
return // stop runtime errors
if(B.hp <= 0 && A.tourny == 1) /// YOU MIGHT HAVE TO CHANGE THIS INCASE YOUR HP VAR IS DIFF, SEE: your death proc for more info
world<<"<font color = white><font face = 'Comic Sans MS'>[A] has won against [B]!"
B.Battle = 0
A.Battle = 0
Entries.Remove(B)
B.hp = A.maxhp
B.loc = locate(1,3,1)
A.loc=locate(10,107,3)
Tournament_AI()
return // stop runtime errors
else
spawn(200)
goto begin
proc
Tournament_AI()
if(Entries.len==1)
world<<"<font color = white><font face = 'Comic Sans MS'>Tournament over, winner is:"
for(var/mob/K in Entries)
world<<K
Entries.Remove(K)
for(var/mob/M in world)
if(M.client)
M.verbs-=typesof(/mob/learn/verb/Join)
M.tourny=0
Tournament=0
return
doit
for(var/mob/M in world)
if(M.tourny)
var/A=pick(Entries)
var/B=pick(Entries)
if(A==B)
goto doit
sleep(10)
M<<"<font color = white><font face = 'Comic Sans MS'>Tournament Announcer: Okay lets start this match!"
sleep(20)
M<<"<font color = white><font face = 'Comic Sans MS'>Tournament Announcer: This match will be..."
sleep(30)
M<<"<font color = white><font face = 'Comic Sans MS'>Tournament Announcer: [A] .VS. [B]!"
B:loc=locate(16,115,3) /// locate them to a specific place.
A:loc=locate(4,115,3) /// locate them to a specific place.
sleep(30)
M<<"<font color = white><font face = 'Comic Sans MS'> Fight!"
A:Battle = 1
B:Battle = 1
FightFinish(A,B)
Problem description: For some reason whenever I host the tourny it picks one A, and one B, then a couple of seconds later 2 more people come in even though the battle isn't over. Any way to fix this, All help appreciated.
Ungh. No put : operator in code.