;================================================================================
;                       ANDY BOGARD: Parte uno... Principal.
;================================================================================
; VAR:  9 = AI
;      17 = Codigo ADVANCE
;      23 = Barra TIME

[Data]
life = 1000
attack = 100
defence = 100
fall.defence_up = 50
liedown.time = 60
airjuggle = 15
sparkno = 0
guard.sparkno = 0
KO.echo = 0
volume = 100
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1
yscale = 1
ground.back = 15
ground.front = 16
air.back = 12
air.front = 12
height = 60
attack.dist = 160
proj.attack.dist = 90
proj.doscale = 0
head.pos = -5, -82
mid.pos = -5, -60
shadowoffset = 0
draw.offset = 0,1

[Velocity]
walk.fwd  = 2.7
walk.back = -2.8
run.fwd  = 6.1
run.back = -5,-3.5
jump.neu = 0,-8.5
jump.back = -2.9
jump.fwd = 2.9
runjump.back = -3.1,-8.9
runjump.fwd = 4,-8.9
airjump.neu = 0,-8.2
airjump.back = -2.55
airjump.fwd = 2.5

[Movement]
airjump.num = 0
airjump.height = 35
yaccel = .44
stand.friction = .8
crouch.friction = .8

;-------------------------------------------------------------
; Salto (inicio)
[Statedef 40]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 40, 2]
type = VarSet
trigger1 = Time = 0
var(5) = 0

[State 40, 3]
type = VarSet
trigger1 = command = "jump"
trigger2 = prevstateno = 101 && command = "holdfwd"
var(5) = 1

[State 40, 4]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 40, 5]
type = VarSet
trigger1 = command = "holdback"
sysvar(1) = -1

[State 40, 6]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x)))
y = const(velocity.jump.y)

[State 40, 9]
type = ChangeState
trigger1 = AnimTime = 0 && command != "holdup"
value = 950
ctrl = 1

[State 40, 10]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

; Salto (arriba)
[Statedef 50]
type    = A
physics = A

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = VelSet
trigger1 = Time = 0 && Var(5)
x = IfElse(vel x = 0,0,IfElse(vel x < 0,-5,5))

[State 50, 3]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 4]
type = AfterImage
trigger1 = Time = 0 && Var(5) && Vel X != 0
time = 10
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

; Salto corto
[Statedef 950]
type = A
movetype = I
physics = A
anim = 950

[State 950, 1]
type = VelSet
trigger1 = Time = 0
x = IfElse(vel x = 0,0,IfElse(vel x < 0,-3,3))
y = -7

[State 950, 2]
type = VelSet
trigger1 = Time = 0 && Var(5)
x = IfElse(vel x = 0,0,IfElse(vel x < 0,-5,5))

[State 950, 3]
type = AfterImage
trigger1 = Time = 0 && Var(5) && Vel X != 0
time = 10
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 950, 4]
type = ChangeState
trigger1 = Pos Y >= 0 && Vel Y > 0
value = 52

; Salto (aterrizaje)
[Statedef 52]
type    = S
physics = S
ctrl = 1
anim = 47
velset = 0,0
facep2 = 1

[State 52, Landing Sound]
type = PlaySnd
trigger1 = Time = 0
value = 0, 2

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 52, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Correr
[Statedef 100]
type = S
movetype = I
physics = S
anim = 100
velset = 0
ctrl = 0

[State 100, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 101

[Statedef 101]
type = S
movetype = I
physics = S
anim = 101
ctrl = 0

[State 100, 1]
type = VelSet
trigger1 = 1
x = const(velocity.run.fwd.x)

[State 100, 0]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0,3
loop = 1
channel = 1

[State 101, 3]
type = ChangeState
trigger1 = command = "holdup"
value = 40

[State 100, 5.1]
type = ChangeState
triggerall = var(9) = 0
trigger1 = AnimElem = 3, >= 0
trigger1 = command != "holdfwd"
value = 102

[State 100, 5.2]
type = ChangeState
trigger1 = var(9) = 1
trigger1 = AnimElem = 3, >= 0
trigger1 = P2bodydist X <= 40
value = 102

[Statedef 102]
type = S
movetype = I
physics = S
anim = 102

[State 102, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = 102

[State 106, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 106, 2]
type = PosSet
trigger1 = Time = 0
y = 0

[State 106, 3]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

[State 106, 4]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Perder (Time Over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;---------------------------------------------------------------------------
; Win pose
[Statedef 180]
type = S

[State 180, 1]
type = VarRandom
trigger1 = Time = 0
v = 8
range = 1,4

[State 180, 2] ;Choose win1
type = VarSet
trigger1 = Command = "hold_x"
v = 8
value = 1

[State 180, 3] ;Choose win2
type = VarSet
trigger1 = Command = "hold_a"
v = 8
value = 2

[State 180, 5] ;Choose win3
type = VarSet
trigger1 = Command = "hold_y"
v = 8
value = 3

[State 180, 6] ;Choose win4
type = VarSet
trigger1 = Command = "hold_b"
v = 8
value = 4

[State 180, 2]
type = ChangeState
trigger1 = Time = 0
trigger1 = var(15) = 1
trigger1 = matchover
value = 189

[State 180, 1]
type = ChangeState
trigger1 = Var(8) = 1
value = 181

[State 180, 2]
type = ChangeState
trigger1 = Var(8) = 2
value = 182

[State 180, 3]
type = ChangeState
trigger1 = Var(8) = 3
value = 183

[State 180, 4]
type = ChangeState
trigger1 = Var(8) = 4
value = 184
;---------------------------------------------------------------------------
; Win pose 1 (firme, de cara a la pantalla)
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, end]
type = AssertSpecial
trigger1 = time < 350
flag = RoundNotOver

[State 181, 0]
type = PlaySnd
trigger1 = AnimElem = 5
value = S20, 2

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Perfect msg]
type = Explod
trigger1 = time = 0
trigger1 = life = 1000
anim = F10000
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [500,999]
anim = F10001
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [100,499]
anim = F10002
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [1,99]
anim = F10003
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0

; Winpose Finish
[State 181, 4]
type = AssertSpecial
triggerall = Matchover
trigger1 = time = [319,810]
flag = roundnotover

[State 3800, KillMAX]
type = VarSet
trigger1 = time = 2
v = 17
value = 0

[State 181, 5]
type = EnvColor
trigger1 = MatchOver && time = 320
value = 0,0,0
time = 3

[State 181, 6]
type = EnvColor
trigger1 = MatchOver && time = 324
value = 255,255,255
time = 3

[State 181, 7]
type = AssertSpecial
trigger1 = Matchover && time > 320
flag = NoMusic

[State 181, 17]
type = PlaySnd
triggerall = MatchOver
trigger1 = time = 324
value = 2,6

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 327 && MatchOver
anim = 9410
pos = 0,0
postype = left
sprpriority = 99990
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 500 && MatchOver
anim = 9400
pos = 0,0
postype = left
sprpriority = 99991
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 520 && MatchOver
anim = 9500+(random%5)
pos = 0,0
postype = left
sprpriority = 99999
ownpal = 1
removetime = 999999

[State 181, 16]
type = AssertSpecial
trigger1 = MatchOver = 1 && time >= 320
flag = nobardisplay
flag2 = noFG
flag3 = invisible

;-----------------------------------------------------------
; Win pose 2 (de espalda a la pantalla)
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 181, end]
type = AssertSpecial
trigger1 = time < 350
flag = RoundNotOver

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Perfect msg]
type = Explod
trigger1 = time = 0
trigger1 = life = 1000
anim = F10000
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [500,999]
anim = F10001
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [100,499]
anim = F10002
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [1,99]
anim = F10003
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0

; Winpose Finish
[State 181, 4]
type = AssertSpecial
triggerall = Matchover
trigger1 = time = [319,810]
flag = roundnotover

[State 3800, KillMAX]
type = VarSet
trigger1 = time = 2
v = 17
value = 0

[State 181, 5]
type = EnvColor
trigger1 = MatchOver && time = 320
value = 0,0,0
time = 3

[State 181, 6]
type = EnvColor
trigger1 = MatchOver && time = 324
value = 255,255,255
time = 3

[State 181, 7]
type = AssertSpecial
trigger1 = Matchover && time > 320
flag = NoMusic

[State 181, 17]
type = PlaySnd
triggerall = MatchOver
trigger1 = time = 324
value = 2,6

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 327 && MatchOver
anim = 9410
pos = 0,0
postype = left
sprpriority = 99990
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 500 && MatchOver
anim = 9400
pos = 0,0
postype = left
sprpriority = 99991
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 520 && MatchOver
anim = 9500+(random%5)
pos = 0,0
postype = left
sprpriority = 99999
ownpal = 1
removetime = 999999

[State 181, 16]
type = AssertSpecial
trigger1 = MatchOver = 1 && time >= 320
flag = nobardisplay
flag2 = noFG
flag3 = invisible

;-----------------------------------------------------------
; Win Pose 3 (maniobras varias con las manos[long])
[Statedef 183]
type = S
ctrl = 0
anim = 186
velset = 0,0

[State 181, end]
type = AssertSpecial
trigger1 = time < 350
flag = RoundNotOver

[State 186, 1]
type = PlaySnd
trigger1 = AnimElem = 15
value = S20, 1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Perfect msg]
type = Explod
trigger1 = time = 0
trigger1 = life = 1000
anim = F10000
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [500,999]
anim = F10001
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [100,499]
anim = F10002
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [1,99]
anim = F10003
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0

; Winpose Finish
[State 181, 4]
type = AssertSpecial
triggerall = Matchover
trigger1 = time = [319,810]
flag = roundnotover

[State 3800, KillMAX]
type = VarSet
trigger1 = time = 2
v = 17
value = 0

[State 181, 5]
type = EnvColor
trigger1 = MatchOver && time = 320
value = 0,0,0
time = 3

[State 181, 6]
type = EnvColor
trigger1 = MatchOver && time = 324
value = 255,255,255
time = 3

[State 181, 7]
type = AssertSpecial
trigger1 = Matchover && time > 320
flag = NoMusic

[State 181, 17]
type = PlaySnd
triggerall = MatchOver
trigger1 = time = 324
value = 2,6

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 327 && MatchOver
anim = 9410
pos = 0,0
postype = left
sprpriority = 99990
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 500 && MatchOver
anim = 9400
pos = 0,0
postype = left
sprpriority = 99991
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 520 && MatchOver
anim = 9500+(random%5)
pos = 0,0
postype = left
sprpriority = 99999
ownpal = 1
removetime = 999999

[State 181, 16]
type = AssertSpecial
trigger1 = MatchOver = 1 && time >= 320
flag = nobardisplay
flag2 = noFG
flag3 = invisible

;-------------------------------
; Win pose 4 (maniobras varias con las manos[short])
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

[State 181, end]
type = AssertSpecial
trigger1 = time < 340
flag = RoundNotOver

[State 184, 2]
type = PlaySnd
trigger1 = AnimElem = 5
value = S20, 1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 181, Perfect msg]
type = Explod
trigger1 = time = 0
trigger1 = life = 1000
anim = F10000
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [500,999]
anim = F10001
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [100,499]
anim = F10002
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0
[State 181, Normal KO]
type = Explod
trigger1 = time = 0
trigger1 = life = [1,99]
anim = F10003
pos = 0,0
postype = Left
facing = 1
sprpriority = 9
ownpal = 0

; Winpose Finish
[State 181, 4]
type = AssertSpecial
triggerall = Matchover
trigger1 = time = [319,810]
flag = roundnotover

[State 3800, KillMAX]
type = VarSet
trigger1 = time = 2
v = 17
value = 0

[State 181, 5]
type = EnvColor
trigger1 = MatchOver && time = 320
value = 0,0,0
time = 3

[State 181, 6]
type = EnvColor
trigger1 = MatchOver && time = 324
value = 255,255,255
time = 3

[State 181, 7]
type = AssertSpecial
trigger1 = Matchover && time > 320
flag = NoMusic

[State 181, 17]
type = PlaySnd
triggerall = MatchOver
trigger1 = time = 324
value = 2,6

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 327 && MatchOver
anim = 9410
pos = 0,0
postype = left
sprpriority = 99990
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 500 && MatchOver
anim = 9400
pos = 0,0
postype = left
sprpriority = 99991
ownpal = 1
removetime = 999999

[State 181, 8]; Box (up)
type = Explod
trigger1 = time = 520 && MatchOver
anim = 9500+(random%5)
pos = 0,0
postype = left
sprpriority = 99999
ownpal = 1
removetime = 999999

[State 181, 16]
type = AssertSpecial
trigger1 = MatchOver = 1 && time >= 320
flag = nobardisplay
flag2 = noFG
flag3 = invisible

;------------------------------------------------------------------
[Statedef 189]
type = S
movetype = I
physics = S
anim = 0

[State 184, 1]
type = AssertSpecial
trigger1 = Time = 0
flag = RoundNotOver
;-------------------------------------------------------------------
; INTROS
[Statedef 190]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Joe Higashi" || p4name = "Joe Higashi"
value = 192

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Geese Howard" || p4name = "Geese Howard"
value = 193

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Terry Bogard" || p4name = "Terry Bogard"
value = 196

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Mai Shiranui" || p4name = "Mai Shiranui"
value = 197

[State 192, 1]
type = ChangeState
triggerall = Time = 0
trigger1 = P2name = "R_Fullpower"
value = 0

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 198

;-------------------------------------------
; Normal
[Statedef 198]
type = S
ctrl = 0
anim = 194
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = animelem = 8
value = 0,9

[State 191, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-------------------------------------------
; vs Terry
[Statedef 196]
type = S
ctrl = 0
anim = 197
velset = 0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 8
value = 0, 5

[State 191, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-------------------------------------------
; vs Mai
[Statedef 197]
type = S
ctrl = 0
anim = 198
velset = 0, 0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-------------------------------------------
; vs Joe
[Statedef 192]
type = S
ctrl = 0
anim = 196
velset = 0,0

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-------------------------------------------
; vs Geese
[Statedef 193]
type = S
ctrl = 0
anim = 193
velset = 0,0

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 9,9

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 191, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;-----------------------------------------------------------
; Burlas
[Statedef 195]
type = S
movetype = A
physics = S
anim = 195

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = 20,0

[State 195, 2]
type = ChangeState
triggerall = roundstate = 2
triggerall = time > 20
trigger1 = command = "holdback"
trigger2 = command = "holdfwd"
value = 20

[State 195, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;------------------------------------------------------------------------
;----------------------------------Evasiones-----------------------------
;------------------------------------------------------------------------
; Evasion
[Statedef 362]
type = S
movetype = I
physics = S
anim = 362
velset = 0
ctrl = 0
sprpriority = -1

[State 350, 1]
type = NotHitBy
trigger1 = AnimElem = 6,< 0
value = ,NA,NP,SA,SP,HA,HP

[State 350, 1]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Evasion + contrataque
[Statedef 363]
type = S
movetype = A
physics = S
anim = 363
poweradd = 0
juggle = 10
velset = 0
ctrl = 0
facep2 = 1

[State 220, 1]
type = PlaySnd
trigger1 = AnimElem = 2
;trigger2 = AnimElem = 3
value = 2,1

[State 200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 102,1

[State 220, 2]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 69
animtype = medium
hitflag = MAF
guardflag = MA
sparkno = S4050
guard.sparkno = S4110
sparkxy = -25,-70
hitsound = S200,3
guardsound = S3,0
pausetime = 12,13
ground.hittime = 17
ground.type = high
ground.slidetime = 17
ground.velocity = -12.3
air.velocity = -3,-4
hit.priority = 1
hit.getpower = 10

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Rodar adelante (normal)
[Statedef 361]
type = S
physics = S
anim = 361
sprpriority = -1
poweradd = 0
velset = 0,0
ctrl = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1,0

[State 350, hit]
type = HitBy
trigger1 = time <= 27
value =  , AT

[State 350, hit]
type = NotHitBy
trigger1 = time <= 27
value = , AA, AP

[State 705, 1]
type = velset
trigger1 = Time = [9,25]
x = 5

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Rodar adelante (barra TIME)
[Statedef 366]
type = S
physics = S
anim = 361
sprpriority = -1
poweradd = 0
velset = 0,0
ctrl = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1,0

[State 350, hit]
type = HitBy
trigger1 = time <= 27
value =  , AT

[State 350, hit]
type = NotHitBy
trigger1 = time <= 27
value = , AA, AP

[State 290, Drain]
type = VarAdd
trigger1 = time = 0
v = 17
value = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 20
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 2041, 2]
type = Afterimagetime
trigger1 = stateno = 366
trigger1 = time%2 = 0 && Time < 20
time = 2

[State 705, 1]
type = velset
trigger1 = Time = [9,25]
x = 5

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; Rodar atras (normal)
[Statedef 360]
type = S
physics = S
anim = 360
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, hit]
type = HitBy
trigger1 = time <= 27
value =  , AT

[State 350, hit]
type = NotHitBy
trigger1 = time <= 27
value = , AA, AP

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1,0

[State 705, 1]
type = velset
trigger1 = Time = [9,25]
x = -5

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

; rodar atras (barra TIME)
[Statedef 365]
type = S
physics = S
anim = 360
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 350, hit]
type = HitBy
trigger1 = time <= 27
value =  , AT

[State 350, hit]
type = NotHitBy
trigger1 = time <= 27
value = , AA, AP

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1,0

[State 290, Drain]
type = VarAdd
trigger1 = time = 0
v = 17
value = -1000

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 20
length = 7
PalBright = 0,0,0
PalContrast = 255,255,255
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 2041, 2]
type = Afterimagetime
trigger1 = stateno = 365
trigger1 = time%2 = 0 && Time < 20
time = 2

[State 705, 1]
type = velset
trigger1 = Time = [9,25]
x = -5

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;Recuperacion tras caida
[Statedef 370]
type = C
physics = C
anim = 370
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0
facep2 = 1

[State 370, pos]
type = posset
trigger1 = time = 0
y = 0

[State 350, hit]
type = NotHitBy
trigger1 = 1
value = SCA,NT,ST,HT

[State 350, snd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1,0

[State 705, 1]
type = velset
trigger1 = Time = [1,16]
x = -4

[State 370, 2]
type = VelAdd
trigger1 = animelem = 1
x = -5

[State 220, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; -2 states... De aqui para abajo NO TOCAR NADA, ya que puede causar m疽
;              fallas de las que el char ya tiene.
;---------------------------------------------------------------------------
[Statedef -2]
;==================================================================================
[State -2, detect]
type = VarSet
trigger1 = p2name = "R1" || p4name = "R1"
trigger2 = p2name = "R_FullPower" || p4name = "R_FullPower"
var(15) = 1
;==================================================================================
; 98 REV codes |
;---------------
;Advanced Mode (Ehnyd)
[State -2, StartOnLeft]
type = VarSet
trigger1 = var(23) = 0
trigger1 = Pos X < 0
v = 23
value = 1

[State -2, StartOnRight]
type = VarSet
trigger1 = var(23) = 0
trigger1 = Pos X >= 0
v = 23
value = 2

[State -2, CountDown]
type = VarSet
trigger1 = var(17) < 0
var(17) = 0
ignorehitpause = 1

[State -2, CountDown]
type = VarAdd
trigger1 = var(17) > 0
v = 17
ignorehitpause = 1
value = -1

[State -2, ExplodCountdown]
type = ModifyExplod
trigger1 = Var(17) != 0
ID = 4102
scale = (1100 - Var(17)) / 1100.0,1
ontop = 1

[State -2, ResetDamageBonus]
type = AttackMulSet
trigger1 = Var(17) <= 0 && NumExplod(4100) != 0
value = 1

[State -2, BarRemovalAnimLeft]; P1, no tocar
type = Explod
trigger1 = Var(17) <= 0 && Var(23) = 1 && NumExplod(4100) != 0
anim = 4101
postype = left
pos = 7,208
ontop = 1
supermove = 1
ignorehitpause = 1
ignoresuperpause = 1
bindtime = 30
ownpal = 1

[State -2, BarRemovalAnimRight]
type = Explod
trigger1 = Var(17) <= 0 && Var(23) = 2 && NumExplod(4100) != 0
anim = 4106
postype = right
pos = -84,208
ontop = 1
supermove = 1
ignorehitpause = 1
ignoresuperpause = 1
bindtime = 30
ownpal = 1

[State -2, RemoveMAXCounterBar]
type = RemoveExplod
trigger1 = Var(17) <= 0 && NumExplod(4100) != 0
id = 4102

[State -2, RemoveMAXBar]
type = RemoveExplod
trigger1 = Var(17) <= 0 & NumExplod(4100) != 0
id = 4100

[State 3500, KillMAX]
type = VarSet
trigger1 = Life = 0
v = 17
value = 0

[State -2, No 98 Bars]
type = AssertSpecial
trigger1 = roundstate = [0,1]
trigger2 = roundstate = 4
trigger3 = Ctrl = 0 && (Anim = [0,2]) && MoveType != H
flag = NoBarDisplay
ignorehitpause = 1

;===============================================
; ------- COUNTER HIT --------
;===============================================
[State -2, COUNTER HIT1]
type = VarSet
trigger1 = enemy, movetype = A
ignorehitpause = 1
var(20) = 1

[State -2, COUNTER HIT2]
type = VarSet
trigger1 = enemy, movetype = I || var(21) >= 1
ignorehitpause = 1
var(20) = 0

[State -2, COUNTER HIT3]
type = VarSet
trigger1 = var(21) > 10 && enemy, movetype = H
ignorehitpause = 1
var(20) = 0

[State -2, COUNTER HIT4]
type = VarSet
trigger1 = (stateno != [1600,1655]) && (stateno != [1901,1910]) && (stateno != 460) && var(20) = 1 && movehit
ignorehitpause = 1
var(21) = 1

[State -2, COUNTER HIT5]
type = Varadd
trigger1 = var(21) >= 1
ignorehitpause = 1
var(21) = 1

[State -2, COUNTER HIT6]
type = VarSet
trigger1 = var(21) >= 22 && movehit && stateno != 1001
trigger2 = p2movetype != H
trigger3 = movetype = H
trigger4 = var(21) >= 22 && stateno = 1002
trigger5 = var(35) > 0
ignorehitpause = 1
var(21) = 0

[State -2, COUNTER HIT7]
type = Assertspecial
trigger1 = var(21) > 0 
trigger2 = var(13) > 0
trigger3 = var(24) = 1
trigger4 = var(32) > 0
trigger5 = var(35) > 0
flag = Nojugglecheck
;--------------------------

[State -2, run sound]
type = stopsnd
trigger1 = stateno != 101
channel = 1

[State 100, 0]
type = StopSnd
trigger1 = stateno != 2301
channel = 2

[State 100, 0]
type = StopSnd
trigger1 = stateno != 910 && stateno != 911
channel = 3

[State 100, 0]
type = StopSnd
trigger1 = stateno != 910 && stateno != 911
channel = 4

[State -2,]
type = Varset
trigger1 = projhit1000 = 1
var(12) = 18

[State -2,]
type = Varset
trigger1 = projhit3000 = 1
var(12) = 25

[State -2,]
type = VarAdd
trigger1 = var(12) != 0
trigger1 = (gametime%3) = 0
var(12) = -1

[State -2,]
type = Pause
triggerall = (gametime%3) = 0
trigger1 = var(12) != 0
time = 1
movetime = 0

;---------------------------------------------------------------------------
; -3 states... De aqui para abajo NO TOCAR NADA, ya que puede causar m疽
;              fallas de las que el char ya tiene.
;---------------------------------------------------------------------------

[Statedef -3]

[State 52, Landing Sound]
type = PlaySnd
trigger1 = Time = 1
trigger1 = stateno = 106
value = 0,2

[State -3, Jumping Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 105
value = 0,4

[State -3, Jumping Sound]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(5) = 1
trigger1 = stateno = 50
trigger2 = stateno = 950
value = 0,1

[State -3, Jumping Sound]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(5) = 0
trigger1 = stateno = 50
trigger2 = stateno = 950
value = 0,0

[State -2, 4]
type = VarRandom
triggerall = Time = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
v = 4
range = 0,15

[State -2, 5]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [0,3]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,0

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [4,7]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,1

[State -2, 6]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [8,11]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,2

[State -3, ai1]
type = Varset
triggerall = var(9) != 1
triggerall = RoundState != 3
trigger1 = command = "AI_1"
trigger2 = command = "AI_2"
trigger3 = command = "AI_3"
trigger4 = command = "AI_4"
trigger5 = command = "AI_5"
trigger6 = command = "AI_6"
trigger7 = command = "AI_7"
trigger8 = command = "AI_8"
trigger9 = command = "AI_9"
trigger10 = command = "AI_10"
var(9) = 1

[State -3, ai1]
type = Varset
triggerall = var(9) != 1
triggerall = RoundState != 3
trigger1 = command = "AI_11"
trigger2 = command = "AI_12"
trigger3 = command = "AI_13"
trigger4 = command = "AI_14"
trigger5 = command = "AI_15"
trigger6 = command = "AI_16"
trigger7 = command = "AI_17"
trigger8 = command = "AI_18"
trigger9 = command = "AI_19"
trigger10 = command = "AI_20"
var(9) = 1

[State -3, SetAI]
type = VarSet
triggerall = Alive && RoundState = 2
triggerall = IsHomeTeam && !IsHelper
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(9) = 1

[State -3, ai2]
type = Varset
trigger1 = RoundState = 3
var(9) = 0

;---------------------------------------------------------------------------
[State -3, コマンドを入れたらVarをON] 
type = VarSet
trigger1 = command = "jump"
trigger1 = ctrl
trigger1 = statetype = S
v = 3
value = 1

[State -3, sysvarを引継ぐ]
type = VarSet
trigger1 = Var(3) = 1
trigger1 = stateno = 40
trigger1 = AnimTime = 0
var(3) = ifelse(sysvar(1)=0, 2, ifelse(sysvar(1)=1, 3, 4))

[State -3, varをOFFにするステート]
type = VarSet
triggerall = Time = 2
trigger1 = stateno = 50
trigger2 = stateno != [40,59]
v = 3
value = 0

[State -3, 前にボタンを押してたら前にも加速]
type = VelAdd
trigger1 = var(3) = 3
trigger1 = stateno = 50
y = -0.8
x = 2

[State -3, 後ろなら後ろに加速]
type = VelAdd
trigger1 = var(3) = 4
trigger1 = stateno = 50
y = -0.8
x = -2.1

[State -3, 垂直ジャンプにveladdを使って上に加速]
type = VelAdd
trigger1 = var(3) = 2
trigger1 = stateno = 50
y = -2

[State -3, Afterimage]
type = Afterimage
trigger1 = var(3) >= 1
trigger1 = stateno = 50
trigger2 = AnimTime = 0
trigger2 = prevstateno = 100 ;RUN_FWD
trigger2 = sysvar(1) = 1
time = 2
length = 7
PalBright = 0,0,0
PalContrast = 256,256,256
PalAdd = 0,0,0
PalMul = 1,1,1
FrameGap = 3

[State 2041, 2]
type = Afterimagetime
trigger1 = stateno = 50
trigger1 = time%2 = 0 && Time < 20
time = 2