;---------------------------------------------------------------------------
;K-Palette Selection! Config
;Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, K-Palette Selection!]
type = VarSet
trigger1 = 1
v = 27
value = 1

;---------------------------------------------------------------------------
; If value = 1 K-Palette Selection! is ON
; If value = 0 K-Palette Selection! is OFF 
;---------------------------------------------------------------------------

[State 5900, K-Pal Selection! On]
type = helper
triggerall = var(27)&&!numhelper(256)&&!AILevel&&numenemy 
trigger1 = roundno = 1 && matchno=1 && !(teammode = simul) && !(enemy, teammode = simul)
trigger2 = !var(26) 
trigger3 =(teammode = turns)
trigger3 =!roundsexisted && (enemy,roundsexisted)
id = 256
stateno = 256
facing = facing
ownpal = 1
size.xScale = 1
size.yScale = 1

[State 5900, K-Pal Selection! Off]
type = remappal
trigger1 = !var(27)
trigger2 = AILevel && !var(26)
source = 1, 1
dest = 1, palno
ignorehitpause = 1

;---------------------------------------------------------------------------
;Intro
[State 5900, Intro Decider]
type = ChangeState
trigger1 = RoundNo = 1
value = 190+(random%2)

[State 5900, Turns Intro]
type = ChangeState
trigger1 = TeamMode = Turns
trigger1 = !RoundsExisted && RoundNo >= 2
value = 198

[State 5900, End]
type = ChangeState
trigger1 = 1
value = 0