;-| AI Activation Commands |-----------------------------------------------
; From BBH
[Command]
name = "CPU0"
command = U,U,D,D,B,F,B,F,s,s
time = 0

[Command]
name = "CPU1"
command = U,U,D,D,B,F,B,F,a,a
time = 0

[Command]
name = "CPU2"
command = U,U,D,D,B,F,B,F,b,b
time = 0

[Command]
name = "CPU3"
command = U,U,D,D,B,F,B,F,c,c
time = 0

[Command]
name = "CPU4"
command = U,U,D,D,B,F,B,F,x,x
time = 0

[Command]
name = "CPU5"
command = U,U,D,D,B,F,B,F,y,y
time = 0

[Command]
name = "CPU6"
command = U,U,D,D,B,F,B,F,z,z
time = 0

[Command]
name = "CPU7"
command = U,U,D,D,B,F,B,F,a,b
time = 0

[Command]
name = "CPU8"
command = U,U,D,D,B,F,B,F,b,c
time = 0

[Command]
name = "CPU9"
command = U,U,D,D,B,F,B,F,a,c
time = 0

[Command]
name = "CPU10"
command = U,U,D,D,B,F,B,F,x,y
time = 0

[Command]
name = "CPU11"
command = U,U,D,D,B,F,B,F,y,z
time = 0

[Command]
name = "CPU12"
command = U,U,D,D,B,F,B,F,x,z
time = 0

[Command]
name = "CPU13"
command = U,U,D,D,B,F,B,F,a,x
time = 0

[Command]
name = "CPU14"
command = U,U,D,D,B,F,B,F,a,y
time = 0

[Command]
name = "CPU15"
command = U,U,D,D,B,F,B,F,a,z
time = 0

[Command]
name = "CPU16"
command = U,U,D,D,B,F,B,F,b,x
time = 0

[Command]
name = "CPU17"
command = U,U,D,D,B,F,B,F,b,y
time = 0

[Command]
name = "CPU18"
command = U,U,D,D,B,F,B,F,b,z
time = 0

[Command]
name = "CPU19"
command = U,U,D,D,B,F,B,F,c,x
time = 0

[Command]
name = "CPU20"
command = U,U,D,D,B,F,B,F,c,y
time = 0

[Command]
name = "CPU21"
command = U,U,D,D,B,F,B,F,c,z
time = 0

[Command]
name = "CPU22"
command = U,U,D,D,B,F,B,F,x,a
time = 0

[Command]
name = "CPU23"
command = U,U,D,D,B,F,B,F,x,b
time = 0

[Command]
name = "CPU24"
command = U,U,D,D,B,F,B,F,x,c
time = 0

[Command]
name = "CPU25"
command = U,U,D,D,B,F,B,F,y,a
time = 0

[Command]
name = "CPU26"
command = U,U,D,D,B,F,B,F,y,b
time = 0

[Command]
name = "CPU27"
command = U,U,D,D,B,F,B,F,y,c
time = 0

[Command]
name = "CPU28"
command = U,U,D,D,B,F,B,F,z,a
time = 0

[Command]
name = "CPU29"
command = U,U,D,D,B,F,B,F,z,b
time = 0

[Command]
name = "CPU30"
command = U,U,D,D,B,F,B,F,z,c
time = 0

[Command]
name = "CPU31"
command = U,U,D,D,B,F,B,F,s,s,s
time = 0

;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "start"
command = s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

[Command]
name = "holda"
command = /a
time = 1

[Command]
name = "holdb"
command = /b
time = 1

[Command]
name = "holdc"
command = /c
time = 1

[Command]
name = "holdx"
command = /x
time = 1

[Command]
name = "holdy"
command = /y
time = 1

[Command]
name = "holdz"
command = /z
time = 1

[Command]
name = "holdstart"
command = /s
time = 1


[Command]
name = "a2"
command = a
time = 1

[Command]
name = "b2"
command = b
time = 1

[Command]
name = "c2"
command = c
time = 1

[Command]
name = "x2"
command = x
time = 1

[Command]
name = "y2"
command = y
time = 1

[Command]
name = "z2"
command = z
time = 1

[Command]
name = "start2"
command = s
time = 1

[Command]
name = "holdfwd2"
command = /$F
time = 1

[Command]
name = "holdback2"
command = /$B
time = 1

[Command]
name = "holdup2"
command = /$U
time = 1

[Command]
name = "holddown2"
command = /$D
time = 1

[Command]
name = "holda2"
command = /a
time = 1

[Command]
name = "holdb2"
command = /b
time = 1

[Command]
name = "holdc2"
command = /c
time = 1

[Command]
name = "holdx2"
command = /x
time = 1

[Command]
name = "holdy2"
command = /y
time = 1

[Command]
name = "holdz2"
command = /z
time = 1

[Command]
name = "holdstart2"
command = /s
time = 1

[Command]
name = "recovery2"
command = x+y
time = 1

[State -1, AI Helper Check]
type = ChangeState
trigger1 = IsHelper(9741)
value = 9741

[State -1, AI Helper Check 2]
type = ChangeState
trigger1 = IsHelper(9742)
value = 9742

; The CMD file.
;
; Two parts: 1. Command definition and  2. State entry
; (state entry is after the commands def section)
;
; 1. Command definition
; ---------------------
; Note: The commands are CASE-SENSITIVE, and so are the command names.
; The eight directions are:
;   B, DB, D, DF, F, UF, U, UB     (all CAPS)
;   corresponding to back, down-back, down, downforward, etc.
; The six buttons are:
;   a, b, c, x, y, z               (all lower case)
;   In default key config, abc are are the bottom, and xyz are on the
;   top row. For 2 button characters, we recommend you use a and b.
;   For 6 button characters, use abc for kicks and xyz for punches.
;
; Each [Command] section defines a command that you can use for
; state entry, as well as in the CNS file.
; The command section should look like:
;
;   [Command]
;   name = some_name
;   command = the_command
;   time = time (optional -- defaults to 15 if omitted)
;
; - some_name
;   A name to give that command. You'll use this name to refer to
;   that command in the state entry, as well as the CNS. It is case-
;   sensitive (QCB_a is NOT the same as Qcb_a or QCB_A).
;
; - command
;   list of buttons or directions, separated by commas.
;   Directions and buttons can be preceded by special characters:
;   slash (/) - means the key must be held down
;          egs. command = /D       ;hold the down direction
;               command = /DB, a   ;hold down-back while you press a
;   tilde (~) - to detect key releases
;          egs. command = ~a       ;release the a button
;               command = ~D, F, a ;release down, press fwd, then a
;          If you want to detect "charge moves", you can specify
;          the time the key must be held down for (in game-ticks)
;          egs. command = ~30a     ;hold a for at least 30 ticks, then release
;   dollar ($) - Direction-only: detect as 4-way
;          egs. command = $D       ;will detect if D, DB or DF is held
;               command = $B       ;will detect if B, DB or UB is held
;   plus (+) - Buttons only: simultaneous press
;          egs. command = a+b      ;press a and b at the same time
;               command = x+y+z    ;press x, y and z at the same time
;   You can combine them:
;     eg. command = ~30$D, a+b     ;hold D, DB or DF for 30 ticks, release,
;                                  ;then press a and b together
;   It's recommended that for most "motion" commads, eg. quarter-circle-fwd,
;   you start off with a "release direction". This matches the way most
;   popular fighting games implement their command detection.
;
; - time (optional)
;   Time allowed to do the command, given in game-ticks. Defaults to 15
;   if omitted
;
; If you have two or more commands with the same name, all of them will
; work. You can use it to allow multiple motions for the same move.
;
; Some common commands examples are given below.
;
; [Command] ;Quarter circle forward + x
; name = "QCF_x"
; command = ~D, DF, F, x
;
; [Command] ;Half circle back + a
; name = "HCB_a"
; command = ~F, DF, D, DB, B, a
;
; [Command] ;Two quarter circles forward + y
; name = "2QCF_y"
; command = ~D, DF, F, D, DF, F, y
;
; [Command] ;Tap b rapidly
; name = "5b"
; command = b, b, b, b, b
; time = 30
;
; [Command] ;Charge back, then forward + z
; name = "charge_B_F_z"
; command = ~60$B, F, z
; time = 10
;
; [Command] ;Charge down, then up + c
; name = "charge_D_U_c"
; command = ~60$D, U, c
; time = 10
;

;;;;;;;;;;;;
;; AI SET ;;
;;;;;;;;;;;;
[State -1]
type = VarSet
triggerall = roundstate = 2
trigger1 = command = "CPU0"
trigger2 = command = "CPU1"
trigger3 = command = "CPU2"
trigger4 = command = "CPU3"
trigger5 = command = "CPU4"
trigger6 = command = "CPU5"
trigger7 = command = "CPU6"
trigger8 = command = "CPU7"
v = 21
value = 1

[State -1]
type = VarSet
triggerall = roundstate = 2
trigger1 = command = "CPU8"
trigger2 = command = "CPU9"
trigger3 = command = "CPU10"
trigger4 = command = "CPU11"
trigger5 = command = "CPU12"
trigger6 = command = "CPU13"
trigger7 = command = "CPU14"
trigger8 = command = "CPU15"
v = 21
value = 1

[State -1]
type = VarSet
triggerall = roundstate = 2
trigger1 = command = "CPU16"
trigger2 = command = "CPU17"
trigger3 = command = "CPU18"
trigger4 = command = "CPU19"
trigger5 = command = "CPU20"
trigger6 = command = "CPU21"
trigger7 = command = "CPU22"
trigger8 = command = "CPU23"
v = 21
value = 1

[State -1]
type = VarSet
triggerall = roundstate = 2
trigger1 = command = "CPU24"
trigger2 = command = "CPU25"
trigger3 = command = "CPU26"
trigger4 = command = "CPU27"
trigger5 = command = "CPU28"
trigger6 = command = "CPU29"
trigger7 = command = "CPU30"
trigger8 = command = "CPU31"
v = 21
value = 1

;-| Super Motions |--------------------------------------------------------


;-| Special Motions |------------------------------------------------------

[Command]
name = "konamicoderight"
command = U, U, D, D, B, F, B, F, s
time = 100

[Command]
name = "konamicodeleft"
command = U, U, D, D, F, B, F, B, s
time = 100

[Command]
name = "upper_x"
command = ~F, D, DF, x

[Command]
name = "upper_y"
command = ~F, D, DF, y

[Command]
name = "upper_xy"
command = ~F, D, DF, x+y

[Command]
name = "QCF_x"
command = ~D, DF, F, x

[Command]
name = "QCF_a"
command = ~D, DF, F, a

[Command]
name = "QCF_b"
command = ~D, DF, F, b

[Command]
name = "QCF_y"
command = ~D, DF, F, y

[Command]
name = "QCF_xy"
command = ~D, DF, F, x+y

[Command]
name = "QCB_a"
command = ~D, DF, F, a

[Command]
name = "QCB_b"
command = ~D, DF, F, b

[Command]
name = "QCB_x"
command = ~D, DB, B, x

[Command]
name = "FF_ab"
command = F, F, a+b

[Command]
name = "FF_a"
command = F, F, a

[Command]
name = "FF_b"
command = F, F, b

;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery";Required (do not remove)
command = x+y
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

[Command]
name = "forward_a"
command = /$F,a
time = 1

[Command]
name = "forward_x"
command = /$F,x
time = 1

[Command]
name = "sweep"
command = /$B, x
time = 1

;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "start"
command = s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd";Required (do not remove)
command = /$F
time = 1

[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holddown";Required (do not remove)
command = /$D
time = 1

;---------------------------------------------------------------------------
; 2. State entry
; --------------
; This is where you define what commands bring you to what states.
;
; Each state entry block looks like:
;   [State -1, Label]           ;Change Label to any name you want to use to
;                               ;identify the state with.
;   type = ChangeState          ;Don't change this
;   value = new_state_number
;   trigger1 = command = command_name
;   . . .  (any additional triggers)
;
; - new_state_number is the number of the state to change to
; - command_name is the name of the command (from the section above)
; - Useful triggers to know:
;   - statetype
;       S, C or A : current state-type of player (stand, crouch, air)
;   - ctrl
;       0 or 1 : 1 if player has control. Unless "interrupting" another
;                move, you'll want ctrl = 1
;   - stateno
;       number of state player is in - useful for "move interrupts"
;   - movecontact
;       0 or 1 : 1 if player's last attack touched the opponent
;                useful for "move interrupts"
;
; Note: The order of state entry is important.
;   State entry with a certain command must come before another state
;   entry with a command that is the subset of the first.
;   For example, command "fwd_a" must be listed before "a", and
;   "fwd_ab" should come before both of the others.
;
; For reference on triggers, see CNS documentation.
;
; Just for your information (skip if you're not interested):
; This part is an extension of the CNS. "State -1" is a special state
; that is executed once every game-tick, regardless of what other state
; you are in.


; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

;--------------------------------------------------------------------------;-
;Run Fwd
;ダッシュ
;[State -1, Run Fwd]
;type = ChangeState
;value = 100
;trigger1 = command = "FF"
;trigger1 = statetype = S
;trigger1 = ctrl

;--------------------------------------------------------------------------;-
;Run Back
;後退ダッシュ
;[State -1, Run Back]
;type = ChangeState
;value = 105
;trigger1 = command = "BB"
;trigger1 = statetype = S
;trigger1 = ctrl

;===========================================================================
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Out of Bullets
[State -1, GunSound]
type = PlaySnd
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) <= 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
value = 1,1

;--------------------------------------------------------------------------
;Sonic Round
[State -1, JumpSoundP1]
type = PlaySnd
triggerall = !IsHelper
triggerall = MatchNo+var(24) = 5
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = (TeamSide = 1 || (TeamSide = 2 && enemy,Name = "XTSM"))
trigger1 = Command = "a" && NumHelper(25481) = 0 
trigger2 = Command = "b" && var(29) >= 1 && NumHelper(25482) = 0
trigger3 = Command = "c" && var(29) >= 2 && NumHelper(25483) = 0
value = 0,12

[State -1, CreateSonic]
type = Helper
triggerall = !IsHelper
triggerall = MatchNo+var(24) = 5
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
triggerall = NumHelper(25481) = 0 
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
helpertype = normal
name = "Sonic"
ID = 25481
postype = p1
ownpal = 1
stateno = 25481
pos = 0,floor(240-Pos Y)

[State -1, CreateTails]
type = Helper
triggerall = !IsHelper
triggerall = MatchNo+var(24) = 5
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "b"
triggerall = NumHelper(25482) = 0
triggerall = var(29) >= 1 
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
helpertype = normal
name = "Tails"
ID = 25482
postype = p1
ownpal = 1
stateno = 25481
pos = 0,floor(240-Pos Y)

[State -1, CreateKnuckles]
type = Helper
triggerall = !IsHelper
triggerall = MatchNo+var(24) = 5
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "c"
triggerall = NumHelper(25483) = 0
triggerall = var(29) >= 2 
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
helpertype = normal
name = "Knuckles"
ID = 25483
postype = p1
ownpal = 1
stateno = 25481
pos = 0,floor(240-Pos Y)


;--------------------------------------------------------------------------
;Star Wars Round
[State -1, BlasterSound]
type = PlaySnd
triggerall = MatchNo+var(24) = 4
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
value = 0,9+RoundNo+var(25)

;Fireball Hit Spark
[State -1, Attack]
type = Projectile
triggerall = MatchNo+var(24) = 4
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
attr = S,N
sparkno = -1
projanim = IfElse(RoundNo+var(25)=1,10009,10012)
affectteam = B
projremovetime = IfElse(RoundNo+var(25)=1,12,6)
projsprpriority = -1
projremove = 0

;X-Wing Laser (Upper Left)
[State -1, LaserUL]
type = Explod
triggerall = MatchNo+var(24) = 4
triggerall = RoundNo+var(25) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
anim = 10010
ID = 10010
postype = left
bindtime = 1
removetime = 6
ownpal = 1
sprpriority = -2
pos = floor(ScreenPos X-50),floor(ScreenPos Y-50)
vel = 7,7

;X-Wing Laser (Upper Right)
[State -1, LaserUR]
type = Explod
triggerall = MatchNo+var(24) = 4
triggerall = RoundNo+var(25) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
anim = 10011
ID = 10010
postype = left
bindtime = 1
removetime = 6
ownpal = 1
sprpriority = -2
pos = floor(ScreenPos X+50),floor(ScreenPos Y-50)
vel = -7,7

;X-Wing Laser (Lower Left)
[State -1, LaserLL]
type = Explod
triggerall = MatchNo+var(24) = 4
triggerall = RoundNo+var(25) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
anim = 10011
ID = 10010
postype = left
bindtime = 1
removetime = 6
ownpal = 1
sprpriority = -2
pos = floor(ScreenPos X-50),floor(ScreenPos Y+50)
vel = 7,-7

;X-Wing Laser (Lower Right)
[State -1, LaserUR]
type = Explod
triggerall = MatchNo+var(24) = 4
triggerall = RoundNo+var(25) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
anim = 10010
ID = 10010
postype = left
bindtime = 1
removetime = 6
ownpal = 1
sprpriority = -2
pos = floor(ScreenPos X+50),floor(ScreenPos Y+50)
vel = -7,-7

;Increase shot count
[State -1, IncreaseShot]
type = VarAdd
triggerall = MatchNo+var(24) = 4
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && var(28) = 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,var(28) = 0
v = 9
value = 1

;--------------------------------------------------------------------------
;Mario Round
[State -1, FireBall]
type = PlaySnd
triggerall = MatchNo+var(24) = 3
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
value = 0,9

;Fireball Hit Spark
[State -1, Attack]
type = Projectile
triggerall = MatchNo+var(24) = 3
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
attr = S,N
sparkno = -1
projanim = 10008
affectteam = B
projremovetime = 9
projsprpriority = -1
projremove = 0

;Increase shot count
[State -1, IncreaseShot]
type = VarAdd
triggerall = MatchNo+var(24) = 3
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1
trigger2 = TeamSide = 2 && enemy,Name = "XTSM"
v = 9
value = 1

;--------------------------------------------------------------------------
;Duck Hunt Round
;Zapper
[State -1, Zapper]
type = PlaySnd
triggerall = MatchNo+var(24) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && NumHelper(25403) > 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,NumHelper(25403) > 0
value = 0,8

;Make screen flash
[State -1, ScreenFlash]
type = AllPalFX
triggerall = MatchNo+var(24) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && NumHelper(25403) > 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,NumHelper(25403) > 0
time = 1
add = 256,256,256
mul = 256,256,256

;Zapper Fire
[State -1, Attack]
type = Projectile
triggerall = MatchNo+var(24) = 2
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && NumHelper(25403) > 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,NumHelper(25403) > 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
attr = S,N
sparkno = -1
projanim = 10007
affectteam = B
projremovetime = 2
projsprpriority = -1
projremove = 0

;Increase shot count
[State -1, IncreaseShot]
type = VarAdd
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && NumHelper(25403) > 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,NumHelper(25403) > 0
v = 9
value = 1

;Take Away Bullets
[State -1, Attack]
type = VarAdd
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = Command = "a"
trigger1 = TeamSide = 1 && NumHelper(25403) > 0
trigger2 = TeamSide = 2 && enemy,Name = "XTSM" && enemy,NumHelper(25403) > 0
v = 5
value = -1

;---------------------------------------------------------------------------
;Lethal Enforcers II Round
;Gun Sound
[State -1, GunSound]
type = PlaySnd
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
trigger2 = command = "holda" && var(7) = 1 && GameTime%6 = 0
trigger3 = command = "holda" && var(7) = 3 && GameTime%5 = 0
trigger4 = command = "holda" && var(7) = 4 && GameTime%4 = 0
trigger5 = command = "holda" && var(7) = 5 && GameTime%4 = 0
value = 0,var(7)
volume = IfElse(var(7)=5,-80,0)

;Gun Fire
[State -1, Attack]
type = Projectile
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
triggerall = var(5) > 0
triggerall = RoundState = 2
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
trigger2 = command = "holda" && var(7) = 1 && GameTime%6 = 0
trigger3 = command = "holda" && var(7) = 3 && GameTime%5 = 0
trigger4 = command = "holda" && var(7) = 4 && GameTime%4 = 0
trigger5 = command = "holda" && var(7) = 5 && GameTime%4 = 0
attr = S,N
sparkno = -1
projanim = 10000+var(7)
affectteam = B
projremovetime = IfElse(var(7)=6,8,IfElse(var(7)=1,6,IfElse(var(7)=2,32,IfElse(var(7)=5,16,8))))
offset = IfElse(var(7)=5,facing*-Pos X,0),IfElse(var(7)=5,-Pos Y+20,0)
velocity = IfElse(var(7)=5,facing*(Pos X+Pos X)/32,0),IfElse(var(7)=5,(Pos Y+Pos Y-20)/32,0)
projsprpriority = -1
projremove = 0

;Extra Gatling Gun Bullets
[State -1, GGBullets]
type = Projectile
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "holda" && var(7) = 1 && GameTime%6 = 0
attr = S,N
sparkno = -1
projanim = 10000+var(7)
affectteam = B
projremovetime = 6
offset = 0,-20
projsprpriority = -1
projremove = 0

[State -1, GGBullets]
type = Projectile
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "holda" && var(7) = 1 && GameTime%6 = 0
attr = S,N
sparkno = -1
projanim = 10000+var(7)
affectteam = B
projremovetime = 6
offset = 20,0
projsprpriority = -1
projremove = 0

[State -1, GGBullets]
type = Projectile
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "holda" && var(7) = 1 && GameTime%6 = 0
attr = S,N
sparkno = -1
projanim = 10000+var(7)
affectteam = B
projremovetime = 6
offset = 0,20
projsprpriority = -1
projremove = 0

[State -1, GGBullets]
type = Projectile
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
damage = IfElse(TeamSide=1,1,3),IfElse(TeamSide=1,1,3)
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "holda" && var(7) = 1 && GameTime%6 = 0
attr = S,N
sparkno = -1
projanim = 10000+var(7)
affectteam = B
projremovetime = 6
offset = -20,0
projsprpriority = -1
projremove = 0

;Reload Vocal
[State -1, ReloadVocal]
type = PlaySnd
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) = 1
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
trigger2 = command = "holda" && var(7) = 1 && GameTime%6 = 0
trigger3 = command = "holda" && var(7) = 3 && GameTime%5 = 0
trigger4 = command = "holda" && var(7) = 4 && GameTime%4 = 0
trigger5 = command = "holda" && var(7) = 5 && GameTime%4 = 0
value = 1,2

;Take Away Bullets
[State -1, Attack]
type = VarAdd
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
trigger2 = command = "holda" && var(7) = 1 && GameTime%6 = 0
trigger3 = command = "holda" && var(7) = 3 && GameTime%5 = 0
trigger4 = command = "holda" && var(7) = 4 && GameTime%4 = 0
trigger5 = command = "holda" && var(7) = 5 && GameTime%4 = 0
v = 5
value = -1

;Increase shot count
[State -1, IncreaseShot]
type = VarAdd
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
triggerall = var(5) > 0
triggerall = !(Pos Y = [18,20])
trigger1 = command = "a"
trigger2 = command = "holda" && var(7) = 1 && GameTime%6 = 0
trigger3 = command = "holda" && var(7) = 3 && GameTime%5 = 0
trigger4 = command = "holda" && var(7) = 4 && GameTime%4 = 0
trigger5 = command = "holda" && var(7) = 5 && GameTime%4 = 0
v = 9
value = 1

;Reload Sound
[State -1, ReloadSound]
type = PlaySnd
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
trigger1 = Pos Y = [18,20]
trigger1 = command = "a"
value = 1,0

;Reload
[State -1, Reload]
type = VarSet
triggerall = MatchNo+var(24) = 1
triggerall = var(21) = 0
triggerall = var(3) > 0
triggerall = RoundState = 2
trigger1 = Pos Y = [18,20]
trigger1 = command = "a"
v = 5
value = IfElse(var(7)=0,8,IfElse(var(7)=1,30,IfElse(var(7)=2,15,IfElse(var(7)=3,60,IfElse(var(7)=4,45,IfElse(var(7)=5,50,20))))))
;---------------------------------------------------------------------------

;Game Over.  Press Start to Resume Play
[State -1, CoinSound]
type = PlaySnd
triggerall = var(21) = 0
triggerall = var(3) <= 0
triggerall = RoundState = 2
trigger1 = command = "start"
value = 1,3

[State -1, Take Away Points]
type = VarAdd
triggerall = var(21) = 0
triggerall = RoundState = 2
triggerall = var(3) <= 0
trigger1 = command = "start"
v = 1
value = -1000

[State -1, Reset Lives]
type = VarSet
triggerall = var(21) = 0
triggerall = RoundState = 2
triggerall = var(3) <= 0
trigger1 = command = "start"
v = 3
value = IfElse(var(20)=1,10,5)