;Char: Megaman - MvsC style      -      feito por/by: DG 
; *e-mail:
;  .info@dgmugen.com.br ou dg_mugen@yahoo.com.br
; *site:
;  .http://dgmugen.com.br
;-------------------------------------------------------------------

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

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 14        ;Player width (back, air)
air.front = 15       ;Player width (front, air)
height = 45          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 3.2      ;Walk forward
walk.back = -3.0      ;Walk backward
run.fwd  = 6.0,-5.5     ;Run forward (x, y) x+2 
run.back = -6.5,-6.0    ;Hop backward (x, y) x+2
jump.neu = 0,-8.7 ;-10.1    ;Neutral jumping velocity (x, y)
jump.back = -2.55 ;-2.15    ;Jump back Speed (x, y)
jump.fwd = 2.55 ;2.1       ;Jump forward Speed (x, y)
runjump.back = -4.55,-8.1   ;Running jump speeds (opt)
runjump.fwd = 4,-8.1          ;.
airjump.neu = 0,-8.7 ;0,-9.1  ;.
airjump.back = -3.15 ;-2.85   ;Air jump speeds (opt)
airjump.fwd = 3.55 ;4.8       ;.

[Movement]
airjump.num = 1;ifelse(var(33) = 1, 1, 0) ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .44;.49        ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

[Quotes]
victory1 = "I must defeat the next bosses."
victory2 = "Let's go Rush! We need to stop Dr. Willy!"
victory3 = "Now I have your power."
victory4 = "Dr. Light, mission accomplished!"

;---------------------------------------------------------------------------
; Format:
; [Statedef STATENO]
; type = ?      S/C/A/L  stand/crouch/air/liedown
; movetype = ?  I/A/H    idle/attack/gethit
; physics = ?   S/C/A/N  stand/crouch/air/none
; juggle = ?             air juggle points move requires
;
; [State STATENO, ?]     ? - any number you choose
; type = ?
; ...

;---------------------------------------------------------------------------
; Lose by Time Over
;[Statedef 170]
;type = S
;ctrl = 0
;anim = 170
;velset = 0,0

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

[Statedef 170]
type = S
anim = 10
velset = 0,0

[State 170, 1]
type = PlaySnd
trigger1 = time = 12
value = 1500, 1

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

[State 170, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 10
ctrl = 0

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Win state decider
[Statedef 180]
type = S

[State 180, 1] 
type = VarRandom
trigger1 = 1
v = 2
range = 6

[State 180, 2]
type = ChangeState
trigger1 = var(35) != 3
trigger1 = Time = 0
value = ifelse(var(33) = 1, 184, (181 + var(2)))

[State 180, 3]
type = ChangeState
trigger1 = var(35) = 3
trigger1 = Time = 0
value = 188

;-----------------------------------------;
;Win A - Ya Tah!
[Statedef 181]
type = S
anim = 180
velset = 0,0

[State 181, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 0
channel = 0

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

;-----------------------------------------;
;Win B - Bug! (X-Ray)
[Statedef 182]
type = S
anim = 181
velset = 0,0

;[State 182, 1]
;type = PlaySnd
;trigger1 = Time = 1
;value = 0, 0
;volume = 255

[State 182, 2]
type = PalFX
trigger1 = Time = 47 
add = 120,120,255
time = 1

[State 182, 3]
type = PalFX
trigger1 = Time = 48 
add = 80,80,256
time = 1

[State 182, 4]
type = PalFX
trigger1 = Time = 49
trigger2 = Time = 57
add = 50,50,155
time = 1

[State 182, 5]
type = PalFX
trigger1 = Time = 50
add = 20,20,95
time = 1

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

;-----------------------------------------;
;Win C - Jo Ken Po
[Statedef 183]
type = S
;anim = 182
velset = 0,0

[State 183, 1] 
type = VarRandom
trigger1 = 1
v = 0
range = 2

[State 183, 2] ;suki, puu or pa
type = ChangeAnim
trigger1 = Time = 0 
value = 182 + var(0) 

[State 183, 3]
type = PlaySnd
trigger1 = Time = 1
value = 0, 2  
channel = 0

[State 183, 3] ;suki
type = PlaySnd
trigger1 = Anim = 182
trigger1 = Time = 79
value = 0, 3  
channel = 0

[State 183, 3] ;puu
type = PlaySnd
trigger1 = Anim = 183
trigger1 = Time = 75
value = 0, 4  
channel = 0

[State 183, 3] ;pa
type = PlaySnd
trigger1 = Anim = 184
trigger1 = Time = 75
value = 0, 5  
channel = 0

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

;-----------------------------------------;
;Win D - No Helmet or S.A. Win
[Statedef 184]
type = S
anim = ifelse(var(33) = 1, 6027, 185)
velset = 0,0

[State 184, 1]
type = PlaySnd
trigger1 = Time = 15
value = 0, ifelse(var(33) = 1, 0, 6)
channel = 0

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

;[State 184, 3]
;type = AssertSpecial
;trigger1 = Anim = 184 
;trigger1 = AnimTime = 0
;flag = roundnotover

;-----------------------------------------;
;Win E - Rush Hug
[Statedef 185]
type = S
;anim = 186
velset = 0,0

[State 185, 2] 
type = ChangeAnim
;trigger1 = NumHelper > 0
;trigger1 = Helper, ParentDist X <= 20*ifelse(Facing,1,-1) ;Anim = 7181
triggerall = var(8) = 1 
trigger1 = var(5) = 1 ;Time = 14
value = 186

[State 185, 2] 
type = ChangeAnim
triggerall = var(8) = 2 
trigger1 = var(5) = 2 
value = 5

[State 185, 2] 
type = ChangeAnim
;triggerall = var(8) = 2 
trigger1 = Anim = 5
trigger1 = AnimTime = 0 
value = 186

[State 185, 3]
type = Turn
triggerall = Var(8) = 2
trigger1 = Anim = 5
trigger1 = AnimElem = 1, = 0
;trigger1 = !Time

[State 185, 1]
type = PlaySnd
trigger1 = Anim = 186
trigger1 = AnimElem = 14
value = 0, 1
channel = 0
persistent = 0

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

;-----------------------------------------;
;Win F - FlipTop Cake
[Statedef 186]
type = S
;anim = 180
velset = 0,0
sprpriority = 4

[State 186, 1]
type = ChangeAnim
triggerall = Anim != 180
trigger1 = NumHelper(192) > 0
trigger1 = Helper(192), Anim = 187
value = 180

[State 186, 1] ;Fliptop
type = Helper
triggerall = NumHelper(192) < 1
trigger1 = !Time
helpertype = normal
name = "FlipTop"
ID = 192 
pos = 340, 0 ;260, 0
postype = p1
;facing = 1
stateno = 192 
ownpal = 1
ignorehitpause = 1

[State 186, 2]
type = PlaySnd
trigger1 = Anim = 180
trigger1 = AnimElem = 1, = 2
value = 0, 0
channel = 0
persistent = 0

[State 186, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; FlipTop: Helper 
[Statedef 192]
type = A
movetype = I
ctrl = 0
anim = 1104
velset = -3, 0
sprpriority = 3

[State 192, 1]
type = ChangeAnim
triggerall = Anim != 187
trigger1 = ParentDist X >= -48;-45
value = 187

[State 192, 2]
type = VelSet
trigger1 = ParentDist X >= -48
x = 0

;[State 192, 3]
;type = DestroySelf
;trigger1 = RoundState != 4

;-----------------------------------------;
;Win G - Roll Flowers
[Statedef 187]
type = S
;anim = 188
velset = 0,0
sprpriority = 4

[State 187, 0]
type = ChangeAnim
triggerall = Anim != 188
trigger1 = NumHelper(193) > 0
trigger1 = Helper(193), Anim = 193
value = 188

[State 187, 1] ;Roll
type = Helper
triggerall = NumHelper(193) < 1
trigger1 = !Time
helpertype = normal
name = "Roll"
ID = 193 
pos = 340, 0 ;260, 0
postype = p1
;facing = 1
stateno = 193 
ownpal = 1
ignorehitpause = 1

[State 187, 2]
type = PlaySnd
trigger1 = Anim = 188
trigger1 = AnimElem = 6, = 2;4
value = 0, 0
channel = 0
persistent = 0

[State 187, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
;---------------------------------------------------------------------------
; Roll: Helper 
[Statedef 193]
type = A
movetype = I
ctrl = 0
anim = 189
velset = -4.7, 0
sprpriority = 3

[State 193, 1]
triggerall = Anim != 193
type = ChangeAnim
trigger1 = ParentDist X >= -50
value = 193

[State 193, 2]
type = VelSet
trigger1 = ParentDist X >= -50
x = 0

[State 193, 3]
type = PlaySnd
trigger1 = Vel X = 0
value = 0, 8
;channel = 0
persistent = 0

[State 193, 4]
type = DestroySelf
trigger1 = RoundState != 4

;-----------------------------------------;
;Win Auto Fix
[Statedef 188]
type = S
anim = 18601
velset = 0,0
sprpriority = 4

[State 188, turn]
type = Turn
trigger1 = NumHelper(7000) > 0
trigger1 = Helper(7000), Pos X >= Pos X
trigger1 = facing = -1
trigger2 = NumHelper(7000) > 0
trigger2 = Helper(7000), Pos X < Pos X
trigger2 = facing = 1

[State 188, 0]
type = ChangeAnim
trigger1 = Anim = 18601 ;!= 18602
trigger1 = NumHelper(18600) > 0
trigger1 = Helper(18600), Anim = 18700;193
trigger1 = Helper(18600), AnimElem = 9
value = 18602

[State 188, 0]
type = ChangeAnim
trigger1 = Anim = 18602
trigger1 = AnimTime = 0 
value = 18603

[State 188, 1] ;Auto
type = Helper
triggerall = NumHelper(18600) < 1
trigger1 = !Time
helpertype = normal
name = "Auto"
ID = 18600;193 
pos = -340, 0
postype = p1
;facing = 1
stateno = 18600;193 
ownpal = 1
ignorehitpause = 1

[State 188, 2]
type = PlaySnd
trigger1 = Anim = 18602
trigger1 = AnimElem = 3, = 2;4
value = 0, 0
channel = 0
persistent = 0

[State 188, 2]
type = PlaySnd
trigger1 = !Time
value = 0, 1 ;3, 5
channel = 0
persistent = 0

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

[State 188, 4]
type = AssertSpecial
trigger1 = Anim = 18601 
trigger2 = Anim = 18602 
;trigger2 = AnimElem = [1, 10] 
flag = roundnotover
;---------------------------------------------------------------------------
; Auto: Helper 
[Statedef 18600]
type = A
movetype = I
ctrl = 0
anim = 18600 ;189
velset = 1.4, 0 ;.98, 0
sprpriority = 5

[State 18600, turn]
type = turn
trigger1 = !time && numhelper(7000)
trigger1 = (helper(7000),pos x - pos x) * facing < 0

[State 18600, 0.1]
type = posset
trigger1 = !time
x = -340 * facing

[State 18600, 2]
type = VelSet
trigger1 = Anim = 18600
x = 1.4

[State 18600, 1]
;triggerall = Anim != 18700 ;193
type = ChangeAnim
;trigger1 = NumHelper(7000) > 0
;trigger1 = (Helper(7000), Pos X) <= Pos X ;ParentDist X <= (Helper(7000), ParentDist X) ;ParentDist X >= 0) ;50
;trigger1 = facing = 1
;;trigger1 = ParentDist X <= -50
;trigger2 = NumHelper(7000) > 0
;trigger2 = (Helper(7000), Pos X) > Pos X 
;trigger2 = facing = -1
trigger1 = Anim != 18700
trigger1 = time && numhelper(7000)
trigger1 = (helper(7000),pos x - pos x) * facing < 0
value = 18700 ;193

[State 18600, 3]
type = PlaySnd
triggerall = Anim = 18600
trigger1 = AnimElem = 2, = 0
trigger2 = AnimElem = 6, = 0
value = 0, 14 
persistent = 1

[State 18600, 2]
type = VelSet
;trigger1 = NumHelper(7000) > 0
;trigger1 = (Helper(7000), Pos X) <= Pos X ;ParentDist X <= (Helper(7000), ParentDist X) ;(Helper(7000), Pos X) 
;trigger1 = facing = 1
;;trigger1 = ParentDist X <= -50
;trigger2 = NumHelper(7000) > 0
;trigger2 = (Helper(7000), Pos X) > Pos X 
;trigger2 = facing = -1
trigger1 = Anim = 18700
x = 0

[State 18600, 3]
type = PlaySnd
trigger1 = Anim = 18700 ;Vel X = 0
value = 18, 11 ;0, 8
channel = 0
persistent = 0

[State 18600, 4]
type = DestroySelf
trigger1 = RoundState != 4

[State 18600, 5]
type = AssertSpecial
trigger1 = Vel X != 0
trigger2 = Anim = 18700 
trigger2 = AnimElem != 9
flag = roundnotover



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Introduction state decider
[Statedef 190]
type = S

[State 190, 1] 
type = VarRandom
trigger1 = 1
v = 3
range = 1

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 191 + ifelse(var(3) = 1, 0 ,3)

;-----------------------------------------;
;Intro A
[Statedef 191]
type = S
anim = 190
velset = 0,0

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

;[State 191, 2]
;type = AssertSpecial
;trigger1 = Time = [0, 73]
;flag = noshadow

[State 191, 2]
type = trans
trigger1 = Time = [0, 73]
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

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

[State 191, 4]
type = PalFX
trigger1 = Time = [41, 72]
;trigger1 = Time = 41
;trigger2 = Time = 43 
;trigger3 = Time = 45 
;trigger4 = Time = 47 
;trigger5 = Time = 49 
;trigger6 = Time = 52 
;trigger7 = Time = 54 
;trigger8 = Time = [56, 57] 
;trigger9 = Time = 59 
;trigger10 = Time = 61 
;trigger11 = Time = 64 
;trigger12 = Time = 66 
;trigger13 = Time = [68, 69] 
;trigger14 = Time = [71, 72]  
add = 256,256,256
time = 1

[State 191, 5]
type = PalFX
trigger1 = Time = [73, 76] 
add = 120,120,255
time = 1

[State 191, 6]
type = PalFX
trigger1 = Time = [77, 79] 
add = 80,80,256
time = 1

[State 191, 7]
type = PalFX
trigger1 = Time = [80, 83] 
add = 50,50,155
time = 1

[State 191, 8]
type = PalFX
trigger1 = Time = [84, 86] 
add = 20,20,95
time = 1

[State 191, 9]
type = Explod
trigger1 = Time = 0 
persistent = 0
anim = 7190
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -2
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 191, 9]
type = Explod
trigger1 = Time = 0 
persistent = 0
anim = 190111;7190
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -2
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 191, 10]
type = PlaySnd
trigger1 = Time = 23
value = 1, 0

[State 191, 10]
type = PlaySnd
trigger1 = Time = 100 ;45
value = 1, 1
channel = 0

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

;-----------------------------------------;
;Intro B
[Statedef 194]
type = S
anim = 191
velset = 0,0

[State 194, 0]
type = AssertSpecial
trigger1 = NumHelper(192000) > 0
flag = nobardisplay

[State 194, 1]
type = AssertSpecial
trigger1 = 1
flag = Intro
flag2 = nomusic

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

[State 194, 1] ;Auto
type = Helper
triggerall = NumHelper(192000) < 1
trigger1 = !Time
helpertype = normal
name = "Auto"
ID = 192000 
pos = -56, 0 
postype = p1
;facing = 1
stateno = 192000 
ownpal = 1
ignorehitpause = 1

[State 194, 1] ;Roll
type = Helper
triggerall = NumHelper(192001) < 1
trigger1 = !Time
helpertype = normal
name = "Roll"
ID = 192001 
pos = -20, 0 
postype = p1
;facing = 1
stateno = 192001 
ownpal = 1
ignorehitpause = 1

[State 194, 9] ;speak box anim
type = Explod
trigger1 = NumExplod(191125) < 1
trigger1 = !Time 
persistent = 0
anim = 191125
ID = 191125
postype = left
pos = 160, 10 ;160, -210
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
bindtime = -1

[State 194, 1] ;speak box
type = Helper
triggerall = NumHelper(191124) < 1
trigger1 = !Time
helpertype = normal
name = "Speak Box"
ID = 191124
pos = 160, -210 
postype = left
;facing = 1
stateno = 191124
ownpal = 1
ignorehitpause = 1
;bindtime = -1

[State 194, 1] ;yellow helmet
type = Helper
triggerall = NumHelper(191125) < 1
trigger1 = Time = 361;362 ;Anim = 191112
;trigger1 = AnimElem = 1
helpertype = normal
name = "Yellow Helmet"
ID = 191125
pos = 0, 0
postype = p1
;facing = 1
stateno = 191125
ownpal = 1
ignorehitpause = 1
bindtime = -1


;[State 194, 9] ;speak box
;type = Explod
;trigger1 = NumExplod(191124) < 1
;trigger1 = Time = 0 
;persistent = 0
;anim = 191124
;postype = left
;pos = 160, 20
;velocity = 0, 0
;accel = 0, 0
;removetime = -2
;sprpriority = -2

[State 194, 9] ;bag
type = Explod
trigger1 = NumExplod(191123) < 1
trigger1 = Time = 0 
persistent = 0
anim = 191123
ID = 191123
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = -1
removetime = -2
sprpriority = -7
ownpal = 1

[State 194, 10] ;remove bag
type = RemoveExplod
triggerall = NumHelper(192000) > 0
trigger1 = Helper(192000), Anim = 191118
trigger1 = Anim = 1911133
trigger1 = AnimElem = 11
trigger2 = Helper(192000), Anim = 191122
ID = 191123


[State 194, 9] ;yellow helmet 
type = Explod
trigger1 = NumExplod(191114) < 1
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 4
persistent = 0
anim = 191114
ID = 191114
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
bindtime = -1

[State 194, 9] ;yellow helmet - back
type = Explod
trigger1 = NumExplod(1911144) < 1
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 8
persistent = 0
anim = 1911144
ID = 1911144
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
bindtime = -1

[State 194, 9] ;megaman helmet 
type = Explod
trigger1 = NumExplod(191115) < 1
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 10;9
persistent = 0
anim = 191115
ID = 1911144
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1

[State 194, 1]
type = ChangeAnim
trigger1 = Anim = 191
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 4
value = 191111

[State 194, 1]
type = ChangeAnim
trigger1 = Anim = 191111
trigger1 = AnimTime = 0
value = 191112

[State 194, 1]
type = ChangeAnim
trigger1 = Anim = 191112
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 8
value = 191113

[State 194, 1]
type = ChangeAnim
trigger1 = Anim = 191113
trigger1 = AnimTime = 0
value = 191

[State 194, 1]
type = ChangeAnim
trigger1 = Anim = 191
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 10;8
value = 1911133



[State 194, 5]
type = PalFX
trigger1 = Time = [1121,1132] ;[1322, 1333]
add = 256,256,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 194, 5]
type = PalFX
trigger1 = Time = [1133,1135] ;[1334, 1336]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 194, 4]
type = PalFX
trigger1 = Time = [1136,1137] ;[1337, 1338]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 194, 3]
type = PalFX
trigger1 = Time = [1138,1140] ;[1339, 1341]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 194, 2]
type = PalFX
trigger1 = Time = [1141,1142] ;[1342, 1343]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999


[State 194, 1]
type = PlaySnd
trigger1 = !Time
value = 30, 8
persistent = 0
volume = 150
channel = 2

[State 194, 2]
type = StopSnd
trigger1 = Anim = 191112
trigger1 = AnimElem = 1
value = 30, 8
persistent = 0
channel = 2

[State 194, 9]
type = PlaySnd
trigger1 = Anim = 191112
trigger1 = AnimElem = 1
value = 18, 20
persistent = 0

[State 194, 9]
type = PlaySnd
trigger1 = Anim = 191112
trigger1 = AnimElem = 2
value = 30, 6
persistent = 0


[State 194, 10]
type = PlaySnd
trigger1 = Anim = 1911133
trigger1 = AnimElem = 6
value = 18, 20
persistent = 0

[State 194, 10]
type = PlaySnd
trigger1 = Anim = 1911133
trigger1 = AnimElem = 7
value = 30, 7
persistent = 0


;[State 194, 10]
;type = PlaySnd
;trigger1 = Time = 100 ;45
;value = 1, 1
;channel = 0

[State 194, 11]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 0



;---------------------------------------------------------------------------
; Auto: Helper 
[Statedef 192000]
type = A
movetype = I
ctrl = 0
anim = 191118
velset = 0, 0
sprpriority = -2

[State 18600, 2]
type = VelSet
trigger1 = Anim = 191122
x = -0.8
y = -1.2

;[State 18600, 1]
;type = ChangeAnim
;trigger1 = Anim = 191118
;trigger1 = AnimTime = 0
;value = 191122

;[State 18600, 1]
;type = ChangeAnim
;trigger1 = Anim = 191118
;trigger1 = AnimTime = 0
;value = 191122

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191118
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 3
value = 191119

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191119
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 4
value = 191121

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191121
;trigger1 = NumHelper(191124) > 0
;trigger1 = Helper(191124), Anim = 191124
;trigger1 = Helper(191124), AnimElem = 8
trigger1 = root, Anim = 191113
trigger1 = root, AnimElem = 6
value = 191119

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191119
trigger1 = NumHelper(191124) > 0
trigger1 = Helper(191124), Anim = 191124
trigger1 = Helper(191124), AnimElem = 10;9
value = 191121

;[State 18600, 1]
;type = ChangeAnim
;trigger1 = Anim = 191113
;trigger1 = AnimTime = 0
;value = 191

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191121
trigger1 = root, Anim = 1911133
trigger1 = root, AnimElem = 5
value = 191118

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191118
trigger1 = root, Anim = 1911133
trigger1 = root, AnimElem = 11
value = 191122

[State 18600, 9] ;helix
type = Explod
trigger1 = NumExplod(12044) < 1
trigger1 = Anim = 191122
persistent = 0
anim = 1204
ID = 12044
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1

;[State 18600, 3]
;type = PlaySnd
;triggerall = Anim = 18600
;trigger1 = AnimElem = 2, = 0
;trigger2 = AnimElem = 6, = 0
;value = 0, 14 
;persistent = 1

[State 18600, 4]
type = DestroySelf
trigger1 = Anim = 191122
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105

;[State 18600, 5]
;type = AssertSpecial
;trigger1 = Vel X != 0
;trigger2 = Anim = 18700 
;trigger2 = AnimElem != 9
;flag = roundnotover

;---------------------------------------------------------------------------
; Roll: Helper 
[Statedef 192001]
type = A
movetype = I
ctrl = 0
anim = 191116
velset = 0, 0
sprpriority = 5

[State 18600, 2]
type = VelSet
trigger1 = Anim = 191117
x = -1.4

[State 18600, 1]
type = ChangeAnim
trigger1 = Anim = 191116
;trigger1 = Time = 1400
trigger1 = root, Anim = 1911133
trigger1 = root, AnimElem = 11
value = 191117

[State 18600, 4]
type = DestroySelf
trigger1 = Anim = 191117
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105

;[State 18600, 5]
;type = AssertSpecial
;trigger1 = Vel X != 0
;trigger2 = Anim = 18700 
;trigger2 = AnimElem != 9
;flag = roundnotover

;---------------------------------------------------------------------------
; Speak Box: Helper 
[Statedef 191124]
type = A
movetype = I
ctrl = 0
anim = 191124
velset = 0, 0
sprpriority = -2

[State 191124, 2]
type = PosFreeze
trigger1 = 1

;[State 191124, 0] 
;type = ScreenBound
;trigger1 = P2MoveType = H 
;trigger2 = NumTarget > 0
;value = 1
;movecamera = 0,0

[State 191124, 2]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 191124, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Yellow Helmet: Helper 
[Statedef 191125]
type = A
movetype = I
ctrl = 0
anim = 19111444
velset = 0, 0
sprpriority = 7

[State 191125, 5]
type = PalFX
trigger1 = Time = [1, 7]
add = 256,256,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 191125, 5]
type = PalFX
trigger1 = Time = [8, 10]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 191125, 4]
type = PalFX
trigger1 = Time = [11, 12]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 191125, 3]
type = PalFX
trigger1 = Time = [13, 15]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 191125, 2]
type = PalFX
trigger1 = Time = [16, 17]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999



[State 191125, 1]
type = DestroySelf
trigger1 = AnimTime = 0



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = ifelse(var(33) = 1, 6030, 195)
velset = 0,0
movetype = I
physics = S
sprpriority = 2

;[State 195, 1]
;type = Width
;trigger1 = Time = [3, 44]
;player = 20,10

[State 195, 2]
type = CtrlSet
trigger1 = Time = 40
value = 1

[State 195, 3]
type = PlaySnd
trigger1 = Time = 1
value = 0, 7
channel = 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 2                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6100, 200)                      
poweradd = 20                    
sprpriority = 2                  

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2 ;1 = 8 hits para um dano diminuido
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8                 
guard.sparkno = s8300 ;S8200
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -15, -47              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12

[state 200, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 200, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 200, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 200, 5]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Medium Punch
[Statedef 210]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6101, 210)                       
poweradd = 55 
sprpriority = 2                  

[State 210, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 8, 8         
guard.sparkno = s8300 ;S8200        
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -5, -78
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 20 ;12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 20 ;12

;[State 210, 1] 
;type = StateTypeSet
;trigger1 = AnimElem = 4 
;statetype = A
;movetype = A
;physics = N

;[State 210, 2] 
;type = StateTypeSet
;trigger1 = AnimElem = 7 
;statetype = S
;movetype = A
;physics = S

[State 210, 1]
type = Width
trigger1 = AnimElem = 4
player = 20,5

[State 210, 1]
type = Width
trigger1 = AnimElem = 6
player = 5, 0

[state 210, 2]
type = VelSet
trigger1 = Time = 6 
x = 3.2

[state 210, 2]
type = VelSet
trigger1 = Time = 13 
x = 2.7

[state 210, 2]
type = VelAdd
trigger1 = Time = 18 
y = .4

[state 210, 2]
type = VelSet
trigger1 = Time = 22 
x = 0

[state 210, 2]
type = VelSet
trigger1 = Time = 25 
y = 0

[state 210, 2]
type = PosSet
trigger1 = Time = 25 
y = 0

[state 210, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 210, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 210, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 210, 5]
type = Width
trigger1 = Time = [6, 14]
player = 5, 0

[State 210, 2]
type = PlaySnd
trigger1 = Time = 1
value = 2, 0
channel = 0

[State 210, 6]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Strong Punch
[Statedef 220]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, ifelse(var(20) > 75, 6137, 6102), 220)                       
poweradd = 90 
sprpriority = 2                  

[State 220, 2] ;Fireball Shoot
type = Explod
trigger1 = var(20) < 76 && AnimElem = 4
persistent = 0
anim = 300;221
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 220, 3] ;Fireball efect
type = Explod
trigger1 = var(22) < 76 && Time = 10
persistent = 0
anim = 222
postype = p1
pos = 24, -46
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 220, 4]
type = Helper
trigger1 = var(20) < 76 && AnimElem = 4
helpertype = normal
name = "Fireball"
ID = 223 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 223 
ownpal = 1

[State 220, 2]
type = PalFX
trigger1 = var(22) < 76 && Time = [5, 7] ;3
add = 120,120,255
time = 1

[State 220, 3]
type = PalFX
trigger1 = var(22) < 76 && Time = [8, 10] ;3
add = 80,80,256
time = 1

[State 220, 4]
type = PalFX
trigger1 = var(22) < 76 && Time = [11, 14] ;4
add = 50,50,155
time = 1

[State 220, 5]
type = PalFX
trigger1 = var(22) < 76 && Time = [15, 17] ;3
add = 20,20,95
time = 1



[State 225, 1] ;Back Dust
type = Explod
trigger1 = var(20) > 75 && Time = 3 ;AnimElem = 4
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 225, 2] ;Fireball Shoot
type = Explod
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 4
persistent = 0
ID = 225
anim = 303;225
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 225, 3] ;Fireball efect
type = Explod
;trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = 10 
persistent = 0
anim = 226
postype = p1
pos = 24, -46
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 225, 4]
type = Helper
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 4 
helpertype = normal
name = "Hold Fireball"
ID = 227 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 227 
ownpal = 1

[State 225, 4.2]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) > 75 && var(20) < 350 && AnimElem = 4
helpertype = normal
name = "Hand Burst"
ID = 1700 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 1700 
ownpal = 1

[State 225, 4.3]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) >= 350 && AnimElem = 4
helpertype = normal
name = "Hand Strong Burst"
ID = 1702 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 1702 
ownpal = 1

[State 225, 2]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [5, 7] ;3
add = 255,120,0
time = 1

[State 225, 3]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [8, 10] ;3
add = 190,120,0 ;120,190,0
time = 1

[State 225, 4]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [11, 14] ;4
add = 190,80,0
time = 1

[State 225, 5]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [15, 17] ;3
add = 90,50,0
time = 1

[State 225, 2] ;Burst Hand - no pal
type = PalFX
trigger1 = var(33) = 1 
trigger1 = var(22) > 75 && Time = [5, 17]
time = 1

[state 225, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 220, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 220, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 220, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 220, 9]
type = PlaySnd
trigger1 = var(20) < 76 && AnimElem = 4
value = 18, 0

[State 220, 10]
type = PlaySnd
trigger1 = var(20) > 75 && AnimElem = 4
value = 18, 1

[State 220, 5] ;Fireball (reset hold var)
type = VarSet
trigger1 = NumExplod(225) > 0 ;AnimElem = 5 ;Time = 0
trigger2 = var(33) = 1 
trigger2 = var(20) > 75 && AnimElem = 4
var(20) = 0

;[State 220, 3] ;burst hand - start pos y select
;Type = VarSet
;trigger1 = !Time
;var(27) = 1

[State 220, 7]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 220, 2]
type = PlaySnd
trigger1 = var(20) < 76 && Time = 6
value = 2, 1
channel = 0

[State 220, 2]
type = PlaySnd
trigger1 = var(20) > 75 && Time = 6
value = 2, 4
channel = 0

;[State 220, 8]
;type = PlaySnd
;trigger1 = Time = 1
;value = 10, 2

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

;---------------------------------------------------------------------------
; Fireball: Helper
[Statedef 223]
type    = A
movetype= A
anim = 301;223
sprpriority = 3

[State 223, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 223, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 223, 0] ;Projectile Dust
type = Helper
triggerall = parent, Pos Y = 0 
triggerall = parent, Time > 5  
trigger1 = Time = 0 
helpertype = normal
name = "Projectile Dust"
postype = p1
pos = 0, ifelse(parent, StateType = C, 39, 51) 
stateno = 8021
sprpriority = 4
ownpal = 1
persistent = 0

[state 223, 1]
type = VelSet
trigger1 = Time = 0
x = 5

[State 223, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, NP                     
damage = floor(60/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8300 ;S8200              
sparkno = s8310+(random%8) ;S8231 
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 223, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, NP                     
damage = floor(65/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8300 ;S8200                
sparkno = s8310+(random%8) ;S8231
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
fall = 0
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 223, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 223, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 224
time = -1

[State 223, 8]
type = TargetState
trigger1 = MoveHit;NumTarget > 0
;trigger1 = !target, IsHelper
value = 225
ignorehitpause = 1

[State 223, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 224
ignorehitpause = 1

;---------------------------------------------------------------------------
; Fireball: Helper (end)
[Statedef 224]
type = A
movetype = A ;I
ctrl = 0
anim = 302;224
velset = 0, 0
sprpriority = 3
movehitpersist = 1

[State 224, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 224, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 224, 8] ;Hit Floor Spark (front)
type = Explod
;trigger1 = Time = 3
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 2
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 224, 9] ;Hit Floor Spark (back)
type = Explod
;trigger1 = Time = 1
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State 224, 10]
type = PlaySnd
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
value = 17, 0
ignorehitpause = 1
supermovetime = -1

[State 224, 2]
type = DestroySelf
triggerall = Time > 10 ;AnimTime = 0
trigger1 = P2MoveType != H ;NumTarget = 0
;;trigger2 = parent, var(20) = 0
;trigger2 = NumTarget > 0
;trigger2 = target, Time > 1 
;trigger2 = target, PrevStateNo = 225
;trigger2 = target, StateNo = 52
trigger1 = NumTarget < 1

;---------------------------------------------------------------------------
; Hold Fireball: Helper
[Statedef 227]
type    = A
movetype= A
anim = 304;227
sprpriority = 3

[State 227, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 227, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 227, 0] ;Projectile Dust
type = Helper
triggerall = parent, Pos Y = 0 
triggerall = parent, Time > 5  
trigger1 = Time = 0 
helpertype = normal
name = "Projectile Dust"
postype = p1
pos = 0, ifelse(parent, StateType = C, 39, 51) 
stateno = 8021
sprpriority = 4
ownpal = 1
persistent = 0

[state 227, 1]
type = VelSet
trigger1 = Time = 0
x = 6

[state 227, 1]
type = VelSet
trigger1 = NumTarget > 0
trigger1 = !target, IsHelper
trigger1 = MoveContact
trigger1 = HitCount <= 10
x = 1.5

[state 227, 1]
type = VelSet
trigger1 = NumTarget > 0
trigger1 = !target, IsHelper
trigger1 = MoveContact
trigger1 = HitCount > 10
x = .5

[State 227, 2]
type = HitDef
trigger1 = Time % 4 = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = ifelse(MoveContact < 1, floor(80/(1+(root,Var(19)/5.0))), ifelse(HitCount <= 10, floor(5/(1+(root,Var(19)/5.0))), floor(2/(1+(root,Var(19)/5.0))))), 7
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF 
priority = 5, Hit               
sprpriority = 3
pausetime = 2, 10   
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 20             
ground.velocity = -5
airguard.velocity = -1     
air.type = Low                  
air.velocity = -4, -2           
air.hittime = 20
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 227, 3]
type = HitDef
trigger1 = Time % 4 = 0 && P2BodyDist X <= 80
attr = A, SP                     
;damage = ifelse(MoveContact > 0, floor(7/(1+(root,Var(19)/5.0))), floor(80/(1+(root,Var(19)/5.0)))), 8
damage = ifelse(MoveContact < 1, floor(80/(1+(root,Var(19)/5.0))), ifelse(HitCount <= 10, floor(7/(1+(root,Var(19)/5.0))), floor(2/(1+(root,Var(19)/5.0))))), 8
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 5, Hit               
sprpriority = 3
pausetime = 2, 10 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 20             
ground.velocity = -6
airguard.velocity = -5
air.type = Low                 
air.velocity = -5, -4           
air.hittime = 20
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 227, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 227, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 228
time = -1

[State 227] 
type = ParentVarSet
trigger1 = !Time
var(21) = 0

[State 227] 
type = ParentVarSet
trigger1 = NumTarget > 0  
trigger1 = target, IsHelper
var(21) = -80
persistent = 0

[State 227] 
type = ParentVarAdd
;trigger1 = MoveContact
trigger1 = NumTarget > 0  
trigger1 = !target, IsHelper
var(21) = 1

;[State 227] 
;type = ParentVarAdd
;trigger1 = var(21) < 0  
;var(21) = 1

[State 227, 7]
type = TargetState
trigger1 = MoveHit;NumTarget > 0 ;MoveContact 
trigger1 = (parent, var(21)) = 3 + ((parent, var(22))/26)
;trigger1 = !target, IsHelper
value = 226
ignorehitpause = 1

[State 227, 8]
type = ChangeState
trigger1 = NumTarget < 1 ;!MoveContact 
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = NumTarget > 0 ;MoveContact 
trigger2 = (parent, var(21)) = 3 + ((parent, var(22))/26)
trigger3 = var(21) < 0  
value = 228
ignorehitpause = 1

;---------------------------------------------------------------------------
; Hold Fireball: Helper (end)
[Statedef 228]
type = A
movetype = A;I
ctrl = 0
anim = 305;228
velset = 0, 0
sprpriority = 3
movehitpersist = 1

[State 228, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 228, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 228] 
type = ParentVarSet
trigger1 = !Time
var(21) = 0

[State 228] ;hold calculate - reset
type = ParentVarSet
trigger1 = !Time
var(22) = 0

[State 228, 8] ;Hit Floor Spark (front)
type = Explod
;trigger1 = Time = 3
trigger1 = NumTarget > 0
trigger1 = target, PrevStateNo = 226
trigger1 = target, StateNo = 5110
trigger1 = target, Anim = 5170 ;5120
trigger1 = target, AnimElem = 1, = 2
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 228, 9] ;Hit Floor Spark (back)
type = Explod
;trigger1 = Time = 1
trigger1 = NumTarget > 0
trigger1 = target, PrevStateNo = 226
trigger1 = target, StateNo = 5110
trigger1 = target, Anim = 5170 ;5120
trigger1 = target, AnimElem = 1, = 0
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

;[State 228, 10]
;type = PlaySnd
;trigger1 = NumTarget > 0
;trigger1 = target, PrevStateNo = 226
trigger1 = target, StateNo = 5110
;trigger1 = target, Anim = 5170 ;5120
;trigger1 = target, AnimElem = 1, = 0
;value = 40, 2
;ignorehitpause = 1
;supermovetime = -1

[State 228, 2]
type = DestroySelf
triggerall = Time > 10 ;AnimTime = 0
trigger1 = P2MoveType != H ;NumTarget = 0


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Fireball efect: Helper 
[Statedef 229]
type = A
movetype = I
ctrl = 0
anim = 229
velset = 0, 0
sprpriority = 6

[State 229, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 229, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 229, 1]
type = BindToRoot
trigger1 = parent, StateType = S
trigger2 = parent, StateNo = [5100, 5101] ;hit bounce
pos = 5, -40
time = -1
ignorehitpause = 1

[State 229, 1]
type = BindToRoot
trigger1 = parent, StateType = C
pos = 5, -20
time = -1
ignorehitpause = 1

[State 229, 1]
type = BindToRoot
trigger1 = parent, StateType = A
pos = 7, -55
time = -1
ignorehitpause = 1

[State 229, 1] ;medium punch - S
type = BindToRoot
triggerall = parent, StateNo = 210
trigger1 = parent, AnimElemNo(0) = 4 ;, >= 0
trigger2 = parent, AnimElemNo(0) = 5
trigger3 = parent, AnimElemNo(0) = 6
trigger4 = parent, AnimElemNo(0) = 7
pos = 5, -60
time = -1
ignorehitpause = 1
persistent = 1

[State 229, 1] ;medium punch - C
type = BindToRoot
triggerall = parent, StateNo = 410
trigger1 = parent, AnimElemNo(0) = 4
trigger2 = parent, AnimElemNo(0) = 5
trigger3 = parent, AnimElemNo(0) = 6
pos = 5, -60
time = -1
ignorehitpause = 1
persistent = 1

[State 229, 1] ;medium punch - A
type = BindToRoot
trigger1 = parent, StateNo = 610
pos = 15, -60
time = -1
ignorehitpause = 1
persistent = 1

[State 229, 1] ;strong kick - S
type = BindToRoot
trigger1 = parent, StateNo = 250
pos = 5, -20
time = -1
ignorehitpause = 1

[State 229, 1]
type = BindToRoot
trigger1 = parent, StateNo = [5050, 5200]
trigger1 = parent, StateNo != [5100, 5101] ;5040
trigger1 = parent, StateNo != [5070, 5071]
pos = 1, -15
time = -1
ignorehitpause = 1

[State 229, 1]
type = BindToRoot
trigger1 = parent, StateNo = [5030, 5035]
pos = -2, -40
time = -1
ignorehitpause = 1

[State 229, 1] ;custom states
type = BindToRoot
trigger1 = parent, MoveType = H
trigger1 = parent, StateNo != [5000, 5999] ;gethit
trigger1 = parent, StateNo != [120, 155] ;guard
pos = 0, 0
time = -1
ignorehitpause = 1

[State 229, 1] ;jet rush mode
type = BindToRoot
trigger1 = parent, StateNo = 2001 
pos = 5, -38
time = -1
ignorehitpause = 1

;[State 229, 1]
;type = PosSet
;trigger1 = parent, StateType = S
;x = 5
;y = -40

;[State 229, 2]
;type = PosSet
;trigger1 = parent, StateType = C
;x = 5
;y = -20

;[State 229, 3]
;type = PosSet
;trigger1 = parent, StateType = A
;x = 5
;y = -60

;[State 229, 4]
;type = PlaySnd
;trigger1 = parent, var(20) = 46;76 ;Time = 0 ;5
;value = 20, 1
;channel = 1
;ignorehitpause = 1

[State 229, 5]
type = DestroySelf
trigger1 = parent, var(20) = 0 ;command != "hold_z" ;var(21) = 0;!= 1 && parent, var(21) != 2 



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Fall and Recover (a custom gethit state)
[Statedef 225]
type    = U
movetype= H
physics = N
;anim = 5011

[State 225, 1]
type = Turn
trigger1 = P2Dist X < -5
ignorehitpause = 1

[State 225, 1]
type = SelfState
trigger1 = StateType = S 
;trigger1 = !Time
value = 5000   
ignorehitpause = 1

[State 225, 1]
type = SelfState
trigger1 = StateType = C 
;trigger1 = !Time
value = 5010   
ignorehitpause = 1

[State 225, 1]
type = ChangeAnim
;trigger1 = StateType = A 
trigger1 = !Time
value = 5011   
ignorehitpause = 1

[State 225, 0]
type = VelSet
trigger1 = Anim = 5011
trigger1 = !Time 
x = 0
y = 0 

[State 225, 1]
type = ChangeAnim
trigger1 = Anim = 5011
trigger1 = Time = 1;4;8
value = 5050   

[State 225, 1]
type = HitFallSet
;trigger1 = Anim = 5050
trigger1 = Time = 1
value = 1

[State 225, 1] ;test
type = VelSet
;trigger1 = Anim = 5050
trigger1 = Time = 0 ;1
x = -7
y = -3;10 

[State 225, 2] ;test
type = VelAdd
trigger1 = Anim != 5040
trigger1 = Time >= 0 ;1
y = const(movement.yaccel)*1.7 ;GetHitVar(yaccel)*2 

[State 225, 1]
type = ChangeState;ChangeAnim
trigger1 = Anim != 5040;5120
trigger1 = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
value = 300 ;5040;5120   

[State 225, 1] ;if dead
type = SelfState
trigger1 = !Alive
trigger1 = Vel Y > 0  
trigger1 = Pos Y >= 0  
value = 5100 ;5150   

;---------------------------------------------------------------------------
; Fall and Recover - ANIM 5040 (a custom gethit state)
[Statedef 300]
type    = U
movetype= H
physics = N
anim = 5040

[State 300, 6] 
type = NotHitBy
trigger1 = 1
value = SCA

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

[State 300, 1]
type = PosSet
trigger1 = AnimElem = 1, = 0
y = 0

[State 300, 1]
type = VelSet
trigger1 = Time = 2
x = -5
y = -3

[State 300, 1]
type = VelAdd;Gravity
trigger1 = Time > 4 
y = const(movement.yaccel) ;GetHitVar(yaccel)

[State 300, 1] 
type = SelfState ;ChangeAnim
triggerall = Vel Y > 0  
triggerall = Pos Y >= 0  
trigger1 = Time > 4
ctrl = 1
value = 52

[State 300, 1] ;if dead
type = SelfState
trigger1 = !Alive
trigger1 = Vel Y > 0  
trigger1 = Pos Y >= 0  
value = 5100 ;5150   

;---------------------------------------------------------------------------
; Fall and Recover - Hold Burst (a custom gethit state)
[Statedef 226]
type    = U
movetype= H
physics = N
;anim = 5011

[State 226, 1]
type = Turn
trigger1 = P2Dist X < -5
ignorehitpause = 1

[State 226, 1]
type = SelfState
trigger1 = StateType = S 
;trigger1 = !Time
value = 5000   
ignorehitpause = 1

[State 226, 1]
type = SelfState
trigger1 = StateType = C 
;trigger1 = !Time
value = 5010   
ignorehitpause = 1

[State 226, 1]
type = ChangeAnim
;trigger1 = StateType = A 
trigger1 = !Time
value = 5011   
ignorehitpause = 1

[State 226, 0]
type = VelSet
trigger1 = Anim = 5011
trigger1 = !Time 
x = 0
y = 0 

[State 226, 1]
type = ChangeAnim
trigger1 = Anim = 5011
trigger1 = Time = 4
value = 5050   

[State 226, 1]
type = HitFallSet
;trigger1 = Anim = 5050
trigger1 = Time = 4
value = 1

;[State 226, 1]
;type = VelSet
;;trigger1 = Anim = 5050
;trigger1 = Time = 4
;x = -6
;y = -3 

[State 226, 1] ;test
type = VelSet
;trigger1 = Anim = 5050
trigger1 = Time = 4;8
x = -6
y = -8;10 

[State 226, 2] ;test
type = VelAdd
trigger1 = Time >= 4;8 ;1
y = const(movement.yaccel)*2 ;GetHitVar(yaccel)*2

;[State 225, 1]
;type = VelAdd;Gravity
;triggerall = Anim = 5040;5120
;trigger1 = NumEnemy > 0
;trigger1 = enemy(0), var(13) > 4 ;AnimTime > 1
;trigger2 = NumEnemy > 1
;trigger2 = enemy(1), var(13) > 4
;y = const(movement.yaccel) ;GetHitVar(yaccel)

[State 226, 1]
type = SelfState;Anim
;trigger1 = Anim != 5040;5120
trigger1 = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 0  ;.
value = 5110 ;5120   

;[State 226, 1]
;type = VelSet
;triggerall = Anim = 5170 ;5120
;trigger1 = NumEnemy > 0 
;trigger1 = enemy(0), var(13) = 1 ;AnimTime = 1
;trigger2 = NumEnemy > 1
;trigger2 = enemy(1), var(13) = 1
;x = 0
;y = 0

;[State 226, 1]
;type = PosSet
;trigger1 = Anim = 5170 ;5120
;trigger1 = AnimElem = 1, = 0
;;trigger1 = NumEnemy > 0
;;trigger1 = enemy, var(13) = 1 ;AnimTime = 1
;y = 0

[State 226, 1] ;if dead
type = SelfState
trigger1 = !Alive
trigger1 = Vel Y > 0  
trigger1 = Pos Y >= 0  
value = 5110 ;5150   


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Projectile Dust (Fireball)
[Statedef 8021]
type = S
movetype = I
ctrl = 0
anim = 8022
velset = 0, 0
sprpriority = 7

[State 8021, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 8021, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 8021, 1]
type = VelSet
trigger1 = Time = 0
x = 5

[State 8021, 2]
type = ChangeState
;triggerall = time >= 1
;trigger1 = root, var(1) = 1
trigger1 = parent, MoveContact || Parent, StateNo = 224 
trigger2 = parent, MoveContact || Parent, StateNo = 228 
value = 8023

;---------------------------------------------------------------------------
; Projectile Dust (end)
[Statedef 8023]
type = S
movetype = I
ctrl = 0
anim = 8023
velset = 0, 0
sprpriority = 7

[State 8023, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 8023, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 8023, 1]
type = DestroySelf
trigger1 = AnimTime = 0



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Light Kick
[Statedef 230]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6103, 230)                       
poweradd = 20                    
sprpriority = 2                  

[State 230, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 8, 8
guard.sparkno = s8300 ;S8200                 
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -10, -32              
hitsound = S15, 3                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[state 230, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 230, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 230, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = 30, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 230, 5]
type = Width
trigger1 = Time = [6, 12]
player = 6, 0

[State 230, 6]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Medium Kick
[Statedef 240]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6104, 240)                       
poweradd = 55                    
sprpriority = 2                  

[State 240, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8      
guard.sparkno = s8300 ;S8200           
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -8, -56              
hitsound = S15, 4                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 20 ;12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 20 ;12

[State 240, 2]
type = VelSet
trigger1 = Time = 3
x = 5

[State 240, 2]
type = VelSet
trigger1 = Time = 8
x = 0

[state 240, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 240, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 240, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -15, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 240, 5]
type = Width
trigger1 = Time = [6, 18]
player = 8, 3

[State 240, 2]
type = PlaySnd
trigger1 = Time = 0
value = 2, 2
channel = 0

[State 240, 6]
type = PlaySnd
trigger1 = Time = 3
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand Strong Kick
[Statedef 250]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6105, 250)                       
poweradd = 85                    
sprpriority = 2                  

[State 250, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Up                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 11, 8          
guard.sparkno = s8300 ;S8200       
sparkno = s8310+(random%8) ;S8230                      
sparkxy = -10, -85              
hitsound = S15, 5                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 8            
ground.hittime  = 28;25             
ground.velocity = 0,-14.5 ;-15             
airguard.velocity = -2, 1     
air.type = High                  
air.velocity = 0,-11.5 ;-1.4,-3           
air.hittime = 28;25

[State 250, 2] ;Launcher Spark
type = Explod
trigger1 = MoveHit
persistent = 0
anim = 8240
postype = p2
pos = 8, -95
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

[state 250, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 250, 4]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 250, 5]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = 35, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3

[State 250, 6]
type = Width
trigger1 = Time = [11, 23]
player = 8, 0

[State 250, 2]
type = PlaySnd
trigger1 = Time = 1
value = 2, 1
channel = 0

[State 250, 7]
type = PlaySnd
trigger1 = Time = 1
value = 10, 2

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Light Punch
[Statedef 400]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6106, 400)                       
poweradd = 20                    
sprpriority = 2                  

[State 400, 1]
type = HitDef
trigger1 = Time = 0
attr = C, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light              
guardflag = L                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8
guard.sparkno = s8300 ;S8200                 
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -15, -30              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 400, 2]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Medium Punch
[Statedef 410]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 6                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6107, 410)                       
poweradd = 55                    
sprpriority = 2                  

[State 410, 1]
type = HitDef
trigger1 = Time = 0
attr = C, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8    
guard.sparkno = s8300 ;S8200             
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -5, -60              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

;[State 410, 1] 
;type = StateTypeSet
;trigger1 = AnimElem = 4 
;statetype = A
;movetype = A
;physics = N

;[State 410, 2] 
;type = StateTypeSet
;trigger1 = AnimElem = 6 
;statetype = C
;movetype = A
;physics = C

[State 410, 1]
type = Width
trigger1 = AnimElem = 4
player = 20,5

[State 410, 1]
type = Width
trigger1 = AnimElem = 5
player = 5, 0

[state 410, 2]
type = VelSet
trigger1 = Time = 5 
x = 3.2

[state 410, 2]
type = VelSet
trigger1 = Time = 12 
x = 2.7

[state 410, 2]
type = VelAdd
trigger1 = Time = 16 
y = .4

[state 410, 2]
type = VelSet
trigger1 = Time = 19 
x = 0

[state 410, 2]
type = VelSet
trigger1 = Time = 22 
y = 0

[state 410, 2]
type = PosSet
trigger1 = Time = 22 
y = 0

[State 410, 2]
type = PlaySnd
trigger1 = Time = 1
value = 2, 0
channel = 0

[State 410, 2]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Strong Punch
[Statedef 420]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 6                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, ifelse(var(20) > 75, 6140, 6108), 420)                       
poweradd = 85                    
sprpriority = 2                  

[State 420, 2] ;Fireball Shoot
type = Explod
trigger1 = var(20) < 76 && AnimElem = 3
persistent = 0
anim = 421
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 420, 3] ;Fireball efect
type = Explod
trigger1 = var(22) < 76 && Time = 10
persistent = 0
anim = 222
postype = p1
pos = 24, -34
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 420, 4]
type = Helper
trigger1 = var(20) < 76 && AnimElem = 3
helpertype = normal
name = "Fireball"
ID = 223 
pos = 24, -34
postype = p1
;bindtime = -1
;facing = 1
stateno = 223 
ownpal = 1

[State 420, 2]
type = PalFX
trigger1 = var(22) < 76 && Time = [5, 7] ;3
add = 120,120,255
time = 1

[State 420, 3]
type = PalFX
trigger1 = var(22) < 76 && Time = [8, 10] ;3
add = 80,80,256
time = 1

[State 420, 4]
type = PalFX
trigger1 = var(22) < 76 && Time = [11, 14] ;4
add = 50,50,155
time = 1

[State 420, 5]
type = PalFX
trigger1 = var(22) < 76 && Time = [15, 17] ;3
add = 20,20,95
time = 1



[State 425, 1] ;Back Dust
type = Explod
trigger1 = var(20) > 75 && Time = 2 ;AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1

[State 425, 2] ;Fireball Shoot
type = Explod
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 3
persistent = 0
ID = 422
anim = 422
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 425, 3] ;Fireball efect
type = Explod
;trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = 10
persistent = 0
anim = 226
postype = p1
pos = 24, -34
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 425, 4]
type = Helper
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 3
helpertype = normal
name = "Hold Fireball"
ID = 227 
pos = 24, -34
postype = p1
;bindtime = -1
;facing = 1
stateno = 227 
ownpal = 1

[State 425, 4.2]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) > 75 && var(20) < 350 && AnimElem = 3
helpertype = normal
name = "Hand Burst"
ID = 1700 
pos = 24, -34;-46
postype = p1
;bindtime = -1
;facing = 1
stateno = 1700 
ownpal = 1

[State 425, 4.3]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) >= 350 && AnimElem = 3
helpertype = normal
name = "Hand Strong Burst"
ID = 1702 
pos = 24, -34
postype = p1
;bindtime = -1
;facing = 1
stateno = 1702 
ownpal = 1

[State 425, 2]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [5, 7] ;3
add = 255,120,0
time = 1

[State 425, 3]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [8, 10] ;3
add = 190,120,0
time = 1

[State 425, 4]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [11, 14] ;4
add = 190,80,0
time = 1

[State 425, 5]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [15, 17] ;3
add = 90,50,0
time = 1

[State 425, 2] ;Burst Hand - no pal
type = PalFX
trigger1 = var(33) = 1 
trigger1 = var(22) > 75 && Time = [5, 17]
time = 1

[State 420, 9]
type = PlaySnd
trigger1 = var(20) < 76 && AnimElem = 3
value = 18, 0

[State 420, 10]
type = PlaySnd
trigger1 = var(20) > 75 && AnimElem = 3
value = 18, 1

[State 420, 5] ;Fireball (reset hold var)
type = VarSet
trigger1 = NumExplod(422) > 0 ;AnimElem = 4 ;Time = 0
trigger2 = var(33) = 1 
trigger2 = var(20) > 75 && AnimElem = 3
var(20) = 0

;[State 420, 3] ;burst hand - start pos y select
;Type = VarSet
;trigger1 = !Time
;var(27) = 2

[State 420, 2]
type = PlaySnd
trigger1 = var(20) < 76 && Time = 4
value = 2, 1
channel = 0

[State 420, 2]
type = PlaySnd
trigger1 = var(20) > 75 && Time = 4
value = 2, 4
channel = 0

;[State 420, 6]
;type = PlaySnd
;trigger1 = Time = 1
;value = 10, 2

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Light Kick
[Statedef 430]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6109, 430)                       
poweradd = 20                    
sprpriority = 2                  

[State 430, 1]
type = HitDef
trigger1 = Time = 0
attr = C, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = L                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 8, 8      
guard.sparkno = s8300 ;S8200           
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -9, -6              
hitsound = S15, 3                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 430, 2]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Medium Kick
[Statedef 440]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 7                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6110, 440)                       
poweradd = 85                    
sprpriority = 2                  

[State 440, 1]
type = HitDef
trigger1 = Time = 0
attr = C, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = L                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8     
guard.sparkno = s8300 ;S8200            
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -11, -6              
hitsound = S15, 4                  
guardsound = S16, 0            
ground.type = Low               
ground.slidetime = 9            
ground.hittime  = 12             
ground.velocity = -5            
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 440, 2]
type = Width
trigger1 = Time = [7, 15]
player = 8, 3

[State 440, 3]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Crouch Strong Kick
[Statedef 450]
type    = C                      
movetype= A                      
physics = C                      
juggle  = 7                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6111, 450)                       
poweradd = 85                    
sprpriority = 2                  

[State 450, 1]
type = HitDef
trigger1 = var(33) = 0
trigger1 = Time = 0
attr = C, NA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = L                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 10, 10     
guard.sparkno = s8300 ;S8200            
sparkno = s8310+(random%8) ;S8230                      
sparkxy = -11, -10              
hitsound = S15, 5                  
guardsound = S16, 0            
ground.type = Trip               
ground.slidetime = 15            
ground.hittime  = 12             
ground.velocity = 0, -5.5            
airguard.velocity = -1.9,-.8     
air.type = Trip                  
air.velocity = -1,-4.5           
air.hittime = 12

[State 450, 1] ;s.adapt mode 
type = HitDef
trigger1 = var(33) = 1
trigger1 = Time = 0
attr = C, NA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = L                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 10, 10     
guard.sparkno = s8300 ;S8200            
sparkno = s8310+(random%8) ;S8230                      
sparkxy = -11, -10              
hitsound = S15, 5                  
guardsound = S16, 0            
ground.type = Low               
ground.slidetime = 15            
ground.hittime  = 12             
ground.velocity = -5.5            
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1,-4.5           
air.hittime = 12

[State 450, 2]
type = Explod
trigger1 = var(33) = 0
trigger1 = AnimElem = 3
persistent = 1
ID = 451
anim = 451
postype = p1
pos = -14, 5
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 450, 2.2] ;s.adapt mode 
type = Explod
trigger1 = var(33) = 1
trigger1 = AnimElem = 3
persistent = 0
ID = 8041
anim = 8041
postype = p1
pos = -14, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
bindtime = 1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 450, 2.2] ;s.adapt mode 
type = Explod
trigger1 = var(33) = 1
trigger1 = Time = 12
persistent = 0
ID = 8040
anim = 8040
postype = p1
pos = 64, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
bindtime = 1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

;[State 450, 11]
;type = PlayerPush
;trigger1 = NumTarget > 0
;value = 0

[State 450, 2]
type = VelSet
trigger1 = var(33) = 0
trigger1 = Time = [8, 21]
x = 8 ;7

[State 450, 2]
type = VelSet
trigger1 = var(33) = 0
trigger1 = Time = [22, 28]
x = 4

[State 450, 2]
type = VelSet
trigger1 = var(33) = 0
trigger1 = Time = [29, 34]
x = 2

[State 450, 1]  
type = VelMul
trigger1 = var(33) = 0
trigger1 = Time = 35
x = .01

[State 450, 2]
type = VelSet
trigger1 = var(33) = 0
trigger1 = Time = 38
x = 0

[State 450, 2] ;s.adapt mode 
type = VelSet
trigger1 = var(33) = 1
trigger1 = Time = [8, 16]
x = 1.2

[State 450, 1] ;s.adapt mode   
type = VelMul
trigger1 = var(33) = 1
trigger1 = Time = 17
x = .01

[State 450, 2] ;s.adapt mode 
type = VelSet
trigger1 = var(33) = 1
trigger1 = Time = 20
x = 0


[State 450, 2]
type = Width
trigger1 = Time = [9, 19]
player = 8, 0

[State 450, 2]
type = PlaySnd
trigger1 = Time = 7;1
value = 2, 1
channel = 0

[State 450, 3]
type = PlaySnd
trigger1 = var(33) = 0
trigger1 = Time = 9 ;8;1
value = 18, 9

[State 450, 3]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = Time = 9 ;8;1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Light Punch
[Statedef 600]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 2                      
ctrl = 0                         
anim = ifelse(var(33) = 1, 6112, 600)                       
poweradd = 20                    
sprpriority = 2                  

[State 600, 1]
type = HitDef
trigger1 = Time = 0
attr = A, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 8   
guard.sparkno = s8300 ;S8200              
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -8, -56              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
air.type = High  
airguard.velocity = -2,-.8     
air.velocity = -2,-3.5

[State 600, 2]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Medium Punch (neutral)
[Statedef 610]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 4                      
ctrl = 0                         
anim = ifelse(var(33) = 1, 6113, 610)                       
poweradd = 75                    
sprpriority = -1                  

[State 610, 1]
type = HitDef
trigger1 = Time = 0
attr = A, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8 
guard.sparkno = s8300 ;S8200                
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -4, -85              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5       
air.type = High        
airguard.velocity = -2,-2     
air.velocity = -2,-7.9           

[State 610, 2]
type = SprPriority
trigger1 = Time = 10
value = 2

[State 610, 1]
type = Width
trigger1 = AnimElem = 3
player = 10,5

[State 610, 1]
type = Width
trigger1 = AnimElem = 4
player = 5, 0

[State 610, 2]
type = PlaySnd
trigger1 = !(Vel Y > 0 && Pos Y > -38)
trigger1 = Time = 1
value = 2, 1
channel = 0

[State 610, 3]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Strong Punch 
[Statedef 620]
type    = A                      
movetype= A                      
;physics = ifelse(var(20) > 50, N, A)                      
juggle  = 4                      
ctrl = 0                         
anim = ifelse(var(33) = 1, ifelse(var(20) > 75, 6141, 6114), 620)                       
poweradd = 95                    
sprpriority = 2

[State 620, 1] 
type = StateTypeSet
trigger1 = var(20) < 76 && Time = 0 
statetype = A
movetype = A
physics = A

[State 620, 2] ;Fireball Shoot
type = Explod
trigger1 = var(20) < 76 && AnimElem = 3
persistent = 0
anim = 621
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 620, 3] ;Fireball efect
type = Explod
trigger1 = var(22) < 76 && Time = 12
persistent = 0
anim = 222
postype = p1
pos = 29, -68
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 620, 4]
type = Helper
trigger1 = var(20) < 76 && AnimElem = 3
helpertype = normal
name = "Fireball"
ID = 223 
pos = 29, -68
postype = p1
;bindtime = -1
;facing = 1
stateno = 223 
ownpal = 1

[State 620, 2]
type = PalFX
trigger1 = NumHelper(223) > 0
trigger1 = var(22) < 76 && Time = [7, 9] ;3
add = 120,120,255
time = 1

[State 620, 3]
type = PalFX
trigger1 = NumHelper(223) > 0
trigger1 = var(22) < 76 && Time = [10, 12] ;3
add = 80,80,256
time = 1

[State 620, 4]
type = PalFX
trigger1 = NumHelper(223) > 0
trigger1 = var(22) < 76 && Time = [13, 16] ;4
add = 50,50,155
time = 1

[State 620, 5]
type = PalFX
trigger1 = NumHelper(223) > 0
trigger1 = var(22) < 76 && Time = [17, 19] ;3
add = 20,20,95
time = 1


[State 625, 1] 
type = StateTypeSet
trigger1 = var(20) > 75 && Time = 0 
statetype = A
movetype = A
physics = N

[State 625, 2] ;Fireball Shoot
type = Explod
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 3
persistent = 0
ID = 622
anim = 622
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 625, 3] ;Fireball efect
type = Explod
;trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = 12
persistent = 0
anim = 226
postype = p1
pos = 29, -68
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 625, 4]
type = Helper
trigger1 = var(33) != 1 
trigger1 = var(20) > 75 && AnimElem = 3
helpertype = normal
name = "Fireball"
ID = 227 
pos = 29, -68
postype = p1
;bindtime = -1
;facing = 1
stateno = 227 
ownpal = 1

[State 625, 4.2]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) > 75 && var(20) < 350 && AnimElem = 3
helpertype = normal
name = "Hand Burst"
ID = 1700 
pos = 29, -68 ;24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 1700 
ownpal = 1

[State 625, 4.3]
type = Helper
trigger1 = var(33) = 1 
trigger1 = var(20) >= 350 && AnimElem = 3
helpertype = normal
name = "Hand Strong Burst"
ID = 1702 
pos = 29, -68
postype = p1
;bindtime = -1
;facing = 1
stateno = 1702 
ownpal = 1

[State 625, 1]
type = VelSet
trigger1 = var(20) > 75 && Time = 0
x = Vel X / 2 
y = Vel Y / 2  

[State 625, 3]
type = VelMul
trigger1 = var(20) > 75 && Time = 0
x = .1 
y = .1  

[State 625, 2]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [7, 9] ;3
add = 255,120,0
time = 1

[State 625, 3]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [10, 12] ;3
add = 190,120,0
time = 1

[State 625, 4]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [13, 16] ;4
add = 190,80,0
time = 1

[State 625, 5]
type = PalFX
trigger1 = var(33) != 1 
trigger1 = var(22) > 75 && Time = [17, 19] ;3
add = 90,50,0
time = 1

[State 625, 2] ;Burst Hand - no pal
type = PalFX
trigger1 = var(33) = 1 
trigger1 = var(22) > 75 && Time = [7, 19]
time = 1

[State 620, 9]
type = PlaySnd
trigger1 = var(20) < 76 && AnimElem = 3
value = 18, 0

[State 620, 10]
type = PlaySnd
trigger1 = var(20) > 75 && AnimElem = 3
value = 18, 1

[State 620, 5] ;Fireball (reset hold var)
type = VarSet
trigger1 = NumExplod(622) > 0 ;AnimElem = 4 ;Time = 0
trigger2 = var(33) = 1 
trigger2 = var(20) > 75 && AnimElem = 3
var(20) = 0

;[State 620, 3] ;burst hand - start pos y select
;Type = VarSet
;trigger1 = !Time
;var(27) = 3

[State 620, 2]
type = PlaySnd
trigger1 = !(Vel Y > 0 && Pos Y > -48)
trigger1 = var(20) < 76 && Time = 4
value = 2, 0
channel = 0

[State 620, 2]
type = PlaySnd
trigger1 = var(20) > 75 && Time = 4
value = 2, 4
channel = 0
  
;[State 620, 6]
;type = PlaySnd
;trigger1 = Time = 1
;value = 10, 2

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Light Kick
[Statedef 630]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 3                      
ctrl = 0                         
anim = ifelse(var(33) = 1, 6115, 630)                       
poweradd = 20                    
sprpriority = 2                  

[State 630, 1]
type = HitDef
trigger1 = Time = 0
attr = A, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 7, 8   
guard.sparkno = s8300 ;S8200              
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -9, -43              
hitsound = S15, 3                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3       
air.type = Low        
airguard.velocity = -2,-.8     
air.velocity = -2,-3           

[State 630, 2]
type = PlaySnd
trigger1 = Time = 1
value = 10, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Medium Kick 
[Statedef 640]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 4                      
ctrl = 0                         
anim = ifelse(var(33) = 1, 6116, 640)                       
poweradd = 75                    
sprpriority = -1                  

[State 640, 1]
type = HitDef
trigger1 = Time = 0
attr = A, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 8, 8   
guard.sparkno = s8300 ;S8200              
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -13, -53              
hitsound = S15, 4                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5       
air.type = Low        
airguard.velocity = -2,-1     
air.velocity = -2,-5           

[State 640, 2]
type = Width
trigger1 = Time = [6, 16]
player = 8, 0

[State 640, 2]
type = PlaySnd
trigger1 = !(Vel Y > 0 && Pos Y > -25)
trigger1 = Time = 1
value = 2, 3
channel = 0

[State 640, 3]
type = PlaySnd
trigger1 = Time = 1
value = 10, 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Strong Kick 
[Statedef 650]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 5                      
ctrl = 0                         
anim = ifelse(var(33) = 1, 6117, 650)                       
poweradd = 95                    
sprpriority = -1                  

[State 650, 1.1] 
type = HitDef
trigger1 = Time = 0
attr = A, NA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 9, 8     
guard.sparkno = s8300 ;S8200            
sparkno = s8310+(random%8) ;S8230                      
sparkxy = -10, -26              
hitsound = S15, 5                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -7     
air.type = High          
airguard.velocity = -3, 5     
air.velocity = -7, 9           
fall = 0
air.fall = 1
;p2stateno = 651

[State 650, 8]
type = TargetState
trigger1 = MoveHit
;trigger1 = NumTarget > 0
;trigger1 = !target, IsHelper
value = 651
ignorehitpause = 1
persistent = 0

[State 650, 2]
type = Width
trigger1 = Time = [5, 14]
player = 8, 0

[State 650, 2]
type = PlaySnd
trigger1 = !(Vel Y > 0 && Pos Y > -41)
trigger1 = Time = 1
value = 2, 2
channel = 0

[State 650, 3]
type = PlaySnd
trigger1 = Time = 1
value = 10, 2

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Fall and Recover (a custom gethit state)
[Statedef 651]
type    = U
movetype= H
physics = N
;anim = 5011

[State 651, 1]
type = Turn
trigger1 = P2Dist X < -5
ignorehitpause = 1

[State 651, 1]
type = SelfState
trigger1 = StateType = S 
;trigger1 = !Time
value = 5000   
ignorehitpause = 1

[State 651, 1]
type = SelfState
trigger1 = StateType = C 
;trigger1 = !Time
value = 5010   
ignorehitpause = 1

[State 651, 1]
type = ChangeAnim
;trigger1 = StateType = A 
trigger1 = !Time
value = 5011   
ignorehitpause = 1

[State 651, 0]
type = VelSet
trigger1 = Anim = 5011
trigger1 = !Time 
x = 0
y = 0 

[State 651, 1]
type = ChangeAnim
trigger1 = Anim = 5011
trigger1 = Time = 8;4
value = 5050   

[State 651, 1]
type = HitFallSet
;trigger1 = Anim = 5050
trigger1 = Time = 8
value = 1

[State 651, 1] 
type = VelSet
;trigger1 = Anim = 5050
trigger1 = Time = 8
x = -12;-8
y = 12;10 

[State 651, 1]
type = ChangeState;ChangeAnim
trigger1 = Anim != 5040;5120
trigger1 = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
value = 300 ;5040;5120   

[State 651, 1] ;if dead
type = SelfState
trigger1 = !Alive
trigger1 = Vel Y > 0  
trigger1 = Pos Y >= 0  
value = 5100 ;5150   


;---------------------------------------------------------------------------
; Throw - Attempt
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = ifelse(var(33) = 1, 6180, 800) ;800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          
hitflag = M-          
priority = 1 + var(43), Miss    
sparkno = S8250
sparkxy = 0, -60
hitsound = S16, 1     
sprpriority = 1       
p1facing = ifelse (command = "holdback", -1, 1) 
p2facing = -1          
p1stateno = 810       
p2stateno = 820       
guard.dist = 0        
fall = 1              
ignorehitpause = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Throw - Throwing the opponent
[Statedef 810]
type    = S
movetype= A
physics = N
anim = ifelse(var(33) = 1, 6181, 810) ;810
poweradd = 0

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1, 2

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 6
value = 800, 0

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1 
pos = -30, -5

[State 810, Width 2-11]
type = Width
trigger1 = AnimElem = 1 
edge = 2,0

;[State 810, holdfwd - Pos 6] ;If was holding fwd before, move a little
;type = PosAdd
;trigger1 = var(2)
;trigger1 = AnimElem = 6
;x = -37

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElem = 2 
pos = -17, -16

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElem = 3 
pos = -15, -18

[State 810, Bind 6]
type = TargetBind
trigger1 = AnimElem = 4 
pos = -24, -12

[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElem = 5 
pos = -18, -15

[State 810, Bind 9]
type = TargetBind
trigger1 = AnimElem = 6 
pos = 43, 5

;[State 810, Bind 10]
;type = TargetBind
;trigger1 = AnimElem = 7
;pos = 55, 5

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 7
value = -78

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 7
value = 821

[State 810, 3]
type = PosAdd
trigger1 = AnimElem = 11
x = 35

[State 810, 2] ;P2 Hit Ground Spark (front)
type = Explod
trigger1 = enemy, StateNo = 821;5100 ;Time = 43 ;33
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ignorehitpause = 1

[State 810, 3] ;P2 Hit Ground Spark (back)
type = Explod
trigger1 = enemy, StateNo = 821;5100 ;Time = 41 ;31
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ignorehitpause = 1

[State 810, 4]
type = EnvShake
trigger1 = enemy, StateNo = 821;5100 ;Time = 40 ;30
time = 10
ignorehitpause = 1

[State 810, 5]
type = PlaySnd
trigger1 = enemy, StateNo = 821;5100 ;Time = 40 ;30
value = 40, 1;2
persistent = 0
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Thrown (a custom gethit state)
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

;---------------------------------------------------------------------------
; Thrown - thrown into the air (a custom gethit state)
[Statedef 888888821]
type    = A
movetype= H
physics = N
velset = 0, 5
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = 5.4

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

;---------------------------------------------------------------------------
; Throw - HIT_BOUNCE (hit ground)
[Statedef 821]
type    = L
movetype= H
physics = N

;[State 821, 1]
;type = VelSet
;trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
;trigger1 = vel x > 1
;x = 1

[State 821, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

;[State 821, Var] ;Save fall velocity
;type = VarSet
;trigger1 = Time = 0
;;trigger1 = GetHitVar(fall.yvel) = 0
;sysvar(1) = floor(vel y)

[State 821, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 821, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 821, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 821, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 821, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

;[State 821, 7]
;type = ChangeState
;trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
;value = 5110 ;HIT_LIEDOWN

[State 821, 10]
type = HitFallDamage
trigger1 = Time = 3

[State 821, 12]
type = PosFreeze
trigger1 = 1

[State 821, 13]
type = SelfState
trigger1 = AnimTime = 0
value = 5110

[State 821, 14]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Mega Upper - X 
[Statedef 1000]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6121, 1000)                       
poweradd = 75                    
sprpriority = 2                  

[State 1000, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1000, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2      
guard.sparkno = s8301 ;S8200           
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12            
ground.velocity = -7,-14             
airguard.velocity = -1.9,5     
air.type = High                  
air.velocity = -6,-13           
air.hittime = 12

[State 1000, 3] ;Power
type = Explod
triggerall = var(33) = 0
triggerall = NumExplod(1010) < 1
trigger1 = Time = 10  
persistent = 0
anim = 11010
ID = 1010
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
removeongethit = 1
supermovetime = -1
bindtime = -1
ownpal = 1

[State 1000, 4] ;Remove Energy (1)
type = RemoveExplod
trigger1 = AnimElem = 7
ID = 1010

[State 1000, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 6
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1000, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 7
ID = 66142

[State 1000, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 6
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1000, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 7
ID = 66143

[State 1000, 24] 
type = StateTypeSet
trigger1 = Time = 10 
statetype = A
movetype = A
physics = A

[State 1000, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1000, 2]
type = VelSet
trigger1 = Time = 0
x = 7;5

[State 1000, 2]
type = VelSet
trigger1 = AnimElem = 5
x = 0

;[State 1000, 26]
;type = VelSet
;trigger1 = Time = 10
;x = 5.4
;y = -10.1

;[State 1000, 27]
;type = VelSet
;trigger1 = Time = 12
;x = 5.1
;y = -10.1

;[State 1000, 28]
;type = VelSet
;trigger1 = Time = 15
;x = 2.4
;y = -11.1

;[State 1000, 29]
;type = VelSet
;trigger1 = Time = 18
;x = 1.3
;y = -4.1

;[State 1000, 30]
;type = VelSet
;trigger1 = Time = 19
;x = 0
;y = -1.1

[State 1100, Vel]
type = velset
trigger1 = time = [10,13]
x = ifelse(var(33) = 1, 7, 6)
y = -6.5

[State 1100, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1100, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1100, 2]
type = VelAdd
trigger1 = time >= 10 
y = .1

[State 1100, 2]
type = VelAdd
trigger1 = time >= 20
y = .1

[State 1000, 31]
type = PlaySnd
trigger1 = Time = 5;10
value = 3, 3
channel = 0

[State 1000, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 6
value = 18, 25
persistent = 0

[State 1000, 33]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Mega Upper - Y 
[Statedef 1001]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6122, 1001)                       
poweradd = 75                    
sprpriority = 2                  

[State 1001, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1001, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2  
guard.sparkno = s8301 ;S8200               
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12             
ground.velocity = -7.5,-15             
airguard.velocity = -1.9,5    
air.type = High                  
air.velocity = -6.5,-14           
air.hittime = 12

[State 1001, 3] ;Power
type = Explod
triggerall = var(33) = 0
triggerall = NumExplod(1010) < 1
trigger1 = Time = 8  
persistent = 0
anim = 11010
ID = 1010
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
removeongethit = 1
supermovetime = -1
bindtime = -1
ownpal = 1

[State 1001, 4] ;Remove Energy (1)
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 1010

[State 1001, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 5
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1001, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 66142

[State 1001, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 5
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1001, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 66143

[State 1001, 24] 
type = StateTypeSet
trigger1 = Time = 8 
statetype = A
movetype = A
physics = A

[State 1001, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1001, 2]
type = VelSet
trigger1 = Time = 0
x = 7;5

[State 1001, 2]
type = VelSet
trigger1 = AnimElem = 4
x = 0

;[State 1001, 26]
;type = VelSet
;trigger1 = Time = 8
;x = 7.8
;y = -13.1

;[State 1001, 27]
;type = VelSet
;trigger1 = Time = 10
;x = 7.1
;y = -13.1

;[State 1001, 28]
;type = VelSet
;trigger1 = Time = 13
;x = 4.4
;y = -14.1

;[State 1001, 29]
;type = VelSet
;trigger1 = Time = 15
;x = 2.95
;y = -12.1

;[State 1001, 30]
;type = VelSet
;trigger1 = Time = 18
;x = .9
;y = -7.1

;[State 1001, 31]
;type = VelSet
;trigger1 = Time = 21
;x = .1
;y = -2.2

;[State 1001, 32]
;type = VelSet
;trigger1 = Time = 25
;x = 0
;y = -1.5

[State 1101, Vel]
type = velset
trigger1 = time = [8,13]
x = ifelse(var(33) = 1, 8, 7)
y = -8.5

[State 1101, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1101, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1101, 2]
type = VelAdd
trigger1 = time >= 8 
y = .1

[State 1101, 2]
type = VelAdd
trigger1 = time >= 18
y = .1

[State 1001, 33]
type = PlaySnd
trigger1 = Time = 5;10
value = 3, 3
channel = 0

[State 1001, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 5
value = 18, 25
persistent = 0

[State 1001, 35]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Mega Upper - Z 
[Statedef 1002]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = ifelse(var(33) = 1, 6123, 1002)                       
poweradd = 75                    
sprpriority = 2                  

[State 1002, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1002, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12             
ground.velocity = -8,-16             
airguard.velocity = -1.9,5     
air.type = High                  
air.velocity = -7,-15           
air.hittime = 12

[State 1002, 3] ;Power
type = Explod
triggerall = var(33) = 0
triggerall = NumExplod(1010) < 1
trigger1 = Time = 8  
persistent = 0
anim = 11010
ID = 1010
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
removeongethit = 1
supermovetime = -1
bindtime = -1
ownpal = 1

[State 1002, 4] ;Remove Energy (1)
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 1010

[State 1002, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 5
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1002, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 66142

[State 1002, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 5 
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1002, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 6
ID = 66143

[State 1002, 24] 
type = StateTypeSet
trigger1 = Time = 8 
statetype = A
movetype = A
physics = A

[State 1002, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1002, 2]
type = VelSet
trigger1 = Time = 0
x = 7;5

[State 1002, 2]
type = VelSet
trigger1 = AnimElem = 4
x = 0

;[State 1002, 26]
;type = VelSet
;trigger1 = Time = 8
;x = 9.7
;y = -16.1

;[State 1002, 27]
;type = VelSet
;trigger1 = Time = 10
;x = 9.1
;y = -16.1

;[State 1002, 28]
;type = VelSet
;trigger1 = Time = 13
;x = 5.3
;y = -19.1

;[State 1002, 29]
;type = VelSet
;trigger1 = Time = 15
;x = 2.95
;y = -15.1

;[State 1002, 30]
;type = VelSet
;trigger1 = Time = 18
;x = 1.6
;y = -7.1

;[State 1002, 31]
;type = VelSet
;trigger1 = Time = 22
;x = .7
;y = -3.3

;[State 1002, 32]
;type = VelSet
;trigger1 = Time = 25
;x = .05
;y = -1.3

;[State 1002, 33]
;type = VelSet
;trigger1 = Time = 29
;x = 0
;y = -.9

[State 1102, Vel]
type = velset
trigger1 = time = [8,15]
x = ifelse(var(33) = 1, 9, 8)
y = -10;9.5

[State 1102, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1102, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1102, 2]
type = VelAdd
trigger1 = time >= 8 
y = .1

[State 1102, 2]
type = VelAdd
trigger1 = time >= 18
y = .1

[State 1002, 34]
type = PlaySnd
trigger1 = Time = 5;10
value = 3, 3
channel = 0

[State 1002, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 5
value = 18, 25
persistent = 0

[State 1002, 36]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Mega Upper - X (S.Adapt Mode) 
[Statedef 1050]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 6154                       
poweradd = 75                    
sprpriority = 2                  

[State 1050, 2]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2      
guard.sparkno = s8301 ;S8200           
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12            
ground.velocity = -7,-14             
airguard.velocity = -1.9,5     
air.type = High                  
air.velocity = -6,-13           
air.hittime = 12

[State 1050, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 3
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1050, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66142

[State 1050, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 3
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1050, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66143

[State 1050, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1050, Vel]
type = velset
trigger1 = time = [5, 8] ;[10,13]
x = 7
y = -6.5

[State 1050, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1050, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1050, 2]
type = VelAdd
trigger1 = time >= 5;10 
y = .1

[State 1050, 2]
type = VelAdd
trigger1 = time >= 15;20
y = .1

[State 1050, 31]
type = PlaySnd
trigger1 = Time = 0;5;10
value = 3, 3
channel = 0

[State 1050, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 3
value = 18, 25
persistent = 0

[State 1050, 33]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Mega Upper - Y (S.Adapt Mode) 
[Statedef 1051]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 6155                       
poweradd = 75                    
sprpriority = 2                  

[State 1051, 2]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2  
guard.sparkno = s8301 ;S8200               
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12             
ground.velocity = -7.5,-15             
airguard.velocity = -1.9,5    
air.type = High                  
air.velocity = -6.5,-14           
air.hittime = 12

[State 1051, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 3
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1051, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66142

[State 1051, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 3
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1051, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66143

[State 1051, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1051, Vel]
type = velset
trigger1 = time = [8,13]
x = 8
y = -8.5

[State 1051, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1051, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1051, 2]
type = VelAdd
trigger1 = time >= 8 
y = .1

[State 1051, 2]
type = VelAdd
trigger1 = time >= 18
y = .1

[State 1051, 33]
type = PlaySnd
trigger1 = Time = 0;5;10
value = 3, 3
channel = 0

[State 1051, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 3
value = 18, 25
persistent = 0

[State 1051, 35]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Mega Upper - Z (S.Adapt Mode)
[Statedef 1052]
type    = A                      
movetype= A                      
physics = A                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 6156                       
poweradd = 75                    
sprpriority = 2                  

[State 1052, 2]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 7, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8270                      
sparkxy = -15, -95              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 12             
ground.velocity = -8,-16             
airguard.velocity = -1.9,5     
air.type = High                  
air.velocity = -7,-15           
air.hittime = 12

[State 1052, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 3
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1052, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66142

[State 1052, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 3 
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1052, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 4
ID = 66143

[State 1052, 25]
type = HitBy
trigger1 = 1
value = SCA, SA,HA,NP,SP,HP

[State 1052, Vel]
type = velset
trigger1 = time = [8,15]
x = 9
y = -10;9.5

[State 1052, Vel]
type = velmul
trigger1 = 1
x = 0.88

[State 1052, Vel]
type = velmul
trigger1 = vel y > .5
x = 0

[State 1052, 2]
type = VelAdd
trigger1 = time >= 8 
y = .1

[State 1052, 2]
type = VelAdd
trigger1 = time >= 18
y = .1

[State 1052, 34]
type = PlaySnd
trigger1 = Time = 0;5;10
value = 3, 3
channel = 0

[State 1052, 35]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 3
value = 18, 25
persistent = 0

[State 1052, 36]
type = ChangeState
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Weapon Choice - X 
[Statedef 1100]
type    = S                      
movetype= A                      
physics = S                      
;juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 1100                       
;poweradd = 75                    
sprpriority = 2                  

[State 1100, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1100, 1] ;Fliptop
type = Helper
triggerall = NumHelper(192) < 1
trigger1 = !Time
helpertype = normal
name = "FlipTop"
ID = 1101 
pos = 90, 0
postype = p1
;facing = 1
stateno = 1101 
ownpal = 1
ignorehitpause = 1

[State 1120, 5]
type = PlaySnd
trigger1 = Time = 2;6
value = 2, 2
channel = 0

[State 1120, 6]
type = PlaySnd
trigger1 = Time = 5;4
value = 1, 0

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

;---------------------------------------------------------------------------
; FlipTop: Helper 
[Statedef 1101]
type = A
movetype = I
ctrl = 0
anim = 1101
velset = 0, 0
sprpriority = 2

[State 1101, 0.1] ;turn anim
type = Turn
trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
trigger1 = !Time

[State 1101, 0.2] ;turn position
type = PosAdd
trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
trigger1 = !Time
x = 180

[State 1101, 1] ;stand
type = ChangeAnim
trigger1 = Anim = 1101
trigger1 = AnimTime = 0
trigger2 = Anim = 1104
trigger2 = ParentDist X >= -90
value = 1102

[State 1101, 1] ;give weapon
type = ChangeAnim
trigger1 = Anim = 1102
trigger1 = AnimTime = 0
trigger1 = ParentDist X >= -90
value = 1103

[State 1101, 1] ;Weapons: rock ball, tornado hold, leaf shield
type = Helper
triggerall = NumHelper(1120) < 1
trigger1 = Anim = 1103
trigger1 = AnimElem = 5
helpertype = normal
name = "Weapons"
ID = 1102 
pos = 0, 0;-5,-20
postype = p1
;facing = 1
stateno = 1102 
ownpal = 1
ignorehitpause = 1

[State 1101, 1] ;walk
type = ChangeAnim
trigger1 = Anim = 1102
trigger1 = AnimTime = 0
trigger1 = ParentDist X < -90
value = 1104

[State 1101, 2] ;give weapon
type = VelSet
trigger1 = ParentDist X >= -90
trigger2 = Anim = 1103
x = 0

[State 1101, 2] ;walk
type = VelSet
trigger1 = Anim = 1104;2
;trigger1 = ParentDist X < -90
x = -3

;[State 1101, 1]
;type = ChangeAnim
;trigger1 = Anim = 1103
;trigger1 = AnimTime = 0
;value = 1105

[State 1101, 2] ;up
type = VelSet
trigger1 = Anim = 1103;5 
trigger1 = AnimElem = 34
y = -20

[State 1101, 6] ;up
type = PlaySnd
trigger1 = Anim = 1103 
trigger1 = AnimElem = 12
value = 18, 8

[State 1101, 6] ;giving weapon
type = PlaySnd
trigger1 = Anim = 1103 
trigger1 = AnimElem = 4;3
value = 18, 14

[State 1101, 6] ;closing head
type = PlaySnd
trigger1 = Anim = 1103 
trigger1 = AnimElem = 9
value = 18, 15

[State 1101, 3]
type = DestroySelf
trigger1 = Anim = 1103;5
trigger1 = ScreenPos Y < 15 ;Time = 105 
;trigger1 = NumHelper(1102) > 0
;trigger1 = Helper, NumExplod(1110) < 1 && Helper, NumExplod(1111) < 1
;trigger2 = NumHelper(1102) > 0
;trigger2 = Helper, NumExplod(1150) > 0 || Helper, NumExplod(1151) > 0 || Helper, NumExplod(1152) > 0

;---------------------------------------------------------------------------
; Weapons: Rock Ball, Tornado Hold, Leaf Shield (Helper)
[Statedef 1102]
type = A
movetype = I
ctrl = 0
;anim = 1120
velset = 0, 0
sprpriority = 5

[State 1102, 1] 
type = ChangeAnim
trigger1 = !Time
value = 1120 + (root, var(9))

[state 1102, 0]
type = PosAdd
trigger1 = Time = 0 
x = -2
y = -23

[state 1102, 1]
type = PosAdd
trigger1 = Time = 1 
x = -1;-3
y = -6;-29

[state 1102, 2]
type = PosAdd
trigger1 = Time = 2 
x = -2;-5
y = -6;-35

[state 1102, 3]
type = PosAdd
trigger1 = Time = 3 
x = -1;-6
y = -5;-40

[state 1102, 4]
type = PosAdd
trigger1 = Time = 4 
x = -2;-8
y = -5;-45

[state 1102, 5]
type = PosAdd
trigger1 = Time = 5 
x = -1;-9
y = -5;-50

[state 1102, 6]
type = PosAdd
trigger1 = Time = 6 
x = -3;-12
y = -8;-58

[state 1102, 7]
type = PosAdd
trigger1 = Time = 7 
x = -2;-14
y = -4;-62

[state 1102, 8]
type = PosAdd
trigger1 = Time = 8 
x = -1;-15
y = -4;-66

[state 1102, 9]
type = PosAdd
trigger1 = Time = 9 
x = -2;-17
y = -4;-70

[state 1102, 10]
type = PosAdd
trigger1 = Time = 10 
x = -1;-18
y = -3;-73

[state 1102, 11]
type = PosAdd
trigger1 = Time = 11 
x = -2;-20
y = -3;-76

[state 1102, 12]
type = PosAdd
trigger1 = Time = 12 
x = -3;-23
y = -5;-81

[state 1102, 13]
type = PosAdd
trigger1 = Time = 13 
x = -1;-24
y = -2;-83

[state 1102, 14]
type = PosAdd
trigger1 = Time = 14 
x = -2;-26
y = -2;-85

[state 1102, 15]
type = PosAdd
trigger1 = Time = 15 
x = -1;-27
y = -2;-87

[state 1102, 16]
type = PosAdd
trigger1 = Time = 16 
x = -2;-29
y = -2;-89

[state 1102, 17]
type = PosAdd
trigger1 = Time = 17 
x = -1;-30
y = -1;-90

[state 1102, 18]
type = PosAdd
trigger1 = Time = 18 
x = -3;-33
y = -2;-92

[state 1102, 19]
type = PosAdd
trigger1 = Time = 19 
x = -2;-35
y = 0;-92

[state 1102, 20]
type = PosAdd
trigger1 = Time = 20 
x = -1;-36
y = 0;-92

[state 1102, 21]
type = PosAdd
trigger1 = Time = 21 
x = -2;-38
y = 0;-92

[state 1102, 22]
type = PosAdd
trigger1 = Time = 22 
x = -1;-39
y = 0;-92

[state 1102, 23]
type = PosAdd
trigger1 = Time = 23 
x = -2;-41
y = 0;-92

[state 1102, 24]
type = PosAdd
trigger1 = Time = 24 
x = -3;-44
y = 2;-90

[state 1102, 25]
type = PosAdd
trigger1 = Time = 25 
x = -1;-45
y = 1;-89

[state 1102, 26]
type = PosAdd
trigger1 = Time = 26 
x = -2;-47
y = 2;-87

[state 1102, 27]
type = PosAdd
trigger1 = Time = 27 
x = -1;-48
y = 2;-85

[state 1102, 28]
type = PosAdd
trigger1 = Time = 28 
x = -2;-50
y = 2;-83

[state 1102, 29]
type = PosAdd
trigger1 = Time = [29, 30] 
x = -1;-51
y = 2;-81

[state 1102, 30]
type = PosAdd
trigger1 = Time = 31 
x = -3;-54
y = 5;-76

[state 1102, 31]
type = PosAdd
trigger1 = Time = 32 
x = -2;-56
y = 3;-73

[state 1102, 32]
type = PosAdd
trigger1 = Time = 33 
x = -1;-57
y = 3;-70

[state 1102, 33]
type = PosAdd
trigger1 = Time = 34 
x = -2;-59
y = 4;-66

[state 1102, 34]
type = PosAdd
trigger1 = Time = 35 
x = -1;-60
y = 4;-62

[state 1102, 35]
type = PosAdd
trigger1 = Time = 36 
x = -2;-62
y = 4;-58

[state 1102, 36]
type = PosAdd
trigger1 = Time = 37 
x = -1;-63
y = 4;-54

[state 1102, 37]
type = PosAdd
trigger1 = Time = 38 
x = -3;-66
y = 9;-45

[state 1102, 38]
type = PosAdd
trigger1 = Time = 39 
x = -2;-68
y = 5;-40

[state 1102, 39]
type = PosAdd
trigger1 = Time = 40 
x = -1;-69
y = 5;-35

[state 1102, 40]
type = PosAdd
trigger1 = Time = 41 
x = -2;-71
y = 6;-29

[state 1102, 41]
type = PosAdd
trigger1 = Time = 42 
x = -1;-72
y = 6;-23

[state 1102, 42]
type = PosAdd
trigger1 = Time = 43 
x = -3;-75
y = 12;-11

[state 1102, 43]
type = PosAdd
trigger1 = Time = 44 
x = -2;-77
y = 6;-5

[state 1102, 44]
type = PosAdd
trigger1 = Time = 45 
x = -1;-78
y = 5;0


[State 1102, 1] ;Cristal Ball
type = Explod
trigger1 = !Time 
persistent = 0
ID = 1110
anim = 1110
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
shadow = -1,0,0

[State 1102, 1] ;Background Ball
type = Explod
trigger1 = !Time 
persistent = 0
ID = 1111
anim = 1111
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = -1
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0

[State 1102, 1] 
type = ChangeAnim
triggerall = Anim = 1120
trigger1 = Time = 216
value = 1121 

[State 1102, 2] 
type = ChangeAnim
triggerall = Anim = 1130
trigger1 = Time = 216
value = 1131 

[State 1102, 3] 
type = ChangeAnim
triggerall = Anim = 1140
trigger1 = Time = 216
value = 1141 

[State 1102, 4]
type = RemoveExplod
trigger1 = root, var(16) != 1
trigger1 = var(30) := Time ;line by SMI
trigger1 = RootDist X = [-30, 40]
trigger1 = RootDist Y = [-10, 55]
ID = 1110
persistent = 0

[State 1102, 5]
type = RemoveExplod
trigger1 = root, var(16) != 1
trigger1 = var(30) := Time ;line by SMI
trigger1 = RootDist X = [-30, 40]
trigger1 = RootDist Y = [-10, 55]
ID = 1111
persistent = 0

[State 1102, 1] ;rock ball
type = VarSet
triggerall = root, var(16) != 1
triggerall = Anim = 1120 || Anim = 1121
trigger1 = RootDist X = [-30, 40]
trigger1 = RootDist Y = [-10, 55]
;;trigger1 = NumExplod(1150) > 0
;;trigger1 = NumExplod(1110) < 1 && NumExplod(1111) < 1
;trigger1 = Time = var(50) 
v = 10
value = 1;-10
;persistent = 0

[State 1102, 2] ;tornado hold
type = VarSet
triggerall = root, var(16) != 1
triggerall = Anim = 1130 || Anim = 1131
trigger1 = RootDist X = [-30, 40]
trigger1 = RootDist Y = [-10, 55]
;;trigger1 = NumExplod(1151) > 0
;;trigger1 = NumExplod(1110) < 1 && NumExplod(1111) < 1
;trigger1 = Time = var(50)
v = 10
value = 2;0
;persistent = 0

[State 1102, 3] ;leaf shield
type = VarSet
triggerall = root, var(16) != 1
triggerall = Anim = 1140 || Anim = 1141
trigger1 = RootDist X = [-30, 40]
trigger1 = RootDist Y = [-10, 55]
;;trigger1 = NumExplod(1152) > 0
;;trigger1 = NumExplod(1110) < 1 && NumExplod(1111) < 1
;trigger1 = Time = var(50) 
v = 10
value = 3;10
;persistent = 0

[State 1102, 6] ;item sound
type = PlaySnd
triggerall = root, var(16) != 1
trigger1 = Time = var(30) + 1 
value = 18, 7
persistent = 0

[State 1102, 1] ;letter: Rock Ball
type = Explod
triggerall = root, var(16) != 1
triggerall = Anim = 1120 || Anim = 1121
;trigger1 = RootDist X = [-30, 40]
;trigger1 = RootDist Y = [-10, 55]
trigger1 = Time = var(30) + 1 
persistent = 0
ID = 1150
anim = ifelse((root, var(23) = 0), 1150, 1153)
postype = p1
pos = 0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1

[State 1102, 2] ;letter: Tornado Hold
type = Explod
triggerall = root, var(16) != 1
triggerall = Anim = 1130 || Anim = 1131
;trigger1 = RootDist X = [-30, 40]
;trigger1 = RootDist Y = [-10, 55]
trigger1 = Time = var(30) + 1 
persistent = 0
ID = 1151
anim = ifelse((root, var(23) = 0), 1151, 1154)
postype = p1
pos = 0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1

[State 1102, 3] ;letter: Leaf Shield
type = Explod
triggerall = root, var(16) != 1
triggerall = Anim = 1140 || Anim = 1141
;trigger1 = RootDist X = [-30, 40]
;trigger1 = RootDist Y = [-10, 55]
trigger1 = Time = var(30) + 1 
persistent = 0
ID = 1152
anim = ifelse((root, var(23) = 0), 1152, 1155)
postype = p1
pos = 0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1

[State 1102, 6]
type = DestroySelf
trigger1 = root, var(16) != 1
;trigger1 = RootDist X = [-30, 40] ;frente, trás
;trigger1 = RootDist Y = [-10, 55] ;baixo, cima
trigger1 = Time = var(30) + 1 ;line by SMI
;trigger1 = NumExplod(1110) < 1 && NumExplod(1111) < 1
trigger2 = Anim = 1121
trigger2 = AnimTime = 0
trigger3 = Anim = 1131
trigger3 = AnimTime = 0
trigger4 = Anim = 1141
trigger4 = AnimTime = 0

[state -2, displaytoclipboard] ;thanks ixnay
type = displaytoclipboard
trigger1 = 1
text = "var(10) = %d, var(30) = %d, var(11) = %d"
params = var(10), var(30), var(11)


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rock Ball - X
[Statedef 1120]
type    = S                      
movetype= I                     
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1120, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1120, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Rock Ball"
ID = 1125 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1125 
ownpal = 1

;[State 1120, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1120, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1120, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 2
channel = 0

[state 1120, 0]
type = VarSet
trigger1 = !Time
v = 14
value = 0

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

;---------------------------------------------------------------------------
; Rock Ball - Y
[Statedef 1121]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1121, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1121, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Rock Ball"
ID = 1125 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1125 
ownpal = 1

;[State 1121, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1121, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1121, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 2
channel = 0

[state 1121, 0]
type = VarSet
trigger1 = !Time
v = 14
value = 0

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

;---------------------------------------------------------------------------
; Rock Ball - Z
[Statedef 1122]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1122, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1122, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Rock Ball"
ID = 1125 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1125 
ownpal = 1

;[State 1122, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1122, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1122, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 2
channel = 0

[state 1122, 0]
type = VarSet
trigger1 = !Time
v = 14
value = 0

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

;---------------------------------------------------------------------------
; Rock Ball: Helper Position
[Statedef 1125]
type    = A
movetype= I
anim = 1127
sprpriority = 3

[state 1125, 0]
type = ParentVarSet
trigger1 = !Time
v = 14
value = 0

[State 1125, 1] ;kick the ball
type = ChangeState
;triggerall = AnimElem = 12
trigger1 = root, StateNo = 240 
trigger1 = (root, AnimElem = 5) || (root, AnimElem = 6)
trigger1 = RootDist X = [-30, 60] ;frente, trás
trigger1 = RootDist Y = [-10, 55] ;baixo, cima
trigger2 = root, StateNo = 430 
trigger2 = (root, AnimElem = 2) 
trigger2 = RootDist X = [-30, 60] 
trigger2 = RootDist Y = [-10, 55] 
trigger3 = root, StateNo = 440 
trigger3 = (root, AnimElem = 3) || (root, AnimElem = 4)
trigger3 = RootDist X = [-30, 60] 
trigger3 = RootDist Y = [-10, 55]
trigger4 = root, StateNo = 450 
trigger4 = (root, AnimElem = 4) || (root, AnimElem = 5)
trigger4 = RootDist X = [-65, 70] 
trigger4 = RootDist Y = [-10, 55] 
value = 1126

[State 1125, 2] ;explod
type = ChangeState
trigger1 = NumHelper(1125) > 0
trigger1 = root, StateNo = 1120 || root, StateNo = 1121 || root, StateNo = 1122
trigger1 = root, Anim = 220
trigger1 = root, AnimElem = 1
value = 1127

;---------------------------------------------------------------------------
; Rock Ball: Helper Attack
[Statedef 1126]
type    = A
movetype= A
anim = 1128
sprpriority = 3

[state 1126, 44]
type = PosAdd
trigger1 = !Time  
x = 46
y = 4

[State 1126, 2] ;spark
type = Explod
trigger1 = Time = 1
persistent = 0
anim = 8320+(random%8) ;8210
postype = p1
pos = 0, -5
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1

[State 1126, 5]
type = PlaySnd
trigger1 = Time = 1
value = 15, 0

[State 1126, 1]
type = HitDef
triggerall = Time >= 0 ;&& MoveContact = 0
;trigger2 = (GameTime%6) > 5 && HitCount < 3
trigger1 = parent, var(14) = 0
trigger1 = Time % 2 = 0 && HitCount < 4 
;trigger2 = parent, var(14) = 1
;trigger2 = Time > 0 && HitCount < 3 
;trigger3 = parent, var(14) = 2
;trigger3 = Time > 0 && HitCount < 2 
;trigger4 = parent, var(14) = 3
;trigger4 = Time > 0 && HitCount < 1
attr = A, SP                     
damage = floor(56/(1+(Var(19)/5.0))), 2 
getpower = 20
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 2, 3                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8210                      
sparkxy = 15, -25              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3.5             
airguard.velocity = -.5,-.8     
air.type = High                  
air.velocity = -2.5,-1           
air.hittime = 12

[State 1126, 1]
type = AfterImage
trigger1 = Time = 4
length = 16
;PalBright   =  160, 240, 140
;PalContrast =  80, 120, 220
;TimeGap  = 2
FrameGap = 2
Trans = Add1
time = 9999
sprpriority = 3

[state 1126, 1]
type = ParentVarAdd
trigger1 = FrontEdgeDist < -1
v = 14
value = 1
persistent = 0

[state 1126, 1]
type = ParentVarAdd
trigger1 = BackEdgeDist < -1
v = 14
value = 1
persistent = 0

[state 1126, 1]
type = ParentVarAdd
trigger1 = ScreenPos Y < 15 ;ParentDist Y > (200 + (parent, Pos Y))
v = 14
value = 1
persistent = 0

[state 1126, 1]
type = ParentVarAdd
trigger1 = Vel Y > 0 
trigger1 = Pos Y >= 4
v = 14
value = 1
persistent = 0

[state 1126, 1]
type = ParentVarAdd
trigger1 = MoveContact  
v = 14
value = 1
persistent = 0

[state 1126, 1]
type = VelSet
trigger1 = Time = 5 
x = 9
y = -5

[state 1126, 1]
type = VelSet
triggerall = parent, var(14) < 4 
trigger1 = FrontEdgeDist < -1 
x = -9
y = -5

[state 1126, 1]
type = VelSet
triggerall = parent, var(14) < 4
trigger1 = ScreenPos Y < 15 
x = -9
y = 5

[state 1126, 1]
type = VelSet
triggerall = parent, var(14) < 4
trigger1 = BackEdgeDist < -1 
x = 5
y = 7

[state 1126, 1]
type = PlaySnd
trigger1 = parent, var(14) < 4
trigger1 = Vel Y > 0 
trigger1 = Pos Y >= 4
value = 18, 5
persistent = 0

[state 1126, 1]
type = VelSet
triggerall = parent, var(14) < 4
trigger1 = Vel Y > 0 
trigger1 = Pos Y >= 4  
x = -4
y = -5

[state 1126, 1]
type = PlaySnd
trigger1 = parent, var(14) < 4
trigger1 = FrontEdgeDist < -1
value = 18, 5
persistent = 0

[state 1126, 1]
type = PlaySnd
trigger1 = parent, var(14) < 4
trigger1 = BackEdgeDist < -1
value = 18, 5
persistent = 0

[state 1126, 1]
type = PlaySnd
trigger1 = parent, var(14) < 4
trigger1 = ScreenPos Y < 15 
value = 18, 5
persistent = 0

[State 1126, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1126, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1127
time = -1

[State 1126, 2] ;explod
type = ChangeState
trigger1 = NumHelper(1125) > 0
trigger1 = parent, StateNo = 1120
trigger1 = parent, Anim = 220
trigger1 = parent, AnimElem = 1
value = 1127

[State 1126, 3]
type = DestroySelf
trigger1 = FrontEdgeDist < -150 
trigger2 = BackEdgeDist < -150 
trigger3 = ScreenPos Y < -150
trigger4 = ScreenPos Y > 355 ;test

;---------------------------------------------------------------------------
; Rock Ball: Helper (end)
[Statedef 1127]
type = A
movetype = I
ctrl = 0
anim = 8290;1121
velset = 0, 0
sprpriority = 3

[state 1127, 0]
type = ParentVarSet
trigger1 = !Time
v = 14
value = 0

[state 1127, 1]
type = PosAdd
trigger1 = PrevStateNo = 1125
trigger1 = !Time  
x = 50;46
y = 4

[State 1227, 2]
type = PlaySnd
trigger1 = !Time
value = 18, 4
ignorehitpause = 1
supermovetime = -1

[State 1227, 3]
type = DestroySelf
trigger1 = AnimTime = 0



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Tornado Hold - X
[Statedef 1130]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1130, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1130, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Tornado Hold"
ID = 1130 
pos = 31, -38
postype = p1
;bindtime = -1
;facing = 1
stateno = 1135 
ownpal = 1

;[State 1130, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1130, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1130, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 0
channel = 0

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

;---------------------------------------------------------------------------
; Tornado Hold - Y
[Statedef 1131]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1131, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1131, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Tornado Hold"
ID = 1130 
pos = 31, -42
postype = p1
;bindtime = -1
;facing = 1
stateno = 1136 
ownpal = 1

;[State 1131, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1131, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1131, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 0
channel = 0

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

;---------------------------------------------------------------------------
; Tornado Hold - Z
[Statedef 1132]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1132, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1132, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Tornado Hold"
ID = 1130 
pos = 32, -45
postype = p1
;bindtime = -1
;facing = 1
stateno = 1137 
ownpal = 1

;[State 1132, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1132, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1132, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 0
channel = 0

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

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Tornado Hold: Helper - X
[Statedef 1135]
type    = A
movetype= I
anim = 1132
sprpriority = 3

[state 1135, 1]
type = VelSet
trigger1 = Time = 0 
x = 5
;y = -5

[state 1135, 2]
type = VelAdd
trigger1 = Time >= 0 
y = 0.48

[state 1135, 3]
type = VelSet
trigger1 = FrontEdgeDist < 6;-1
x = 0

[State 1135, 4] 
type = ChangeState
trigger1 = Vel Y > 0   
trigger1 = Pos Y >= 0  
value = 1138

;---------------------------------------------------------------------------
; Tornado Hold: Helper - Y
[Statedef 1136]
type    = A
movetype= I
anim = 1132
sprpriority = 3

[state 1136, 1]
type = VelSet
trigger1 = Time = 0 
x = 9.5
;y = -6

[state 1136, 2]
type = VelAdd
trigger1 = Time >= 0 
y = 0.48

[state 1136, 3]
type = VelSet
trigger1 = FrontEdgeDist < 6;-1
x = 0

[State 1136, 4] 
type = ChangeState
trigger1 = Vel Y > 0   
trigger1 = Pos Y >= 0  
value = 1138

;---------------------------------------------------------------------------
; Tornado Hold: Helper - Z
[Statedef 1137]
type    = A
movetype= I
anim = 1132
sprpriority = 3

[state 1137, 1]
type = VelSet
trigger1 = Time = 0 
x = 12;14

[state 1137, 1]
type = VelSet
trigger1 = Time = 1 
y = -.48

[state 1137, 2]
type = VelAdd
trigger1 = Time >= 0 
y = 0.48

[state 1137, 3]
type = VelSet
trigger1 = FrontEdgeDist < 8;-1
x = 0

[State 1137, 4] 
type = ChangeState
trigger1 = Vel Y > 0   
trigger1 = Pos Y >= 0  
value = 1138

;---------------------------------------------------------------------------
; Tornado Hold: Helper (start tornado) 
[Statedef 1138]
type    = A
movetype= A
anim = 1139
velset = 0,0
sprpriority = 3

[state 1138, 1]
type = PosSet
trigger1 = Time = 0 
y = 0

[State 1138, 3]
type = HitDef
triggerall = Time > 5 
trigger1 = Time % 4 = 0 && HitCount < 3
attr = A, SP                     
damage = floor(30/(1+(root,Var(19)/5.0))), 7
animtype = Up                 
guardflag = MA                  
hitflag = MAFD                  
priority = 4, Hit               
sprpriority = 3
pausetime = 2, 2  
guard.sparkno = -1;S8200                
sparkno = -1;S8270
sparkxy = 0, 0              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = 0, -10
airguard.velocity = -5
air.type = High                 
air.velocity = 0, -8 
air.hittime = 25   

[State 1138, 4] ;Guard Sparks
type = Explod
triggerall = NumExplod(8200) = 0
;trigger1 = NumTarget > 0
trigger1 = MoveGuarded && Time < 25
persistent = 1
anim = 8301 ;8200
ID = 8200
postype = p2 
pos = 0, -40
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
ignorehitpause = 1

[State 1138, 4] ;Hit Sparks
type = Explod
triggerall = NumExplod(8270) = 0
;trigger1 = NumTarget > 0 
trigger1 = MoveHit && HitCount = 1 && Time < 25
persistent = 1
anim = 8320+(random%8) ;8270
ID = 8270
postype = p2 
pos = 0, -50
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
ignorehitpause = 1

[State 1138, 4] ;Hit Sparks
type = Explod
triggerall = NumExplod(8271) = 0
;trigger1 = NumTarget > 0 
trigger1 = MoveHit && HitCount = 2 && Time < 25
persistent = 1
anim = 8320+(random%8) ;8270
ID = 8271
postype = p2 
pos = 0, -50
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
ignorehitpause = 1

[State 1138, 4] ;Hit Sparks
type = Explod
triggerall = NumExplod(8272) = 0
;trigger1 = NumTarget > 0 
trigger1 = MoveHit && HitCount = 3 && Time < 25
persistent = 1
anim = 8320+(random%8) ;8270
ID = 8272
postype = p2 
pos = 0, -50
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1
ignorehitpause = 1

[State 1138, 1] ;bottom power 
type = Explod
trigger1 = Time = 0
persistent = 0
ID = 1133
anim = 1133
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = -1
removetime = -2
sprpriority = 3
ownpal = 1
ignorehitpause = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1138, 1] ;bottom tornado 
type = Explod
trigger1 = Time = 0
persistent = 0
ID = 1138
anim = 11138
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
bindtime = -1
removetime = -2
sprpriority = 4
ownpal = 1
ignorehitpause = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1138, 1] ;tornado 1
type = Explod
trigger1 = Time = 0;5
persistent = 0
ID = 1134
anim = 11134
postype = p1
pos = 0, -8
velocity = 0, 0
accel = 0, 0
bindtime = 26
removetime = -2
sprpriority = 4
ownpal = 1
ignorehitpause = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1138, 1] ;tornado 2
type = Explod
trigger1 = Time = 0;9
persistent = 0
ID = 1135
anim = 11135
postype = p1
pos = 0, -72
velocity = 0, 0
accel = 0, 0
bindtime = 26
removetime = -2
sprpriority = 5
ownpal = 1
ignorehitpause = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1138, 1] ;tornado 3
type = Explod
trigger1 = Time = 0;12
persistent = 0
ID = 1136
anim = 11136
postype = p1
pos = 0, -136
velocity = 0, 0
accel = 0, 0
bindtime = 26
removetime = -2
sprpriority = 6
ownpal = 1
ignorehitpause = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1138, 3]
type = PlaySnd
trigger1 = !Time
value = 18, 6

[State 1138, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1138, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1139
time = -1

;[State 1138, 1] 
;type = ChangeState
;;trigger1 = Vel Y > 0   
;;trigger1 = Pos Y >= 0  
;;trigger1 = Time = 26
;trigger1 = NumExplod(1138) < 1
;value = 1139
;ignorehitpause = 1

[State 1138, 3] 
type = DestroySelf
trigger1 = NumExplod(1138) < 1

;---------------------------------------------------------------------------
; Tornado Hold: Helper (end) 
[Statedef 1139]
type    = A
movetype= I
anim = 8930 ;1137
sprpriority = 3

[State 1139, 1] ;tornado 1
type = Explod
trigger1 = Time = 0
ID = 1137
anim = 11137
postype = p1
pos = 0, -8
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1139, 1] ;tornado 2
type = Explod
trigger1 = Time = 0
ID = 1137
anim = 11137
postype = p1
pos = 0, -72
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 5
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1139, 2] ;tornado 3
type = Explod
trigger1 = Time = 0
ID = 1137
anim = 11137
postype = p1
pos = 0, -136
velocity = 0, 0
accel = 0, 0
;bindtime = -1
removetime = -2
sprpriority = 6
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1139, 3] 
type = DestroySelf
trigger1 = AnimTime = 0




;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Leaf Shield - X
[Statedef 1140]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1140, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1140, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Leaf Shield"
ID = 1145 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1145 
ownpal = 1

;[State 1140, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1140, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1140, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 1
channel = 0

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

;---------------------------------------------------------------------------
; Leaf Shield - Y
[Statedef 1141]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1141, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1141, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Leaf Shield"
ID = 1145 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1145 
ownpal = 1

;[State 1141, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1141, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1141, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 1
channel = 0

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

;---------------------------------------------------------------------------
; Leaf Shield - Z
[Statedef 1142]
type    = S                      
movetype= I                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1142, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1142, 2]
type = Helper
trigger1 = AnimElem = 4
helpertype = normal
name = "Leaf Shield"
ID = 1145 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1145 
ownpal = 1

;[State 1142, 3]
;type = PlaySnd
;trigger1 = AnimElem = 4
;value = 18, 0

[State 1142, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1142, 5]
type = PlaySnd
trigger1 = Time = 6
value = 3, 1
channel = 0

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

;---------------------------------------------------------------------------
; Leaf Shield - Attack
[Statedef 1143]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 220                       
poweradd = 90 
sprpriority = 2                  

[State 1143, 1] ;Back Dust
type = Explod
trigger1 = Time = 3 
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1143, 4]
type = Width
trigger1 = Time = [12, 18]
player = 5, 0

[State 1143, 5]
type = PlaySnd
trigger1 = Time = 6
value = 2, 0
channel = 0

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

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Leaf Shield: Helper Mother
[Statedef 1145]
type    = A
movetype= I
anim = 1144;8930
sprpriority = 3
persistent = 0

[State 1145, 1]
type = BindToRoot
;trigger1 = root, StateNo != 1143 && root, Anim != 220 && root, AnimElem != 4
trigger1 = 1;Time >= 0
;trigger1 = parent, StateType = S
pos = 0, 0;-25 
time = -1
ignorehitpause = 1

;[State 1145, 2]
;type = BindToParent
;;triggerall = !parent, StateNo = 1143
;;triggerall = !parent, Anim = 220
;;triggerall = !parent, AnimElem = 4
;trigger1 = parent, StateType = C
;pos = 0, -25
;time = -1
;ignorehitpause = 1

;[State 1145, 3]
;type = BindToParent
;;triggerall = !parent, StateNo = 1143
;;triggerall = !parent, Anim = 220
;;triggerall = !parent, AnimElem = 4
;trigger1 = parent, StateType = A
;pos = -2, -30
;time = -1
;ignorehitpause = 1

[State 1145, 2]
type = Helper
trigger1 = Time = 0 
helpertype = normal
name = "Leaf Shield 1"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1150 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;8
helpertype = normal
name = "Leaf Shield 2"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1151 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;16
helpertype = normal
name = "Leaf Shield 3"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1152 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;24
helpertype = normal
name = "Leaf Shield 4"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1153 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;32
helpertype = normal
name = "Leaf Shield 5"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1154 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;40
helpertype = normal
name = "Leaf Shield 6"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1155 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;48
helpertype = normal
name = "Leaf Shield 7"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1156 
ownpal = 0
persistent = 0

[State 1145, 2]
type = Helper
trigger1 = Time = 0;56
helpertype = normal
name = "Leaf Shield 8"
ID = 1146 
pos = 0, 0
postype = p1
;bindtime = -1
;facing = 1
stateno = 1157 
ownpal = 0
persistent = 0

[State 1145, 5] ;shield active
type = ParentVarSet
trigger1 = !Time
v = 16
value = 1
persistent = 0

[State 1146, 5] ;shield desactive
type = ParentVarSet
trigger1 = NumHelper(1146) < 1
v = 16
value = 0
persistent = 0

[State 1145, 3] ;attack
type = ChangeState
;trigger1 = root, command = "use_weapon_X"   
;trigger2 = root, command = "use_weapon_Y"
;trigger3 = root, command = "use_weapon_Z"
trigger1 = root, StateNo = 1143
trigger1 = root, Anim = 220
trigger1 = root, AnimElem = 4
value = 1146

[State 1145, 6]
type = HitBy
trigger1 = root, StateNo != [120, 155]
trigger1 = Time >= 0 ;1 
value = SCA, AA,AP,AT
time = -1

[State 1145, 6]
type = NotHitBy
trigger1 = root, StateNo = [120, 155]
trigger1 = Time >= 0 ;1 
value = SCA, AA,AP,AT
time = -1

[State 1145, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1148
time = -1

[State 1145, 4] ;time over
type = ChangeState
trigger1 = Time > 355
value = 1147

[State 1145, 4] ;gethit
type = ChangeState
;trigger1 = NumHelper(1146) > 7
;trigger1 = Helper(1146), StateNo = 1158 ;MoveContact 
trigger1 = MoveContact
value = 1148

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 1
[Statedef 1150]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1150, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
;pos = sin(time*-.10)*-36.1, cos(time*-.10)*-36.1 
pos = cos(time/28.0*pi)*32, -27+sin(time/28.0*pi)*32 ;by Phantom.of.the.Server
time = -1
ignorehitpause = 1

[State 1150, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1150, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1150, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1150, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1150, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1150, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1150, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 2
[Statedef 1151]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1151, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+7)/28.0*pi)*32, -27+sin((time+7)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1151, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1151, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1151, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1151, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1151, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1151, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1151, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 3
[Statedef 1152]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1152, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+14)/28.0*pi)*32, -27+sin((time+14)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1152, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1152, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1152, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1152, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1152, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1152, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1152, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 4
[Statedef 1153]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1153, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+21)/28.0*pi)*32, -27+sin((time+21)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1153, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1153, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1153, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1153, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1153, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1153, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1153, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 5
[Statedef 1154]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1154, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+28)/28.0*pi)*32, -27+sin((time+28)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1154, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1154, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1154, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1154, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1154, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1154, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1154, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 6
[Statedef 1155]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1155, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+35)/28.0*pi)*32, -27+sin((time+35)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1155, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1155, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1155, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1155, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1155, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1155, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1155, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 7
[Statedef 1156]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1156, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+42)/28.0*pi)*32, -27+sin((time+42)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1156, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1156, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1156, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1156, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1156, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1156, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1156, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper - Shield 8
[Statedef 1157]
type    = A
movetype= I
anim = 1142
sprpriority = 3

[State 1157, 1]
type = BindToParent
;trigger1 = parent, StateType = S
trigger1 = 1
pos = cos((time+49)/28.0*pi)*32, -27+sin((time+49)/28.0*pi)*32
time = -1
ignorehitpause = 1

[State 1157, 1]
type = HitDef
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0 && HitCount < 1
attr = A, SP                     
damage = floor(15/(1+(Var(19)/5.0))), 3 
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 1, 1                 
guard.sparkno = s8301 ;S8200
sparkno = s8320+(random%8) ;S8270                      
sparkxy = 10, -27              
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1157, 6]
type = NotHitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145
value = SCA, AA,AP,AT
time = -1

[State 1157, 6]
type = HitBy
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
value = SCA, AA,AP,AT
time = -1

[State 1157, 7] 
type = StateTypeSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146 
statetype = A
movetype = A

[State 1157, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1158
time = -1

[State 1157, 4]
type = ChangeState
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger2 = parent, Time > 355
trigger3 = MoveContact
value = 1158

[State 1157, 5]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shields: 8 Helpers (end) 
[Statedef 1158]
type    = A
movetype= I
anim = 1143
velset = 0,0
sprpriority = 3

[State 1158, 1]
type = BindToParent
trigger1 = !Time
pos = 0, 0 
time = 0
ignorehitpause = 1

[State 1158, 2]
type = VelSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1146
trigger1 = Time >= 0
x = -2*(root,facing)*facing ;by P.O.T.S.
y = 1.5

[State 1158, 3]
type = VelSet
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1148
trigger1 = Time >= 0
y = 1

[State 1158, 4] 
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Leaf Shield: Helper Mother - Attack and DestroySelf
[Statedef 1146]
type    = A
movetype= A
anim = 1144;8930;1142
sprpriority = 3

[State 1146, 1]
type = BindToRoot
trigger1 = !Time
pos = 0, 0 
time = 0
ignorehitpause = 1

;[State 1146, 1]
;type = VelSet
;trigger1 = time >= 0
;x = sin(time*.2)*5.1 ;by Chon Wang
;y = cos(time*.2)*5.1

[State 1146, 2]
type = VelSet
trigger1 = Time = 0
x = 4*(root,facing)*facing ;by P.O.T.S.
y = 0

[State 1146, 4]
type = NotHitBy
trigger1 = 1
value = SCA, AA,AP,AT
time = -1

[State 1146, 5] ;shield desactive
type = ParentVarSet
trigger1 = !Time
v = 16
value = 0

[State 1146, 8]
type = DestroySelf
trigger1 = NumHelper(1146) < 1
;trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Leaf Shield: Helper Time Over (end) 
[Statedef 1147]
type    = A
movetype= I
anim = 1144;8930;1143
sprpriority = 3

[State 1147, 1] ;shield desactive
type = ParentVarSet
trigger1 = !Time
v = 16
value = 0

[State 1147, 2] 
type = DestroySelf
trigger1 = NumHelper(1146) < 1

;---------------------------------------------------------------------------
; Leaf Shield: Helper GetHit (end) 
[Statedef 1148]
type    = A
movetype= I
anim = 1144;8930;1143
sprpriority = 3

[State 1148, 2] ;shield desactive
type = ParentVarSet
;;trigger1 = NumEnemy > 0
;trigger1 = P2MoveType != A ;AnimTime = 0
trigger1 = !Time ;> 15
v = 16
value = 0

[State 1148, 3]
type = PalFX
trigger1 = Time = [0, 15] 
add = 80,80,256
time = 1

[State 1148, 5] 
type = DestroySelf
trigger1 = NumHelper(1146) < 1
trigger1 = P2MoveType != A  
;trigger1 = var(16) = 0 



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Striker Pose - Beat 
[Statedef 1200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 1200                       
;poweradd = 75                    
sprpriority = 2                  

[State 1200, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1200, 1] ;Beat
type = Helper
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "Beat"
ID = 1201 
postype = left
pos = ifelse(facing = 1, 0, 319), 0 
facing = facing
stateno = 1201 
ownpal = 1
ignorehitpause = 1

[State 1200, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

[State 1200, 6] ;beat wings noise
type = PlaySnd
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 10

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

;---------------------------------------------------------------------------
; Beat: Helper 
[Statedef 1201]
type = A
movetype = A
ctrl = 0
anim = 1220
velset = 0, 0
sprpriority = 4

[State 1210, 1]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
;getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 8, 8         
guard.sparkno = s8301 ;S8200        
sparkno = s8360+(random%8) ;S8270                      
sparkxy = 10, 0
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 1201, 2] 
type = PosAdd
trigger1 = !Time
x = -30
y = -132

[State 1201, 2] 
type = VelSet
trigger1 = Time = 0 
x = 2.5
y = 2.1 ;1.9

[State 1201, 2] 
type = VelAdd
trigger1 = Time >= 15 && Time < 45
x = .25
;y = .1

[State 1201, 2] 
type = VelSet
trigger1 = Time = 48 
;x = .1
y = .1

[State 1201, 2] 
type = VelSet
trigger1 = Time = 50
x = 3.0
;y = -3.1

[State 1201, 2] 
type = VelAdd
trigger1 = Time >= 50 
x = .1
y = -.2

[State 1201, 2] 
type = VelSet
trigger1 = Time = 70
y = -3.0

;[State 1201, 6] ;shoot
;type = PlaySnd
;trigger1 = Anim = 1202
;trigger1 = AnimElem = 1, = 2
;value = 18, 12

[State 1201, 7]
type = HitBy
trigger1 = 1
value = SCA, AA,AP,AT

[State 1201, 8]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1202
time = -1

[State 1201, 9]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Beat: Helper GetHit
[Statedef 1202]
type = A
movetype = I
ctrl = 0
anim = 1221
velset = 0, 0
sprpriority = 5

[State 1202, 0] 
type = VelSet
trigger1 = Time = 0 
x = -2.2
y = -3

[State 1202, 1] 
type = VelAdd
trigger1 = Time >= 0 
y = .3

[State 1202, 2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 6

[State 1202, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger3 = ScreenPos Y > 255 



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Striker Pose - FlipTop 
[Statedef 1210]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 1200                       
;poweradd = 75                    
sprpriority = 2                  

[State 1210, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1210, 1] ;FlipTop
type = Helper
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "FlipTop"
ID = 1211 
postype = left
pos = ifelse(facing = 1, 0, 319), 0 
facing = facing
stateno = 1211 
ownpal = 1
ignorehitpause = 1

[State 1210, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

[State 1210, 6] ;fliptop voice
type = PlaySnd
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 13

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

;---------------------------------------------------------------------------
; FlipTop: Helper 
[Statedef 1211]
type = A
movetype = A
ctrl = 0
anim = 1210
velset = 0, 0
sprpriority = 4

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

[State 1211, 0] 
type = ChangeAnim
trigger1 = Anim = 1210
trigger1 = P2Dist X = [-55, 55] 
value = 1211

[State 1211, 0] 
type = ChangeAnim
trigger1 = Anim = 1211
trigger1 = AnimTime = 0
value = 1214

[State 1211, 3] ;fire
type = Explod
trigger1 = NumExplod(11212) < 1
trigger1 = !Time 
ID = 11212
anim = 1212
postype = p1
pos = 0, 0
facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1211, 1]
type = Helper
trigger1 = Anim = 1211
trigger1 = AnimElem = 4
helpertype = normal
name = "Bomb"
ID = 1212 
pos = 2, -25
postype = p1
;bindtime = -1
;facing = 1
stateno = 1212 
ownpal = 1

[State 1211, 2] 
type = PosAdd
trigger1 = !Time
x = -30
y = -132

[State 1211, 2] 
type = VelSet
trigger1 = Time = 0 
x = 3.5

[State 1211, 2] 
type = VelAdd
trigger1 = Anim = 1211 ;1210
trigger1 = Vel X > 0
x = -.25

[State 1211, 2] 
type = VelSet
trigger1 = Anim = 1214
;trigger1 = AnimTime = 0
;trigger1 = Vel X = 0
x = 3.7

;[State 1211, 2] 
;type = VelAdd
;trigger1 = Time >= 50 
;x = .1

[State 1211, 6] ;shoot
type = PlaySnd
trigger1 = Anim = 1211
trigger1 = AnimElem = 3
value = 18, 14

[State 1211, 2] ;Remove FlipTop striker fire
type = RemoveExplod
;trigger1 = NumHelper(1211) < 1
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 
ID = 11212

[State 1211, 7]
type = HitBy
trigger1 = 1
value = SCA, AA,AP,AT

[State 1211, 8]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1215
time = -1

[State 1211, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Bomb: Helper
[Statedef 1212]
type    = A
movetype= A
anim = 1213
sprpriority = 5

[state 1212, 1.0]
type = VelSet
trigger1 = Time = 0
x = 1.5
y = -3

[state 1212, 1.1]
type = VelAdd
trigger1 = Time > 0
y = .3

[State 1212, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(70/(1+(root,Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 5, Hit               
sprpriority = 3
pausetime = 0, 9;10, 10 
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S18, 4                  
guardsound = S18, 4 ;16, 0                
ground.type = High              
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -4, -5
airguard.velocity = -1     
air.type = High                 
air.velocity = -3, -4 
air.hittime = 25       
fall = 1
air.fall = 1 

[State 1212, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(75/(1+(root,Var(19)/5.0))), 7
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 5, Hit               
sprpriority = 3
pausetime = 0, 10 ;9, 9  
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S18, 4                  
guardsound = S18, 4 ;16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -5, -6
airguard.velocity = -5
air.type = High                 
air.velocity = -4, -5         
air.hittime = 25   
fall = 1
air.fall = 1

[State 1212, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1212, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1213
time = -1

[State 1212, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 || Pos Y >= 0
value = 1213
ignorehitpause = 1

;---------------------------------------------------------------------------
; Bomb: Helper (end)
[Statedef 1213]
type = A
movetype = I
ctrl = 0
anim = 8290
velset = 0, 0
sprpriority = 5

[State 1213, 0]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 1213, 1]
type = PlaySnd
trigger1 = !Time
trigger1 = Pos Y >= 0
value = 18, 4
ignorehitpause = 1
supermovetime = 99999

[State 1213, 2]
type = DestroySelf
;trigger1 = Time > 10 
;trigger1 = P2MoveType != H 
;trigger1 = NumTarget < 1
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; FlipTop: Helper GetHit
[Statedef 1215]
type = A
movetype = I
ctrl = 0
anim = 1215
velset = 0, 0
sprpriority = 5

[State 1215, vira]
type = Turn
trigger1 = !Time

[State 1215, 0] 
type = VelSet
trigger1 = Time = 0 
x = 3.2

;[State 1215, 1] 
;type = VelAdd
;trigger1 = Time >= 0 
;y = .1

[State 1215, 1.1] ;fire
type = Explod
trigger1 = NumExplod(11212) < 1
trigger1 = !Time 
ID = 11212
anim = 1212
postype = p1
pos = 0, 0
facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 1215, 1.2] ;Remove FlipTop striker fire
type = RemoveExplod
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 
ID = 11212

[State 1215, 2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 6

[State 1215, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger3 = ScreenPos Y > 255 



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Striker Pose - Auto 
[Statedef 1220]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 1200                       
;poweradd = 75                    
sprpriority = 2                  

[State 1220, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1220, 1] ;Auto
type = Helper
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "Auto"
ID = 1221 
postype = left
pos = ifelse(facing = 1, 0, 319), 0 
facing = facing
stateno = 1221 
ownpal = 1
ignorehitpause = 1

[State 1220, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

[State 1220, 6] ;auto voice
type = PlaySnd
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 24 ;18, 11

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

;---------------------------------------------------------------------------
; Auto: Helper 
[Statedef 1221]
type = A
movetype = I
ctrl = 0
anim = 1201
velset = 0, 0
sprpriority = 4

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

[State 1221, 2] 
type = ChangeAnim
trigger1 = Anim = 1201
trigger1 = Time = 50 
value = 1202

[State 1221, 2] 
type = ChangeAnim
trigger1 = Anim = 1202
trigger1 = AnimTime = 0 
value = 1201

[State 1221, 1]
type = Helper
trigger1 = NumHelper(1224) < 1
trigger1 = !Time 
helpertype = normal
name = "Helix"
ID = 1224
pos = 0, 0 ;ifelse((Anim = 1201 && AnimElem = 1), 2, ifelse((Anim = 1201 && AnimElem = 2), 1, 0)), 0 ;0, 0
postype = p1
;bindtime = -1
;facing = facing
stateno = 1224  
ownpal = 0

[State 1221, 1]
type = Helper
trigger1 = Anim = 1202
trigger1 = AnimElem = 1, = 2
helpertype = normal
name = "Missel"
ID = 1222 
pos = 62, -114
postype = p1
;bindtime = -1
;facing = 1
stateno = 1222 
ownpal = 1

;[State 1221, 1] 
;type = PosSet
;trigger1 = !Time
;y = ceil(root, pos y) - 100

[State 1221, 2] 
type = PosAdd
trigger1 = !Time
x = -60
y = -132

[State 1221, 2] 
type = VelSet
trigger1 = Time = 0 
x = 2.7
;y = 1.7

[State 1221, 2] 
type = VelAdd
trigger1 = Time >= 0 && Time < 50
;x = .5
y = .1

[State 1221, 2] 
type = VelSet
trigger1 = Time = 50 ;ScreenPos Y > 200;215
x = .1
y = .1

[State 1221, 2] 
type = VelSet
;trigger1 = Anim = 1202 ;1201
trigger1 = Time = 80
x = -2.9
y = -5.1

[State 1221, 2] 
type = VelAdd
trigger1 = Vel Y < -1.5
trigger1 = Time >= 80 
;x = -2.5
y = .1

[State 1221, 6] ;shoot
type = PlaySnd
trigger1 = Anim = 1202
trigger1 = AnimElem = 1, = 2
value = 18, 12

[State 1221, 7]
type = HitBy
trigger1 = 1
value = SCA, AA,AP,AT

[State 1221, 8]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP,AT
stateno = 1225
time = -1

[State 1221, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Missel: Helper
[Statedef 1222]
type    = A
movetype= A
anim = 1203
sprpriority = 5

[state 1222, 1]
type = VelSet
trigger1 = Time = 0
x = 5
y = ifelse(enemy, Pos Y < 0, ifelse(enemy, Pos Y < -100, -1, 0), 1)

[state 1222, 1.1]
type = VelAdd
trigger1 = Time >= 0
y = ifelse(enemy, Pos Y < 0, ifelse(enemy, Pos Y < -100, -.1, 0), .1)

[State 1222, 2.1]
type = Explod
trigger1 = !Time
anim = 8041  
postype = p1
pos = -5, -12
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1222, 2.2]
type = Explod
trigger1 = !Time
anim = 8041  
postype = p1
pos = -15, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1222, 2.3]
type = Explod
trigger1 = !Time
anim = 8041  
postype = p1
pos = -5, 12
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1222, 2.3]
type = Explod
trigger1 = !Time
anim = 8041  
postype = p1
pos = -28, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1222, 1]
type = Explod
trigger1 = Time % 4 = 0
anim = 8040  
postype = p1
pos = -30, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1222, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(70/(1+(root,Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 5, Hit               
sprpriority = 3
pausetime = 0, 9;10, 10 
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S40, 2 ;S18, 4                  
guardsound = S40, 2 ;S16, 0                
ground.type = High              
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -4, -5
airguard.velocity = -1     
air.type = High                 
air.velocity = -3, -4 
air.hittime = 25       
fall = 1
air.fall = 1 

[State 1222, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(75/(1+(root,Var(19)/5.0))), 7
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 5, Hit               
sprpriority = 3
pausetime = 0, 10 ;9, 9  
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S40, 2 ;S18, 4                  
guardsound = S40, 2 ;16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -5, -6
airguard.velocity = -5
air.type = High                 
air.velocity = -4, -5         
air.hittime = 25   
fall = 1
air.fall = 1

[State 1222, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1222, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1223
time = -1

[State 1222, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 1223
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missel: Helper (end)
[Statedef 1223]
type = A
movetype = I
ctrl = 0
anim = 8292
velset = 0, 0
sprpriority = 5

[State 1223, 0]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

;[State 1223, 1]
;type = PlaySnd
;trigger1 = !Time
;value = 18, 4
;ignorehitpause = 1
;supermovetime = 99999

[State 1223, 2]
type = DestroySelf
;trigger1 = Time > 10 
;trigger1 = P2MoveType != H 
;trigger1 = NumTarget < 1
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Helix: Helper
[Statedef 1224]
type    = A
movetype= I
anim = 1204
sprpriority = 5

[State 1224, 0]
type = BindToParent
trigger1 = (parent, Anim = 1201) && (parent, AnimElem != 1) && (parent, AnimElem != 2)
trigger2 = parent, Anim = 1202
pos = 0, 0 ;ifelse((parent, Anim = 1201 && parent, AnimElem = 1), 2, ifelse((parent, Anim = 1201 && parent, AnimElem = 2), 1, 0)), 0 ;0, 0
time = -1;1
ignorehitpause = 1

[State 1224, 0]
type = BindToParent
trigger1 = (parent, Anim = 1201) && (parent, AnimElem = 2)
pos = 1, 0 
time = -1
ignorehitpause = 1

[State 1224, 0]
type = BindToParent
trigger1 = (parent, Anim = 1201) && (parent, AnimElem = 1)
pos = 2, 0 
time = -1
ignorehitpause = 1

[State 1224, 1]
type = DestroySelf
trigger1 = NumHelper(1221) < 1
trigger2 = parent, MoveType = H

;---------------------------------------------------------------------------
; Auto: Helper GetHit
[Statedef 1225]
type = A
movetype = I
ctrl = 0
anim = 1205;1201
velset = 0, 0
sprpriority = 5

[State 1225, 0] 
type = VelSet
trigger1 = Time = 0 
x = -.5

[State 1225, 1] 
type = VelAdd
trigger1 = Time >= 0 
y = .1

[State 1225, 2.1]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 40, 40
removetime = -2
ownpal = 1
sprpriority = 6

[State 1225, 2.2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 5, -40
velocity = 0, 0
accel = 0, 0
random = 40, 40
removetime = -2
ownpal = 1
sprpriority = 6

[State 1225, 2.2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 3, -70
velocity = 0, 0
accel = 0, 0
random = 40, 40
removetime = -2
ownpal = 1
sprpriority = 6

[State 1225, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 
trigger2 = BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger3 = ScreenPos Y > 455 



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Guard Push (Stand) (by Soldats)
[Statedef 1400]
type    = S
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = ifelse(var(33) = 1, 6125, 1400)
sprpriority = 2

[State 1400, VelMul]
type = VelMul
trigger1 = 1
x = 0.75

[State 1400, VelSet]
type = VelSet
trigger1 = Time = 10
x = 0

[State 1400, Width]
type = Width
trigger1 = 1
value = 10,0

[State 1400, NotHitBy]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 23

[State 1400, PlaySnd 1]
type = PlaySnd
trigger1 = Time = 0
value = 2,0
channel = 0

[State 1400, PlaySnd 2]
type = PlaySnd
trigger1 = Time = 0
value = 18,2

[State 1400, Push Spark]
type = Explod
trigger1 = Time = 0
anim = 8260
ID = 8260
postype = p1
pos = 51,-57
ownpal = 1
bindtime = -1
ignorehitpause = 1
sprpriority = 3

[State 1400, Guard Push Helper]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "BreakPush"
postype = P1
pos = -50,0
stateno = 1450
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

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

;---------------------------------------------------------------------------
; Guard Push (Helper) (by Soldats)
[Statedef 1450]
type    = S
movetype= I
physics = N
poweradd= 0
ctrl = 0
anim = 1450
sprpriority = -4

[State 1450, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 1

[State 1450, VelSet 1]
type = VelSet
trigger1 = Time = [0,10]
x = 30

[State 1450, VelSet 2]
type = VelSet
trigger1 = Time = [11,13]
x = 20

[State 1450, VelSet 2]
type = VelSet
trigger1 = Time >= 14
x = 10

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

[State 1450, DestroySelf]
type = DestroySelf
trigger1 = Time >= 18

;---------------------------------------------------------------------------
; Guard Push (Crouching) (by Soldats)
[Statedef 1410]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = ifelse(var(33) = 1, 6126, 1410)
sprpriority = 2

[State 1410, VelMul]
type = VelMul
trigger1 = 1
x = 0.75

[State 1410, VelSet]
type = VelSet
trigger1 = Time = 10
x = 0

[State 1410, Width]
type = Width
trigger1 = 1
value = 10,0

[State 1410, NotHitBy]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 23

[State 1410, PlaySnd 1]
type = PlaySnd
trigger1 = Time = 0
value = 2,0
channel = 0

[State 1410, PlaySnd 2]
type = PlaySnd
trigger1 = Time = 0
value = 18,2

[State 1410, Push Spark]
type = Explod
trigger1 = Time = 0
anim = 8260
ID = 8260
postype = p1
pos = 50,-48
ownpal = 1
bindtime = -1
ignorehitpause = 1
sprpriority = 3

[State 1410, Guard Push Helper]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "BreakPush"
postype = P1
pos = -50,0
stateno = 1450
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

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

;---------------------------------------------------------------------------
; Guard Push (Air) (by Soldats)
[Statedef 1420]
type    = A
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = ifelse(var(33) = 1, 6127, 1420)
sprpriority = 2

[State 1420, VelMul]
type = VelMul
trigger1 = 1
x = 0.75

[State 1420, VelSet]
type = VelSet
trigger1 = Time = 10
x = 0

[State 1420, Width]
type = Width
trigger1 = 1
value = 10,0

[State 1420, NotHitBy]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 23

[State 1420, PlaySnd 1]
type = PlaySnd
trigger1 = Time = 0
value = 2,0
channel = 0

[State 1420, PlaySnd 2]
type = PlaySnd
trigger1 = Time = 0
value = 18,2

[State 1420, Push Spark]
type = Explod
trigger1 = Time = 0
anim = 8260
ID = 8260
postype = p1
pos = 40,-84
ownpal = 1
bindtime = -1
ignorehitpause = 1
sprpriority = 3

[State 1420, Guard Push Helper]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "BreakPush"
postype = P1
pos = -50,0
stateno = 1450
ownpal = 1
size.height = 200
size.ground.back = 30
size.ground.front = 30

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Recovery Roll - X or A (by Soldats)
[Statedef 1480]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = ifelse(var(33) = 1, 6128, 1480)
sprpriority = -2

[State 1480, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 1480, VelSet 1]
type = VelSet
trigger1 = AnimElemTime(2) = 0
x = 8

[State 1480, VelSet 2]
type = VelSet
trigger1 = AnimTime = 0
x = 0

[State 1480, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

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

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

;---------------------------------------------------------------------------
; Recovery Roll - Y or B
[Statedef 1485]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = ifelse(var(33) = 1, 6129, 1485)
sprpriority = -2

[State 1485, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 1485, VelSet 1]
type = VelSet
trigger1 = AnimElemTime(2) = 0
x = 8

[State 1485, VelSet 2]
type = VelSet
trigger1 = AnimTime = 0
x = 0

[State 1485, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

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

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

;---------------------------------------------------------------------------
; Recovery Roll - Z or C
[Statedef 1490]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 0,0
ctrl = 0
anim = ifelse(var(33) = 1, 6130, 1490)
sprpriority = -2

[State 1490, PlayerPush]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 1490, VelSet 1]
type = VelSet
trigger1 = AnimElemTime(2) = 0
x = 8

[State 1490, VelSet 2]
type = VelSet
trigger1 = AnimTime = 0
x = 0

[State 1490, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

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

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



;------------------------------
;Super Adaptor Mode - Specials
;------------------------------

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Slash X
[Statedef 1500]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6131
poweradd = 90 
sprpriority = 2                  

[State 1500, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect X"
ID = 1505 
pos = 10, -30
postype = p1
;bindtime = -1
;facing = 1
stateno = 1505 
ownpal = 1

[State 1500, 1] ;Back Dust
type = Explod
trigger1 = AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[state 1500, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1500, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1500, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1500, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1500, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1500, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

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

;---------------------------------------------------------------------------
; Slash Y
[Statedef 1501]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6131
poweradd = 90 
sprpriority = 2                  

[State 1501, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect Y"
ID = 1506 
pos = 10, -30
postype = p1
;bindtime = -1
;facing = 1
stateno = 1506 
ownpal = 1

[State 1501, 1] ;Back Dust
type = Explod
trigger1 = AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[state 1501, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1501, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1501, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1501, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1501, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1501, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

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

;---------------------------------------------------------------------------
; Slash Z
[Statedef 1502]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6131
poweradd = 90 
sprpriority = 2                  

[State 1502, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect Z"
ID = 1507 
pos = 10, -30
postype = p1
;bindtime = -1
;facing = 1
stateno = 1507 
ownpal = 1

[State 1502, 1] ;Back Dust
type = Explod
trigger1 = AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[state 1502, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1502, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1502, 4]
type = Explod
trigger1 = Time = 0 
trigger1 = PrevStateno = 100 || PrevStateno = 105
persistent = 0
anim = 8041
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1502, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1502, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1502, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

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

;---------------------------------------------------------------------------
; Slash efect X: Helper
[Statedef 1505]
type    = A
movetype= A
anim = 6132
sprpriority = 3

;[State 1505, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 1505, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236,118 

[state 1505, 1]
type = VelSet
trigger1 = !Time 
x = .5

[State 1505, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(60/(1+(root,Var(19)/5.0))), 8
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8360+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = High                 
air.velocity = -2, 0 
air.hittime = 25       
fall = 0
air.fall = 1 
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1505, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(65/(1+(root,Var(19)/5.0))), 9
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8360+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = High                 
air.velocity = -3, 0 
air.hittime = 25   
fall = 0
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1505, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1505, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1508
time = -1

[State 1505, 8]
type = DestroySelf;ChangeState
trigger1 = AnimTime = 0
trigger2 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = AnimTime = 0
;value = 1508
;ignorehitpause = 1

;---------------------------------------------------------------------------
; Slash efect Y: Helper
[Statedef 1506]
type    = A
movetype= A
anim = 6132
sprpriority = 3

;[State 1506, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 1506, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236,118 ;256, 256

[state 1506, 1]
type = VelSet
trigger1 = !Time 
x = 2

[State 1506, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(60/(1+(root,Var(19)/5.0))), 8
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8360+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = High                 
air.velocity = -2, 0 
air.hittime = 25       
fall = 0
air.fall = 1 
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1506, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(65/(1+(root,Var(19)/5.0))), 9
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8360+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = High                 
air.velocity = -3, 0 
air.hittime = 25   
fall = 0
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1506, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1506, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1508
time = -1

[State 1506, 8]
type = DestroySelf ;ChangeState
trigger1 = AnimTime = 0
trigger2 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = AnimTime = 0

;---------------------------------------------------------------------------
; Slash efect Z: Helper
[Statedef 1507]
type    = A
movetype= A
anim = 6132
sprpriority = 3

;[State 1507, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 1507, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236,118 

[state 1507, 1]
type = VelSet
trigger1 = !Time 
x = 3.5 

[State 1507, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(60/(1+(root,Var(19)/5.0))), 8
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8360+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = High                 
air.velocity = -2, 0 
air.hittime = 25       
fall = 0
air.fall = 1 
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1507, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(65/(1+(root,Var(19)/5.0))), 9
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 4, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8360+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = High                 
air.velocity = -3, 0 
air.hittime = 25   
fall = 0
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1507, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1507, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1508
time = -1

[State 1507, 8]
type = DestroySelf ;ChangeState
trigger1 = AnimTime = 0
trigger2 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = AnimTime = 0

;---------------------------------------------------------------------------
; Slash efect: Helper (end)
[Statedef 1508]
type = A
movetype = I
ctrl = 0
anim = 61323 ;8220 ;224
velset = 0, 0
sprpriority = 3

;[State 1508, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 1508, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236, 118 

[State 1508, 10]
type = PlaySnd
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
value = 17, 0
ignorehitpause = 1
supermovetime = -1

[State 1508, 2]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Slash X
[Statedef 1550]
type    = A                      
movetype= A                      
;physics = A                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6145 
poweradd = 90 
sprpriority = 2                  

[State 1550, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect X"
ID = 1505 
pos = 10, -40
postype = p1
;bindtime = -1
;facing = 1
stateno = 1505 
ownpal = 1

[state 1550, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1550, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1550, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1550, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1550, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

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

;---------------------------------------------------------------------------
; Air Slash Y
[Statedef 1551]
type    = A                      
movetype= A                      
;physics = A                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6145
poweradd = 90 
sprpriority = 2                  

[State 1551, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect Y"
ID = 1506 
pos = 10, -40
postype = p1
;bindtime = -1
;facing = 1
stateno = 1506 
ownpal = 1

[state 1551, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1551, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1551, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1551, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1551, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

[State 1551, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 53
ctrl = 1

;---------------------------------------------------------------------------
; Air Slash Z
[Statedef 1552]
type    = A                      
movetype= A                      
;physics = A                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 6145
poweradd = 90 
sprpriority = 2                  

[State 1552, 4]
type = Helper
trigger1 = AnimElem = 3
helpertype = normal
name = "Slash efect Z"
ID = 1507 
pos = 10, -40
postype = p1
;bindtime = -1
;facing = 1
stateno = 1507 
ownpal = 1

[state 1552, 2]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 100
x = 4

[state 1552, 3]
type = VelSet
trigger1 = Time = 0 
trigger1 = PrevStateno = 105
x = -4

[State 1552, 9]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2, 2
channel = 0

[State 1552, 10]
type = PlaySnd
trigger1 = AnimElem = 2
value = 10, 2

[State 1552, 7]
type = Width
trigger1 = AnimElem = 3
trigger1 = AnimElem = 4
player = 5, 0

[State 1552, 9]
type = ChangeState
trigger1 = AnimTime = 0
value = 53
ctrl = 1



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; S.Adapt Striker Pose - Tango X
[Statedef 1600]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 6133                       
;poweradd = 75                    
sprpriority = 2                  

[State 1600, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1600, 1] ;Tango
type = Helper
trigger1 = !Time 
helpertype = normal
name = "Tango X"
ID = 1610 
postype = p1 ;left
pos = 90, 0 ;ifelse(facing = 1, 0, 319), 0 
;facing = facing
stateno = 1610 
ownpal = 1
ignorehitpause = 1

[State 1600, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

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

;---------------------------------------------------------------------------
; S.Adapt Striker Pose - Tango Y
[Statedef 1601]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 6133                       
;poweradd = 75                    
sprpriority = 2                  

[State 1601, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1601, 1] ;Tango Y
type = Helper
trigger1 = !Time 
helpertype = normal
name = "Tango Y"
ID = 1611 
postype = p1 ;left
pos = 90, 0 ;ifelse(facing = 1, 0, 319), 0 
;facing = facing
stateno = 1612 
ownpal = 1
ignorehitpause = 1

[State 1601, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

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

;---------------------------------------------------------------------------
; S.Adapt Striker Pose - Tango Z
[Statedef 1602]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 6133                       
;poweradd = 75                    
sprpriority = 2                  

[State 1602, 1] ;Back Dust
type = Explod
trigger1 = Time = 6
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1602, 1] ;Tango
type = Helper
trigger1 = !Time 
helpertype = normal
name = "Tango Z"
ID = 1612 
postype = p1 ;left
pos = 90, 0 ;ifelse(facing = 1, 0, 319), 0 
;facing = facing
stateno = 1614 
ownpal = 1
ignorehitpause = 1

[State 1602, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 4
channel = 0

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


;---------------------------------------------------------------------------
; Tango X: Helper - intro
[Statedef 1610]
type = A
movetype = A
ctrl = 0
anim = 6134
velset = 0, 0
sprpriority = -1

;[State 1610, 0.1] ;turn anim
;type = Turn
;trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
;trigger1 = !Time

[State 1610, 0.2] ;turn position
type = PosAdd
trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
trigger1 = !Time
x = -180

[State 1610, 5]
type = PalFX
trigger1 = Time = [21, 31]
add = 256,256,256
time = 10

[State 1610, 5]
type = PalFX
trigger1 = Time = [32, 34]
add = 200,200,200 ;120,120,255
time = 1

[State 1610, 4]
type = PalFX
trigger1 = Time = [35, 36]
add = 150,150,150 ;80,80,256
time = 1

[State 1610, 3]
type = PalFX
trigger1 = Time = [37, 39]
add = 100,100,100 ;50,50,155
time = 1

[State 1610, 2]
type = PalFX
trigger1 = Time = [40, 41]
add = 60,60,60 ;20,20,95
time = 1

[State 1610, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1610, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1616
time = -1

[State 1610, 6] ;tango voice
type = PlaySnd
trigger1 = Time = 24
value = 18, 17

[State 1610, 1] 
type = ChangeState
trigger1 = Time = 44 ;AnimTime = 0
value = 1611

;---------------------------------------------------------------------------
; Tango X: Helper - attack
[Statedef 1611]
type = A
movetype = A
ctrl = 0
anim = 6135
velset = 0, 0
sprpriority = 4

[State 1611, 1]
type = HitDef
trigger1 = Time % 10 = 0
attr = A, SA                     
damage = floor(15/(1+(Var(19)/5.0))), 3
;getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 4, 8 ;8, 8         
guard.sparkno = s8301 ;S8200        
sparkno = s8360+(random%8) ;S8270                      
sparkxy = 10, 0
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12
fall = 1

[State 1611, 2] 
type = VelAdd
trigger1 = Time >= 0 
y = .41

[State 1611, 2] 
type = VelSet
trigger1 = Pos Y >= 0 
x = 3.5;1.6
y = -5.9

[State 1611, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1611, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1617
time = -1

[State 1611, 1]
type = Explod
trigger1 = Pos Y >= 0
anim = 8041  
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1611, 2]
type = PlaySnd
trigger1 = Pos Y >= 0 
trigger1 = root, Time > 30
value = 18, 5

[State 1611, 3]
type = DestroySelf
trigger1 = ScreenPos Y < -45 
trigger2 = BackEdgeDist < -45 || FrontEdgeDist < -45 

;---------------------------------------------------------------------------
; Tango Y: Helper - intro
[Statedef 1612]
type = A
movetype = A
ctrl = 0
anim = 6134
velset = 0, 0
sprpriority = -1

;[State 1612, 0.1] ;turn anim
;type = Turn
;trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
;trigger1 = !Time

[State 1612, 0.2] ;turn position
type = PosAdd
trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
trigger1 = !Time
x = -180

[State 1612, 5]
type = PalFX
trigger1 = Time = [21, 31]
add = 256,256,256
time = 10

[State 1612, 5]
type = PalFX
trigger1 = Time = [32, 34]
add = 200,200,200 ;120,120,255
time = 1

[State 1612, 4]
type = PalFX
trigger1 = Time = [35, 36]
add = 150,150,150 ;80,80,256
time = 1

[State 1612, 3]
type = PalFX
trigger1 = Time = [37, 39]
add = 100,100,100 ;50,50,155
time = 1

[State 1612, 2]
type = PalFX
trigger1 = Time = [40, 41]
add = 60,60,60 ;20,20,95
time = 1

[State 1612, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1612, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1616
time = -1

[State 1612, 6] ;tango voice
type = PlaySnd
trigger1 = Time = 24
value = 18, 17

[State 1612, 1] 
type = ChangeState
trigger1 = Time = 44 ;AnimTime = 0
value = 1613

;---------------------------------------------------------------------------
; Tango Y: Helper - attack
[Statedef 1613]
type = A
movetype = A
ctrl = 0
anim = 6135
velset = 0, 0
sprpriority = 4

[State 1613, 1]
type = HitDef
trigger1 = Time % 9 = 0
attr = A, SA                     
damage = floor(15/(1+(Var(19)/5.0))), 3
;getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 4, 8 ;8, 8         
guard.sparkno = s8301 ;S8200        
sparkno = s8360+(random%8) ;S8270                      
sparkxy = 10, 0
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12
fall = 1

[State 1613, 2] 
type = VelAdd
trigger1 = Time >= 0 
y = .41

[State 1613, 2] 
type = VelSet
trigger1 = Pos Y >= 0 
x = 2.8
y = -7.9

[State 1613, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1613, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1617
time = -1

[State 1613, 1]
type = Explod
trigger1 = Pos Y >= 0  
anim = 8041  
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1613, 2]
type = PlaySnd
trigger1 = Pos Y >= 0 
trigger1 = root, Time > 30
value = 18, 5
persistent = 0

[State 1613, 3]
type = DestroySelf
trigger1 = ScreenPos Y < -45 
trigger2 = BackEdgeDist < -45 || FrontEdgeDist < -45 

;---------------------------------------------------------------------------
; Tango Z: Helper - intro
[Statedef 1614]
type = A
movetype = A
ctrl = 0
anim = 6134
velset = 0, 0
sprpriority = -1

;[State 1614, 0.1] ;turn anim
;type = Turn
;trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
;trigger1 = !Time

[State 1614, 0.2] ;turn position
type = PosAdd
trigger1 = FrontEdgeDist < -10 || BackEdgeDist < -10
trigger1 = !Time
x = -180

[State 1614, 5]
type = PalFX
trigger1 = Time = [21, 31]
add = 256,256,256
time = 10

[State 1614, 5]
type = PalFX
trigger1 = Time = [32, 34]
add = 200,200,200 ;120,120,255
time = 1

[State 1614, 4]
type = PalFX
trigger1 = Time = [35, 36]
add = 150,150,150 ;80,80,256
time = 1

[State 1614, 3]
type = PalFX
trigger1 = Time = [37, 39]
add = 100,100,100 ;50,50,155
time = 1

[State 1614, 2]
type = PalFX
trigger1 = Time = [40, 41]
add = 60,60,60 ;20,20,95
time = 1

[State 1614, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1614, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1616
time = -1

[State 1614, 6] ;tango voice
type = PlaySnd
trigger1 = Time = 24
value = 18, 17

[State 1614, 1] 
type = ChangeState
trigger1 = Time = 44 ;AnimTime = 0
value = 1615

;---------------------------------------------------------------------------
; Tango Z: Helper - attack
[Statedef 1615]
type = A
movetype = A
ctrl = 0
anim = 6135
velset = 0, 0
sprpriority = 4

[State 1615, 1]
type = HitDef
trigger1 = Time % 8 = 0
attr = A, SA                     
damage = floor(15/(1+(Var(19)/5.0))), 3
;getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 4, 8 ;8, 8         
guard.sparkno = s8301 ;S8200        
sparkno = s8360+(random%8) ;S8270                      
sparkxy = 10, 0
hitsound = S15, 6                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12
fall = 1

[State 1615, 2] 
type = VelAdd
trigger1 = Time >= 0 
y = .41

[State 1615, 2] 
type = VelSet
trigger1 = Pos Y >= 0 
x = 2.4
y = -9.9

[State 1615, 6]
type = HitBy
trigger1 = 1
value = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT

[State 1615, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1617
time = -1

[State 1615, 1]
type = Explod
trigger1 = Pos Y >= 0  
anim = 8041  
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1615, 2]
type = PlaySnd
trigger1 = Pos Y >= 0 
trigger1 = root, Time > 30
value = 18, 5
persistent = 0

[State 1615, 3]
type = DestroySelf
trigger1 = ScreenPos Y < -45 
trigger2 = BackEdgeDist < -45 || FrontEdgeDist < -45 

;---------------------------------------------------------------------------
; Tango GetHit (cat anim) or Up Anim: Helper (end)
[Statedef 1616]
type = A
movetype = I
ctrl = 0
anim = 6136
velset = 0, 0
sprpriority = 3

[State 1616, 1]
type = Explod
trigger1 = Time % 4 = 0 && Time < 20  
anim = 8040  
postype = p1
pos = 0, -20
velocity = 0, 0
accel = 0, 0
random = 20, 40
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1616, 2] ;up
type = VelSet
trigger1 = AnimElem = 2
y = -20

[State 1616, 6] ;up
type = PlaySnd
trigger1 = AnimElem = 2
value = 18, 8

[State 1616, 3]
type = DestroySelf
trigger1 = ScreenPos Y < 15 ;Time = 105 

;---------------------------------------------------------------------------
; Tango GetHit (ball anim): Helper (end)
[Statedef 1617]
type = A
movetype = I
ctrl = 0
;anim = 6135
;velset = 0, 0
sprpriority = 3

[State 1617, 0] 
type = VelSet
trigger1 = Time = 0 
x = -2.2
y = -3

[State 1617, 1] 
type = VelAdd
trigger1 = Time >= 0 
y = .3

[State 1617, 2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1617, 3]
type = DestroySelf
trigger1 = FrontEdgeDist < -150 ;-1
trigger2 = BackEdgeDist < -150 ;-1
trigger3 = ScreenPos Y < -150 ;15
trigger4 = ScreenPos Y > 355 ;Pos Y >= 0



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hand Burst: Helper
[Statedef 1700]
type    = A
movetype= A
anim = 6138
sprpriority = 3

[State 1700, 1] ;back Fire
type = Explod
;trigger1 = P2Dist X >= -5
trigger1 = NumExplod(6139) < 1
;trigger1 = !Time
persistent = 1
ID = 6139
anim = 6139
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256
;removeongethit = 1

[State 1700, 2] ;Remove back Fire
type = RemoveExplod
trigger1 = P2Dist X < -5
ID = 6139

;[State 1700, 0] ;Projectile Dust
;type = Helper
;triggerall = parent, Pos Y = 0 
;triggerall = parent, Time > 5  
;trigger1 = Time = 0 
;helpertype = normal
;name = "Projectile Dust"
;postype = p1
;pos = 0, ifelse(parent, StateType = C, 39, 51) 
;stateno = 8021
;sprpriority = 4
;ownpal = 1
;persistent = 0

;[state 1700, 1]
;type = VelSet
;trigger1 = Time = 0
;x = 5

[State 1700, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(95/(1+(root,Var(19)/5.0))), 6
animtype = High                 
guardflag = MA                  
hitflag = MAFD                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8231 
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -5
airguard.velocity = -1     
air.type = high                 
air.velocity = -4, 0 
air.hittime = 25       
fall = 1
air.fall = 1 
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1700, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(105/(1+(root,Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAFD                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1700, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1700, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1701
time = -1

;[State 1700, 8]
;type = TargetState
;trigger1 = MoveHit;NumTarget > 0
;;trigger1 = !target, IsHelper
;value = 225
;ignorehitpause = 1

;[State 1700, 0]
;type = VelSet
;trigger1 = Time = 0 ;(enemyNear, Time = 19) 
;x = (P2Dist X/30)*(root,facing)*facing 
;y = P2Dist Y/20
;persistent = 0

;[State 1700, 0.1] ;AIR
;type = VelSet
;trigger1 = enemyNear, Pos Y < 0
;trigger1 = Vel Y = 0
;;trigger1 = Time = 0 ;(enemyNear, Time = 19) 
;y = P2Dist Y/20
;persistent = 0

;[State 1700, 3]
;type = VelSet
;trigger1 = P2Dist X = [-10, 10]
;x = 0
;;persistent = 0

;[State 1700, 4] ;AIR
;type = VelSet
;;trigger1 = enemyNear, Pos Y < 0
;trigger1 = P2Dist Y = [-10,60];[-10, 55];[10, 30]
;y = 0
;;persistent = 0

;[State 1700, gox] ;by Z Sabre
;type = VelAdd
;trigger1 = P2BodyDist X >= 0 && Vel X < 6.2
;x = 0.5

;[State 1700, gox1]
;type = VelAdd
;trigger1 = P2BodyDist X < 0 && Vel X > -6.2
;x = -0.5

;[State 1700, goy]
;type = VelAdd
;;trigger1 = enemyNear, Pos Y < 0 && Pos Y >= -46 ;!(enemyNear, Pos Y <= 0) && Time = 0
;trigger1 = P2BodyDist Y >= 55 && Vel Y < 4
;y = 0.5

;[State 1700, goy1]
;type = VelAdd
;;trigger1 = enemyNear, Pos Y < 0 && Pos Y >= -46
;trigger1 = P2BodyDist Y < 55 && Vel Y > -4
;y = -0.5

;[State 1700, goy1]
;type = VelSet
;trigger1 = Pos Y >= -46
;trigger1 = Vel Y > 0
;y = 0

[State 1700, Componente X];by SMEE
Type = VarSet
Trigger1 = 1
fvar(13) = (EnemyNear(0), Pos X - Pos X) * Facing ;Ajusta a direção da componente por facing

;Acha a componente Y do vetor Player, EnemyNear
[State 1700, Componente Y]
Type = VarSet
trigger1 = 1
fvar(14) = (EnemyNear(0), pos Y - (Pos Y + (ifelse(parent, var(27) = 2, 34, ifelse(parent, var(27) = 3, 0, 46)))))

;Encontra o tamanho do vetor Player, EnemyNear(0)
;Fórmula do módulo de um dado vetor AB:
;|AB| = (AB(x)^2 + AB(y)^2)^1/2
[State 1700, Normal]
Type = VarSet
trigger1 = 1
fvar(15) = Exp(0.5*ln((fvar(13) * fvar(13))+(fvar(14) * fvar(14))))

[State 1700, VelSet]
Type = VelSet
trigger1 = 1
x = 7 * fvar(13)/fvar(15)
y = 7 * fvar(14)/fvar(15)

[State 1700, 0]
type = Turn
trigger1 = P2Dist X < -5

[State 1700, 7]
type = PlaySnd
trigger1 = Time
value = 18, 18
persistent = 0

[State 1700, 8]
type = ChangeState
trigger1 = MoveContact ;|| BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = RoundState = 4
;trigger3 = abs(p2dist x) > abs(vel x)
;trigger3 = abs(enemynear,pos y - pos y - enemynear,const(size.mid.pos.y)) > abs(vel y)
value = 1701
ignorehitpause = 1

;---------------------------------------------------------------------------
; Hand Burst: Helper (end)
[Statedef 1701]
type = A
movetype = I
ctrl = 0
;anim = 224
velset = 0, 0
sprpriority = 3

[State 1701] 
type = ParentVarSet
trigger1 = !Time
var(21) = 0

[State 1701] ;hold calculate - reset
type = ParentVarSet
trigger1 = !Time
var(22) = 0

[State 1701, 2] ;Remove back Fire
type = RemoveExplod
trigger1 = Time = 0
trigger2 = RootDist X < -5
ID = 6139

[State 1701, 0] ;turn 
type = Turn
trigger1 = root, facing = facing ;1
trigger1 = Time = 0
trigger2 = RootDist X < -5

[State 1701, 1] ;back Fire
type = Explod
;trigger1 = RootDist X >= -5
trigger1 = NumExplod(6139) < 1
;trigger1 = !Time
persistent = 1
ID = 6139
anim = 6139
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256
;facing = 1
;removeongethit = 1

[State 1701, 8] ;Hit Floor Spark (front)
type = Explod
;trigger1 = Time = 3
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 2
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 1701, 9] ;Hit Floor Spark (back)
type = Explod
;trigger1 = Time = 1
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State 1701, 10]
type = PlaySnd
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
value = 17, 0
ignorehitpause = 1
supermovetime = -1

;[State 1701, 0]
;type = VelSet
;trigger1 = Time = 0 ;(root, Time = 19) 
;x = RootDist X/30
;;y = RootDist Y/30
;persistent = 0

;[State 1701, 0.1] ;AIR
;type = VelSet
;trigger1 = root, Pos Y < 0 || enemyNear, Pos Y < 0 
;trigger1 = Time = 0 ;(root, Time = 19) 
;y = RootDist Y/30
;persistent = 0

;[State 1701, 3]
;type = VelSet
;trigger1 = RootDist X = [-10, 10]
;x = 0
;;persistent = 0

;[State 1701, 4] ;AIR
;type = VelSet
;;trigger1 = root, Pos Y < 0 || enemyNear, Pos Y < 0 
;trigger1 = RootDist Y = [-10, 60] ;[10, 30]
;y = 0
;;persistent = 0

;[State 1701, gox] ;by Z Sabre
;type = VelAdd
;trigger1 = RootDist X >= 0 && Vel X < 6.2
;x = 0.5

;[State 1701 gox1]
;type = VelAdd
;trigger1 = RootDist X < 0 && Vel X > -6.2
;x = -0.5

;[State 1701, goy]
;type = VelAdd
;;trigger1 = root, Pos Y < 0 && Pos Y >= -46 
;trigger1 = RootDist Y >= 55 && Vel Y < 4
;y = 0.5

;[State 1701, goy1]
;type = VelAdd
;;trigger1 = root, Pos Y < 0 && Pos Y >= -46 
;trigger1 = RootDist Y < 55 && Vel Y > -4
;y = -0.5

;[State 1701, goy1]
;type = VelSet
;trigger1 = Pos Y >= -46
;trigger1 = Vel Y > 0
;y = 0

[State 1701, Componente X];by SMEE
Type = VarSet
Trigger1 = 1
fvar(13) = (root, Pos X - Pos X) * Facing ;Ajusta a direção da componente por facing

;Acha a componente Y do vetor Player, EnemyNear
[State 1701, Componente Y]
Type = VarSet
trigger1 = 1
fvar(14) = (root, pos Y - (Pos Y + (ifelse(parent, var(28) = 2, 34, ifelse(parent, var(28) = 3, 0, 46)))))

;Encontra o tamanho do vetor Player, EnemyNear(0)
;Fórmula do módulo de um dado vetor AB:
;|AB| = (AB(x)^2 + AB(y)^2)^1/2
[State 1701, Normal]
Type = VarSet
trigger1 = 1
fvar(15) = Exp(0.5*ln((fvar(13) * fvar(13))+(fvar(14) * fvar(14))))

[State 1701, VelSet]
Type = VelSet
trigger1 = 1
x = 7 * fvar(13)/fvar(15)
y = 7 * fvar(14)/fvar(15)

[State 1700, 1]
type = PlaySnd
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
value = 18, 19
persistent = 0

[State 1701, 3] ;reset var(27)
Type = ParentVarSet
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
;trigger1 = !Time
var(27) = 0

[State 1701, 2] ;Remove back Fire
type = RemoveExplod
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
;trigger1 = Vel X = 0 && Vel Y = 0 ;MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 6139

[State 1701, 2] 
type = DestroySelf
trigger1 = RootDist X = [-30, 30] ;[-10, 10] ;the same line in state -2
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
;trigger1 = Vel X = 0 && Vel Y = 0
;trigger1 = Time > 10 ;AnimTime = 0
;trigger1 = P2MoveType != H ;NumTarget = 0
;trigger1 = NumTarget < 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hand Burst Strong: Helper
[Statedef 1702]
type    = A
movetype= A
anim = 6138
sprpriority = 3

[State 1702, 1] ;back strong Fire
type = Explod
;trigger1 = P2Dist X >= -5
trigger1 = NumExplod(77250) < 1
;trigger1 = !Time
persistent = 1
ID = 77250
anim = 7250
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256
;removeongethit = 1

[State 1702, 2] ;Remove back Fire
type = RemoveExplod
trigger1 = P2Dist X < -5
ID = 77250

[State 1702, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, SP                     
damage = floor(125/(1+(root,Var(19)/5.0))), 6
animtype = High                 
guardflag = MA                  
hitflag = MAFD                  
priority = 7, Hit               
sprpriority = 3
pausetime = 9, 9 
guard.sparkno = s8301 ;S8200              
sparkno = s8320+(random%8) ;S8231 
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -8, -1
airguard.velocity = -1     
air.type = high                 
air.velocity = -7, -2 
air.hittime = 25       
fall = 1
air.fall = 1 
;p2stateno = 225
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1702, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, SP                     
damage = floor(135/(1+(root,Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAFD                  
priority = 7, Hit               
sprpriority = 3
pausetime = 9, 9 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -9, -1
airguard.velocity = -5
air.type = high                 
air.velocity = -8, -2 
air.hittime = 25   
fall = 1
air.fall = 1
;p2stateno = 225
;fall = 1
;air.fall = 1
;palfx.time = 31
;palfx.add = 160,240,140
;palfx.mul = 80,120,220
;palfx.sinadd = 80, 80, 80, 5

[State 1702, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 1702, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 1703
time = -1

[State 1702, Componente X];by SMEE
Type = VarSet
Trigger1 = 1
fvar(13) = (EnemyNear(0), Pos X - Pos X) * Facing ;Ajusta a direção da componente por facing

;Acha a componente Y do vetor Player, EnemyNear
[State 1702, Componente Y]
Type = VarSet
trigger1 = 1
fvar(14) = (EnemyNear(0), pos Y - (Pos Y + (ifelse(parent, var(27) = 2, 34, ifelse(parent, var(27) = 3, 0, 46)))))

;Encontra o tamanho do vetor Player, EnemyNear(0)
;Fórmula do módulo de um dado vetor AB:
;|AB| = (AB(x)^2 + AB(y)^2)^1/2
[State 1702, Normal]
Type = VarSet
trigger1 = 1
fvar(15) = Exp(0.5*ln((fvar(13) * fvar(13))+(fvar(14) * fvar(14))))

[State 1702, VelSet]
Type = VelSet
trigger1 = 1
x = 15 * fvar(13)/fvar(15)
y = 15 * fvar(14)/fvar(15)

[State 1702, 0]
type = Turn
trigger1 = P2Dist X < -5

[State 1702, 7]
type = PlaySnd
trigger1 = Time
value = 18, 18
persistent = 0

[State 1702, 8]
type = ChangeState
trigger1 = MoveContact ;|| BackEdgeDist < -105 || FrontEdgeDist < -105 
trigger2 = RoundState = 4
;trigger3 = abs(p2dist x) > abs(vel x)
;trigger3 = abs(enemynear,pos y - pos y - enemynear,const(size.mid.pos.y)) > abs(vel y)
value = 1703
ignorehitpause = 1

;---------------------------------------------------------------------------
; Hand Strong Burst: Helper (end)
[Statedef 1703]
type = A
movetype = I
ctrl = 0
;anim = 224
velset = 0, 0
sprpriority = 3

[State 1703] 
type = ParentVarSet
trigger1 = !Time
var(21) = 0

[State 1703] ;hold calculate - reset
type = ParentVarSet
trigger1 = !Time
var(22) = 0

[State 1703, 2] ;Remove back Fire
type = RemoveExplod
trigger1 = Time = 0
trigger2 = RootDist X < -5
ID = 77250

[State 1703, 0] ;turn 
type = Turn
trigger1 = root, facing = facing ;1
trigger1 = Time = 0
trigger2 = RootDist X < -5

[State 1703, 1] ;back strong Fire
type = Explod
;trigger1 = RootDist X >= -5
trigger1 = NumExplod(77250) < 1
;trigger1 = !Time
persistent = 1
ID = 77250
anim = 7250
postype = p1
pos = -20, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256
;facing = 1
;removeongethit = 1

[State 1703, 8] ;Hit Floor Spark (front)
type = Explod
;trigger1 = Time = 3
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 2
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 1703, 9] ;Hit Floor Spark (back)
type = Explod
;trigger1 = Time = 1
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State 1703, 10]
type = PlaySnd
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;225
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 0
value = 17, 0
ignorehitpause = 1
supermovetime = -1

[State 1703, Componente X];by SMEE
Type = VarSet
Trigger1 = 1
fvar(13) = (root, Pos X - Pos X) * Facing ;Ajusta a direção da componente por facing

;Acha a componente Y do vetor Player, EnemyNear
[State 1703, Componente Y]
Type = VarSet
trigger1 = 1
fvar(14) = (root, pos Y - (Pos Y + (ifelse(parent, var(28) = 2, 34, ifelse(parent, var(28) = 3, 0, 46)))))

;Encontra o tamanho do vetor Player, EnemyNear(0)
;Fórmula do módulo de um dado vetor AB:
;|AB| = (AB(x)^2 + AB(y)^2)^1/2
[State 1703, Normal]
Type = VarSet
trigger1 = 1
fvar(15) = Exp(0.5*ln((fvar(13) * fvar(13))+(fvar(14) * fvar(14))))

[State 1703, VelSet]
Type = VelSet
trigger1 = 1
x = 15 * fvar(13)/fvar(15)
y = 15 * fvar(14)/fvar(15)

[State 1703, 1]
type = PlaySnd
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
value = 18, 19
persistent = 0

[State 1703, 3] ;reset var(27)
Type = ParentVarSet
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
;trigger1 = !Time
var(27) = 0

[State 1703, 2] ;Remove back strong Fire
type = RemoveExplod
trigger1 = RootDist X = [-30, 30] ;[-10, 10]
trigger1 = RootDist Y = [20, 60] ;[-10, 60]
;trigger1 = Vel X = 0 && Vel Y = 0 ;MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 77250

[State 1703, 2] 
type = DestroySelf
trigger1 = RootDist X = [-30, 30] ;[-10, 10] ;the same line in state -2
trigger1 = RootDist Y = [20, 60] ;[-10, 60]


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Dash Forward X (start)
[Statedef 1750]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6150
sprpriority = 1

[State 1750, 1] ;Back Dust
type = Explod
trigger1 = !Time
trigger1 = Pos Y >= 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1750, 1]
type = VelSet
trigger1 = !Time
x = 5
y = -5.5

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

[state 1750, 2]
type = VelAdd
trigger1 = Time >= 15
trigger2 = AnimElem = 2
y = .47

[State 1750, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1750, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1750, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 1
ID = 1750
anim = 6143
postype = p1
pos = -8, -46
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1750, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1750

[State 1750, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 1
ID = 1751
anim = 6143
postype = p1
pos = 13, -25
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1750, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1751

[State 1750, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = 20

[State 1750, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = !Time
value = 18, 25
persistent = 0

[State 1750, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1753

;---------------------------------------------------------------------------
; Dash Forward Y (start)
[Statedef 1751]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6150
sprpriority = 1

[State 1751, 1] ;Back Dust
type = Explod
trigger1 = !Time
trigger1 = Pos Y >= 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1751, 1]
type = VelSet
trigger1 = !Time
x = 7
y = -5.5

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

[state 1751, 2]
type = VelAdd
trigger1 = Time >= 15
trigger2 = AnimElem = 2
y = .47

[State 1751, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1751, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1751, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 1
ID = 1750
anim = 6143
postype = p1
pos = -8, -46
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1751, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1750

[State 1751, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 1
ID = 1751
anim = 6143
postype = p1
pos = 13, -25
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1751, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1751

[State 1751, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = 20

[State 1751, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = !Time
value = 18, 25
persistent = 0

[State 1751, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1753

;---------------------------------------------------------------------------
; Dash Forward Z (start)
[Statedef 1752]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6150
sprpriority = 1

[State 1752, 1] ;Back Dust
type = Explod
trigger1 = !Time
trigger1 = Pos Y >= 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1752, 1]
type = VelSet
trigger1 = !Time
x = 9
y = -5.5

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

[state 1752, 2]
type = VelAdd
trigger1 = Time >= 15
trigger2 = AnimElem = 2
y = .47

[State 1752, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1752, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1752, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 1
ID = 1750
anim = 6143
postype = p1
pos = -8, -46
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1752, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1750

[State 1752, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 1
ID = 1751
anim = 6143
postype = p1
pos = 13, -25
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1752, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 2
ID = 1751

[State 1752, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = 20

[State 1752, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = !Time
value = 18, 25
persistent = 0

[State 1752, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1753

;---------------------------------------------------------------------------
; Dash Forward (land) 
[Statedef 1753]
type    = S
physics = S
ctrl = 0
anim = 6017

[State 1753, 0]
type = VelSet
trigger1 = Time = 0
x = Vel X + 1

[State 1753, 1] ;brake 
type = VelMul
trigger1 = Time = 9 ;AnimElem = 2;1
x = .01

[State 1753, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 1753, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 1753, 4]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

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


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Dash Kick A (start)
[Statedef 1800]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6153
sprpriority = 1

[State 1800, 1]
type = VelSet
trigger1 = AnimElem = 2 ;!Time
x = 5
y = 6.5

[state 1800, 2]
type = VelAdd
trigger1 = AnimElem = 2
y = 1.17

[State 1800, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1800, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1800, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 2
ID = 1750
anim = 6143
postype = p1
pos = -21, -53
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1800, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1750

[State 1800, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 2
ID = 1751
anim = 6144
postype = p1
pos = 18, -58
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1800, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1751

[State 1800, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1
length = 6;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1

[State 1800, 15]
type = AfterImageTime
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
time = 0

[State 1800, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 2
value = 18, 25
persistent = 0

[State 1800, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52

;---------------------------------------------------------------------------
; Air Dash Kick B (start)
[Statedef 1801]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6153
sprpriority = 1

[State 1801, 1]
type = VelSet
trigger1 = AnimElem = 2 ;!Time
x = 7
y = 6.5

[state 1801, 2]
type = VelAdd
trigger1 = AnimElem = 2
y = 1.17

[State 1801, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1801, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1801, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 2
ID = 1750
anim = 6143
postype = p1
pos = -21, -53
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1801, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1750

[State 1801, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 2
ID = 1751
anim = 6144
postype = p1
pos = 18, -58
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1801, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1751

[State 1801, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1
length = 6;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1

[State 1801, 15]
type = AfterImageTime
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
time = 0

[State 1801, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 2
value = 18, 25
persistent = 0

[State 1801, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52

;---------------------------------------------------------------------------
; Air Dash Kick C (start)
[Statedef 1802]
type    = A
movetype= A
physics = N
juggle  = 4
ctrl = 0
anim = 6153
sprpriority = 1

[State 1802, 1]
type = VelSet
trigger1 = AnimElem = 2 ;!Time
x = 9
y = 6.5

[state 1802, 2]
type = VelAdd
trigger1 = AnimElem = 2
y = 1.17

[State 1802, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1802, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA                     
damage = floor(105/(1+(Var(19)/5.0))), 7
animtype = High                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 8, 8 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8320+(random%8) ;S8231
sparkxy = 0, -30              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = high               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -6
airguard.velocity = -5
air.type = high                 
air.velocity = -5, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 1802, 0] ;back fire 1
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1750) < 1
trigger1 = AnimElem = 2
ID = 1750
anim = 6143
postype = p1
pos = -21, -53
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1802, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1750

[State 1802, 0.2] ;back fire 2
type = Explod
triggerall = var(33) = 1
trigger1 = NumExplod(1751) < 1
trigger1 = AnimElem = 2
ID = 1751
anim = 6144
postype = p1
pos = 18, -58
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1802, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
ID = 1751

[State 1802, 15]
type = AfterImage
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 1
length = 6;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1

[State 1802, 15]
type = AfterImageTime
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
time = 0

[State 1802, 16]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = AnimElem = 2
value = 18, 25
persistent = 0

[State 1802, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jet Rush Mode - start 
[Statedef 2000]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 2000;1100                       
;poweradd = 75                    
sprpriority = 2                  

;[State 2000, 4.1] 
;type = SuperPause
;trigger1 = Time = 1
;anim = -1;S8020
;;sound = S0, 0
;pos = 11, 2
;movetime = 131
;darken = 0
;poweradd = -1000
;bindtime = -1
;sprpriority = 3
;Time = 132 ;41

;[State 2000, 7] ;Background
;type = Explod
;trigger1 = Time = 17;1
;persistent = 0
;anim = 8910;8921
;postype = left
;pos = 0, 0
;velocity = 0, 0
;accel = 0, 0
;removetime = -2
;sprpriority = -5
;supermovetime = -1
;bindtime = -1
;ownpal = 1

;[State 2000, 8]
;type = PlaySnd
;trigger1 = Time = 17
;value = 30, 0

;[State 2000, 5]
;type = AssertSpecial
;trigger1 = Time = [1, 132]
;flag = nobardisplay
;ignorehitpause = 1
;supermovetime = -1

;[State 2000, 6]
;type = AssertSpecial
;trigger1 = Time = [1, 132]
;flag = NoFG
;ignorehitpause = 1
;supermovetime = -1

;[State 2000, 7]
;type = ChangeAnim
;trigger1 = NumHelper(7000) = 1
;trigger1 = Helper(7000), AnimElem = 10 ;Pos X = [-10, 10] 
;value = 6029

;[State 2000, 1] ;Back Dust
;type = Explod
;trigger1 = Anim = 6029
;trigger1 = AnimElem = 1, 0
;persistent = 0
;anim = 8020
;postype = p1
;pos = 20, 3
;velocity = 0, 0
;accel = 0, 0
;removetime = -2
;supermovetime = -1
;sprpriority = 4
;ownpal = 1

[State 2000, 3] ;start var(33)
type = VarSet
trigger1 = var(33) = 0
trigger1 = Time = 0
v = 33
value = 0;2

[State 2000, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 5;0, 1
channel = 0

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

;---------------------------------------------------------------------------
; Jet Rush Mode - air
[Statedef 2001]
type    = A  
movetype= I;A                                        
physics = N                      
juggle  = 0;5                      
velset = 0,0                     
ctrl = 0                         
anim = 0                       
;poweradd = 75                    
sprpriority = 2                  

[State 2001, 1] 
type = StateTypeSet
trigger1 = command = "x" || Anim = 200
trigger2 = command = "y" || Anim = 210 
trigger3 = command = "z" || Anim = 220 
trigger4 = command = "a" || Anim = 230 
trigger5 = command = "b" || Anim = 240 
trigger6 = command = "c" || Anim = 250 
trigger7 = var(35) = 1 ;NumHelper(7244) > 0 || NumHelper(7245) > 0 || NumHelper(7246) > 0 
trigger8 = var(35) = 2 && var(34) >= 58
;trigger9 = command = "Hyper_Megaman_XYZ" || Anim = 3200
;trigger10 = command = "Rush_Drill_ABC" || Anim = 7251
;trigger11 = command = "Rush_Kamikaze" || Anim = 7264
statetype = A
movetype = A
physics = N
ignorehitpause = 1

[State 2001, 1] 
type = StateTypeSet
trigger1 = Anim != 200 && command != "x" 
trigger1 = Anim != 210 && command != "y"
trigger1 = Anim != 220 && command != "z"
trigger1 = Anim != 230 && command != "a"
trigger1 = Anim != 240 && command != "b"
trigger1 = Anim != 250 && command != "c"
trigger1 = var(35) != 1 && (var(35) != 2 || (var(35) = 2 && var(34) < 58))
;trigger1 = Anim != 3200 && command != "Hyper_Megaman_XYZ"
;trigger1 = Anim != 7251 && command != "Rush_Drill_ABC"
;trigger1 = Anim != 7264 && command != "Rush_Kamikaze"
statetype = A
movetype = I
physics = N
ignorehitpause = 1

[State 2001, 0] ;state time add
type = VarAdd
trigger1 = Anim = 200 && var(34) >= 0
trigger2 = Anim = 210 && var(34) >= 0
trigger3 = Anim = 220 && var(34) >= 0
trigger4 = Anim = 230 && var(34) >= 0
trigger5 = Anim = 240 && var(34) >= 0
trigger6 = Anim = 250 && var(34) >= 0
trigger7 = Anim = 3200 && var(34) >= 0 ;(Anim = 3200 && var(34) >= 0 && var(35) = 0) || var(35) != 0
trigger8 = var(35) = 2 && var(34) >= 0
trigger9 = var(35) = 3 && var(34) >= 0
trigger10 = Anim = 1200 && var(34) >= 0
trigger11 = Anim = 12000 && var(34) >= 0
trigger12 = Anim = 12001 && var(34) >= 0
var(34) = 1
ignorehitpause = 1
supermovetime = 999999

[State 2001, 0] ;state time set to 0
type = VarSet
;trigger1 = (Anim = 200 && MoveContact) ;Anim != 200
;trigger1 = command = "x"
;trigger1 = var(35) != 2
;trigger1 = AnimElem = 1, = 0
trigger1 = Anim = 200
trigger1 = AnimTime = 0
trigger2 = (Anim = 200 && MoveContact) || (Anim = 230 && MoveContact) ;;(Anim = 200 && MoveContact)
trigger2 = command = "y"
trigger2 = var(35) != 2
;trigger3 = AnimElem = 1, = 0
trigger3 = Anim = 210
trigger3 = AnimTime = 0
trigger4 = (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) ;;(Anim = 200 && MoveContact) || (Anim = 210 && MoveContact)
trigger4 = command = "z"
trigger4 = var(35) != 2
;trigger5 = AnimElem = 1, = 0
trigger5 = Anim = 220
trigger5 = AnimTime = 0
;trigger7 = (Anim = 230 && MoveContact)
;trigger7 = var(35) != 2
;trigger7 = command = "a"
;trigger7 = AnimElem = 1, = 0
trigger6 = Anim = 230
trigger6 = AnimTime = 0
trigger7 = (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 230 && MoveContact) ;;(Anim = 230 && MoveContact)
trigger7 = var(35) != 2
trigger7 = command = "b"
;trigger9 = AnimElem = 1, = 0
trigger8 = Anim = 240
trigger8 = AnimTime = 0
trigger9 = (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 220 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) ;;(Anim = 230 && MoveContact) || (Anim = 240 && MoveContact)
trigger9 = var(35) != 2
trigger9 = command = "c"
;trigger11 = AnimElem = 1, = 0
trigger10 = Anim = 250
trigger10 = AnimTime = 0
trigger11 = Anim != 200 && Anim != 210 && Anim != 220 && Anim != 230 && Anim != 240 && Anim != 250 && Anim != 3200 && Anim != 7251 && Anim != 7264 && Anim != 1200 && Anim != 12000 && Anim != 12001 ;!(var(35) != 0 && var(34) > 0 && var(34) < 500) 
;;trigger3 = command != "hold_z" 
;trigger14 = var(34) >= 500 ;(var(35) != 0 && var(34) >= 500) ;supers
trigger12 = Anim = 3200
trigger12 = AnimElemTime(1) >= 0 ;AnimElem = 1, = 0
trigger13 = var(35) = 0                 ;super 2 
trigger13 = Anim != 7251                ;super 2
trigger13 = command = "Rush_Drill_ABC"  ;super 2
trigger14 = var(35) = 2
trigger14 = Anim = 12 ;NumHelper(7000) > 0
;trigger15 = helper, anim = 7241
trigger15 = !Time
trigger16 = Anim = 1200
trigger16 = AnimElem = 1, = 0 || AnimTime = 0 
trigger17 = Anim = 12000
trigger17 = AnimElem = 1, = 0 || AnimTime = 0
trigger18 = Anim = 12001
trigger18 = AnimElem = 1, = 0 || AnimTime = 0
var(34) = 0
ignorehitpause = 1
supermovetime = 999999

;[State 2001, 0] 
;type = VelAdd
;trigger1 = Time = 0
;y = 0

[State 2001, 0] 
type = PosSet
trigger1 = Time = 0
y = -20;-19;-11

[State 2001, 0]
type = Turn
trigger1 = var(35) != 2 && var(35) != 3 
trigger1 = P2Dist X < -5

[State 2001, 1] ;move fwd
type = VelSet
trigger1 = var(35) != 2 && var(35) != 3
trigger1 = command = "holdfwd"
x = ifelse(var(35) = 1, 6, 4)

[State 2001, 1] ;move back
type = VelSet
trigger1 = var(35) != 2 && var(35) != 3
trigger1 = command = "holdback"
x = ifelse(var(35) = 1, -6, -4)

[State 2001, 1] ;move up
type = VelSet
trigger1 = var(35) != 2 && var(35) != 3
trigger1 = command = "holdup"
y = ifelse(var(35) = 1, -6, -4)

[State 2001, 1] ;move down
type = VelSet
trigger1 = var(35) != 2 && var(35) != 3
trigger1 = command = "holddown"
y = ifelse(var(35) = 1, 6, 4)

[State 2001, 1] ;stop horizontal move
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
;trigger2 = Time = 207
x = 0

[State 2001, 1] ;stop vertical move
type = VelSet
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger2 = command = "holddown"
trigger2 = Pos Y >= -20;-19;0
trigger3 = command = "holdup"
trigger3 = ScreenPos Y < 65;70
;trigger4 = Time = 207
y = 0

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;;trigger1 = Anim != 200
;trigger1 = Anim != 210
;trigger1 = Anim != 220
;trigger1 = Anim != 230
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 ;|| (Anim = 200 && MoveContact)
trigger1 = command = "x"
value = 200

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 200 && MoveContact)
;trigger1 = command = "x"
trigger1 = Anim = 200
trigger1 = AnimElem = 1, = 0
value = 20

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim != 210
;trigger1 = Anim != 220
;trigger1 = Anim != 230
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 230 && MoveContact) 
trigger1 = command = "y" 
value = 210

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 200 && MoveContact)
;trigger1 = command = "y" 
trigger1 = Anim = 210
trigger1 = AnimElem = 1, = 0
value = 55

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim != 220
;trigger1 = Anim != 230
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) 
trigger1 = command = "z"
value = 220

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact)
;trigger1 = command = "z"
trigger1 = Anim = 220
trigger1 = AnimElem = 1, = 0
value = 85

[State 2001, 1.2] ;hold burst anim (based on Ribeiro code)
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
trigger1 = var(22) = var(20) 
;trigger1 = Anim != 220
;trigger1 = Anim != 230
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) 
trigger1 = command != "hold_z" && var(20) > 75 && anim != 220 ;&& statetype = A
;trigger1 = NumExplod(225) < 1
value = 220
ignorehitpause = 1

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim != 200
;trigger1 = Anim != 210
;trigger1 = Anim != 220
;;trigger1 = Anim != 230
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 ;|| (Anim = 230 && MoveContact)
trigger1 = command = "a"
value = 230

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 230 && MoveContact)
;trigger1 = command = "a"
trigger1 = Anim = 230
trigger1 = AnimElem = 1, = 0
value = 20

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim != 200
;trigger1 = Anim != 210
;trigger1 = Anim != 220
;trigger1 = Anim != 240
;trigger1 = Anim != 250
trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 230 && MoveContact) 
trigger1 = command = "b"
value = 240

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 230 && MoveContact)
;trigger1 = command = "b"
trigger1 = Anim = 240
trigger1 = AnimElem = 1, = 0
value = 55

[State 2001, 1]
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim != 200
;trigger1 = Anim != 210
;trigger1 = Anim != 220
;trigger1 = Anim != 250
trigger1 = Anim = 0 || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 220 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) 
trigger1 = command = "c"
value = 250

[State 2001, 1] 
type = PowerAdd
trigger1 = var(35) != 2 && var(35) != 3
;trigger1 = Anim = 0 || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact)
;trigger1 = command = "c"
trigger1 = Anim = 250
trigger1 = AnimElem = 1, = 0
value = 90

;-Specials-------

[State 2001, 1] ;Special 1
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3 ;var(35) = 0
trigger1 = Anim != 1200
trigger1 = NumHelper(1201) < 1 && NumHelper(1211) < 1 && NumHelper(1221) < 1
trigger1 = command = "striker_beat"
value = 1200

[State 2001, 2] ;Special 2
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3 ;var(35) = 0
trigger1 = Anim != 12000
trigger1 = NumHelper(1201) < 1 && NumHelper(1211) < 1 && NumHelper(1221) < 1
trigger1 = command = "striker_fliptop"
value = 12000

[State 2001, 3] ;Special 3
type = ChangeAnim
trigger1 = var(35) != 2 && var(35) != 3 ;var(35) = 0
trigger1 = Anim != 12001
trigger1 = NumHelper(1201) < 1 && NumHelper(1211) < 1 && NumHelper(1221) < 1
trigger1 = command = "striker_auto"
value = 12001

;-Supers---------

[State 2001, 1] ;Super 1
type = ChangeAnim
trigger1 = power >= 1000
trigger1 = var(35) = 0 ;(var(35) != 1) && (var(35) != 2) && (var(35) != 3) ;var(35) = 0
trigger1 = Anim != 3200
trigger1 = command = "Hyper_Megaman_XYZ"
;trigger1 = (Anim = 0) ;|| (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 220 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) || (Anim = 250 && MoveContact) 
value = 3200

[State 2001, 2] ;Super 2
type = ChangeAnim
trigger1 = power >= 1000
trigger1 = var(35) = 0 ;(var(35) != 1) && (var(35) != 2) && (var(35) != 3) ;var(35) = 0
trigger1 = Anim != 7251
trigger1 = command = "Rush_Drill_ABC"
;trigger1 = (Anim = 0) || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 220 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) || (Anim = 250 && MoveContact)
value = 7251

[State 2001, 3] ;Super 3
type = ChangeAnim
trigger1 = power >= 3000
trigger1 = var(35) = 0 ;(var(35) != 1) && (var(35) != 2) && (var(35) != 3) ;var(35) = 0
trigger1 = Anim != 7264
trigger1 = command = "Rush_Kamikaze"
;trigger1 = (Anim = 0) || (Anim = 200 && MoveContact) || (Anim = 210 && MoveContact) || (Anim = 220 && MoveContact) || (Anim = 230 && MoveContact) || (Anim = 240 && MoveContact) || (Anim = 250 && MoveContact)
value = 7264

;[State 2001, 0] 
;type = MoveHitReset
;;triger1 = var(35) != 2 && var(35) != 3
;;;trigger1 = var(35) = 2
;;trigger1 = var(34) >= 20
;trigger1 = MoveContact
;trigger1 = HitPauseTime = 0

[State 2001, 0] ;Super 1 VarSet
type = VarSet
trigger1 = Anim = 3200
trigger1 = var(34) >= 0 ;= 0 ;AnimElem = 1, 0
var(35) = 1
ignorehitpause = 1

[State 2001, 0] ;Super 2 VarSet
type = VarSet
trigger1 = Anim = 7251
trigger1 = var(34) >= 0 ;= 0
var(35) = 2
ignorehitpause = 1

[State 2001, 0] ;Super 3 VarSet
type = VarSet
trigger1 = Anim = 7264
trigger1 = var(34) >= 0 ;= 0
var(35) = 3
ignorehitpause = 1

[State 2001, 0] ;Supers VarSet - back to normal 
type = VarSet
trigger1 = var(35) = 1
trigger1 = var(36) >= 400 ;500
trigger2 = var(35) = 2
trigger2 = Anim = 12 ;NumHelper(7000) > 0
;trigger2 = helper, anim = 7241
trigger3 = !Time
var(35) = 0
ignorehitpause = 1

[State 2001, 0] ;state time set to 0
type = VarSet
trigger1 = var(35) = 1 
trigger1 = var(36) >= 400 ;500
trigger2 = !Time
trigger3 = var(35) = 0
var(36) = 0
ignorehitpause = 1

[State 2001, 0] ;state time add
type = VarAdd
trigger1 = var(35) = 1 
;trigger2 = var(35) = 3 - now in rush state
;trigger2 = Vel X = 0
;trigger2 = Vel Y = 0
var(36) = 1
ignorehitpause = 1

[State 2001, 1] ;Super 2 anim to crouch to stand anim
type = ChangeAnim
trigger1 = Anim = 7251
trigger1 = var(34) >= 85 ;90
value = 12

[State 2001, 1] ;back to stand anim
type = ChangeAnim
trigger1 = Anim = 200
trigger1 = AnimTime = 0
trigger2 = Anim = 210
trigger2 = AnimTime = 0
trigger3 = Anim = 220
trigger3 = AnimTime = 0
trigger4 = Anim = 230
trigger4 = AnimTime = 0
trigger5 = Anim = 240
trigger5 = AnimTime = 0
trigger6 = Anim = 250
trigger6 = AnimTime = 0
trigger7 = Anim = 3200
trigger7 = AnimTime = 0
trigger8 = Anim = 12
trigger8 = AnimTime = 0
trigger9 = Anim = 1200
trigger9 = AnimTime = 0
trigger10 = Anim = 12000
trigger10 = AnimTime = 0
trigger11 = Anim = 12001
trigger11 = AnimTime = 0
value = 0

;--Basic-Attacks----------

[State 2001, light punch]
type = HitDef
trigger1 = Anim = 200
trigger1 = var(34) = 0
attr = A, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2 ;1 = 8 hits para um dano diminuido
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 10, 4;8                 
guard.sparkno = s8300 ;S8200
sparkno = s8310+(random%8) ;S8210                      
sparkxy = 15, -47              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12
;persistent = 0

[State 2001, light punch]
type = PlaySnd
trigger1 = Anim = 200
trigger1 = var(34) = 1
value = 10, 0

[State 2001, medium punch]
type = HitDef
trigger1 = Anim = 210
trigger1 = var(34) = 0
attr = A, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 8, 8         
guard.sparkno = s8300 ;S8200        
sparkno = s8310+(random%8) ;S8220                      
sparkxy = 10, -67
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 2001, medium punch]
type = Width
trigger1 = Anim = 210
trigger1 = AnimElem = 4
player = 20,5

[State 2001, medium punch]
type = Width
trigger1 = Anim = 210
trigger1 = AnimElem = 6
player = 5, 0

[State 2001, medium punch]
type = Width
trigger1 = Anim = 210
trigger1 = var(34) = [6, 14]
player = 5, 0

[State 2001, medium punch]
type = PlaySnd
trigger1 = Anim = 210
trigger1 = var(34) = 1
value = 2, 0
channel = 0

[State 2001, medium punch]
type = PlaySnd
trigger1 = Anim = 210
trigger1 = var(34) = 1
value = 10, 1

[State 2001, strong punch] ;Fireball Shoot
type = Explod
trigger1 = NumExplod(221) < 1
trigger1 = Anim = 220
trigger1 = var(20) < 76 && AnimElem = 4
persistent = 1
ID = 221
anim = 221
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 2001, strong punch] ;Fireball efect
type = Explod
trigger1 = NumExplod(222) < 1
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = 10
persistent = 1
ID = 222
anim = 222
postype = p1
pos = 24, -46
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 2001, strong punch]
type = Helper
trigger1 = Anim = 220
trigger1 = var(20) < 76 && AnimElem = 4
helpertype = normal
name = "Fireball"
ID = 223 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 223 
ownpal = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = [5, 7] ;3
add = 120,120,255
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = [8, 10] ;3
add = 80,80,256
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = [11, 14] ;4
add = 50,50,155
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = [15, 17] ;3
add = 20,20,95
time = 1


[State 2001, strong punch] ;Fireball Shoot
type = Explod
trigger1 = NumExplod(225) < 1
trigger1 = Anim = 220
trigger1 = var(20) > 75 && AnimElem = 4
persistent = 1
ID = 225
anim = 225
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 2001, strong punch] ;Fireball efect
type = Explod
trigger1 = NumExplod(226) < 1
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = 10
persistent = 1
anim = 226
postype = p1
pos = 24, -46
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1

[State 2001, strong punch]
type = Helper
trigger1 = Anim = 220
trigger1 = var(20) > 75 && AnimElem = 4
helpertype = normal
name = "Hold Fireball"
ID = 227 
pos = 24, -46
postype = p1
;bindtime = -1
;facing = 1
stateno = 227 
ownpal = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = [5, 7] ;3
add = 255,120,0
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = [8, 10] ;3
add = 120,190,0
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = [11, 14] ;4
add = 190,80,0
time = 1

[State 2001, strong punch]
type = PalFX
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = [15, 17] ;3
add = 90,50,0
time = 1

[State 2001, strong punch]
type = PlaySnd
trigger1 = Anim = 220
trigger1 = var(20) < 76 && AnimElem = 4
value = 18, 0

[State 2001, strong punch]
type = PlaySnd
trigger1 = Anim = 220
trigger1 = var(20) > 75 && AnimElem = 4
value = 18, 1

[State 2001, strong punch] ;Fireball (reset hold var)
type = VarSet
trigger1 = NumExplod(225) > 0 
var(20) = 0

[State 2001, strong punch]
type = Width
trigger1 = Anim = 220
trigger1 = var(34) = [12, 18]
player = 5, 0

[State 2001, strong punch]
type = PlaySnd
trigger1 = Anim = 220
trigger1 = var(20) < 76 && var(34) = 6
value = 2, 1
channel = 0

[State 2001, strong punch]
type = PlaySnd
trigger1 = Anim = 220
trigger1 = var(20) > 75 && var(34) = 6
value = 2, 4
channel = 0

[State 2001, light kick]
type = HitDef
trigger1 = Anim = 230
trigger1 = var(34) = 0
attr = A, NA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 9, 4;8
guard.sparkno = s8300 ;S8200                 
sparkno = s8310+(random%8) ;S8210                      
sparkxy = -10, -32              
hitsound = S15, 3                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -3             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 2001, light kick]
type = Width
trigger1 = Anim = 230
trigger1 = var(34) = [6, 12]
player = 6, 0

[State 2001, light kick]
type = PlaySnd
trigger1 = Anim = 230
trigger1 = var(34) = 1
value = 10, 0

[State 2001, medium kick]
type = HitDef
trigger1 = Anim = 240
trigger1 = var(34) = 0
attr = A, NA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 3, Hit               
pausetime = 9, 8      
guard.sparkno = s8300 ;S8200           
sparkno = s8310+(random%8) ;S8220                      
sparkxy = -8, -56              
hitsound = S15, 4                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 5             
ground.hittime  = 12             
ground.velocity = -5             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12

[State 2001, medium kick]
type = Width
trigger1 = Anim = 240
trigger1 = var(34) = [6, 18]
player = 8, 3

[State 2001, medium kick]
type = PlaySnd
trigger1 = Anim = 240
trigger1 = var(34) = 0
value = 2, 2
channel = 0

[State 2001, medium kick]
type = PlaySnd
trigger1 = Anim = 240
trigger1 = var(34) = 3
value = 10, 1

[State 2001, strong kick]
type = HitDef
trigger1 = Anim = 250
trigger1 = var(34) = 0
attr = A, NA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 9, 9          
guard.sparkno = s8300 ;S8200       
sparkno = s8310+(random%8) ;S8230                      
sparkxy = -10, -74              
hitsound = S15, 5                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 8            
ground.hittime  = 25             
ground.velocity = -8,-1              
airguard.velocity = -2, 2     
air.type = High                  
air.velocity = -7,-2           
air.hittime = 25

[State 2001, strong kick]
type = Width
trigger1 = Anim = 250
trigger1 = var(34) = [11, 23]
player = 8, 0

[State 2001, strong kick]
type = PlaySnd
trigger1 = Anim = 250
trigger1 = var(34) = 1
value = 2, 1
channel = 0

[State 2001, strong kick]
type = PlaySnd
trigger1 = Anim = 250
trigger1 = var(34) = 1
value = 10, 2


;---Specials--------

[State 2001, special 1] ;Beat
type = Helper
trigger1 = Anim = 1200
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "Beat"
ID = 1201 
postype = left
pos = ifelse(facing = 1, 0, 319), floor((pos y) / 2) ;0 
facing = facing
stateno = 1201 
ownpal = 1
ignorehitpause = 1

[State 2001, special 1]
type = PlaySnd
trigger1 = command != "normal_mode"
trigger1 = command != "super-adaptor_mode"
trigger1 = Anim = 1200
trigger1 = var(34) = 0;1
value = 3, 4
channel = 0

[State 2001, special 1] ;beat wings noise
type = PlaySnd
trigger1 = Anim = 1200
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 10

[State 2001, special 2] ;FlipTop
type = Helper
trigger1 = Anim = 12000
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "FlipTop"
ID = 1211 
postype = left
pos = ifelse(facing = 1, 0, 319), floor((pos y) / 2) ;0 
facing = facing
stateno = 1211 
ownpal = 1
ignorehitpause = 1

[State 2001, special 2]
type = PlaySnd
trigger1 = command != "normal_mode"
trigger1 = command != "super-adaptor_mode"
trigger1 = Anim = 12000
trigger1 = var(34) = 0;1
value = 3, 4
channel = 0

[State 2001, special 2] ;fliptop voice
type = PlaySnd
trigger1 = Anim = 12000
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 13

[State 2001, special 3] ;Auto
type = Helper
trigger1 = Anim = 12001
trigger1 = AnimElem = 4 ;Time = 0 
helpertype = normal
name = "Auto"
ID = 1221 
postype = left
pos = ifelse(facing = 1, 0, 319), floor((pos y) / 2) ;0 
facing = facing
stateno = 1221 
ownpal = 1
ignorehitpause = 1

[State 2001, special 3]
type = PlaySnd
trigger1 = command != "normal_mode"
trigger1 = command != "super-adaptor_mode"
trigger1 = Anim = 12001
trigger1 = var(34) = 0;1
value = 3, 4
channel = 0

[State 2001, special 3] ;auto voice
type = PlaySnd
trigger1 = Anim = 12001
trigger1 = AnimElem = 4 ;Time = 5
value = 18, 24 ;18, 11


;---SUPERS----------

[State 2001, Super] 
type = SuperPause
trigger1 = var(35) = 1
trigger1 = var(36) = 17
trigger2 = var(35) = 2 
trigger2 = var(34) = 17
trigger3 = var(35) = 3 
trigger3 = var(36) = 2
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = 1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 2001, Super]
type = AssertSpecial
trigger1 = var(35) = 1 
trigger1 = var(36) = [17, 150]
trigger2 = var(35) = 2
trigger2 = var(34) = [17, 150]
trigger3 = var(35) = 3 
trigger3 = var(36) = [2, 135]
flag = nobardisplay
ignorehitpause = 1

[State 2001, Super]
type = AssertSpecial
trigger1 = var(35) = 1 
trigger1 = var(36) = [17, 58]
trigger2 = var(35) = 2
trigger2 = var(34) = [17, 58]
trigger3 = var(35) = 3 
trigger3 = var(36) = [2, 43]
flag = NoFG
ignorehitpause = 1

[State 2001, Super] ;Super BG (start)
type = Explod
trigger1 = var(35) = 1 
trigger1 = var(36) = 17
trigger2 = var(35) = 2
trigger2 = var(34) = 17
trigger3 = var(35) = 3 
trigger3 = var(36) = 2
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 2001, Super]
type = PlaySnd
trigger1 = var(35) = 1 
trigger1 = var(36) = 17
trigger2 = var(35) = 2
trigger2 = var(34) = 17
trigger3 = var(35) = 3 
trigger3 = var(36) = 2
value = 30, 0

[State 2001, Super] ;Super Portrait
type = Explod
trigger1 = var(35) = 1 
trigger1 = var(36) = 20
trigger2 = var(35) = 2
trigger2 = var(34) = 20
trigger3 = var(35) = 3 
trigger3 = var(36) = 5
anim = 8890
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 2001, Super] ;Rush Super Portrait (Super 3)
type = Explod
trigger1 = var(35) = 3 
trigger1 = var(36) = 37
anim = 8892
postype = left
pos = ifelse(facing = 1, 0, 319), 5 ;0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1
scale = .5, .5

[State 2001, super 2]
type = HitDef
trigger1 = var(35) = 2
trigger1 = var(34) = 0 || var(34) = 1
attr = A, HA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                 
priority = 7, Hit               
pausetime = 12, 12          
guard.sparkno = s8301 ;S8200       
sparkno = s8330+(random%8) ;S8270                      
sparkxy = -20, 0              
hitsound = S15, 5                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 8            
ground.hittime  = 25             
ground.velocity = -8,-6              
airguard.velocity = -2, 2     
air.type = High                  
air.velocity = -7,-7           
air.hittime = 25
fall = 1
air.fall = 1

[State 2001, super 2] 
type = VelSet
trigger1 = var(35) = 2
trigger1 = var(34) >= 58;47
x = 11

[State 2001, super 2] 
type = VelSet
trigger1 = var(35) = 2
trigger1 = var(34) >= 85
x = 0

[State 2001, super 2]
type = PlaySnd
trigger1 = var(35) = 2
trigger1 = var(34) = 5
value = 0, 1
channel = 0

[State 2001, super 3] 
type = VelSet
trigger1 = var(35) = 3
x = -9

[State 2001, super 3] 
type = VelSet
trigger1 = var(35) = 3
y = -9

[State 2001, super 3] 
type = VelSet
trigger1 = var(35) = 3
trigger1 = BackEdgeDist < 25;-1
x = 0

[State 2001, super 3] 
type = VelSet
trigger1 = var(35) = 3
trigger1 = ScreenPos Y < 55
y = 0

[State 2001, super 3] 
type = VelSet
trigger1 = var(35) = 3
trigger1 = var(36) != 0 ;Vel X = 0
x = 0
y = 0

[State 2001, super 3] 
type = ScreenBound
trigger1 = var(35) = 3
;trigger1 = var(36) < 43;58
value = 1
movecamera = 0,0



[State 2001, 5] ;Arigato!
type = PlaySnd
trigger1 = Time = 0
value = 3, 6
channel = 0

;[State 2001, 6]
;type = HitOverride
;trigger1 = 1
;attr = SCA, AA,AP,AT
;stateno = 2002
;time = -1

[State 2001, 7]
type = ChangeState
trigger1 = command = "normal_mode"
trigger2 = RoundState != 2
trigger2 = var(35) != 2
;trigger2 = MoveType = H
;trigger2 = time = 500 ;AnimTime = 0
trigger3 = var(35) = 3
;trigger3 = Vel X = 0
;trigger3 = Vel Y = 0
trigger3 = var(36) >= 43;57
value = 2002

[State 2001, 8]
type = ChangeState
trigger1 = command = "super-adaptor_mode"
value = 2004

;---------------------------------------------------------------------------
; Jet Rush Mode - air end
[Statedef 2002]
type    = A                                          
physics = N                      
velset = 0,0                     
ctrl = 0                         
anim = 53                       
sprpriority = 2                  

[State 2002, super 3] 
type = ScreenBound
trigger1 = var(35) = 3
;trigger1 = var(36) < 43;58
value = 1
movecamera = 0,0

[State 2002, 1] ;AIR
type = VelSet
trigger1 = Time = 0 ;Pos Y < 0
x = ifelse(var(35) = 3, -2, 0) ;-2
y = -2.7 ;-2.5

[State 2002, 1.2] ;AIR
type = VelAdd
trigger1 = Time >= 0 ;Pos Y < 0
y = const(movement.yaccel)

[State 2002, 11]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 
ctrl = 1

;---------------------------------------------------------------------------
; S.Adapt Mode to Jet Rush Mode
[Statedef 2003]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 1100                       
;poweradd = 75                    
sprpriority = 2                  

[State 2003, 5]
type = PalFX
trigger1 = Time = [0, 10]
add = 256,256,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 2003, 1] ;Back Dust
type = Explod
trigger1 = Time = 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1

[State 2003, 3] ;reset var(33)
type = VarSet
trigger1 = var(33) = 1
trigger1 = Time = 0
v = 33
value = 0

[State 2003, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 1, 0
channel = 0

[State 2003, 5]
type = PalFX
trigger1 = Time = [11, 13]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 2003, 4]
type = PalFX
trigger1 = Time = [14, 15]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 2003, 3]
type = PalFX
trigger1 = Time = [16, 18]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 2003, 2]
type = PalFX
trigger1 = Time = [19, 20]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 2003, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 2000

;---------------------------------------------------------------------------
; Jet Rush Mode to S.Adapt Mode (part 1)
[Statedef 2004]
type    = A                                          
physics = N                      
velset = 0,0                     
ctrl = 0                         
anim = 53                       
sprpriority = 2                  

[State 2004, 1] ;AIR
type = VelSet
trigger1 = Time = 0 ;Pos Y < 0
x = -2
y = -2.7 ;-2.5

[State 2004, 1.2] ;AIR
type = VelAdd
trigger1 = Time >= 0 ;Pos Y < 0
y = const(movement.yaccel)

[State 2004, 2]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 2005 
ctrl = 1

;---------------------------------------------------------------------------
; Jet Rush Mode to S.Adapt Mode (part 2)
[Statedef 2005]
type    = S
physics = S
ctrl = 0
anim = ifelse(var(33) = 1, 6014, 47)

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

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

;[State 2005, 3]
;type = CtrlSet
;trigger1 = Time = 3
;value = 1

[State 2005, 4]
type = Turn
triggerall = P2Dist X < -5 ;P2BodyDist X < 0
trigger1 = Command = "holdup" || Command = "holddown" 
trigger2 = Command = "holdup" && Command = "holdfwd" || Command = "holdback"

[State 2005, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = AnimElem = 2 && Command = "holddown"
value = 6028

;---------------------------------------------------------------------------
; Jet Rush start Mode - to Normal Mode - Position
[Statedef 2006]
type    = S                      
movetype= A                      
physics = S                                          
velset = 0,0                     
ctrl = 0                         
anim = 1100                                   
sprpriority = 2                  

[State 2006, 0]
type = PlaySnd
trigger1 = Time = 0
value = 1, 0

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Coil Rush Mode - start 
[Statedef 2100]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 3                      
velset = 0,0                     
ctrl = 0                         
anim = 2000;1100                       
;poweradd = 75                    
sprpriority = 2                  

[State 2100, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 3, 5;0, 1
channel = 0

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

;---------------------------------------------------------------------------
; Coil Rush Mode - Jump (start)
[Statedef 2101]
type    = A;S
physics = N;S
anim = 40
ctrl = 0
sprpriority = 1

[state 2101, 0]
type = VelSet
trigger1 = !Time
y = 0

[state 2101, 0]
type = PosSet
trigger1 = !Time
y = -37

[State 2101, VelAdd]; by GGN
type = VelAdd
triggerall = Vel X >= -2
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.1

[State 2101, VelAdd]; by GGN
type = VelAdd
triggerall = Vel X <= 2.5
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
x = 0.25

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

[State 2101, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

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

[State 2101, 4]
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 2101, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 2102 ;61
ctrl = 1

;---------------------------------------------------------------------------
; Coil Rush Mode - Jump (up)
[Statedef 2102]
type    = A
physics = A
anim = 60 
ctrl = 1

[state 2102, 0]
type = PosSet
trigger1 = Time = 0
y = -40

[state 2102, 0]
type = PosSet
trigger1 = Time = 1
y = -42

[state 2102, 0]
type = PosSet
trigger1 = Time = 2
y = -45

[State 2102, 6]
type = PlaySnd
trigger1 = Time = 2
value = 18, 23 ;17, 1

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

[state 2102, 2]
type = VelSet
trigger1 = Time = 3
y = -10 ;-15

[state 2102, 3]
type = VelAdd
trigger1 = Time = 4;1
y = -.985 ;.105 ;.102

[State 2102, 4]
type = VelAdd
trigger1 = Time >= 5 
trigger1 = Command = "holdback" 
trigger1 = Vel X > -1.8
x = -0.18

[State 2102, 5]
type = VelAdd
trigger1 = Time >= 5 
trigger1 = Command = "holdfwd" 
trigger1 = Vel X < 1.8
x = 0.74 ;0.18

[state 2102, 10]
type = VelAdd
trigger1 = AnimElem = 15
y = .04 ;0.05

[State 2102, 11]
type = Turn
trigger1 = P2Dist X < -5 ;0

;---------------------------------------------------------------------------
; Coil Rush Mode to Normal Mode - Position
[Statedef 2105]
type    = S                      
movetype= A                      
physics = S                                          
velset = 0,0                     
ctrl = 0                         
anim = 1100                                   
sprpriority = 2                  

[State 2105, 0]
type = PlaySnd
trigger1 = Time = 0
value = 1, 0

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




;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hyper Megaman
[Statedef 3000]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 7                      
velset = 0,0                     
ctrl = 0                         
;anim = ifelse(Pos Y >= 0, 3000, 3001)                       
sprpriority = 2

[State 3000, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = ifelse(Pos Y >= 0, 3000, 3001) 
ignorehitpause = 1

[State 3000, 1] ;Back Dust
type = Explod
trigger1 = PrevStateNo != 3950
trigger1 = Pos Y >= 0
trigger1 = Time = 2
persistent = 0
anim = 8020
postype = p1
pos = 11, 2
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1
supermovetime = -1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 3000, 3] ;Energy
type = Explod
trigger1 = PrevStateNo != 3950
trigger1 = AnimElem = 9, = 3
persistent = 0
anim = 3030
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 2
supermovetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1

;[State 3000, 4.0] 
;type = SuperPause
;trigger1 = Time = 0;, 44]
;anim = -1
;movetime = 44
;darken = 0
;sprpriority = 3
;Time = 44

;[State 3000, 4.05] ;BG charging pal
;type = BGPalFX
;trigger1 = Time = [0,44]
;add = 30,33,80 ;Floor((30 + 40 * sin((2 * pi * (time))/17.0)) + 0.5),Floor((33 + 42 * sin((2 * pi * (time))/17.0))+0.5),Floor((60 + 60 *sin((2 * pi * (time))/17.0))+0.5)
;;mul = 152,178,229 
;time = 1

[State 3000, 4.1] 
type = SuperPause
trigger1 = PrevStateNo != 3950
trigger1 = Time = 17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 3000, 5]
type = AssertSpecial
trigger1 = PrevStateNo != 3950
trigger1 = Time = [17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 3000, 6]
type = AssertSpecial
trigger1 = PrevStateNo != 3950
trigger1 = Time = [17, 58]
flag = NoFG
ignorehitpause = 1

[State 3000, 7] ;Super BG (start)
type = Explod
trigger1 = PrevStateNo != 3950
trigger1 = Time = 17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 3000, 8]
type = PlaySnd
trigger1 = PrevStateNo != 3950
trigger1 = Time = 17
value = 30, 0

[State 3000, 9] ;Super Portrait
type = Explod
trigger1 = PrevStateNo != 3950
trigger1 = Time = 20
persistent = 0
anim = 8890
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 3000, 10]
type = Helper
trigger1 = var(59) = 0 ;Time = 0
helpertype = normal
name = "FlipTop"
ID = 3050
postype = right
pos = ifelse(facing = 1, 0, -319), -150 ;50, -100
facing = facing
;facing = 1
stateno = 3050  
supermovetime = 999999
ownpal = 0;1

;[State 3000, 11] ;FlipTop sound
;type = PlaySnd
;trigger1 = Time = 2
;value = 18, 13
;channel = 2
;supermovetime = 999999

[State 3000, 10]
type = Helper
trigger1 = var(59) = 0 ;Time = 0
helpertype = normal
name = "Beat"
ID = 3051
postype = left
pos = ifelse(facing = 1, 0, 319), -150 ;-50, -100
facing = facing
;facing = 1
stateno = 3051  
supermovetime = 999999
ownpal = 0;1

;[State 3000, 11] ;Beat sound
;type = PlaySnd
;trigger1 = Time = 0
;value = 18, 10
;channel = 3
;supermovetime = 999999

;[State 3000, 12] ;Rush sound
;type = PlaySnd
;trigger1 = Time = 10
;value = 18, 16
;channel = 4
;supermovetime = 999999

[State 3000, 1]
type = HitDef
trigger1 = Time = 0
attr = S, HA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Up                 
guardflag = MA                  
hitflag = MAF                 
priority = 3, Hit               
pausetime = 11, 8          
guard.sparkno = s8301 ;S8200       
sparkno = s8330+(random%8) ;S8230                      
sparkxy = -10, -74              
hitsound = S15, 5                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 8            
ground.hittime  = 25             
ground.velocity = -4,-10            
airguard.velocity = -2, 1     
air.type = High                  
air.velocity = -3,-7           
air.hittime = 25
fall = 1

[State 3000, 10]
type = Helper
trigger1 = NumHelper(3010) < 1
trigger1 = AnimElem = 11, = 1 ;var(59) = 91 ;Time = 91
helpertype = normal
name = "Beam"
ID = 3010
pos = 117, -116
postype = p1
bindtime = -1
;facing = 1
stateno = 3010  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = AnimElem = 14
trigger2 = AnimElem = 22
helpertype = normal
name = "Missel 2"
ID = 3021
pos = -12, -134
postype = p1
bindtime = -1
;facing = 1
stateno = 3021  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = AnimElem = 14
trigger2 = AnimElem = 22
helpertype = normal
name = "Missel 1"
ID = 3020
pos = -24, -132
postype = p1
bindtime = -1
;facing = 1
stateno = 3020  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = AnimElem = 14
trigger2 = AnimElem = 22
helpertype = normal
name = "Missel 4"
ID = 3023
pos = 38, -132
postype = p1
bindtime = -1
;facing = 1
stateno = 3023  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = AnimElem = 14
trigger2 = AnimElem = 22
helpertype = normal
name = "Missel 3"
ID = 3022
pos = 20, -133
postype = p1
bindtime = -1
;facing = 1
stateno = 3022  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = var(59) = 115 ;Time = 115
trigger2 = var(59) = 136 ;Time = 136
helpertype = normal
name = "Beat Power"
ID = 3011
pos = -3, -92
postype = p1
bindtime = -1
;facing = 1
stateno = 3011  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = var(59) = 107 ;Time = 107
trigger2 = var(59) = 129 ;Time = 129
helpertype = normal
name = "FlipTop Power"
ID = 3013
pos = 47, -45
postype = p1
bindtime = -1
;facing = 1
stateno = 3013  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 10]
type = Helper
trigger1 = var(59) = 121 ;Time = 121
trigger2 = var(59) = 143 ;Time = 143
helpertype = normal
name = "Rush Power"
ID = 3015
pos = -36, -41
postype = p1
bindtime = -1
;facing = 1
stateno = 3015  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3000, 2]
type = PalFX
trigger1 = var(59) = [16, 19] ;Time = [16, 19] 
trigger2 = var(59) = [195, 196] ;Time = [195, 196] 
add = 60,60,60 ;20,20,95
time = 1

[State 3000, 3]
type = PalFX
trigger1 = var(59) = [20, 22] ;Time = [20, 22]
trigger2 = var(59) = [192, 194] ;Time = [192, 194]  
add = 100,100,100 ;50,50,155
time = 1

[State 3000, 4]
type = PalFX
trigger1 = var(59) = [23, 26] ;Time = [23, 26] 
trigger2 = var(59) = [190, 191] ;Time = [190, 191] 
add = 150,150,150 ;80,80,256
time = 1

[State 3000, 5]
type = PalFX
trigger1 = var(59) = [27, 29] ;Time = [27, 29] 
trigger2 = var(59) = [187, 189] ;Time = [187, 189] 
add = 200,200,200 ;120,120,255
time = 1

[State 3000, 5]
type = PalFX
trigger1 = var(59) = [30, 58] ;Time = [30, 58]
trigger2 = var(59) = [178, 186] ;Time = [178, 186]  
add = 256,256,256
time = 1

[State 3000] 
type = PalFX 
trigger1 = var(59) = [59, 177] ;Time = [59, 177] ;90
time = 1 
add = Floor((100 + (-100)* sin((2 * pi * (time))/20.0)) + 0.5),Floor((100 + (-100)* sin((2 * pi * (time))/20.0))+0.5),Floor((100 + (-100)*sin((2 * pi * (time))/20.0))+0.5)
mul = 156,156,156
ignorehitpause = 1

[State 3000, 19]
type = Width
trigger1 = var(59) = [60, 170] ;Time = [20, 160]
value = 30, 40;25, 5

[State 3000, 20]
type = PlayerPush
trigger1 = var(59) = [60, 170] 
value = 1

[State 3000, 20]
type = VarSet
trigger1 = 1
v = 17
value = 0

[State 3000, 21]
type = EnvShake
trigger1 = var(59) = 91 ;Time = 91
time = 85
ampl = -2
freq = 70
phase = 30
supermovetime = 1000
ignorehitpause = 1

[State 3000, 22]
type = PlaySnd
trigger1 = var(59) = 1 ;Time = 1
value = 5, 0
channel = 0

[State 3000, 23]
type = PlaySnd
trigger1 = AnimElem = 11, = 0 ;var(59) = 58 ;Time = 58
value = 5, 1
channel = 0

[State 3000, 0] ;turn in finish pose
type = Turn
trigger1 = Anim = 53
trigger1 = P2Dist X < -5

[State 3000, 1] 
type = StateTypeSet
trigger1 = Pos Y < 0 
statetype = A
physics = N

[State 3000, 1] 
type = VelSet
trigger1 = Anim = 53
trigger1 = AnimElem = 1, = 0
;trigger1 = Time = 235 
x = -2
y = -2.7 ;-2.5

[State 3000, 1.2] 
type = VelAdd
trigger1 = Anim = 53
;trigger1 = Time >= 235 
y = const(movement.yaccel)

[State 3000, 10]
type = ChangeAnim
trigger1 = Anim = 3001
trigger1 = AnimTime = 0 
value = 53

[State 3000, 11]
type = ChangeState
trigger1 = Anim = 53
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 
ctrl = 1

[State 3000, 26]
type = ChangeState
trigger1 = Anim = 3000
trigger1 = AnimTime = 0
value = 0 
ctrl = 1

;---------------------------------------------------------------------------
; Hyper Megaman: Helper
[Statedef 3010]
type    = A
movetype= A
anim = 33010
sprpriority = 6

;[State 3010, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3010, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3010, 1]
type = BindToRoot
trigger1 = 1
pos = 117, -116
time = -1
ignorehitpause = 1

[State 3010, 2]
type = HitDef
trigger1 = Time % 3 = 0 && Time <= 49 ;72
attr = A, HP                     
damage = 8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAFP                  
priority = 6, Hit               
sprpriority = 6
pausetime = 0, 2
guard.sparkno = -1;S8200
sparkno = -1 ;Sifelse((Random < 330),8500,ifelse((Random = [330,660]),8501,8502)) ;S8500
sparkxy = 0,0 ;ifelse((Random < 330),0,ifelse((Random = [330,660]),-15,-45)), 0 ;(thanks GGN)
hitsound = S20, 0                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 50;57
ground.hittime  = 60             
ground.velocity = -5
airguard.velocity = -1     
air.type = Low                  
air.velocity = -5, -1           
air.hittime = 60

[State 3010, 3]
type = HitDef
trigger1 = Time > 49
attr = A, HP                     
damage = 14, 8                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAFP                  
priority = 7, Hit               
sprpriority = 6
pausetime = 0, 2 
guard.sparkno = -1;S8200  
sparkno = -1;S8500                      
sparkxy = 0, 0              
hitsound = S20, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 50
ground.hittime  = 60             
ground.velocity = -26, -7
airguard.velocity = -5
air.type = High                  
air.velocity = -28, -9           
air.hittime = 60
fall = 1
air.fall = 1

[State 3010, 4] ;Super Guard Sparks
type = Explod
triggerall = NumExplod(8200) = 0
trigger1 = NumTarget > 0
trigger1 = MoveGuarded && Time < 136
persistent = 1
anim = 8301 ;8200
ID = 8200
postype = left;p2 
pos = floor(160.5 + target, pos x), 145 ;20(+160), -40  (thanks SMI)
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1

[State 3010, 4] ;Super Hit Sparks
type = Explod
triggerall = NumExplod(8500) = 0
trigger1 = NumTarget > 0
trigger1 = MoveHit && Time < 136
persistent = 1
anim = 88500
ID = 8500
postype = left;p2 
pos = floor(160.5 + target, pos x), 145 ;20(+160), -40  (thanks SMI)
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 7
ownpal = 1

[State 3010, 6]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3010, 7]
type = PlaySnd
trigger1 = Time = 1
value = 30, 3
channel = 2
ignorehitpause = 1

[State 3010, 8]
type = StopSnd
trigger1 = root, MoveType = H
trigger1 = root, StateNo != 3950
channel = 2
ignorehitpause = 1

[State 3010, 9]
type = DestroySelf
trigger1 = AnimTime = 0 ;Time = 86
trigger2 = root, MoveType = H
trigger2 = root, StateNo != 3950
trigger3 = root, StateNo = 3000
trigger3 = root, var(59) = 146 ;Time = 146

;---------------------------------------------------------------------------
; Beat Fireball: Helper
[Statedef 3011]
type    = A
movetype= A
anim = 33011
sprpriority = 3

;[State 3011, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3011, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3011, 1]
type = BindToRoot
trigger1 = Time = 0
pos = -3, -92
time = 2
ignorehitpause = 1

[state 3011, 1]
type = VelSet
trigger1 = Time > 1
x = 12

[State 3011, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(30/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3011, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(35/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 55             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 55   
fall = 0
air.fall = 1

[State 3011, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3011, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3012
time = -1

[State 3011, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3012
ignorehitpause = 1

;---------------------------------------------------------------------------
; Beat Fireball: Helper (end)
[Statedef 3012]
type = A
movetype = I
ctrl = 0
anim = 33012
velset = 0, 0
sprpriority = 3

;[State 3012, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3012, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3012, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; FlipTop Fireball: Helper
[Statedef 3013]
type    = A
movetype= A
anim = 33013
sprpriority = 3

;[State 3013, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3013, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3013, 1]
type = BindToRoot
trigger1 = Time = 0
pos = 47, -45
time = 2
ignorehitpause = 1

[state 3013, 1]
type = VelSet
trigger1 = Time > 1
x = 12

[State 3013, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(30/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3013, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(35/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 55             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 55   
fall = 0
air.fall = 1

[State 3013, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3013, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3014
time = -1

[State 3013, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3014
ignorehitpause = 1

;---------------------------------------------------------------------------
; FlipTop Fireball: Helper (end)
[Statedef 3014]
type = A
movetype = I
ctrl = 0
anim = 33014
velset = 0, 0
sprpriority = 3

;[State 3014, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3014, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3014, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Rush Fireball: Helper
[Statedef 3015]
type    = A
movetype= A
anim = 33015
sprpriority = 3

;[State 3015, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3015, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3015, 1]
type = BindToRoot
trigger1 = Time = 0
pos = -36, -41
time = 3
ignorehitpause = 1

[state 3015, 1]
type = VelSet
trigger1 = Time > 3
x = 12
y = 5

[state 3015, 1]
type = VelSet
trigger1 = ScreenPos Y > 220 
y = 0

[State 3015, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(30/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3015, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(35/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 55             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 55   
fall = 0
air.fall = 1

[State 3015, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3015, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3016
time = -1

[State 3015, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3016
ignorehitpause = 1

;---------------------------------------------------------------------------
; Rush Fireball: Helper (end)
[Statedef 3016]
type = A
movetype = I
ctrl = 0
anim = 33016
velset = 0, 0
sprpriority = 3

;[State 3016, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3016, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3016, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Missel 1: Helper
[Statedef 3020]
type    = A
movetype= A
anim = 3020
sprpriority = 4

[State 3020, 1] ;Missel Fire
type = Explod
trigger1 = NumExplod(3024) < 1
trigger1 = !Time
persistent = 0
ID = 3024
anim = 3024
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 3020, 2] ;Remove Missel Fire
type = RemoveExplod
trigger1 = MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 3024

[state 3020, 1]
type = VelSet
trigger1 = AnimElem = 1
trigger2 = AnimElem = 9
trigger3 = AnimElem = 13
trigger4 = AnimElem = 17
x = 6
y = 0

[state 3020, 1]
type = VelSet
trigger1 = AnimElem = 2
trigger2 = AnimElem = 8
trigger3 = AnimElem = 10
trigger4 = AnimElem = 12
trigger5 = AnimElem = 14
trigger6 = AnimElem = 16
x = 6
y = -3

[state 3020, 1]
type = VelSet
trigger1 = AnimElem = 3
trigger2 = AnimElem = 7
trigger3 = AnimElem = 11
trigger4 = AnimElem = 15
x = 6
y = -6

[state 3020, 1]
type = VelSet
trigger1 = AnimElem = 4
trigger2 = AnimElem = 6
x = 3
y = -6

[state 3020, 1]
type = VelSet
trigger1 = AnimElem = 5
x = 0
y = -6

[State 3020, 2]
type = HitDef
trigger1 = Time = 0 
attr = A, HP                     
damage = floor(20/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3020, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3020, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3024
time = -1

[State 3020, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3024
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missel 2: Helper
[Statedef 3021]
type    = A
movetype= A
anim = 3021
sprpriority = 4

[State 3021, 1] ;Missel Fire
type = Explod
trigger1 = NumExplod(3025) < 1
trigger1 = !Time
persistent = 0
ID = 3025
anim = 3025
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 3021, 2] ;Remove Missel Fire
type = RemoveExplod
trigger1 = MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 3025

[state 3021, 1]
type = VelSet
trigger1 = AnimElem = 1
x = -6
y = 6

[state 3021, 1]
type = VelSet
trigger1 = AnimElem = 2
x = 0
y = 6

[state 3021, 1]
type = VelSet
trigger1 = AnimElem = 3
x = 6
y = 6

[state 3021, 1]
type = VelSet
trigger1 = AnimElem = 4
x = 6
y = 3

[state 3021, 1]
type = VelSet
trigger1 = AnimElem = 5
x = 6
y = 0

[State 3021, 2]
type = HitDef
trigger1 = Time = 0 
attr = A, HP                     
damage = floor(20/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3021, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3021, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3024
time = -1

[State 3021, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3024
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missel 3: Helper
[Statedef 3022]
type    = A
movetype= A
anim = 3022
sprpriority = 4

[State 3022, 1] ;Missel Fire
type = Explod
trigger1 = NumExplod(3026) < 1
trigger1 = !Time
persistent = 0
ID = 3026
anim = 3026
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 3022, 2] ;Remove Missel Fire
type = RemoveExplod
trigger1 = MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 3026

[state 3022, 1]
type = VelSet
trigger1 = AnimElem = 1
trigger2 = AnimElem = 3
x = 6
y = -3

[state 3022, 1]
type = VelSet
trigger1 = AnimElem = 2
x = 6
y = -6

[state 3022, 1]
type = VelSet
trigger1 = AnimElem = 4
x = 6
y = 0

[State 3022, 2]
type = HitDef
trigger1 = Time = 0 
attr = A, HP                     
damage = floor(20/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3022, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3022, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3024
time = -1

[State 3022, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3024
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missel 4: Helper
[Statedef 3023]
type    = A
movetype= A
anim = 3023
sprpriority = 4

[State 3023, 1] ;Missel Fire
type = Explod
trigger1 = NumExplod(3027) < 1
trigger1 = !Time
persistent = 0
ID = 3027
anim = 3027
postype = p1
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = -1
bindtime = -1
ownpal = 1
removeongethit = 1

[State 3023, 2] ;Remove Missel Fire
type = RemoveExplod
trigger1 = MoveContact || BackEdgeDist < -104 || FrontEdgeDist < -104  
ID = 3027

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 1
x = 6
y = 3

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 2
x = 6
y = 6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 3
x = 3
y = 6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 4
x = 0
y = 6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 5
x = -3
y = 6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 6
x = -6
y = 6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 7
x = -6
y = 0

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 8
x = -6
y = -3

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 9
x = -6
y = -6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 10
x = -3
y = -6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 11
x = 0
y = -6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 12
x = 6
y = -6

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 13
x = 6
y = -3

[state 3023, 1]
type = VelSet
trigger1 = AnimElem = 14
x = 6
y = 0

[State 3023, 2]
type = HitDef
trigger1 = Time = 0 
attr = A, HP                     
damage = floor(20/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 55             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 55       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3023, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3023, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3024
time = -1

[State 3023, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3024
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missels: Helper (end)
[Statedef 3024]
type = A
movetype = I
ctrl = 0
anim = 8290
velset = 0, 0
sprpriority = 3

[State 3024, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; FlipTop: Helper 
[Statedef 3050]
type = A
movetype = I
ctrl = 0
anim = 3050
velset = 0,0 ;-3.5, 1.5
sprpriority = 3

[State 3050, 1]
type = ChangeAnim
trigger1 = root, AnimElem = 6
value = 8930

[State 3050, 2]
type = ChangeAnim
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
value = 3050

;x = 3
;para time = 14
;volta time = 41

[State 3050, 0]
type = VelSet
trigger1 = (root, var(59) >= 0) && (root, var(59) < 15) ;(root, Time >= 0) && (root, Time < 15) 
x = -4

[State 3050, 0]
type = VelSet
trigger1 = (root, var(59) >= 15) && (root, var(59) < 42) ;(root, Time >= 15) && (root, Time < 42) 
x = 0

[State 3050, 0]
type = VelSet
trigger1 = (root, var(59) = 42) ;(root, Time = 42) ;&& (root, Time < 80) 
x = RootDist X/10
y = RootDist Y/10
persistent = 0

[State 3050, 3]
type = VelSet
;trigger1 = (root, var(59) < 80) ;(root, Time < 80) ;&& (root, Time < 170)  
trigger1 = RootDist X = [-10, 10]
x = 0
;persistent = 0

[State 3050, 4]
type = VelSet
;trigger1 = (root, var(59) < 80) ;(root, Time < 80) ;&& (root, Time < 170)
trigger1 = RootDist Y = [10, 30]
y = 0
;persistent = 0

[State 3050, 5]
type = ChangeState
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
trigger2 = root, MoveType = H
trigger2 = root, StateNo != 3950
value = 3052

;---------------------------------------------------------------------------
; FlipTop: Helper (end)
[Statedef 3052]
type = A
movetype = I
ctrl = 0
;anim = 3250
velset = 0,0 ;3.5, 1.5
sprpriority = 3

[State 3052, 5]
type = VelSet
trigger1 = !Time ;root, Time > 180 ;AnimElem = 35
x = -6.5
y = -2.5

[State 3052, 6]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105

;---------------------------------------------------------------------------
; Beat: Helper 
[Statedef 3051]
type = A
movetype = I
ctrl = 0
anim = 3250
velset = 0,0 ;3.5, 1.5
sprpriority = 3

[State 3051, 1]
type = ChangeAnim
trigger1 = root, AnimElem = 6
value = 8930

[State 3051, 2]
type = ChangeAnim
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
value = 3250

[State 3051, 0]
type = VelSet
trigger1 = (root, var(59) >= 0) && (root, var(59) < 15) ;(root, Time >= 0) && (root, Time < 15) 
x = 4

[State 3051, 0]
type = VelSet
trigger1 = (root, var(59) >= 15) && (root, var(59) < 42) ;(root, Time >= 15) && (root, Time < 42) 
x = 0

[State 3051, 0]
type = VelSet
trigger1 = (root, var(59) = 42) ;(root, Time = 42) ;&& (root, Time < 150) 
x = RootDist X /10 ;7 (by P.O.T.S.)
y = RootDist Y /10 ;6.5
persistent = 0

[State 3051, 3]
type = VelSet
;;trigger1 = (root, var(59) < 80) ;(root, Time < 80) ;&& (root, Time < 170)
trigger1 = RootDist X = [-10, 10]
x = 0
;persistent = 0

[State 3051, 4]
type = VelSet
;;trigger1 = (root, var(59) < 80) ;(root, Time < 80) ;&& (root, Time < 170)
trigger1 = RootDist Y = [10, 40]
y = 0
;persistent = 0

[State 3051, 5]
type = ChangeState ;VelSet
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
trigger2 = root, MoveType = H
trigger2 = root, StateNo != 3950
value = 3053

;---------------------------------------------------------------------------
; Beat: Helper (end)
[Statedef 3053]
type = A
movetype = I
ctrl = 0
;anim = 3250
velset = 0,0 ;3.5, 1.5
sprpriority = 3

[State 3053, 5]
type = VelSet
trigger1 = !Time ;root, Time > 180 ;AnimElem = 35
x = 6.5
y = -2.5

[State 3053, 6]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105

;---------------------------------------------------------------------------
; Hyper Megaman - (move end) -NOT USED-
[Statedef 3001]
type    = S
physics = S
velset = 0,0
ctrl = 0
anim = 3001
sprpriority = 2

[State 3001, 1]
type = VarSet
trigger1 = 1
v = 50
value = 1

[State 3001, 2] ;code by SodonHID, adapted 
type = ScreenBound
trigger1 = P2MoveType = H ;|| BackEdgeBodyDist < -1
;;;trigger1 = Helper(3010), MoveHit
;trigger1 = NumHelper(3010) > 0
;trigger1 = Helper(3010), MoveHit
trigger2 = NumTarget > 0
value = 0
movecamera = 0,0

[State 3001, 3] ;code by SodonHID, adapted 
type = ChangeState
triggerall = AnimTime = 0
trigger1 = P2MoveType = H
;;;trigger1 = BackEdgeBodyDist <= -1
;triggerall = NumHelper(3010) > 0
;triggerall = Helper(3010), MoveHit
trigger2 = NumTarget > 0
value = 9000
ctrl = 0

[State 3001, 4] ;code by SodonHID, adapted 
type = ChangeState
triggerall = AnimTime = 0
trigger1 = P2MoveType != H
;;;trigger1 = BackEdgeBodyDist > -1
;triggerall = NumHelper(3010) > 0
;triggerall = Helper(3010), MoveHit = 0
trigger2 = NumTarget < 1
value = 0
ctrl = 1



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush Drill
[Statedef 3100]
type    = S                      
movetype= A 
physics = S  
juggle  = 7                      
velset = 0,0                     
ctrl = 0                         
anim = 3100                       
sprpriority = 2

[State 3100, 1] ;Back Dust
type = Explod
trigger1 = Time = 2
persistent = 0
anim = 8020
postype = p1
pos = 11, 2
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
supermovetime = -1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

;[State 3100, 4.05] ;BG charging pal
;type = BGPalFX
;trigger1 = Time = [0,44]
;add = 30,33,80 ;Floor((30 + 40 * sin((2 * pi * (time))/17.0)) + 0.5),Floor((33 + 42 * sin((2 * pi * (time))/17.0))+0.5),Floor((60 + 60 *sin((2 * pi * (time))/17.0))+0.5)
;;mul = 152,178,229 
;time = 1

[State 3100, 4.1] 
type = SuperPause
trigger1 = Time = 17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 3100, 5]
type = AssertSpecial
trigger1 = Time = [17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 3100, 6]
type = AssertSpecial
trigger1 = Time = [17, 58]
flag = NoFG
ignorehitpause = 1

[State 3100, 7] ;Super BG (start)
type = Explod
trigger1 = Time = 17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 3100, 8]
type = PlaySnd
trigger1 = Time = 17
value = 30, 0

[State 3100, 9] ;Super Portrait
type = Explod
trigger1 = Time = 20
persistent = 0
anim = 8890
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

;[State 3100, 10] ;Rush sound
;type = PlaySnd
;trigger1 = Time = 10
;value = 18, 16
;channel = 2
;supermovetime = 999999

[State 3100, 2]
type = PalFX
trigger1 = Time = [16, 19] 
add = 60,60,60 ;20,20,95
time = 1

[State 3100, 3]
type = PalFX
trigger1 = Time = [20, 22]
add = 100,100,100 ;50,50,155
time = 1

[State 3100, 4]
type = PalFX
trigger1 = Time = [23, 26] 
add = 150,150,150 ;80,80,256
time = 1

[State 3100, 5]
type = PalFX
trigger1 = Time = [27, 29] 
add = 200,200,200 ;120,120,255
time = 1

[State 3100, 5]
type = PalFX
trigger1 = Time = [30, 58]
add = 256,256,256
time = 1

[State 3100, 19]
type = Width
trigger1 = Time = [20, 160]
value = 25, 5

[State 3100, 20]
type = VarSet
trigger1 = 1
v = 17
value = 1

;[State 3100, 21]
;type = EnvShake
;trigger1 = Time = 91
;time = 85
;ampl = -2
;freq = 70
;phase = 30
;supermovetime = 1000
;ignorehitpause = 1

[State 3100, 22]
type = PlaySnd
trigger1 = Time = 1
value = 5, 2
channel = 0

[State 3100, 26]
type = ChangeState
trigger1 = AnimTime = 0
value = 3101 

;---------------------------------------------------------------------------
; Rush Drill - stand
[Statedef 3101]
type    = S                   
movetype= A 
physics = S  
juggle  = 7 
velset = 0,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3102                       
sprpriority = 2

[State 3101, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 
ignorehitpause = 1

;[State 3101, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

[State 3101, 0] ;set pos y = 5
type = VarSet
trigger1 = PrevStateNo = 3105
trigger1 = Time = 0
v = 42
value = 40

[State 3101, 0]
type = RemoveExplod
trigger1 = !Time
ID = 3150

;[State 3101, 0] 
;type = PosSet
;;trigger1 = var(45) < 182
;trigger1 = PrevStateNo = 3105
;trigger1 = !Time
;y = 0

[State 3101, 1] 
type = StateTypeSet
trigger1 = Pos Y < 0 
statetype = A
physics = N

[State 3101, 2] 
type = StateTypeSet
trigger1 = Pos Y >= 0 
statetype = S
physics = S

;[State 3101, 1] 
;type = ChangeAnim
;trigger1 = PrevStateNo != 3105
;trigger1 = Anim != 3102
;trigger1 = !Time
;value = 3102

;[State 3101, 1]
;type = ChangeAnim
;trigger1 = PrevStateNo = 3105
;trigger1 = !Time
;value = 3105

;[State 3101, 1]
;type = ChangeAnim
;trigger1 = Anim = 3105
;trigger1 = AnimTime = 0
;value = 3102

[State 3101, 1] ;walk fwd
type = ChangeState
trigger1 = Anim != 3101 && Anim != 53
trigger1 = Time >= 3
trigger1 = command = "holdfwd"
value = 3102
ignorehitpause = 1

[State 3101, 1] ;walk back
type = ChangeState
trigger1 = Anim != 3101 && Anim != 53
trigger1 = Time >= 3
trigger1 = command = "holdback"
value = 3103
ignorehitpause = 1

[State 3101, 1] ;jump
type = ChangeState
trigger1 = Anim != 3101 && Anim != 53
trigger1 = Time >= 3
trigger1 = command = "holdup"
value = 3104
ignorehitpause = 1

[State 3101, 1] ;turn
type = ChangeState
trigger1 = Anim != 3101 && Anim != 53
trigger1 = Time >= 3
trigger1 = P2Dist X < -5
value = 3106
ignorehitpause = 1

[State 3101, 7] ;jat fwd
type = ChangeState
trigger1 = Anim != 3101 && Anim != 53
trigger1 = Time >= 3
trigger1 = command = "x" || command = "y" || command = "z" || command = "a" || command = "b" || command = "c"
value = 3107
ignorehitpause = 1

[State 3101, 3] ;wheel 1
type = Explod
trigger1 = NumExplod(3110) < 1
trigger1 = !Time ;Anim = [3102, 3104]
ID = 3110
anim = 3110
postype = p1
pos = 0, 0
facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 2
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 3101, 3.2] ;wheel 1 (turn)
type = Explod
trigger1 = NumExplod(3101) < 1
trigger1 = !Time ;Anim = [3102, 3104]
ID = 3110
anim = 3110
postype = p1
pos = 0, 0
facing = -1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 2
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 3101, 10]
type = Helper
trigger1 = NumHelper(3111) < 1
trigger1 = !Time ;Anim = [3102, 3104]
helpertype = normal
name = "Wheel 2"
ID = 3111
pos = 0, 0
postype = p1
bindtime = -1
;facing = facing
stateno = 3110  
supermovetime = 999999
ownpal = 0
ignorehitpause = 1

[State 3101, 10]
type = Helper
trigger1 = NumHelper(3120) < 1
trigger1 = !Time 
helpertype = normal
name = "Tank"
ID = 3120
pos = 0, 0
postype = p1
bindtime = -1
;facing = facing
stateno = 3120  
supermovetime = 999999
ownpal = 0
ignorehitpause = 1

[State 3101, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time >= 3
trigger1 = Time % 6 = 0 
attr = S, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 2, 2;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15;10
ground.hittime  = 15;20             
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3101, 2.2]
type = HitDef
trigger1 = var(45) >= 151
attr = S, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

;154
;157
;159
;162
;164 - 182

[State 3101, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3101, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3101, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3101, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3101, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3101, 1];stop to finish
type = VelSet
trigger1 = var(45) = 154
x = 0
y = 0 

[State 3101, 19]
type = Width
trigger1 = var(45) = [20, 160] ;Time = [20, 160]
value = 20, 20

[State 3101, 20]
type = PlayerPush
trigger1 = Anim = 3190 ;var(45) = [20, 160] 
value = 1

[State 3101, 20]
type = VarSet
trigger1 = 1
v = 17
value = 1

;[State 3101, 21]
;type = EnvShake
;trigger1 = Time = 91
;time = 85
;ampl = -2
;freq = 70
;phase = 30
;supermovetime = 1000
;ignorehitpause = 1

[State 3101, 23]
type = PlaySnd
trigger1 = PrevStateNo = 3100
trigger1 = Time = 0
value = 5, 3
channel = 0

[State 3101, 1]
type = RemoveExplod
trigger1 = var(45) = 182 ;Anim = 3101
ID = 3110

;[State 3101, 9]
;type = VarSet
;trigger1 = var(45) = 3101
;v = 45
;value = 0

[State 3101, 0] ;turn in finish pose
type = Turn
trigger1 = Anim = 3101 || Anim = 53
trigger1 = P2Dist X < -5

[State 3101, 1] ;AIR
type = VelSet
trigger1 = Pos Y < 0
trigger1 = var(45) = 182 
x = -2
y = -2.7 ;-2.5

[State 3101, 1.2] ;AIR
type = VelAdd
trigger1 = Pos Y < 0
trigger1 = var(45) >= 182 
y = const(movement.yaccel)

;[State 3101, 9]
;type = HitBy
;trigger1 = 1
;value = SCA, HA,HP

;[State 3101, 9.1]
;type = HitBy
;trigger1 = enemy, HitCount > 2
;value = SCA, SA,SP

[State 3101, 10]
type = ChangeAnim
trigger1 = var(45) = 182 ;Time = 300
value = ifelse(Pos Y < 0, 53, 3101)

[State 3101, 11]
type = ChangeState
trigger1 = Anim = 3101
trigger1 = AnimTime = 0
value = 0 
ctrl = 1

[State 3101, 11]
type = ChangeState
trigger1 = Anim = 53
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 
ctrl = 1

;---------------------------------------------------------------------------
; Rush Drill - walking fwd
[Statedef 3102]
type    = S                                            
movetype= A 
physics = S  
juggle  = 7 
;velset = 2,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3102                       
sprpriority = 2

[State 3102, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 

;[State 3102, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

;[State 3102, 1] 
;type = ChangeAnim
;trigger1 = Anim != 3102
;trigger1 = !Time
;value = 3102

[State 3102, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time % 6 = 0 ;&& Time <= 49 ;72
attr = S, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 2, 2;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3102, 2.2]
type = HitDef
trigger1 = var(45) >= 151
attr = S, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

[State 3102, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3102, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3102, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3102, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3102, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3102, 2] 
type = VelSet
trigger1 = var(45) < 154 ;1 ;Time >= 0 ;1
x = 2

[State 3102, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0

[State 3102, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3102, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3102, 0] ;jat fwd
type = ChangeState
trigger1 = command = "x" || command = "y" || command = "z" || command = "a" || command = "b" || command = "c"
value = 3107
ignorehitpause = 1

[State 3102, 3] ;walk back
type = ChangeState
trigger1 = command = "holdback" && command != "holdfwd"
value = 3103
ignorehitpause = 1

[State 3102, 4] ;jump
type = ChangeState
trigger1 = command = "holdup"
value = 3104
ignorehitpause = 1

[State 3102, 5] ;turn
type = ChangeState
trigger1 = P2Dist X < -5
value = 3106
ignorehitpause = 1

[State 3102, 6]
type = ChangeState
trigger1 = command != "holdfwd"
trigger2 = var(45) = 182
value = 3101
ignorehitpause = 1

;---------------------------------------------------------------------------
; Rush Drill - walking back
[Statedef 3103]
type    = S                                             
movetype= A 
physics = S  
juggle  = 7  
velset = -2,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3102                       
sprpriority = 2

[State 3103, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 
ignorehitpause = 1

;[State 3103, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

;[State 3103, 1] 
;type = ChangeAnim
;trigger1 = Anim != 3102
;trigger1 = !Time
;value = 3102

[State 3103, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time % 6 = 0 
attr = S, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 2, 2;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3103, 2.1]
type = HitDef
trigger1 = var(45) >= 151
attr = S, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

[State 3103, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3103, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3103, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3103, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3103, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3103, 2] 
type = VelSet
trigger1 = var(45) < 145 ;1
x = -2

[State 3103, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0

[State 3103, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3103, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3103, 0] ;jat fwd
type = ChangeState
trigger1 = command = "x" || command = "y" || command = "z" || command = "a" || command = "b" || command = "c"
value = 3107
ignorehitpause = 1

[State 3103, 3] ;walk fwd
type = ChangeState
trigger1 = command = "holdfwd" && command != "holdback"
value = 3102
ignorehitpause = 1

[State 3103, 4] ;jump
type = ChangeState
trigger1 = command = "holdup"
value = 3104
ignorehitpause = 1

[State 3103, 5] ;turn
type = ChangeState
trigger1 = P2Dist X < -5
value = 3106
ignorehitpause = 1

[State 3103, 6]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = var(45) = 182
value = 3101
ignorehitpause = 1

;---------------------------------------------------------------------------
; Rush Drill - jump start
[Statedef 3104]
type    = S                           
movetype= A 
physics = S  
juggle  = 7 
;velset = 0,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3103                       
sprpriority = 2

[State 3104, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 

;[State 3104, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

[State 3104, 0] ;set pos y = 5
type = VarSet
trigger1 = Time = 0
v = 42
value = 30

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

[State 3104, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

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

[State 3104, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time % 6 = 0 
attr = S, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 2, 2;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270 
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3104, 2.2]
type = HitDef
trigger1 = var(45) >= 151
attr = S, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

[State 3104, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3104, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3104, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3104, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3104, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3104, 4]
type = VelSet
trigger1 = var(45) < 154
trigger1 = Time = 2 ;AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, 2.1, -2.15)) ;fdw=2.1,back=-2.15
y = -10.1 ;const(velocity.jump.y)

[State 3104, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0
y = 0 

[State 3104, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3104, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3104, 5] ;turn
type = ChangeState
trigger1 = P2Dist X < -5
value = 3106
ignorehitpause = 1

[State 3104, 6]
type = ChangeState
trigger1 = Time = 2 ;AnimTime = 0
value = 3105
ctrl = 1
ignorehitpause = 1

[State 3104, 7] ;finish super
type = ChangeState
trigger1 = var(45) = 182
value = 3101

;---------------------------------------------------------------------------
; Rush Drill - jump 
[Statedef 3105]
type    = A 
movetype= A                      
physics = N                                
juggle  = 7
;velset = 0,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3104                       
sprpriority = 2

[State 3105, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 

;[State 3105, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

[State 3105, 0]
type = RemoveExplod
trigger1 = !Time
ID = 3150

[State 3105, 1] ;fire
type = Explod
trigger1 = var(45) < 154
trigger1 = NumExplod(3150) < 1
trigger1 = !Time 
ID = 3150
anim = ifelse(Vel X = 0, 3151, ifelse(Vel X < 0, 3153, 3152))
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 2
supermovetime = 999999
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 3105, 0]
type = RemoveExplod
trigger1 = Vel Y >= 0
trigger2 = var(45) >= 154 ;182
trigger3 = MoveType = H ;has no root
trigger3 = root, StateNo != 3950 ;Super Armor state
ID = 3150

[State 3105, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time % 6 = 0 
attr = A, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 2, 2;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270 
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3105, 2.2]
type = HitDef
trigger1 = var(45) >= 151
attr = A, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

[State 3105, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3105, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3105, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3105, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3105, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3105, 1]
type = VelAdd;Gravity
trigger1 = var(45) < 154 ;1
y = .629 ;const(movement.yaccel)*1.8 ;GetHitVar(yaccel)*1.8

[State 3105, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0
y = 0 

[State 3105, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3105, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3105, 5] ;turn
type = ChangeState
trigger1 = P2Dist X < -5
value = 3106
ignorehitpause = 1

;[State 3105, 2.1] ;turn
;type = ChangeAnim
;trigger1 = P2Dist X < -5
;value = 3106

;[State 3105, 2.2] ;turn
;type = ChangeAnim
;trigger1 = Anim = 3106
;trigger1 = AnimTime = 0
;value = 8930

;[State 3105, 2.3] ;turn
;type = Turn
;trigger1 = P2Dist X < -5

[State 3105, 2]
type = PosSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -ceil(vel y) ;0 (line by Phantom.of.the.Server)
y = 0

[State 3105, 3]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0 
trigger2 = var(45) = 182
value = 3101

;---------------------------------------------------------------------------
; Rush Drill - turn 
[Statedef 3106]
type    = S                          
physics = S                  
;velset = 0,0                     
ctrl = 0                         
;anim = 3106 ;8930 ;3104                       
sprpriority = 2

[State 3106, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 

;[State 3106, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

[State 3106, 1] 
type = StateTypeSet
trigger1 = Pos Y < 0 
statetype = A
physics = N

[State 3106, 2] 
type = StateTypeSet
trigger1 = Pos Y >= 0 
statetype = S
physics = S

[State 3106, 0]
type = RemoveExplod
trigger1 = !Time
ID = 3150

[State 3106, 1] ;fire turn x = 0
type = Explod
trigger1 = var(45) < 154
trigger1 = NumExplod(3150) < 1
trigger1 = Vel Y < 0 
ID = 3150
anim = 3151
postype = p1
pos = 14, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 2
supermovetime = 999999
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 3106, 0]
type = RemoveExplod
trigger1 = Vel Y >= 0 ;!Time
trigger2 = var(45) >= 154 ;182
trigger3 = root, MoveType = H
trigger3 = root, StateNo != 3950 ;Super Armor state
ID = 3150

[State 3106, 0]
type = Turn
trigger1 = !Time

[State 3106, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3106, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3106, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3106, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3106, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3106, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0
y = 0 

[State 3106, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3106, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3106, 1]
type = ChangeState
trigger1 = PrevStateNo != 3105
trigger1 = Time = 3
trigger2 = var(45) = 182
value = 3101
ignorehitpause = 1

[State 3106, 2]
type = PosSet
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -ceil(vel y) ;(line by Phantom.of.the.Server)
y = 0

[State 3106, 3]
type = ChangeState
trigger1 = PrevStateNo = 3105
trigger1 = Time = 3
value = 3105

;---------------------------------------------------------------------------
; Rush Drill - jat walking fwd
[Statedef 3107]
type    = S                                            
movetype= A 
physics = S  
juggle  = 7 
;velset = 2,0                     
ctrl = 0                         
;anim = 3190 ;8930 ;3102                       
sprpriority = 2

[State 3107, ChangeAnim] ;Super Armor - not repeat in hit
type = ChangeAnim
trigger1 = (Time = 0) && (PrevStateNo != 3950)
value = 3190 

;[State 3107, CtrlSet];Super Armor
;type = CtrlSet
;trigger1 = PrevStateNo = 3950
;value = 1

;[State 3107, 1] 
;type = ChangeAnim
;trigger1 = Anim != 3102
;trigger1 = !Time
;value = 3102

;[State 3107, 1] ;back fire 
;type = Explod
;trigger1 = NumExplod(3150) < 1
;trigger1 = Time >= 0 && Time < 29
;ID = 3150
;anim = 3150
;postype = p1
;pos = 0, 0
;;facing = 1
;velocity = 0, 0
;accel = 0, 0
;removetime = -1
;sprpriority = 2
;supermovetime = 999999
;bindtime = -1
;ownpal = 1
;removeongethit = 1

;[State 3107, 0]
;type = RemoveExplod
;trigger1 = Time = 29 ;30 ;= 40
;trigger2 = var(45) = 182
;ID = 3150

[State 3107, 2.1]
type = HitDef
trigger1 = var(45) < 151
trigger1 = Time % 6 = 0 
attr = S, HA                     
damage = floor(21/(1+(Var(19)/5.0))), 5 ;9, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 1;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -3.0
airguard.velocity = -1     
air.type = Low                  
air.velocity = -3.0, -1           
air.hittime = 20
;fall = 1
;air.fall = 1

[State 3107, 2.2]
type = HitDef
trigger1 = var(45) >= 151
attr = S, HA                     
damage = floor(22/(1+(Var(19)/5.0))), 5 ;8, 5                 
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 6
pausetime = 1, 0;3 ;3, 3
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, -20 
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 0             
ground.velocity = -2, -14
airguard.velocity = -1     
air.type = Hard                  
air.velocity = -2, -14           
air.hittime = 0
p2stateno = 3150
fall = -1

[State 3107, 2]
type = PalFX
trigger1 = var(45) = [14, 17] 
trigger2 = var(45) = [153, 155] 
trigger3 = var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3107, 3]
type = PalFX
trigger1 = var(45) = [10, 13]
trigger2 = var(45) = [156, 157]  
trigger3 = var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3107, 4]
type = PalFX
trigger1 = var(45) = [6, 9] 
trigger2 = var(45) = [158, 160] 
trigger3 = var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3107, 5]
type = PalFX
trigger1 = var(45) = [1, 5] 
trigger2 = var(45) = [161, 162] 
trigger3 = var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3107, 5]
type = PalFX
trigger1 = var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3107, 19]
type = Width
trigger1 = 1
value = 20, 20

[State 3107, 20]
type = PlayerPush
trigger1 = 1 
value = 1

[State 3107, 2] 
type = VelSet
trigger1 = var(45) < 154
trigger1 = Time <= 29 ;30 ;1 ;command = "x" || command = "y" || command = "z"
x = 10

[State 3107, 2] 
type = VelAdd
trigger1 = var(45) < 154
trigger1 = Time > 29 ;30 
x = -.5 ;-.7

[State 3107, 1];stop to finish
type = VelSet
trigger1 = var(45) >= 154
x = 0

;[State 3107, 3] ;walk back
;type = ChangeState
;trigger1 = command != "x" && command != "y" && command != "z"
;trigger1 = command = "holdback" && command != "holdfwd"
;value = 3103

;[State 3107, 4] ;jump
;type = ChangeState
;trigger1 = command = "holdup"
;value = 3104

[State 3107, 5] ;turn
type = ChangeState
trigger1 = P2Dist X < -5
trigger1 = Time >= 38 
value = 3106
ignorehitpause = 1

[State 3107, 6]
type = ChangeState
trigger1 = Time >= 38 ;40 ;command != "holdfwd"
trigger2 = var(45) = 182
value = 3101
ignorehitpause = 1

;---------------------------------------------------------------------------
; Rush Drill: Wheel Helper
[Statedef 3110]
type    = A
movetype= I
anim = 3111
sprpriority = 3

[State 3110, 0.1] ;walk fwd (and Jat fwd)
type = VarAdd
trigger1 = root, StateNo != [3104, 3107]
trigger1 = root, command = "holdfwd"
trigger1 = var(44) = 2 ;Random = [1, 2]
trigger2 = root, StateNo = 3107
trigger2 = var(44) = 1 
v = 43
value = 1

[State 3110, 0.2] ;walk fwd (and Jat fwd) - (reset)
type = VarSet
trigger1 = root, command = "holdfwd"
trigger1 = var(43) > 3
trigger2 = root, StateNo = 3107
trigger2 = var(43) > 3 
v = 43
value = 0

[State 3110, 0.1] ;walk back
type = VarAdd
trigger1 = root, StateNo != [3104, 3107]
trigger1 = root, command = "holdback"
trigger1 = var(44) = 2 
v = 43
value = -1

[State 3110, 0.2] ;walk back (reset)
type = VarSet
trigger1 = root, command = "holdback"
trigger1 = var(43) < 0
v = 43
value = 3

[State 3110, 0] ;count
type = VarAdd
trigger1 = root, command = "holdfwd"
trigger2 = root, command = "holdback"
trigger3 = root, StateNo = 3107
v = 44
value = 1

[State 3110, 0] ;reset count
type = VarSet
trigger1 = root, StateNo != 3107
trigger1 = var(44) = 3 ;Random = [2, 3]
trigger2 = root, StateNo = 3107
trigger2 = var(44) = 2
v = 44
value = 0

[State 3110, 0]
type = Turn
trigger1 = root, StateNo = 3106
;trigger1 = root, P2Dist X < -5

[State 3110, 1]
type = ChangeAnim
trigger1 = root, StateNo = 3106
;trigger1 = root, P2Dist X < -5
value = 8930

[State 3110, 1]
type = ChangeAnim
trigger1 = Anim = 8930
trigger1 = root, StateNo != 3106
value = 3111 + var(43)

[State 3110, 1]
type = ChangeAnim
trigger1 = root, StateNo != [3104, 3106]
trigger1 = var(43) = 0
value = 3111

[State 3110, 2]
type = ChangeAnim
trigger1 = root, StateNo != [3104, 3106]
trigger1 = var(43) = 1
value = 3112

[State 3110, 3]
type = ChangeAnim
trigger1 = root, StateNo != [3104, 3106]
trigger1 = var(43) = 2
value = 3113

[State 3110, 4]
type = ChangeAnim
trigger1 = root, StateNo != [3104, 3106]
trigger1 = var(43) = 3
value = 3114

[State 3110, 0]
type = BindToRoot
trigger1 = 1
pos = 0, 0
time = -1;1
ignorehitpause = 1

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = Anim != 3120
;trigger1 = root, command = "holdfwd"
;value = 3120

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = Anim != 3121
;trigger1 = root, command = "holdback"
;value = 3121

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = root, command != "holdfwd" && root, command != "holdback"
;trigger1 = Anim = 3120
;trigger1 = AnimElem = 1
;trigger2 = root, command != "holdfwd" && root, command != "holdback"
;trigger2 = Anim = 3121
;trigger2 = AnimElem = 3
;value = 3112

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = root, command != "holdfwd" && root, command != "holdback"
;trigger1 = Anim = 3120
;trigger1 = AnimElem = 2
;trigger2 = root, command != "holdfwd" && root, command != "holdback"
;trigger2 = Anim = 3121
;trigger2 = AnimElem = 2
;value = 3113

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = root, command != "holdfwd" && root, command != "holdback"
;trigger1 = Anim = 3120
;trigger1 = AnimElem = 3
;trigger2 = root, command != "holdfwd" && root, command != "holdback"
;trigger2 = Anim = 3121
;trigger2 = AnimElem = 1
;value = 3114

;[State 3110, 1]
;type = ChangeAnim
;trigger1 = root, command != "holdfwd" && root, command != "holdback"
;trigger1 = Anim = 3120
;trigger1 = AnimElem = 4
;trigger2 = root, command != "holdfwd" && root, command != "holdback"
;trigger2 = Anim = 3121
;trigger2 = AnimElem = 4
;value = 3111

[State 3110, 6]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3110, 9]
type = DestroySelf
trigger1 = root, MoveType = H ;parent,
trigger1 = root, StateNo != 3950 ;Super Armor state
trigger2 = root, Anim = 3101 || parent, Anim = 53 ;parent,

[state -2, displaytoclipboard] ;thanks ixnay
type = displaytoclipboard
trigger1 = 1
text = "var(43) = %d, var(44) = %d"
params = var(43), var(44)

;---------------------------------------------------------------------------
; Rush Drill: Tank Helper
[Statedef 3120]
type    = A ;S                                           
movetype= I ;physics = S                                         
velset = 0,0                     
ctrl = 0                         
anim = 3102 
sprpriority = 2

[State 3120, 1] ;back fire 
type = Explod
trigger1 = var(45) < 154
trigger1 = NumExplod(3150) < 1
trigger1 = root, StateNo = 3107
trigger1 = root, Time >= 0 && root, Time < 29
ID = 3150
anim = 3150
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 1
supermovetime = 999999
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 3120, 0]
type = RemoveExplod
trigger1 = root, StateNo = 3107
trigger1 = root, Time = 29
trigger2 = root, var(45) >= 154 ;182
trigger3 = root, MoveType = H
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger4 = root, PrevStateNo = 3107
trigger4 = root, StateNo = 3104
;trigger4 = !(root, Time)
ID = 3150

[State 3120, 0]
type = Turn
trigger1 = root, StateNo = 3106
;trigger1 = root, P2Dist X < -5

[State 3120, 1]
type = ChangeAnim
trigger1 = root, StateNo = 3106
value = 8930

[State 3120, 1]
type = ChangeAnim
trigger1 = Anim = 8930
trigger1 = root, StateNo != 3106
value = 3102

[State 3120, 0] ;active
type = ParentVarAdd
trigger1 = 1
v = 42
value = 1

[State 3120, 0] ;reset
type = ParentVarSet
;triggerall = var(42) != 0
trigger1 = parent, var(42) = 20
trigger2 = parent, var(42) = 34
trigger3 = parent, var(42) = 51
v = 42
value = 0

[State 3120, 0]
type = BindToRoot
triggerall = Pos Y = [0, 2] 
trigger1 = parent, var(42) = [0, 2]
trigger2 = parent, var(42) = 4
trigger3 = parent, var(42) = 6
trigger4 = parent, var(42) = [8, 10]
trigger5 = parent, var(42) = 12
trigger6 = parent, var(42) = [14, 16]
trigger7 = parent, Pos Y < 0
pos = 0, 0
time = -1;1
ignorehitpause = 1

[State 3120, 0]
type = BindToRoot
triggerall = Pos Y = [0, 2] 
trigger1 = parent, var(42) = 5
trigger2 = parent, var(42) = 13
trigger3 = parent, var(42) = 17
trigger4 = parent, var(42) = 19
pos = 0, 1
time = -1;1
ignorehitpause = 1

[State 3120, 0]
type = BindToRoot
triggerall = Pos Y = [0, 2] 
trigger1 = parent, var(42) = 3
trigger2 = parent, var(42) = 7
trigger3 = parent, var(42) = 11
trigger4 = parent, var(42) = 18
pos = 0, 2
time = -1;1
ignorehitpause = 1

[State 3120, 0]
type = BindToRoot
;triggerall = Pos Y != 5 
;trigger1 = root, StateNo = 3104
trigger1 = parent, var(42) = 31
;trigger2 = root, PrevStateNo = 3105
;trigger2 = root, StateNo = 3101
trigger2 = parent, var(42) = 41
pos = 0, 5
time = -1;1
ignorehitpause = 1

[State 3120, 0]
type = BindToRoot
;triggerall = Pos Y = 5 
;trigger1 = root, StateNo = 3104
trigger1 = parent, var(42) = 33
;trigger2 = root, PrevStateNo = 3105
;trigger2 = root, StateNo = 3101
trigger2 = parent, var(42) = 50
trigger3 = parent, Pos Y < 0
pos = 0, 0
time = -1;1
ignorehitpause = 1

;[State 3120, 1] 
;type = ChangeAnim
;trigger1 = Anim != 3102
;trigger1 = !Time
;value = 3102

[State 3120, 2]
type = Helper
trigger1 = NumHelper(3130) < 1
trigger1 = !Time 
helpertype = normal
name = "Drill"
ID = 3130
pos = 0, 0
postype = p1
bindtime = -1
;facing = root, facing
stateno = 3130  
supermovetime = 999999
ownpal = 0;1
ignorehitpause = 1

;[State 3120, 1] 
;type = PosSet
;triggerall = Pos Y = [0, 2] ;root, StateNo != [3104, 3105]
;trigger1 = Time = [0, 2]
;trigger2 = Time = 4
;trigger3 = Time = 6
;trigger4 = Time = [8, 10]
;trigger5 = Time = 12
;trigger6 = Time = [14, 16]
;y = 0

;[State 3120, 1] 
;type = PosSet
;triggerall = Pos Y = [0, 2] ;root, StateNo != [3104, 3105]
;trigger1 = Time = 5
;trigger2 = Time = 13
;trigger3 = Time = 17
;trigger4 = Time = 19
;y = 1

;[State 3120, 1] 
;type = PosSet
;triggerall = Pos Y = [0, 2] ;root, StateNo != [3104, 3105]
;trigger1 = Time = 3
;trigger2 = Time = 7
;trigger3 = Time = 11
;trigger4 = Time = 18
;y = 2

;[State 3120, 1] 
;type = PosSet
;trigger1 = root, StateNo = 3104
;trigger1 = !Time  ;root, Time = [0, 1]
;trigger2 = root, PrevStateNo = 3105
;trigger2 = root, StateNo = 3101
;trigger2 = !Time  ;root, Time = [0, 8]
;y = 5

;[State 3120, 1] 
;type = PosSet
;trigger1 = root, StateNo = 3104
;trigger1 = Time = 2
;trigger2 = root, PrevStateNo = 3105
;trigger2 = root, StateNo = 3101
;trigger2 = Time = 9
;y = 0

;[State 3120, 1]
;type = ChangeState
;trigger1 = Pos Y = [0, 2] ;root, StateNo != [3104, 3105]
;trigger1 = Time >= 20 ;19
;;trigger2 = Pos Y = 5
;;trigger2 = Time >= 0   
;value = 3120

[State 3120, 3]
type = DestroySelf
trigger1 = root, MoveType = H
trigger1 = root, StateNo != 3950 ;Super Armor state
trigger2 = root, Anim = 3101 || root, Anim = 53

;---------------------------------------------------------------------------
; Rush Drill: Tank Helper: Drill Helper
[Statedef 3130]
type    = A
movetype= I
anim = 3130
sprpriority = 4

[State 3130, 0]
type = Turn
;trigger1 = root, StateNo != 3107
;trigger1 = root, P2Dist X < -5
;trigger2 = root, StateNo = 3107
;trigger2 = root, Time = 38
trigger1 = root, StateNo = 3106

[State 3130, 1]
type = ChangeAnim
;trigger1 = root, StateNo != 3107
;trigger1 = root, P2Dist X < -5
;trigger2 = root, StateNo = 3107
;trigger2 = root, Time = 38
trigger1 = root, StateNo = 3106
value = 8930

[State 3130, 1]
type = ChangeAnim
trigger1 = Anim = 8930
trigger1 = root, StateNo != 3106
;trigger1 = root, Time = 3
value = 3130

[State 3130, 1]
type = BindToParent
trigger1 = 1
pos = 0, 0 ;ifelse((root, Anim = 3103 || root, Anim = 3105), 5, 0) ;0
time = -1
ignorehitpause = 1
persistent = 1

[State 3130, 2]
type = PalFX
trigger1 = root, var(45) = [14, 17] 
trigger2 = root, var(45) = [153, 155] 
trigger3 = root, var(45) = [200, 201]
add = 60,60,60 ;20,20,95
time = 1

[State 3130, 3]
type = PalFX
trigger1 = root, var(45) = [10, 13]
trigger2 = root, var(45) = [156, 157]  
trigger3 = root, var(45) = [197, 199]
add = 100,100,100 ;50,50,155
time = 1

[State 3130, 4]
type = PalFX
trigger1 = root, var(45) = [6, 9] 
trigger2 = root, var(45) = [158, 160] 
trigger3 = root, var(45) = [195, 196]
add = 150,150,150 ;80,80,256
time = 1

[State 3130, 5]
type = PalFX
trigger1 = root, var(45) = [1, 5] 
trigger2 = root, var(45) = [161, 162] 
trigger3 = root, var(45) = [192, 194]
add = 200,200,200 ;120,120,255
time = 1

[State 3130, 5]
type = PalFX
trigger1 = root, var(45) = 0
trigger2 = root, var(45) = [163, 191]  ;182
add = 256,256,256
time = 1

[State 3130, 6]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3130, 7]
type = PlaySnd
trigger1 = Time = 1
value = 30, 4
channel = 2
ignorehitpause = 1

[State 3130, 8]
type = StopSnd
trigger1 = root, MoveType = H
trigger1 = root, StateNo != 3950 ;Super Armor state
channel = 2
ignorehitpause = 1

[State 3130, 9]
type = DestroySelf
trigger1 = root, MoveType = H
trigger1 = root, StateNo != 3950 ;Super Armor state
trigger2 = root, var(45) = 182 ;Anim = 3101

;---------------------------------------------------------------------------
; HITG_SHAKE (code by Hsieh - Roll Character)
[Statedef 3150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 3150, 1]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(SelfAnimExist(5250),5250,ifelse(SelfAnimExist(5051),5051,5030))

[State 3150, 2] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 3150, 3] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 && GetHitVar(fall)
trigger2 = Pos Y != 0
type = a

[State 3150, 4]
type = ChangeState
trigger1 = HitShakeOver
value = 3160

[State 3150, FFB Hard]
type = ForceFeedback
trigger1 = 1
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up) - (code by Hsieh - Roll Character)
[Statedef 3160]
type    = A
movetype= H
physics = N
ctrl = 0

[State 3160, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 3160, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 3160, 4]
type = SelfState
triggerall = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 3160, 5]
type = ChangeState
trigger1 = Vel Y > -1
value = 3170 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition) - (code by Hsieh - Roll Character)
[Statedef 3170]
type    = A
movetype= H
physics = N

[State 3170, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5251)
value = 5251

[State 3170, 1]
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5251) = 0
trigger1 = SelfAnimExist(5061)
value = 5061

[State 3170, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 3170, 4]
type = SelfState
triggerall = HitFall
trigger1 = Vel Y > 0    ;Hit ground
trigger1 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Beat Plane
[Statedef 3200]
type    = A
movetype= I                      
physics = N  
juggle  = 7                      
velset = 0,0                     
ctrl = 0                         
anim = 3200                       
sprpriority = 2

[State 3200, 0]
type = ChangeAnim
trigger1 = Anim = 3200
trigger1 = AnimTime = 0
value = 3201
ignorehitpause = 1

[State 3200, 1] ;Back Dust
type = Explod
trigger1 = Pos Y >= 0
trigger1 = Time = 2
persistent = 0
anim = 8020
postype = p1
pos = 11, 2
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
supermovetime = -1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 3200, 3.2] ;helix
type = Explod
trigger1 = NumExplod(3202) < 1
trigger1 = Anim != 3205 || (Anim = 3205 && AnimElem = 2, = 4)
trigger1 = Anim != 53
trigger1 = Time >= 53
ID = 3202
anim = 3202
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 2
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 3200, 3.2] ;wing
type = Explod
trigger1 = NumExplod(3203) < 1
trigger1 = Anim != 3205 || (Anim = 3205 && AnimElem = 2, = 4)
trigger1 = Anim != 53
trigger1 = Time >= 53
ID = 3203
anim = 3203
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 3200, 3.2] ;Megaman scarf
type = Explod
trigger1 = NumExplod(3204) < 1
trigger1 = Anim != 3205 || (Anim = 3205 && AnimElem = 2, = 4)
trigger1 = Anim != 53
trigger1 = Time >= 53
ID = 3204
anim = 3204
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 3200, 10] ;remove heli
type = RemoveExplod
;trigger1 = Anim = 3205
trigger1 = Time >= 54 && Time < 207
trigger1 = P2Dist X < -5
trigger2 = Time >= 235
ID = 3202
ignorehitpause = 1

[State 3200, 10] ;remove wing
type = RemoveExplod
;trigger1 = Anim = 3205
trigger1 = Time >= 54 && Time < 207
trigger1 = P2Dist X < -5
trigger2 = Time >= 235
ID = 3203
ignorehitpause = 1

[State 3200, 10] ;remove megaman scarf
type = RemoveExplod
;trigger1 = Anim = 3205
trigger1 = Time >= 54 && Time < 207
trigger1 = P2Dist X < -5
trigger2 = Time >= 235
ID = 3204
ignorehitpause = 1

;[State 3200, 4.05] ;BG charging pal
;type = BGPalFX
;trigger1 = Time = [0,44]
;add = 30,33,80 ;Floor((30 + 40 * sin((2 * pi * (time))/17.0)) + 0.5),Floor((33 + 42 * sin((2 * pi * (time))/17.0))+0.5),Floor((60 + 60 *sin((2 * pi * (time))/17.0))+0.5)
;;mul = 152,178,229 
;time = 1

[State 3200, 4.1] 
type = SuperPause
trigger1 = Time = 13 ;17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 40;41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 40;41

[State 3200, 5]
type = AssertSpecial
trigger1 = Time = [13, 150] ;[17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 3200, 6]
type = AssertSpecial
trigger1 = Time = [13, 53] ;[17, 58]
flag = NoFG
ignorehitpause = 1

[State 3200, 7] ;Super BG (start)
type = Explod
trigger1 = Time = 13;17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 3200, 8]
type = PlaySnd
trigger1 = Time = 13;17
value = 30, 0

[State 3200, 9] ;Super Portrait
type = Explod
trigger1 = Time = 16 ;20
persistent = 0
anim = 8890
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 3200, 10]
type = Helper
trigger1 = Time = 0
helpertype = normal
name = "Beat"
ID = 3250
postype = left
pos = ifelse(facing = 1, 0, 319), -150 ;-50, -100
facing = facing
;facing = 1
stateno = 3250  
supermovetime = 999999
ownpal = 0;1
ignorehitpause = 1

;[State 3200, 11] ;Beat sound
;type = PlaySnd
;trigger1 = Time = 0
;value = 18, 10
;channel = 2
;supermovetime = 999999

;[State 3200, 12] ;Rush up
;type = PlaySnd
;trigger1 = Time = 2
;value = 18, 8
;channel = 3
;volume = -20
;supermovetime = 999999

[State 3200, 1]
type = ChangeAnim
trigger1 = Anim != 53 && Anim != 3025
trigger1 = Time >= 54 && Time < 207
trigger1 = P2Dist X < -5
value = 3205
ignorehitpause = 1

[State 3200, 0]
type = Turn
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = P2Dist X < -5

[State 3200, 2]
type = ChangeAnim
trigger1 = Anim = 3205
trigger1 = AnimTime = 0
value = 3201
ignorehitpause = 1

[State 3200, 1] ;move fwd
type = VelSet
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "holdfwd"
x = 4

[State 3200, 1] ;move back
type = VelSet
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "holdback"
x = -4

[State 3200, 1] ;move up
type = VelSet
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "holdup"
y = -4

[State 3200, 1] ;move down
type = VelSet
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "holddown"
y = 4

[State 3200, 1] ;stop horizontal move
type = VelSet
trigger1 = Time >= 54 && Time < 207
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger2 = Time = 207
;trigger3 = command = "holdfwd"
;trigger3 = FrontEdgeDist < 0
;trigger4 = command = "holdback"
;trigger4 = BackEdgeDist < 0
x = 0

[State 3200, 1] ;stop vertical move
type = VelSet
trigger1 = Time >= 54 && Time < 207
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger2 = Time = 207
trigger3 = command = "holddown"
trigger3 = Pos Y >= 0
trigger4 = command = "holdup"
trigger4 = ScreenPos Y < 0
y = 0

[State 3200, 0] ;shoot fireball
type = ChangeAnim
trigger1 = Anim != 3207
trigger1 = Anim != 53
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "x" || command = "y" || command = "z" 
value = 3207
ignorehitpause = 1

[State 3200, 0] ;shoot fireball (cancel)
type = ChangeAnim
trigger1 = Anim = 3207
trigger1 = AnimTime = 0
;trigger1 = Time >= 54 && Time < 207
trigger1 = command != "x" && command != "y" && command != "z" 
value = 3201
ignorehitpause = 1

[State 3200, 3] ;shoot missel
type = Explod
trigger1 = NumExplod(3208) < 1
trigger1 = Anim != 53 && Anim != 3025
trigger1 = Time >= 54 && Time < 207
trigger1 = command = "a" || command = "b" || command = "c" 
trigger1 = var(46) := Time
ID = 3208
anim = 3208
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 3200, 10] ;remove shoot missel
type = RemoveExplod
trigger1 = Anim = 3205
trigger2 = Time >= 207
ID = 3208
ignorehitpause = 1

[State 3200, 10]
type = Helper
;trigger1 = NumHelper(3210) > 0 
;trigger1 = Helper(3210), Time = 5
;trigger1 = NumHelper(3210) < 1
trigger1 = Anim = 3207
trigger1 = AnimElem = 2, = 1
helpertype = normal
name = "Fireball"
ID = 3210
pos = 56, -21
postype = p1
bindtime = -1
;facing = 1
stateno = 3210  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3200, 10]
type = Helper
;trigger1 = NumHelper(3220) > 0
;trigger1 = Helper(3220), Time = 5
;trigger1 = NumHelper(3220) < 1
trigger1 = Time >= 54 && Time < 207
trigger1 = NumExplod(3208) > 0
trigger1 = Time = var(46) + 1 
helpertype = normal
name = "Missel"
ID = 3220
pos = -5, -9 ;-12,-9
postype = p1
bindtime = -1
;facing = 1
stateno = 3220  
supermovetime = 999999
ownpal = 1
ignorehitpause = 1

[State 3200, 2]
type = PalFX
trigger1 = Time = [12, 15] 
trigger2 = Time = [68, 70] 
trigger1 = Time = [207, 209] 
trigger1 = Time = 253 
add = 60,60,60 ;20,20,95
time = 1

[State 3200, 3]
type = PalFX
trigger1 = Time = [16, 18]
trigger2 = Time = [64, 67] 
trigger1 = Time = [210, 211] 
trigger1 = Time = [250, 252] 
add = 100,100,100 ;50,50,155
time = 1

[State 3200, 4]
type = PalFX
trigger1 = Time = [19, 22] 
trigger2 = Time = [61, 63] 
trigger1 = Time = [212, 214] 
trigger1 = Time = [248, 249] 
add = 150,150,150 ;80,80,256
time = 1

[State 3200, 5]
type = PalFX
trigger1 = Time = [23, 25] 
trigger2 = Time = [57, 60] 
trigger1 = Time = [215, 216] 
trigger1 = Time = [241, 247] 
add = 200,200,200 ;120,120,255
time = 1

[State 3200, 5]
type = PalFX
trigger1 = Time = [26, 56]
trigger2 = Time = [217, 240] 
add = 256,256,256
time = 1

;207 start finish

[State 3200, 19]
type = Width
trigger1 = Time = [20, 160]
value = 25, 5

[State 3200, 20]
type = VarSet
trigger1 = 1
v = 17
value = 2

;[State 3200, 21]
;type = EnvShake
;trigger1 = Time = 91
;time = 85
;ampl = -2
;freq = 70
;phase = 30
;supermovetime = 1000
;ignorehitpause = 1

[State 3200, 21]
type = PlaySnd
trigger1 = Time = 1
value = 5, 4
channel = 0

[State 3200, 22]
type = PlaySnd
trigger1 = Time = 54
value = 5, 5
channel = 0

[State 3200, 23]
type = PlaySnd
trigger1 = Anim = 3207
trigger1 = AnimElem = 2, = 1
value = 20, 3

[State 3200, 0] ;turn in finish pose
type = Turn
trigger1 = Anim = 53
trigger1 = P2Dist X < -5

[State 3200, 1] 
type = VelSet
trigger1 = Time = 235
;trigger2 = !(enemy, Alive) 
x = -2
y = -2.7 ;-2.5

[State 3200, 1.2] 
type = VelAdd
trigger1 = Time >= 235 
;trigger2 = !(enemy, Alive)
;trigger2 = Anim = 53
;trigger2 = AnimElemTime(1) >= 0
y = const(movement.yaccel)

[State 3200, 10]
type = ChangeAnim
trigger1 = Time = 235;223 
;trigger2 = !(enemy, Alive)
value = 53
ignorehitpause = 1

[State 195, 2]
type = CtrlSet
trigger1 = !(enemy, Alive)
value = 0
ignorehitpause = 1

[State 3200, 11]
type = ChangeState
trigger1 = Anim = 53
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 
ctrl = 1

;---------------------------------------------------------------------------
; Fireball: Helper
[Statedef 3210]
type    = A
movetype= A
anim = 33210
sprpriority = 3

;[State 3210, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3210, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[state 3210, 1]
type = VelSet
trigger1 = Time > 0
x = 12

[State 3210, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(15/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3210, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(16/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
fall = 0
air.fall = 1

[State 3210, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3210, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3211
time = -1

[State 3210, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 3211
ignorehitpause = 1

;---------------------------------------------------------------------------
; Fireball: Helper (end)
[Statedef 3211]
type = A
movetype = I
ctrl = 0
anim = 33211
velset = 0, 0
sprpriority = 3

;[State 3211, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[State 3211, Assert]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3211, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Missel: Helper
[Statedef 3220]
type    = A
movetype= A
anim = 3220
sprpriority = 3

;[state 3220, 1]
;type = PosAdd
;trigger1 = root, Anim != 3205
;trigger1 = Time = 0
;x = 7

[state 3220, 1]
type = VelSet
trigger1 = root, Anim != 3205
;trigger1 = Vel X = 0
;trigger1 = Vel Y = 0
;trigger1 = AnimElem = 1
trigger1 = Time = 0
x = 5
y = 0

[state 3220, 1]
type = VelSet
trigger1 = root, Anim != 3205
;trigger1 = Vel X = 5
;trigger1 = Vel Y = 0
;trigger1 = AnimElem = 3
trigger1 = Time = 2
x = 5
y = 5

[state 3220, 1]
type = VelSet
trigger1 = root, Anim = 3205
x = 0
y = 5

;[state 3220, 1]
;type = VelSet
;trigger1 = root, Anim != 3205
;trigger1 = Vel X = 0
;trigger1 = Vel Y = 5
;trigger1 = AnimElem = 1
;x = 12
;y = 0

;[state 3220, 1]
;type = VelSet
;trigger1 = root, Anim != 3205
;trigger1 = Vel X = 12
;trigger1 = Vel Y = 0
;trigger1 = AnimElem = 3
;x = 12
;y = 5

[State 3220, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(15/(1+(root,Var(19)/5.0))), 6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
fall = 0
air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 3220, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(16/(1+(root,Var(19)/5.0))), 7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
fall = 0
air.fall = 1

[State 3220, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 3220, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 3221
time = -1

[State 3220, 8]
type = ChangeState
trigger1 = MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 || Pos Y >= 0
value = 3221
ignorehitpause = 1

;---------------------------------------------------------------------------
; Missel: Helper (end)
[Statedef 3221]
type = A
movetype = I
ctrl = 0
anim = 8290
velset = 0, 0
sprpriority = 3

[State 3201, 0]
type = trans
trigger1 = 1
trans = addalpha
alpha = 256, 256
ignorehitpause = 1

[State 3221, 1]
type = PlaySnd
trigger1 = !Time
value = 18, 4

[State 3221, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Beat: Helper 
[Statedef 3250]
type = A
movetype = I
ctrl = 0
anim = 3250
velset = 0,0 ;3.5, 1.5
sprpriority = 3

[State 3250, 1]
type = ChangeAnim
trigger1 = root, Time = 54
value = 8930

[State 3250, 2]
type = ChangeAnim
trigger1 = root, Time = 236
value = 3250

[State 3250, 0]
type = VelSet
trigger1 = (root, Time >= 0) && (root, Time < 15) 
x = 4

[State 3250, 0]
type = VelSet
trigger1 = (root, Time >= 15) && (root, Time < 42) 
x = 0

[State 3250, 0]
type = VelSet
trigger1 = (root, Time = 42) ;&& (root, Time < 150) 
x = RootDist X /10 ;7 (by P.O.T.S.)
y = RootDist Y /10 ;6.5
persistent = 0

[State 3250, 3]
type = VelSet
trigger1 = RootDist X = [-10, 10]
x = 0

[State 3250, 4]
type = VelSet
trigger1 = RootDist Y = [10, 40]
y = 0

[State 3250, 5]
type = ChangeState 
trigger1 = root, Time = 236 
trigger2 = root, MoveType = H
value = 3251

;---------------------------------------------------------------------------
; Beat: Helper (end)
[Statedef 3251]
type = A
movetype = I
ctrl = 0
;anim = 3250
velset = 0,0 ;3.5, 1.5
sprpriority = 3

[State 3251, 0]
type = PosSet
trigger1 = !Time 
x = root, Pos X 

[State 3251, 1] 
type = PosSet
;trigger1 = root, Pos Y < 0
trigger1 = !Time 
y = root, Pos Y

[State 3251, 2]
type = VelSet
trigger1 = !Time ;root, Time > 180 ;AnimElem = 35
x = 6.5
y = -2.5

[State 3251, 3]
type = DestroySelf
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105




;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; S.Adapt Mode Supers
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Super Slash
[Statedef 4000]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 4000                       
sprpriority = 2

[State 4000, 1] ;Back Dust
type = Explod
trigger1 = Anim = 6131
trigger1 = AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 11, 2
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1
supermovetime = -1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 4000, 4.1] 
type = SuperPause
trigger1 = Time = 17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 4000, 5]
type = AssertSpecial
trigger1 = Time = [17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 4000, 6]
type = AssertSpecial
trigger1 = Time = [17, 58]
flag = NoFG
ignorehitpause = 1

[State 4000, 7] ;Super BG (start)
type = Explod
trigger1 = Time = 17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4000, 8]
type = PlaySnd
trigger1 = Time = 17
value = 30, 0

[State 4000, 9] ;Super Portrait
type = Explod
trigger1 = Time = 20
persistent = 0
anim = 8891
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4000, 10]
type = Helper
trigger1 = NumHelper(4010) < 1
trigger1 = Anim = 6131
trigger1 = AnimElem = 3
helpertype = normal
name = "Super Slash"
ID = 4010
pos = 10, -30
postype = p1
bindtime = -1
;facing = 1
stateno = 4010  
supermovetime = 999999
ownpal = 1

[State 4000, 11]
type = AfterImage
trigger1 = !Time 
Trans = Add1
Timegap = 2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1
ignorehitpause = 1

[State 4000, 19]
type = Width
trigger1 = Time = [20, 160]
value = 25, 5

[State 4000, 20]
type = VarSet
trigger1 = 1
v = 17
value = 0

[State 4000, 22]
type = PlaySnd
trigger1 = Time = 1
value = 5, 0
channel = 0

[State 4000, 23]
type = PlaySnd
trigger1 = Time = 58
value = 2, 2 ;5, 1
channel = 0

[State 4000, 10]
type = PlaySnd
trigger1 = Anim = 6145
trigger1 = AnimElem = 2
value = 10, 2

[State 4000, Super Slash Attacks AfterImage Off]
type = AfterImageTime
trigger1 = Anim = 4000
trigger1 = AnimTime = 0 
time = 0

[State 4000, 10]
type = ChangeAnim
trigger1 = Anim = 4000
trigger1 = AnimTime = 0 
value = 6131

[State 4000, 26]
type = ChangeState
trigger1 = Anim = 6131
trigger1 = AnimTime = 0
value = 0 
ctrl = 1

;---------------------------------------------------------------------------
; Super Slash efect: Helper
[Statedef 4010]
type    = A
movetype= A
anim = 61322
sprpriority = 3

;[State 4010, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 4010, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236, 118 

[state 4010, 1]
type = VelSet
trigger1 = !Time 
x = 4.5 

[State 4010, 2]
type = HitDef
trigger1 = Time % 2 = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = 40, 8 ;50, 6
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8370+(random%8) ;S8270 
sparkxy = 0, 0              
hitsound = S15, 8                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = High                 
air.velocity = -2, 0 
air.hittime = 25       
fall = 1
air.fall = 1 

[State 4010, 3]
type = HitDef
trigger1 = Time % 8 = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = 41, 9 ;51, 7
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
sprpriority = 3
pausetime = 0, 4 ;0, 8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200                
sparkno = s8370+(random%8) ;S8270
sparkxy = 0, 0              
hitsound = S15, 8                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = High                 
air.velocity = -3, 0 
air.hittime = 25   
fall = 1
air.fall = 1

[State 4010, 5]
type = AfterImage
trigger1 = !Time 
Trans = Add1
Timegap = 5;2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1
ignorehitpause = 1

[State 4010, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 4010, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 4011
time = -1

[State 4010, 8]
type = DestroySelf 
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 

;---------------------------------------------------------------------------
; Super Slash efect: Helper (end)
[Statedef 4011]
type = A
movetype = I
ctrl = 0
anim = 61323
velset = 0, 0
sprpriority = 3

;[State 4011, 0]
;type = AssertSpecial
;trigger1 = 1
;flag = noshadow
;ignorehitpause = 1

[state 4011, 1]
type = trans
trigger1 = 1
trans = addalpha
alpha = 236, 118 

[State 4011, 2]
type = DestroySelf
trigger1 = AnimTime = 0


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Air Super Slash
[Statedef 4050]
type    = A                      
movetype= A                      
;physics = A                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 4050                       
sprpriority = 2

[State 4050, 4.1] 
type = SuperPause
trigger1 = Time = 17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 4050, 5]
type = AssertSpecial
trigger1 = Time = [17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 4050, 6]
type = AssertSpecial
trigger1 = Time = [17, 58]
flag = NoFG
ignorehitpause = 1

[State 4050, 7] ;Super BG (start)
type = Explod
trigger1 = Time = 17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4050, 8]
type = PlaySnd
trigger1 = Time = 17
value = 30, 0

[State 4050, 9] ;Super Portrait
type = Explod
trigger1 = Time = 20
persistent = 0
anim = 8891
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4050, 10]
type = Helper
trigger1 = NumHelper(4010) < 1
trigger1 = Anim = 6145
trigger1 = AnimElem = 3
helpertype = normal
name = "Super Slash"
ID = 4010
pos = 10, -40
postype = p1
bindtime = -1
;facing = 1
stateno = 4010  
supermovetime = 999999
ownpal = 1

[State 4050, 11]
type = AfterImage
trigger1 = !Time 
Trans = Add1
Timegap = 2
Framegap = 1;3
length = 6;9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1
ignorehitpause = 1

[State 4050, 19]
type = Width
trigger1 = Time = [20, 160]
value = 25, 5

[State 4050, 20]
type = VarSet
trigger1 = 1
v = 17
value = 0

[State 4050, 22]
type = PlaySnd
trigger1 = Time = 1
value = 5, 0
channel = 0

[State 4050, 23]
type = PlaySnd
trigger1 = Time = 58
value = 2, 2 ;5, 1
channel = 0

[State 4050, 10]
type = PlaySnd
trigger1 = Anim = 6145
trigger1 = AnimElem = 2
value = 10, 2

[State 4050, Super Slash Attacks AfterImage Off]
type = AfterImageTime
trigger1 = Anim = 4050
trigger1 = AnimTime = 0 
time = 0

[State 4050, 10]
type = ChangeAnim
trigger1 = Anim = 4050
trigger1 = AnimTime = 0 
value = 6145

[State 4050, 26]
type = ChangeState
trigger1 = Anim = 6145
trigger1 = AnimTime = 0
value = 53 
ctrl = 1


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Multi Attacks
[Statedef 4100]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 4                      
velset = 0,0                     
ctrl = 0                         
anim = 4000                       
sprpriority = 2

[State 4100, 1] ;Back Dust
type = Explod
trigger1 = Anim = 6131
trigger1 = AnimElem = 3
persistent = 0
anim = 8020
postype = p1
pos = 11, 2
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1
supermovetime = -1
removeongethit = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 4100, 4.1] 
type = SuperPause
trigger1 = Time = 17
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 41
darken = ifelse(Time >= 45, 1, 0);1
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 41

[State 4100, 5]
type = AssertSpecial
trigger1 = Time = [17, 150]
flag = nobardisplay
ignorehitpause = 1

[State 4100, 6]
type = AssertSpecial
trigger1 = Time = [17, 58]
flag = NoFG
ignorehitpause = 1

[State 4100, 7] ;Super BG (start)
type = Explod
trigger1 = Time = 17
persistent = 0
anim = 8910
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4100, 8]
type = PlaySnd
trigger1 = Time = 17
value = 30, 0

[State 4100, 9] ;Super Portrait
type = Explod
trigger1 = Time = 20
persistent = 0
anim = 8891
postype = left
pos = ifelse(facing = 1, 0, 319), 0 ;0, 0
facing = facing
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
supermovetime = -1
bindtime = -1
ownpal = 1

[State 4100, 19]
type = Width
trigger1 = Time = [20, 160]
value = 25, 5

[State 4100, 20]
type = VarSet
trigger1 = 1
v = 17
value = 0

[State 4100, 22]
type = PlaySnd
trigger1 = Time = 1
value = 5, 0
channel = 0

[State 4100, 10]
type = ChangeAnim
trigger1 = Anim = 4000
trigger1 = AnimTime = 0 
value = 6400

[State 4100, 1] ;200
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 2
attr = S, HA                     
damage = floor(26/(1+(Var(19)/5.0))), 2 ;1 = 8 hits para um dano diminuido
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
pausetime = 2, 8                 
guard.sparkno = s8300 ;S8200
sparkno = s8330+(random%8) ;S8210                      
sparkxy = -15, -47              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20             
ground.hittime  = 30             
ground.velocity = -1.5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-1           
air.hittime = 30

[State 4100, 1] ;230
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 6
attr = S, HA                     
damage = floor(26/(1+(Var(19)/5.0))), 2
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                 
priority = 7, Hit               
pausetime = 2, 8
guard.sparkno = s8300 ;S8200                 
sparkno = s8330+(random%8) ;S8210                      
sparkxy = -10, -32              
hitsound = S15, 3                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20             
ground.hittime  = 30             
ground.velocity = -1.5             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-1           
air.hittime = 30

[State 4100, 1] ;200
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 10
attr = S, HA                     
damage = floor(26/(1+(Var(19)/5.0))), 2 ;1 = 8 hits para um dano diminuido
getpower = 20
animtype = Light                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
pausetime = 2, 8                 
guard.sparkno = s8300 ;S8200
sparkno = s8330+(random%8) ;S8210                      
sparkxy = -15, -47              
hitsound = S15, 0                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20             
ground.hittime  = 30             
ground.velocity = -1.5             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-1           
air.hittime = 30

[State 4100, 1] ;210
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 15 || AnimElem = 16 
attr = S, HA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                 
priority = 7, Hit               
pausetime = 2, 8         
guard.sparkno = s8300 ;S8200        
sparkno = s8330+(random%8) ;S8220                      
sparkxy = -5, -78
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20             
ground.hittime  = 30             
ground.velocity = -2             
airguard.velocity = -1.9,-.8     
air.type = High                  
air.velocity = -1.4,-1.5           
air.hittime = 30
persistent = 0

[State 4100, 1] ;240
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 21 || AnimElem = 22
attr = S, HA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Heavy                 
guardflag = MA                  
hitflag = MAF                  
priority = 7, Hit               
pausetime = 2, 8      
guard.sparkno = s8300 ;S8200           
sparkno = s8330+(random%8) ;S8220                      
sparkxy = -8, -56              
hitsound = S15, 4                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20             
ground.hittime  = 30             
ground.velocity = -1.5             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-1           
air.hittime = 30
persistent = 0

[State 4100, 1] ;440 
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 28 || AnimElem = 29
attr = C, HA                     
damage = floor(38/(1+(Var(19)/5.0))), 3
getpower = 40
animtype = Medium                 
guardflag = L                  
hitflag = MAF                  
priority = 7, Hit               
pausetime = 2, 8     
guard.sparkno = s8300 ;S8200            
sparkno = s8330+(random%8) ;S8220                      
sparkxy = -11, -6              
hitsound = S15, 4                  
guardsound = S16, 0            
ground.type = Low               
ground.slidetime = 20            
ground.hittime  = 30             
ground.velocity = -1.5            
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-1           
air.hittime = 30
persistent = 0

[State 4100, 1] ;450 (s.adapt mode)
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 34 || AnimElem = 35
attr = C, HA                     
damage = floor(50/(1+(Var(19)/5.0))), 4
getpower = 60
animtype = Heavy                 
guardflag = L                  
hitflag = MAF                 
priority = 7, Hit               
pausetime = 2, 10     
guard.sparkno = s8300 ;S8200            
sparkno = s8330+(random%8) ;S8230                      
sparkxy = -11, -10              
hitsound = S15, 5                  
guardsound = S16, 0            
ground.type = Low               
ground.slidetime = 20            
ground.hittime  = 30             
ground.velocity = -1.5            
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-1           
air.hittime = 30
persistent = 0

[State 4100, 2] ;1000
type = HitDef
trigger1 = Anim = 6400 
trigger1 = AnimElem = 41
attr = S, HA                     
damage = floor(60/(1+(Var(19)/5.0))), 6
animtype = Heavy                 
guardflag = HA                  
hitflag = MAF                  
priority = 7, Hit               
pausetime = 7, 2      
guard.sparkno = s8301 ;S8200           
sparkno = s8330+(random%8) ;S8270                      
sparkxy = -15, -95
hitsound = S15, 2                  
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 20
ground.hittime  = 40            
ground.velocity = -7,-14             
airguard.velocity = -1.9,5     
air.type = High                  
air.velocity = -6,-13           
air.hittime = 40
fall = 1

[State 4100, 1] ;Back Dust - 1000
type = Explod
trigger1 = Anim = 6400 
trigger1 = AnimElem = 40
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1
shadow = -1,0,0
trans = addalpha
alpha = 256, 256


[State 1400, 0] ;back fire 1
type = Explod
trigger1 = NumExplod(66142) < 1
trigger1 = AnimElem = 41
ID = 66142
anim = 6143
postype = p1
pos = -14, -60
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 4100, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = AnimElem = 42
ID = 66142

[State 4100, 0.2] ;back fire 2
type = Explod
trigger1 = NumExplod(66143) < 1
trigger1 = AnimElem = 41 
ID = 66143
anim = 6144
postype = p1
pos = 22, -67
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = 3
bindtime = -1
ownpal = 1
removeongethit = 1

[State 4100, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = AnimElem = 42
ID = 66143

[state 4100, 1]
type = VelSet
triggerall = Anim = 6400 
trigger1 = AnimElem = 2
trigger2 = AnimElem = 6
trigger3 = AnimElem = 10 
trigger4 = AnimElem = 21 || AnimElem = 22
trigger5 = AnimElem = 28 
trigger6 = AnimElem = 34 
x = 2.5

[state 4100, 1]
type = VelSet
triggerall = Anim = 6400 
trigger1 = AnimElem = 15
x = 4

[state 4100, 1]
type = VelSet
triggerall = Anim = 6400 
trigger1 = AnimElem = 16 || AnimElem = 17
x = 3

[state 4100, 1]
type = VelSet
trigger1 = Anim = 6400 
trigger1 = AnimElem = 41
x = 7 
y = -9

[state 4100, 1]
type = VelSet
trigger1 = Anim = 6400 
trigger1 = AnimElem = 42
x = 0.7

[state 4100, 1]
type = VelSet
trigger1 = Anim = 6400 
trigger1 = AnimElem = 43
x = 0.5 

[State 4100, 1] 
type = StateTypeSet
trigger1 = Anim = 6400 
trigger1 = AnimElem = 41;42
statetype = A
movetype = A
physics = A

[State 4100, 21]
type = AfterImage
trigger1 = Anim = 6400 
trigger1 = AnimElem = 1
Trans = Add1
Timegap = 2
Framegap = 3
length = 9;15
PalBright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
palcontrast = 120,120,120
palpostbright = 0,0,0
time = -1

[State 4100, 5] ;200
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 1, = 1
trigger2 = AnimElem = 9, = 1
value = 10, 0

[State 4100, 6] ;230
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 5, = 1
value = 10, 0

;[State 4100, 2] ;210
;type = PlaySnd
;trigger1 = Anim = 6400 
;trigger1 = AnimElem = 12, = 1
;value = 2, 0
;channel = 0

[State 4100, 6] ;210
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 12, = 1
value = 10, 1

;[State 4100, 2] ;240
;type = PlaySnd
;trigger1 = Anim = 6400 
;trigger1 = AnimElem = 19, = 0
;value = 2, 2
;channel = 0

[State 4100, 6] ;240
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 19, = 2
value = 10, 1

[State 4100, 3] ;440
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 26, = 0
value = 10, 1

;[State 4100, 2] ;450
;type = PlaySnd
;trigger1 = Anim = 6400 
;trigger1 = AnimElem = 35, = 0
;value = 2, 1
;channel = 0

[State 4100, 3] ;450
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 32, = 0
value = 10, 1

[State 4100, 31] ;1000
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 39, = 0
value = 3, 3
channel = 0

[State 4100, 32] ;1000
type = PlaySnd
trigger1 = Anim = 6400 
trigger1 = AnimElem = 41
value = 18, 25
persistent = 0

[State 4100, 11]
type = ChangeState
trigger1 = Anim = 6400 
trigger1 = Pos Y >= 0 
trigger1 = Vel Y > 0
value = 52



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Finish Hit Explod (based on FlowaGirl and Ethan Lives codes)
[Statedef 8900]
type = S
movetype = I
physics = N
anim = 8930

;[State 8900, 1]
;type = Pause
;trigger1 = (!Time)
;time = 12
;movetime = 12

[State 8900, 1]
type = EnvShake
trigger1 = (!Time)
time = 12
freq = 120;10
ampl = -3;2
phase = 90

[State 8900, 2]
type = Explod
triggerall = (NumExplod(8900) < 1)
trigger1 = Time = 0
persistent = 0
anim = 8900
ID = 8900
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
bindtime = -1
ontop = 1
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

[State 8900, 3]
type = PlaySnd
trigger1 = (NumExplod(8900) != 0)
value = 30, 1
persistent = 0
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Author: FlowaGirl
;flowergirl@cutey.com
;http://blargh.i-xcell.com
;
; Super Finish BG
[Statedef 8920]
type = A
movetype = I
physics = N
anim = 8930

;[State 8920, 1]
;type = Pause
;trigger1 = (!Time)
;time = 12
;movetime = 12

[State 8920, 1]
type = EnvShake
trigger1 = (!Time)
time = 12
freq = 120;10
ampl = -3;2
phase = 90

[State 8920, 2] ;Super Finish BG
type = Explod
triggerall = (NumExplod(8920) < 1)
trigger1 = Time = 0
persistent = 0
anim = 8920
ID = 8920
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -4
bindtime = -1
ownpal = 1
ignorehitpause = 1

[State 8920, 3] ;Super Letters 1
type = Explod
triggerall = (NumExplod(8940) < 1) && parent,var(17) = 0
trigger1 = Time = 7 ;Super BG = 149 ticks
persistent = 0
anim = 8940
ID = 8940
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
;sprpriority = 10
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 8920, 4] ;Super Letters 2
type = Explod
triggerall = (NumExplod(8941) < 1) && parent,var(17) = 1
trigger1 = Time = 7
persistent = 0
anim = 8941
ID = 8941
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
;sprpriority = 10
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 8920, 5] ;Super Letters 3
type = Explod
triggerall = (NumExplod(8942) < 1) && parent,var(17) = 2
trigger1 = Time = 7
persistent = 0
anim = 8942
ID = 8942
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
;sprpriority = 10
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 8920, 6] ;Super Letters 4
type = Explod
triggerall = (NumExplod(8943) < 1) && parent,var(17) = 3
trigger1 = Time = 3 
persistent = 0
anim = 8943
ID = 8943
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
;sprpriority = 10
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 8920, 7]
type = AssertSpecial
trigger1 = (NumExplod(8920) != 0)
flag = NoBG
flag2 = NoFG
;flag3 = NoMusic

[State 8920, 8]
type = PlaySnd
trigger1 = (NumExplod(8920) != 0)
value = 30, 2
persistent = 0
ignorehitpause = 1



;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Super Armor HitOverRide (by Soldats)

[Statedef 3950]
type    = U ;Unchanged
movetype= I;H
physics = U

[State 3950, AnimElem VarSet]
type = VarSet
trigger1 = Time <= 0
v = 56
value = AnimElemNo(0)
ignorehitpause = 1;

[State 3950, PosFreeze]
type = PosFreeze
trigger1 = 1

[State 3950, VelSet]
type = VelSet
trigger1 = 1
trigger1 = Life > 0
x = FVar(30)
y = FVar(31)

[State 3950, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = Anim
elem = Var(56)
ignorehitpause = 1;

[State 3950, ChangeState];Dead
type = ChangeState
trigger1 = Life <= 0
;value = 5000
value = 3951
ignorehitpause = 1;

[State 3950, ChangeState];Still alive
type = ChangeState
trigger1 = (Time >= floor(GetHitVar(HitTime)/3)) && (Life > 0)
trigger2 = (Time >= floor(GetHitVar(HitTime)/4)) && (Life > 0)
trigger3 = (Time >= floor(GetHitVar(HitTime)/5)) && (Life > 0)
value = Var(57)
ignorehitpause = 1;

[State 3950, 1.1]
type = PalFX
trigger1 = GetHitVar(hitcount) =1
trigger2 = GetHitVar(hitcount) =2
time = 1
add = 255,50,0
color = 0
ignorehitpause = 1

[State 3950, 1.2]
type = PalFX
trigger1 = GetHitVar(hitcount) =3
trigger2 = GetHitVar(hitcount) =4
time = 1
add = 255,0,0
color = 0
ignorehitpause = 1

[State 3950, 1.3]
type = PalFX
trigger1 = GetHitVar(hitcount) =5
time = 1
add = 200,0,20
color = 0
ignorehitpause = 1

;---------------------------------------------------------------------------
; HITG_SHAKE (Die during super armor) (by Soldats)
[Statedef 3951]
type    = S
movetype= H
physics = N
velset = 0,0

[State 3951, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
value = 5030

[State 3951, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 && GetHitVar(fall)
trigger2 = Pos Y != 0
type = a

[State 3951, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 3952

[State 3951, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 3951, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 3951, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up) (by Soldats)
[Statedef 3952]
type    = A
movetype= H
physics = N
ctrl = 0

[State 3952, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 3952, VelSet]
type = VelSet
trigger1 = Time = 0
y = ifelse(GetHitVar(YVel) >= 0, -5, GetHitVar(YVel))

[State 3950, HitVelSet]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 3952, 4]
type = ChangeState
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; S.Adaptor Mode - start 
[Statedef 6028]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 6028                       
;poweradd = 75                    
sprpriority = 2                  

[State 6028, 4.1] 
type = SuperPause
trigger1 = Time = 1
anim = -1;S8020
;sound = S0, 0
pos = 11, 2
movetime = 131
darken = 0
poweradd = -1000
bindtime = -1
sprpriority = 3
Time = 132 ;41

[State 6028, 7] ;Background
type = Explod
trigger1 = Time = 17;1
persistent = 0
anim = 8910;8921
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
supermovetime = -1
bindtime = -1
ownpal = 1

[State 6028, 1] ;Energy Cruz Efect
type = Explod
trigger1 = Time = 69 
persistent = 0
anim = 8423
postype = p1
pos = 0, -45
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
supermovetime = -1
ownpal = 1

[State 6028, 1] ;Electricity Efect
type = Explod
trigger1 = Time = 89;85;80 
persistent = 0
anim = 8422
postype = p1
pos = 0, -45 
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
supermovetime = -1
ownpal = 1

[State 6028, 8]
type = PlaySnd
trigger1 = Time = 17
value = 30, 0

[State 6028, 5]
type = AssertSpecial
trigger1 = Time = [1, 132]
flag = nobardisplay
ignorehitpause = 1
supermovetime = -1

[State 6028, 6]
type = AssertSpecial
trigger1 = Time = [1, 132]
flag = NoFG
ignorehitpause = 1
supermovetime = -1

[State 6028, 7]
type = ChangeAnim
trigger1 = NumHelper(7000) = 1
trigger1 = Helper(7000), AnimElem = 10 ;Pos X = [-10, 10] 
value = 6029

[State 6028, 1] ;Back Dust
type = Explod
trigger1 = Anim = 6029
trigger1 = AnimElem = 1, 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
supermovetime = -1
sprpriority = 4
ownpal = 1

[State 6028, 3] ;start var(33)
type = VarSet
trigger1 = var(33) = 0
trigger1 = Time = 0
v = 33
value = 1

[State 6028, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 0, 1;3, 5
channel = 0

[State 6028, 6]
type = PlaySnd
trigger1 = Time = 39
value = 18, 20

[State 6028, 6]
type = PlaySnd
trigger1 = Time = 69;80
value = 18, 19

[State 6028, 6]
type = PlaySnd
trigger1 = Time = 93;89;80
value = 18, 21

[State 6029, 5]
type = PalFX
trigger1 = Time = [68, 89]
add = 256,256,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 5]
type = PalFX
trigger1 = Time = [90, 92]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 4]
type = PalFX
trigger1 = Time = [93, 94]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 3]
type = PalFX
trigger1 = Time = [95, 97]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 2]
type = PalFX
trigger1 = Time = [98, 99]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999

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

;---------------------------------------------------------------------------
; S.Adaptor Mode - end 
[Statedef 6029]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 5                      
velset = 0,0                     
ctrl = 0                         
anim = 1100                       
;poweradd = 75                    
sprpriority = 2                  

[State 6029, 5]
type = PalFX
trigger1 = Time = [0, 10]
add = 256,256,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 1] ;Back Dust
type = Explod
trigger1 = Time = 0
persistent = 0
anim = 8020
postype = p1
pos = 20, 3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 4
ownpal = 1

[State 6029, 3] ;reset var(33)
type = VarSet
trigger1 = var(33) = 1
trigger1 = Time = 0
v = 33
value = 0

[State 6029, 5]
type = PlaySnd
trigger1 = Time = 0;1
value = 1, 0
channel = 0

[State 6029, 5]
type = PalFX
trigger1 = Time = [11, 13]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 4]
type = PalFX
trigger1 = Time = [14, 15]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 3]
type = PalFX
trigger1 = Time = [16, 18]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 6029, 2]
type = PalFX
trigger1 = Time = [19, 20]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush (code by VIB)
[Statedef 7000]
type = S
movetype = I
physics = N
velset = 0,0
;anim = 7000
ctrl = 0
sprpriority = -4

[State 7000, 0]
type = PlayerPush
trigger1 = !Time 
value = 0

[State 7000, 0] 
type = PosSet
trigger1 = PrevStateNo = 7301
y = 0

[State 7000, stand anim]
type = ChangeAnim
;triggerall = RoundState != 4
trigger1 = PrevStateNo != 7021 
trigger1 = Facing = Var(32)
trigger1 = !Time
value = 7000

[State 7000, back from walking back]
type = ChangeAnim
;triggerall = RoundState != 4
trigger1 = PrevStateNo = 7021 
trigger1 = Facing = Var(32)
trigger1 = !Time
value = 7005

[State 7000, vira]
type = ChangeAnim
;triggerall = RoundState != 4
trigger1 = Anim = 7005
trigger1 = AnimTime = 0
value = 7000

[State 7000, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7000, Start Round Invisible (mega in stateb 5900)]
type = ChangeState
trigger1 = root, var(33) = 1
trigger1 = root, StateNo != 6028
value = 7900

[State 7000, walk foward]
type = ChangeState
;triggerall = RoundState != 4
triggerall = Var(31) > 70*ifelse(Var(32) = Facing,1,-1) + 15
trigger1 = Var(41) < 1
trigger2 = FrontEdgeBodyDist != [0,20]
value = 7020

[State 7000, walk back]
type = ChangeState
;triggerall = RoundState != 4
triggerall = Var(31) < 10*ifelse(Var(32) = Facing,1,-1) - 15 ;70*ifelse... -15
trigger1 = Var(41) > -1
trigger2 = BackEdgeBodyDist != [0,20]
value = 7021

[State 7000, vira]
type = ChangeState
;triggerall = RoundState != 4
trigger1 = Facing != Var(32)
value = 7005

[State 7000, mad]
type = ChangeState
;triggerall = RoundState != 4
trigger1 = parent, var(20) = 24 ;command = "hold_z"
;trigger1 = Time > 19
value = 7220

[State 7000, sad]
type = ChangeState
trigger1 = parent, MoveType = H
trigger1 = parent, GetHitVar(hitcount) > 2
;trigger2 = parent, MoveType = H
;trigger2 = RoundState = 4
value = 7500

[State 7000, Win Poses]
type = ChangeState
trigger1 = RoundState = 4
value = 7180

[State 7000, Win Pose - start]
type = ChangeState
triggerall = PrevStateNo = 7182
trigger1 = Time = 0 ;RoundState = 4
value = 7182

[State 7000, Megaman Dead]
type = ChangeState
trigerall = StateNo != 7500
trigger1 = !parent, Alive
value = 7500

[State 7000, Hyper Megaman / Rush Drill]
type = ChangeState
;triggerall = PrevStateNo != 7301
triggerall = Anim = 7000
trigger1 = root, StateNo = 3000
trigger1 = root, Time < 57 ;AnimElem = 1
trigger2 = root, StateNo = 3100
trigger2 = root, Time < 57 ;AnimElem = 1
value = 7300

[State 7000, Beat Plane]
type = ChangeState
triggerall = Anim = 7000
trigger1 = root, StateNo = 3200
trigger1 = root, Time >= 15 ;= 15
value = 7320

[State 7000, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7000, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7000, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7000, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7000, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7000, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7000, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7000, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7000, Coil Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2100
trigger1 = root, StateNo = 2100
value = 7260

;---------------------------------------------------------------------------
; Rush - Turn
[Statedef 7005]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 7005
ctrl = 0
sprpriority = -4

[State 7005, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7005, var(41)]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 7005, vira]
type = Turn
trigger1 = !Time ;!AnimTime

[State 7005, volta]
type = ChangeState
trigger1 = !AnimTime
value = 7000

[State 7005, Megaman Dead]
type = ChangeState
trigerall = StateNo != 7500
trigger1 = !parent, Alive
value = 7500

[State 7005, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7005, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7005, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7005, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7005, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7005, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

;---------------------------------------------------------------------------
; Rush - Walk Foward
[Statedef 7020]
type    = S
movetype= I
physics = N
velset = 3.2,0
anim = 7020
ctrl = 0
sprpriority = -4

[State 7020, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7020, var(41)]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 7020, var(41) add]
type = VarAdd
trigger1 = Var(40) = Floor(Pos X)
trigger1 = Var(40)
trigger1 = FrontEdgeBodyDist = [0,20]
var(41) = 1

[State 7020, Var(40)]
type = VarSet
trigger1 = 1
var(40) = Floor(Pos X)

[State 7020, corre]
type = ChangeState
trigger1 = Var(31) > ifelse(Var(32) = Facing,105,-10) ;130,-10
value = 7100

[State 7020, volta]
type = ChangeState
trigger1 = Var(31) <= 70*ifelse(Var(32) = Facing,1,1) ;1,-1 
trigger2 = Var(41) > 5
value = 7000 + 5*(Var(32) != Facing)

[State 7020, mad]
type = ChangeState
trigger1 = parent, var(20) = 24 ;command = "hold_z"
value = 7220

[State 7020, sad]
type = ChangeState
trigger1 = parent, MoveType = H
trigger1 = parent, GetHitVar(hitcount) > 2
;trigger2 = parent, MoveType = H
;trigger2 = RoundState = 4
value = 7500

;[State 7020, Megaman Dead]
;type = ChangeAnim
;;triger1 = StateNo != 7500
;trigger1 = !(parent, Alive)
;trigger1 = Anim = 7005
;value = 7500

[State 7020, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7020, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7020, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7020, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7020, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7020, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7020, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7020, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7020, Coil Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2100
trigger1 = root, StateNo = 2100
value = 7260

;---------------------------------------------------------------------------
; Rush - Walk Back
[Statedef 7021]
type    = S
movetype= I
physics = N
velset = -3.0,0
anim = 7021
ctrl = 0
sprpriority = -4

[State 7021, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

;[State 7021, turn anim]
;type = ChangeAnim
;triggerall = var(41) = 0
;;triggerall = PrevStateNo = 7000
;trigger1 = Time = 0 
;value = 7005

;[State 7021, turn anim]
;type = ChangeAnim
;;trigger1 = Anim = 7005
;trigger1 = Time = 9 ;AnimTime = 0
;value = 7021

;[State 7021, 1]
;type = VelSet
;;trigger1 = Anim = 7005
;trigger1 = Time = 9 
;x = -3.0

[State 7021, var(41)]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 7021, var(41) add]
type = VarAdd
trigger1 = Var(40) = Floor(Pos X)
trigger1 = Var(40)
trigger1 = BackEdgeBodyDist = [0,20]
var(41) = -1

[State 7021, Var(40)]
type = VarSet
trigger1 = 1
var(40) = Floor(Pos X)

[State 7021, corre trás]
type = ChangeState
trigger1 = var(31) < ifelse(Var(32) = Facing, -25,-190) ;-30,-190
trigger1 = time
value = 7105

[State 7021, volta]
type = ChangeState
trigger1 = Var(31) >= 10*ifelse(Var(32) = Facing,1,-1) ;70*ifelse...
trigger2 = Var(41) < -5
value = 7000 + 5*(Var(32) != Facing)

[State 7021, mad]
type = ChangeState
trigger1 = parent, var(20) = 24 ;command = "hold_z"
value = 7220

[State 7021, sad]
type = ChangeState
trigger1 = parent, MoveType = H
trigger1 = parent, GetHitVar(hitcount) > 2
;trigger2 = parent, MoveType = H
;trigger2 = RoundState = 4
value = 7500

;[State 7021, Megaman Dead]
;type = ChangeState
;;trigger1 = StateNo != 7500
;trigger1 = !(parent, Alive)
;trigger1 = Anim = 7005
;value = 7500

[State 7021, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7021, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7021, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7021, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7021, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7021, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7021, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7021, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7021, Coil Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2100
trigger1 = root, StateNo = 2100
value = 7260

;---------------------------------------------------------------------------
; Rush - Run Foward
[Statedef 7100]
type    = S
movetype= I
physics = N
velset = 6,0 ;6,0
anim = 7100
ctrl = 0
sprpriority = -4

[State 7100, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7100, var(41)]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 7100, var(41) add]
type = VarAdd
trigger1 = Var(40) = Floor(Pos X)
trigger1 = Var(40)
trigger1 = FrontEdgeBodyDist = [0,20]
var(41) = 1

[State 7100, Var(40)]
type = VarSet
trigger1 = 1
var(40) = Floor(Pos X)

[State 7100, volta]
type = ChangeState
trigger1 = Var(31) <= ifelse(Var(32) = Facing,90,-10);-40
trigger2 = Var(41) > 5
value = 7000

[State 7100, mad]
type = ChangeState
trigger1 = parent, var(20) = 24 ;command = "hold_z"
value = 7220

[State 7100, sad]
type = ChangeState
trigger1 = parent, MoveType = H
trigger1 = parent, GetHitVar(hitcount) > 2
;trigger2 = parent, MoveType = H
;trigger2 = RoundState = 4
value = 7500

;[State 7100, Megaman Dead]
;type = ChangeState
;trigerall = StateNo != 7500
;trigger1 = !parent, Alive
;value = 7500

[State 7100, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7100, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7100, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7100, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7100, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7100, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7100, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7100, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7100, Coil Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2100
trigger1 = root, StateNo = 2100
value = 7260

;---------------------------------------------------------------------------
; Rush - Run Back
[Statedef 7105]
type    = S
movetype= I
physics = N
velset = -6.5,0 ;-7.4,0
anim = 7105
ctrl = 0
sprpriority = -4

[State 7105, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7105, var(41)]
type = VarSet
trigger1 = !Time
var(41) = 0

[State 7105, var(41) add]
type = VarAdd
trigger1 = Var(40) = Floor(Pos X)
trigger1 = Var(40)
trigger1 = BackEdgeBodyDist = [0,20]
var(41) = -1

[State 7105, Var(40)]
type = VarSet
trigger1 = 1
var(40) = Floor(Pos X)

[State 7105, volta]
type = ChangeState
trigger1 = Var(31) >= ifelse(Var(32) = Facing, -11,-220)
trigger2 = Var(41) < -5
value = 7000

[State 7105, mad]
type = ChangeState
trigger1 = parent, var(20) = 24 ;command = "hold_z"
value = 7220

[State 7105, sad]
type = ChangeState
trigger1 = parent, MoveType = H
trigger1 = parent, GetHitVar(hitcount) > 2
;trigger2 = parent, MoveType = H
;trigger2 = RoundState = 4
value = 7500

;[State 7105, Megaman Dead]
;type = ChangeAnim
;trigerall = StateNo != 7500
;trigger1 = !parent, Alive
;value = 7500

[State 7105, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7105, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7105, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7105, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7105, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7105, 11] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7105, 12] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7105, 13] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7105, Coil Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2100
trigger1 = root, StateNo = 2100
value = 7260

;---------------------------------------------------------------------------
; Rush - Win Pose State Decider
[Statedef 7180]
type    = S
movetype= I
physics = N

[State 7180, 1]
type = ChangeState
trigger1 = parent, StateNo = [181, 184] 
trigger2 = parent, StateNo = 186 
value = 7181 

[State 7180, 2]
type = ChangeState
trigger1 = parent, StateNo = 185 
value = 7182 

[State 7180, Megaman Dead]
type = ChangeState
;trigger1 = StateNo != 7500
trigger1 = !(root, Alive)
value = 7500

;---------------------------------------------------------------------------
; Rush - Win Pose (Hologram)
[Statedef 7181]
type    = S
movetype= I
physics = N
velset = 0,0 
;anim = 7180
ctrl = 0
sprpriority = -4

[State 7181, 1]
type = ChangeAnim
trigger1 = parent, StateNo = [181, 184]
trigger1 = Time = 3
trigger2 = parent, StateNo = 186 
trigger2 = Time = 20
value = 7180

[State 7181, 2]
type = Explod
triggerall = NumExplod(7800) < 1
trigger1 = AnimElem = 12
persistent = 1
ID = 7800
anim = 7800
postype = p1
pos = -16, 0
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -5
bindtime = -1
ownpal = 0

[State 7181, 3] ;Dr.Light "not cake" :P
type = PlaySnd
triggerall = NumExplod(7800) > 0
trigger1 = parent, StateNo = 181
trigger2 = parent, StateNo = 183
trigger3 = parent, StateNo = 184
value = 0, 9
;channel = 0
persistent = 0

[State 7181, 4] ;Dr.Light "cake"
type = PlaySnd
triggerall = NumExplod(7800) > 0
trigger1 = parent, StateNo = 186
value = 0, 10
;channel = 0
persistent = 0

[State 7181, 5] ;Rush barck
type = PlaySnd
triggerall = AnimElem = 4
trigger1 = parent, StateNo = 181
trigger2 = parent, StateNo = 183
trigger3 = parent, StateNo = 184
trigger4 = parent, StateNo = 186
value = 0, 13
;channel = 0
persistent = 0

[State 7181, 5] ;hologram start
type = PlaySnd
triggerall = AnimElem = 8
trigger1 = parent, StateNo = 181
trigger2 = parent, StateNo = 183
trigger3 = parent, StateNo = 184
trigger4 = parent, StateNo = 186
value = 0, 11
;channel = 0
persistent = 0

[State 7181, 5] ;hologram working
type = PlaySnd
triggerall = AnimElem = 11
trigger1 = parent, StateNo = 181
trigger2 = parent, StateNo = 183
trigger3 = parent, StateNo = 184
trigger4 = parent, StateNo = 186
value = 0, 12
;channel = 0
persistent = 0


;---------------------------------------------------------------------------
; Rush - Win Pose (Megaman hug)
[Statedef 7182]
type    = S
movetype= I
physics = N
;velset = 0,0 
;anim = 7181
ctrl = 0
sprpriority = -4

[State 7182, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 7100

[State 7182, 0] ;mode 1 
type = ParentVarSet
trigger1 = Var(31) <= 50*ifelse(Var(32) = Facing,1,-1) ;20*
trigger1 = !Time
v = 8
value = 1

[State 7182, 0] ;mode 2
type = ParentVarSet
trigger1 = Var(31) > 50*ifelse(Var(32) = Facing,1,-1) 
trigger1 = !Time
v = 8
value = 2

[State 7182, volta mode 1]
type = ChangeAnim 
triggerall = parent, Var(8) = 1
triggerall = Anim = 7100 
trigger1 = Var(31) <= 10*ifelse(Var(32) = Facing,1,-1) ;20*
trigger1 = Time > ifelse(ParentDist X < 10, 0, 5) ;5
value = 7000 ;7181;7000

[State 7182, volta mode 2]
type = ChangeAnim 
triggerall = parent, Var(8) = 2 
triggerall = Anim = 7100 
trigger1 = Var(31) <= 50*ifelse(Var(32) = Facing,1,-1) ;20*
trigger1 = Time > 5
value = 7000 

[State 7182, 0] ;mode 1 
type = ParentVarSet
triggerall = parent, Var(8) = 1
trigger1 = Anim = 7000 ;7181
v = 5
value = 1

[State 7182, 0] ;mode 2
type = ParentVarSet
triggerall = parent, Var(8) = 2
trigger1 = Anim = 7000 
v = 5
value = 2

[State 7182, 0] 
type = ParentVarSet
trigger1 = parent, Anim = 186
trigger2 = parent, Anim = 5
trigger2 = parent, AnimElem = 1, = 1 
v = 8
value = 0

[State 7182, 0] 
type = ParentVarSet
trigger1 = parent, Anim = 186
trigger2 = parent, Anim = 5 
v = 5
value = 0

[State 7182, Var(40)]
type = VelSet
trigger1 = !Time
x = 3

[State 7182, Var(40)]
type = VelSet
trigger1 = Anim = 7000 
x = 0

[State 7182, 1] 
type = ChangeAnim
trigger1 = parent, Anim = 186
trigger1 = parent, AnimElem = 2, = 1
value = 7181

[State 7182, Var(40)] ;mode 1
type = PosAdd
triggerall = var(32) = Facing
triggerall = Anim = 7181
trigger1 = AnimElem = 2
x = 30

[State 7182, Var(40)] ;mode 2
type = PosAdd
triggerall = var(32) != Facing
triggerall = Anim = 7181
trigger1 = AnimElem = 2
x = 10

[State 7182, turn]
type = Turn
triggerall = var(32) != Facing
triggerall = Anim = 7181
trigger1 = parent, AnimElem = 3, = 2;3

;[State 7182, 4]
;type = SprPriority
;;triggerall = var(32) != Facing
;triggerall = Anim = 7181
;trigger1 = AnimElem = 2
;value = 6

;---------------------------------------------------------------------------
; Rush - Intro State Decider
[Statedef 7190]
type    = S
movetype= I
physics = N

[State 7190, gogo]
type = ChangeState
trigger1 = 1
value = ifelse((root, StateNo = 191), 7191, 7000)

;---------------------------------------------------------------------------
; Rush - Intro I
[Statedef 7191]
type    = S
movetype= I
physics = N
velset = 0,0;2.8,0
anim = 7191;7020
ctrl = 0
sprpriority = -4

[State 7191, 1]
type = PalFX
trigger1 = Time = [42, 43] 
add = 255,255,255
time = 1

[State 7191, 2]
type = PalFX
trigger1 = Time = [44, 47] 
add = 255,120,120
time = 1

[State 7191, 3]
type = PalFX
trigger1 = Time = [48, 50] 
add = 256,80,80
time = 1

[State 7191, 4]
type = PalFX
trigger1 = Time = [51, 54] 
add = 155,50,50
time = 1

[State 7191, 5]
type = PalFX
trigger1 = Time = [55, 57] 
add = 95,20,20
time = 1

;[State 7191, pos ini]
;type = PosSet
;triggerall = RoundNo = 1
;trigger1 = !Time
;x = Parent, Pos X - 300*Facing

;[State 7191, vel ini]
;type = VelSet
;triggerall = RoundNo = 1
;trigger1 = !Time
;x = 2.8

[State 7191, volta]
type = ChangeState
triggerall = RoundNo = 1
;trigger1 = Var(31) <= 70*ifelse(Var(32) = Facing,1,-1)
;trigger1 = Time > 5
trigger1 = AnimTime = 0
value = 7000

[State 7191, volta 2]
type = ChangeState
triggerall = RoundNo != 1
trigger1 = !Time 
value = 7000

;---------------------------------------------------------------------------
; Rush - Mad
[Statedef 7220]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 7220
ctrl = 0
sprpriority = -4

[State 7220, vira]
type = Turn
;trigger1 = NumEnemy > 0
trigger1 = P2Dist X <= -5 ;enemy, ParentDist X <= -20 

[State 7220, 1]
type = PalFX
trigger1 = Time = 0 
time = 1

[State 7220, 2]
type = ChangeState
trigger1 = NumHelper(229) < 1 ;parent, command != "hold_z"
value = 7000

;---------------------------------------------------------------------------
; Rush - Sad
[Statedef 7500]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 7500
ctrl = 0
sprpriority = -4

[State 7500, vira]
type = Turn
trigger1 = ParentDist X <= -20 

[State 7500, remove rush back (facing = 1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7241

[State 7500, remove rush back (facing = -1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7242

[State 7500, remove jet fire (facing = 1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7243

[State 7500, remove jet fire (facing = 1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7244

[State 7500, remove jet fire (facing = -1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7245

[State 7500, remove jet fire (facing = -1)]
type = RemoveExplod
trigger1 = !Time
;trigger1 = !Alive
;trigger2 = MoveType = H
ID = 7246

[State 7500, 1]
type = ChangeState
trigger1 = parent, Alive
trigger1 = parent, MoveType != H
value = 7000

;---------------------------------------------------------------------------
; Rush - Hyper Megaman / Rush Drill
[Statedef 7300]
type = A
movetype = I
ctrl = 0
anim = 7000 ;3050
velset = 0,0 
sprpriority = -4

[State 7300, 1]
type = ChangeAnim
trigger1 = root, StateNo = [3000, 3099] 
trigger1 = root, AnimElem = 6
trigger2 = root, StateNo = [3100, 3199] 
trigger2 = root, var(45) = 1
value = 8930

[State 7300, 2]
type = ChangeAnim
trigger1 = root, StateNo = [3000, 3099]
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
trigger2 = root, StateNo = [3100, 3199] 
trigger2 = root, var(45) = 182
trigger3 = root, MoveType = H
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger4 = root, StateNo = [5000, 5999]
value = 7000

[State 7300, 0]
type = VelSet
trigger1 = (root, Time = 19) 
trigger1 = root, StateNo != 3950 ;Super Armor state
x = RootDist X/10
;y = RootDist Y/10
persistent = 0

[State 7300, 0.1] ;AIR
type = VelSet
trigger1 = root, StateNo != [3100, 3199]
trigger1 = root, StateNo != 3950 ;Super Armor state
trigger1 = root, Pos Y < 0
trigger1 = (root, Time = 19) 
y = RootDist Y/10
persistent = 0

[State 7300, 3]
type = VelSet
trigger1 = RootDist X = [-10, 10]
x = 0
;persistent = 0

[State 7300, 4] ;AIR
type = VelSet
trigger1 = root, StateNo != [3100, 3199]
trigger1 = root, StateNo != 3950 ;Super Armor state
trigger1 = root, Pos Y < 0
trigger1 = RootDist Y = [10, 30]
y = 0
;persistent = 0

[State 7300, 2]
type = PalFX
trigger1 = root, Time = [17, 20] 
add = 60,60,60 ;20,20,95
time = 1

[State 7300, 3]
type = PalFX
trigger1 = root, Time = [21, 23]
add = 100,100,100 ;50,50,155
time = 1

[State 7300, 4]
type = PalFX
trigger1 = root, Time = [24, 27] 
add = 150,150,150 ;80,80,256
time = 1

[State 7300, 5]
type = PalFX
trigger1 = root, Time = [28, 30] 
add = 200,200,200 ;120,120,255
time = 1

[State 7300, 5]
type = PalFX
trigger1 = root, Time = 31 ;[31, 59]
trigger2 = root, StateNo = [3000, 3099]
trigger2 = root, var(59) = [178, 187] ;Time = [178, 187] 
trigger3 = root, StateNo = [3100, 3199] 
trigger3 = root, var(45) = [173, 182]
add = 256,256,256
time = 28 ;1

[State 7300, 5]
type = ChangeState 
trigger1 = root, StateNo = [3000, 3099]
trigger1 = (root, Anim = 3000 && root, AnimElem = 35) || (root, Anim = 53 && root, AnimElem = 1)
trigger2 = root, StateNo = [3100, 3199] 
trigger2 = root, var(45) = 182
trigger3 = root, MoveType = H
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger4 = (root, StateNo = [5000, 5999]) && (root, PrevStateNo = 3950) ;Super Armor state
value = 7301

;---------------------------------------------------------------------------
; Rush - Hyper Megaman / Rush Drill (end)
[Statedef 7301]
type = A
movetype = I
ctrl = 0
;anim = 7021
velset = 0,0 
sprpriority = -4

[State 7301, 1]
type = PosSet
trigger1 = !Time 
x = root, Pos X 

[State 7301, 1] ;AIR
type = PosSet
trigger1 = root, Pos Y < 0
trigger1 = !Time 
y = root, Pos Y

[State 7301, 1]
type = VelSet
trigger1 = !Time 
x = -3*(root,facing)*facing ;by P.O.T.S.   ;-2
;y = -1.5

[State 7301, 1] ;AIR
type = VelSet
trigger1 = root, Pos Y < 0
trigger1 = !Time 
y = -1.5

[State 7301, 1.2] ;AIR
type = VelAdd
trigger1 = root, Pos Y < 0
trigger1 = Time >= 0
y = .44 ;const(movement.yaccel)

[State 7301, 1]
type = VelSet
trigger1 = Time = 20 ;ParentDist X = [60, 50] ;Var(31) = 60*ifelse(Var(32) = Facing,1,1)
x = 0

;[State 7301, 2]
;type = PalFX
;trigger1 = !Time
;add = 256,256,256
;time = 1

[State 7301, 5]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])
trigger1 = root, var(59) = [178, 187] ;Time = [178, 187]  
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [183, 191]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [0, 10]
add = 256,256,256
time = 1

[State 7301, 55]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])
trigger1 = root, var(59) = [188, 190] ;Time = [188, 190] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [192, 194]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [11, 13]
add = 200,200,200 ;120,120,255
time = 1

[State 7301, 4]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099]) 
trigger1 = root, var(59) = [191, 192] ;Time = [191, 192] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [195, 196]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [14, 15]
add = 150,150,150 ;80,80,256
time = 1

[State 7301, 3]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])  
trigger1 = root, var(59) = [193, 195] ;Time = [193, 195]  
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [197, 199]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [16, 18]
add = 100,100,100 ;50,50,155
time = 1

[State 7301, 2]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])  
trigger1 = root, var(59) = [196, 197] ;Time = [196, 197] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [200, 201]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [19, 20]
add = 60,60,60 ;20,20,95
time = 1

[State 7301, 0] ;turn in finish pose
type = Turn
trigger1 = (root, StateNo = [3000, 3099])  
trigger1 = root, Anim = 53
trigger1 = P2Dist X < -5
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, Anim = 3101 || root, Anim = 53
trigger2 = P2Dist X < -5
trigger3 = (root, MoveType = H) ;gethit
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = P2Dist X < -5

[State 7301, 1] ;AIR
type = PosSet
;trigger1 = root, Pos Y < 0
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)    
y = 0

[State 7301, 1]
type = VelSet
trigger1 = root, Pos Y = 0
trigger1 = Time = 16
x = 0

[State 7301, 2]
type = ChangeState 
trigger1 = root, StateNo = [3000, 3099]
trigger1 = root, Anim = 3000
trigger1 = Time = 20 
trigger2 = root, StateNo = [3100, 3199] 
trigger2 = Pos Y >= 0             
trigger2 = Time = 20 
trigger3 = (root, MoveType = H) || (StateNo != [3000, 4999]) ;gethit
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Pos Y >= 0 
trigger3 = Time = 20
value = 7000

[State 7301, 2]
type = ChangeState 
trigger1 = root, StateNo = [3000, 3099] ;AIR
trigger1 = root, Anim = 53              ;AIR
trigger1 = Time >= 1                    ;AIR
trigger2 = root, StateNo = [3100, 3199] ;AIR
trigger2 = Pos Y < 0                    ;AIR
trigger2 = Time >= 1                    ;AIR
trigger3 = (root, MoveType = H) || (StateNo != [3000, 4999]) ;gethit in AIR
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Pos Y < 0
trigger3 = Time >= 1 
value = 7302

;---------------------------------------------------------------------------
; Rush - Hyper Megaman / Rush Drill (In Air) (end) 
[Statedef 7302]
type = A
movetype = I
ctrl = 0
;anim = 7021
;velset = 0,0 
sprpriority = -4

[State 7302, 1.2] ;AIR
type = VelAdd
trigger1 = Pos Y < 0
trigger1 = Time >= 0
y = .44

[State 7302, 5]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])  
trigger1 = root, var(59) = [178, 187] ;Time = [178, 187]  
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [183, 191]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [0, 10]
add = 256,256,256
time = 1

[State 7302, 5]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099])  
trigger1 = root, var(59) = [188, 190] ;Time = [188, 190] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [192, 194]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [11, 13]
add = 200,200,200 ;120,120,255
time = 1

[State 7302, 4]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099]) 
trigger1 = root, var(59) = [191, 192] ;Time = [191, 192] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [195, 196]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [14, 15]
add = 150,150,150 ;80,80,256
time = 1

[State 7302, 3]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099]) 
trigger1 = root, var(59) = [193, 195] ;Time = [193, 195]  
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [197, 199]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [16, 18]
add = 100,100,100 ;50,50,155
time = 1

[State 7302, 2]
type = PalFX
trigger1 = (root, StateNo = [3000, 3099]) 
trigger1 = root, var(59) = [196, 197] ;Time = [196, 197] 
trigger2 = (root, StateNo = [3100, 3199]) 
trigger2 = root, var(45) = [200, 201]
trigger3 = (root, MoveType = H) 
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = Time = [19, 20]
add = 60,60,60 ;20,20,95
time = 1

[State 7302, 0] ;turn in finish pose
type = Turn
trigger1 = root, StateNo = [3000, 3099]
trigger1 = root, Anim = 53
trigger1 = P2Dist X < -5
trigger2 = root, StateNo = [3100, 3199] 
trigger2 = root, Anim = 53
trigger2 = P2Dist X < -5
trigger3 = (root, MoveType = H) ;gethit
trigger3 = root, StateNo != 3950 ;Super Armor state
trigger3 = P2Dist X < -5

[State 7302, 1] ;AIR
type = PosSet
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)    
y = 0

[State 7302, 2]
type = ChangeState 
trigger1 = Vel Y > 0     
trigger1 = Pos Y >= 0    
value = 7000

;---------------------------------------------------------------------------
; Rush - Beat Plane
[Statedef 7320]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 7320
ctrl = 0
sprpriority = -4

[State 7320, 1]
type = PosAdd;Set
trigger1 = AnimElem = 2
x = 48*(root,facing)*facing ;by P.O.T.S. ;floor(root, Pos X)

[State 7320, 2]
type = VelSet
trigger1 = AnimElem = 24
y = -20

[State 7320, 3]
type = ChangeState
trigger1 = root, Time = 221;241
trigger2 = root, MoveType = H
trigger3 = root, StateNo = [5000, 5999]
value = 7321

;---------------------------------------------------------------------------
; Rush - Beat Plane (end)
[Statedef 7321]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 7191
ctrl = 0
sprpriority = -4

[State 7321, 0] ;Rush down
type = PlaySnd
trigger1 = Time = 6
value = 1, 0
channel = 3
supermovetime = 999999

[State 7321, 0] ;turn in finish pose
type = Turn
trigger1 = P2Dist X < -5

[State 7321, 0]
type = PosSet
trigger1 = !Time
trigger1 = root, facing
trigger1 = BackEdgeDist >= 6
x = floor(root, Pos X) -78
y = 0

[State 7321, 0]
type = PosSet
trigger1 = !Time
trigger1 = root, facing = -1 
trigger1 = BackEdgeDist >= 6
x = floor(root, Pos X) +78
y = 0

[State 7321, 0]
type = PosSet
trigger1 = !Time
trigger1 = BackEdgeDist < 6
x = floor(root, Pos X) 
y = 0

[State 7321, 1]
type = Explod
trigger1 = Time = 0 
persistent = 0
anim = 7190
postype = p1
pos = 48,0;*(root,facing)*facing, 0 ;floor(root, Pos X), 0
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -2
ownpal = 0

[State 7321, 1]
type = PalFX
trigger1 = Time = [42, 43] 
add = 255,255,255
time = 1

[State 7321, 2]
type = PalFX
trigger1 = Time = [44, 47] 
add = 255,120,120
time = 1

[State 7321, 3]
type = PalFX
trigger1 = Time = [48, 50] 
add = 256,80,80
time = 1

[State 7321, 4]
type = PalFX
trigger1 = Time = [51, 54] 
add = 155,50,50
time = 1

[State 7321, 5]
type = PalFX
trigger1 = Time = [55, 57] 
add = 95,20,20
time = 1

[State 7321, volta]
type = ChangeState
trigger1 = AnimTime = 0
value = 7000

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush - S.Adaptor MODE
[Statedef 7230]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 7230
ctrl = 0
sprpriority = 9

;[State 7230, vira]
;type = Turn
;trigger1 = ParentDist X <= -20 

[State 7300, 0]
type = VelSet
trigger1 = Time = 10
x = RootDist X/10

[State 7230, 1]
type = VelSet
trigger1 = RootDist X = [-5, 5]
x = 0

[State 7230, 2]
type = VelSet
trigger1 = Time = 10
y = -10

;[State 7230, 2]
;type = VelSet
;trigger1 = Time = 10
;y = -6

[State 7230, 2]
type = VelSet
trigger1 = AnimElem = 4
y = 0

[State 7230, 2]
type = VelSet
trigger1 = AnimElem = 9
y = 2

[State 7230, 2]
type = VelSet
trigger1 = AnimElem = 10
y = 0

[State 7230, 2]
type = PosSet
trigger1 = AnimElem = 10
y = 0

[State 7230, 6] ;rush voice
type = PlaySnd
trigger1 = AnimElem = 3 ;Time = 10
value = 18, 16 ;0, 13

[State 7230, 2]
type = BindToParent
trigger1 = parent, var(33) = 0
pos = 0, 0
time = 1

[State 7230, 2]
type = ChangeState
trigger1 = parent, var(33) = 0
value = 7231

;---------------------------------------------------------------------------
; Rush - Normal Mode
[Statedef 7231]
type = A
movetype = I
ctrl = 0
anim = 7000
velset = 0,0 
sprpriority = -4

;[State 7231, 1]
;type = PosSet
;trigger1 = !Time 
;x = root, Pos X 

[State 7231, 5]
type = PalFX
trigger1 = Time = [0, 10]
add = 256,256,256
time = 10
ignorehitpause = 1
supermovetime = 999999

[State 7231, 5]
type = PalFX
trigger1 = Time = [11, 13]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7231, 4]
type = PalFX
trigger1 = Time = [14, 15]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7231, 3]
type = PalFX
trigger1 = Time = [16, 18]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7231, 2]
type = PalFX
trigger1 = Time = [19, 20]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7231, 1]
type = VelSet
trigger1 = !Time 
x = -3*(root,facing)*facing ;by P.O.T.S. 

[State 7231, 1]
type = VelSet
trigger1 = Time = 20 
x = 0

[State 7231, 2]
type = ChangeState
trigger1 = Vel X = 0
value = 7000

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush - Jet MODE
[Statedef 7240]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 7240
ctrl = 0
sprpriority = -2

[State 7240, 1]
type = ChangeState
trigger1 = AnimTime = 0 ;Time = 5
value = 7241

[State 7240, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

;---------------------------------------------------------------------------
; Rush - Jet MODE - jet
[Statedef 7241]
type    = A
movetype= I
velset = 0,0 
anim = 7241
ctrl = 0
sprpriority = -2

;[State 7241, 0]
;type = PlayerPush
;trigger1 = 1 
;value = 1

;--Super-start------

[State 7241, 0]
type = ChangeAnim
trigger1 = root, var(35) = 1
;trigger1 = root, var(35) != 0
trigger1 = root, var(36) = 15;1
value = 7244

[State 7241, 0]
type = ChangeAnim
trigger1 = Anim = 7244
trigger1 = root, var(35) = 0
value = 7241

[State 7241, 1]
type = PlaySnd
trigger1 = root, var(35) = 1
;trigger1 = root, var(35) != 0
trigger1 = root, var(36) = 15;1
value = 18, 16

[State 7241, 5]
type = PalFX
trigger1 = root, var(35) = 1
trigger1 = root, var(36) = [14, 37]
add = 256,256,256
time = 10
ignorehitpause = 1
supermovetime = 999999

[State 7241, 5]
type = PalFX
trigger1 = root, var(35) = 1
trigger1 = root, var(36) = [38, 40]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7241, 4]
type = PalFX
trigger1 = root, var(35) = 1
trigger1 = root, var(36) = [41, 42]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7241, 3]
type = PalFX
trigger1 = root, var(35) = 1
trigger1 = root, var(36) = [43, 45]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7241, 2]
type = PalFX
trigger1 = root, var(35) = 1
trigger1 = root, var(36) = [46, 47]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999

[State 7241, 1]
type = Helper
trigger1 = root, var(35) = 1
trigger1 = NumHelper(77244) < 1
trigger1 = root, var(36) >= (root, var(36)%2)+58 ;45 ;>= 45 ;(root, var(36)) % 2 > 45
helpertype = normal
name = "Fireball A"
ID = 77244
postype = p1
pos = 50, -2 
;facing = facing
stateno = 7244  
supermovetime = 999999
ownpal = 1

;[State 7241, 1]
;type = Helper
;;trigger1 = NumHelper(77244) <= 3
;trigger1 = root, var(36) >= (root, var(36)%15)+45 ;>= 45 ;(root, var(36)) % 2 > 45
;helpertype = normal
;name = "Fireball B"
;ID = 77244
;postype = p1
;pos = 50, -5
;facing = facing
;stateno = 7245  
;supermovetime = 999999
;ownpal = 1

;[State 7241, 1]
;type = Helper
;;trigger1 = NumHelper(77244) <= 3
;trigger1 = root, var(36) >= (root, var(36)%15)+45 ;>= 45 ;(root, var(36)) % 2 > 45
;helpertype = normal
;name = "Fireball C"
;ID = 77244
;postype = p1
;pos = 50, 5
;facing = facing
;stateno = 7246  
;supermovetime = 999999
;ownpal = 1

[State 7241, super 2]
type = ChangeAnim
trigger1 = root, var(35) = 2
trigger1 = root, var(34) = 0
value = 7247

[State 7241, super 2]
type = PlaySnd
trigger1 = root, var(35) = 2
trigger1 = root, var(34) = 58;47
value = 18, 18

[State 7241, super 2] ;Turbo Fire
type = Explod
trigger1 = NumExplod(7250) < 1
trigger1 = root, var(35) = 2
trigger1 = root, var(34) >= 58;47
persistent = 1
ID = 7250
anim = 7250
postype = p1
pos = -54, -11
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 6
bindtime = -1
ownpal = 1
supermovetime = 999999
ignorehitpause = 1

[State 7241, super 2] ;remove turbo fire
type = RemoveExplod
trigger1 = parent, PrevStateNo = 2001
trigger1 = parent, StateNo != [2001, 2002]
trigger2 = root, Anim != 7251 ;var(34) >= 90
trigger3 = root, movetype = H
ID = 7250

[State 7241, super 2]
type = ChangeAnim
trigger1 = root, var(35) != 2
trigger1 = Anim = 7247
value = 7241

[State 7241, super 3] ;state time add
type = ParentVarAdd
trigger1 = root, StateNo = 2001
trigger1 = root, var(35) = 3
trigger1 = root, Vel X = 0
trigger1 = root, Vel Y = 0
trigger2 = root, StateNo != 2001
trigger2 = root, var(35) = 3
var(36) = 1

[State 7241, super 3]
type = ChangeAnim
trigger1 = root, var(35) = 3
trigger1 = Anim = 7241
trigger1 = root, var(36) = 44;50;60;65
value = 7260

[State 7241, 3.2] ;back fire
type = Explod
trigger1 = NumExplod(7261) < 1
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = root, var(36) >= 46;55;65
ID = 7261
anim = 7261
postype = p1
pos = -5, -45
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 1
;removeongethit = 1

[State 7241, super 3]
type = PlaySnd
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = root, var(36) >= 46
value = 18, 18
persistent = 0

[State 7241, super 3]
type = VelSet
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = root, var(36) >= 48;60;70;75
x = 9
y = 11

;[State 7241, super 3]
;type = VelSet
;trigger1 = root, var(35) = 3
;trigger1 = Anim = 7260
;trigger1 = root, var(36) > 60;75
;trigger1 = Vel Y > 0
;trigger1 = Pos Y >= 0
;x = 0
;y = 0

[State 7241, super 3] ;AIR
type = PosSet
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)    
y = 0

[State 7241, super 3]
type = EnvShake
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)
time = 46
ampl = 3;-2
freq = 70
phase = 30
supermovetime = 1000
ignorehitpause = 1

[State 7241, 2]
type = PlaySnd
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)
value = 30, 5;40, 2
;channel = 2
persistent = 0

[State 7241, super 3]
type = Helper
trigger1 = NumHelper(7263) < 1
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y) 
helpertype = normal
name = "Kamikaze Explosion"
ID = 7263
postype = p1
pos = 0, -3 
stateno = 7251  
ownpal = 1

[State 7241, super 3]
type = ChangeState
trigger1 = root, var(35) = 3
trigger1 = Anim = 7260
trigger1 = Pos Y >= 0
value = 7250

[State 7241, super 3] 
type = ScreenBound
trigger1 = root, var(35) = 3
;trigger1 = root, var(36) = 0 ;&& root, var(36) < 3
trigger1 = root, Anim = 7264
value = 1
movecamera = 0, 0

[State 7241, super 3] 
type = ScreenBound
trigger1 = root, var(35) = 3
;trigger1 = root, var(36) != 0
trigger1 = Anim = 7260
value = 1
movecamera = 1, 1

[State 7241, super 3]
type = Helper
trigger1 = NumHelper(7255) < 1
trigger1 = root, var(35) = 3
trigger1 = root, var(36) = 0
helpertype = normal
name = "Kamikaze Explosion"
ID = 7255
postype = p1
pos = 0, 0 
stateno = 7255  
ownpal = 1

;---Super-end--------

[State 7241, 0]
type = SprPriority
trigger1 = parent, StateNo = 2001
value = 9

[State 7241, 1]
type = SprPriority
trigger1 = parent, StateNo != 2001
value = -2

[State 7241, 1]
type = BindToParent
trigger1 = root, var(35) != 3
trigger1 = parent, StateNo = 2001
trigger2 = root, var(35) = 3
;trigger2 = root, Vel X != 0
;trigger2 = root, Vel Y != 0
trigger2 = parent, StateNo = 2001
trigger2 = root, var(36) < 43;58 
pos = 1, 20
time = 1
;facing = 1

[State 7241, 2]
type = PlaySnd
trigger1 = parent, StateNo = 2001
value = 18, 18
persistent = 0

[State 7241, 0]
type = Turn
trigger1 = root, var(35) != 2 && root, var(35) != 3
;trigger1 = root, P2Dist X < -3;-5
trigger1 = root, facing = 1 && facing = -1
trigger2 = root, var(35) != 2 && root, var(35) != 3
trigger2 = root, facing = -1 && facing = 1

[State 7241, 3.2] ;Rush back (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7241) < 1
ID = 7241
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove rush back (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
trigger5 = Anim = 7244
trigger6 = Anim = 7260
ID = 7241

[State 7241, 3.2] ;Rush back (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7242) < 1
ID = 7242
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove rush back (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
trigger5 = Anim = 7244
trigger6 = Anim = 7260
ID = 7242


[State 7241, 3.2] ;Super Rush back (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7247) < 1
ID = 7247
anim = 7245
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove super rush back (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
trigger5 = Anim = 7241
trigger6 = parent, MoveType = H
trigger7 = Anim = 7260
ID = 7247

[State 7241, 3.2] ;Super Rush back (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7248) < 1
ID = 7248
anim = 7245
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove super rush back (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
trigger5 = Anim = 7241
trigger6 = parent, MoveType = H
trigger7 = Anim = 7260
ID = 7248


[State 7241, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = root, var(35) != 2
trigger1 = facing = 1
trigger1 = NumExplod(7243) < 1
ID = 7243
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = root, var(35) != 2
trigger1 = facing = 1
trigger1 = NumExplod(7244) < 1
ID = 7244
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = Anim = 7241
trigger4 = (parent, StateNo != 2001) 
;trigger5 = parent, MoveType = H
trigger5 = root, var(35) = 2
trigger6 = Anim = 7260
ID = 7243

[State 7241, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = Anim = 7241
trigger4 = (parent, StateNo != 2001) 
;trigger5 = parent, MoveType = H
trigger5 = root, var(35) = 2
trigger6 = Anim = 7260
ID = 7244

[State 7241, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = root, var(35) != 2
trigger1 = facing = -1
trigger1 = NumExplod(7245) < 1
ID = 7245
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = root, var(35) != 2
trigger1 = facing = -1
trigger1 = NumExplod(7246) < 1
ID = 7246
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
;removeongethit = 1

[State 7241, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = Anim = 7241
trigger4 = (parent, StateNo != 2001) 
;trigger5 = parent, MoveType = H
trigger5 = root, var(35) = 2
trigger6 = Anim = 7260
ID = 7245

[State 7241, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = Anim = 7241
trigger4 = (parent, StateNo != 2001) 
;trigger5 = parent, MoveType = H
trigger5 = root, var(35) = 2
trigger6 = Anim = 7260
ID = 7246

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

[State 7241, 2]
type = ChangeAnim
triggerall = Pos Y >= 0
trigger1 = parent, StateNo != 2001
trigger1 = Time = 500
trigger2 = parent, StateNo != [2001, 2004]
trigger2 = command = "normal_mode"
trigger3 = RoundState != 2
trigger3 = Anim != 7240
value = 7240

[State 7241, 6] ;rush voice
type = PlaySnd
trigger1 = Time = 7
value = 0, 13

[State 7241, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7241, 2]
type = ChangeState
trigger1 = root, var(35) != 3
trigger1 = parent, PrevStateNo = 2001
trigger1 = parent, StateNo != 2001
trigger2 = root, MoveType = H
trigger2 = root, PrevStateNo = 2001 || root, StateNo != [5000, 5999]
trigger2 = root, StateNo != [120, 155] ;in Guard bug fix
trigger3 = numenemy < 1 || RoundState = 4
value = 7242;7301

[State 7241, 2]
type = ChangeState
trigger1 = Anim = 7240
trigger1 = AnimTime = 0
value = 7000

;---------------------------------------------------------------------------
; Rush - Jet Rush MODE (end)
[Statedef 7242]
type = A
movetype = I
ctrl = 0
;anim = 7021
velset = 0,0 
sprpriority = -4

[State 7242, 0]
type = PlayerPush
trigger1 = !Time
value = 0

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

[State 7242, 10] ;remove super rush back (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7247

[State 7242, 10] ;remove super rush back (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7248

[State 7242, 3.2] ;Rush back (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7241) < 1
ID = 7241
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 10] ;remove rush back (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
ID = 7241

[State 7242, 3.2] ;Rush back (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7242) < 1
ID = 7242
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 10] ;remove rush back (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
ID = 7242

[State 7242, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7243) < 1
ID = 7243
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7244) < 1
ID = 7244
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;trigger4 = Anim = 7241
;trigger4 = (parent, StateNo != 2001) 
;trigger4 = parent, MoveType = H
ID = 7243

[State 7242, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;trigger4 = Anim = 7241
;trigger4 = (parent, StateNo != 2001) 
;trigger4 = parent, MoveType = H
ID = 7244

[State 7242, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7245) < 1
ID = 7245
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7246) < 1
ID = 7246
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
ignorehitpause = 1
;removeongethit = 1

[State 7242, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;trigger4 = Anim = 7241
;trigger4 = (parent, StateNo != 2001) 
;trigger4 = parent, MoveType = H
ID = 7245

[State 7242, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;trigger4 = Anim = 7241
;trigger4 = (parent, StateNo != 2001) 
;trigger4 = parent, MoveType = H
ID = 7246

[State 7242, 1]
type = PosSet
trigger1 = !Time 
x = root, Pos X 

[State 7242, 1] ;AIR
type = PosSet
trigger1 = root, Pos Y < 0
trigger1 = !Time 
y = root, Pos Y

[State 7242, 1]
type = VelSet
trigger1 = !Time 
x = -3*(root,facing)*facing ;by P.O.T.S.   ;-2
;y = -1.5

[State 7242, 1] ;AIR
type = VelSet
trigger1 = root, Pos Y < 0
trigger1 = !Time 
y = -1.5

[State 7242, 1.2] ;AIR
type = VelAdd
trigger1 = root, Pos Y < 0
trigger1 = Time >= 0
y = .44 ;const(movement.yaccel)

[State 7242, 1]
type = VelSet
trigger1 = Time = 20 ;ParentDist X = [60, 50] ;Var(31) = 60*ifelse(Var(32) = Facing,1,1)
x = 0

[State 7242, 0] ;turn in finish pose
type = Turn
trigger1 = P2Dist X < -5

[State 7242, 1] ;AIR
type = PosSet
;trigger1 = root, Pos Y < 0
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)    
y = 0

[State 7242, 1]
type = VelSet
trigger1 = root, Pos Y = 0
trigger1 = Time = 16
x = 0

[State 7242, 2]
type = ChangeState 
trigger1 = Pos Y >= 0 
trigger1 = Time = 20
value = 7000

[State 7242, 2]
type = ChangeState 
trigger1 = Pos Y < 0
trigger1 = Time >= 1 
value = 7243

;---------------------------------------------------------------------------
; Rush - Jet Rush Mode (In Air) (end) 
[Statedef 7243]
type = A
movetype = I
ctrl = 0
;anim = 7021
;velset = 0,0 
sprpriority = -4

[State 7243, 0]
type = PlayerPush
trigger1 = !Time 
value = 0

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

[State 7243, 10] ;remove super rush back (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7247

[State 7243, 10] ;remove super rush back (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7248

[State 7243, 3.2] ;Rush back (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7241) < 1
ID = 7241
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 10] ;remove rush back (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
;trigger5 = !Alive
ID = 7241

[State 7243, 3.2] ;Rush back (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7242) < 1
ID = 7242
anim = 7242
postype = p1
pos = 0, 0
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3;ifelse((root, StateNo != 2001), 3, -3)
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 10] ;remove rush back (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
trigger4 = parent, PrevStateNo != 6028
trigger4 = parent, StateNo = 6028
;trigger5 = !Alive
ID = 7242

[State 7243, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7243) < 1
ID = 7243
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 3.2] ;jet fire (facing = 1)
type = Explod
trigger1 = facing = 1
trigger1 = NumExplod(7244) < 1
ID = 7244
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;;trigger4 = Anim = 7241
;;trigger4 = (parent, StateNo != 2001) 
;;trigger4 = parent, MoveType = H
;trigger4 = !Alive
ID = 7243

[State 7243, 10] ;remove jet fire (facing = 1)
type = RemoveExplod
trigger1 = facing = -1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;;trigger4 = Anim = 7241
;;trigger4 = (parent, StateNo != 2001) 
;;trigger4 = parent, MoveType = H
;trigger4 = !Alive
ID = 7244

[State 7243, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7245) < 1
ID = 7245
anim = 7243
postype = p1
pos = -30, -6
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 3.2] ;jet fire (facing = -1)
type = Explod
trigger1 = facing = -1
trigger1 = NumExplod(7246) < 1
ID = 7246
anim = 7243
postype = p1
pos = -29, -20
;facing = 1
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -3
supermovetime = 999999
bindtime = -1
ownpal = 0
removeongethit = 1

[State 7243, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;;trigger4 = Anim = 7241
;;trigger4 = (parent, StateNo != 2001) 
;;trigger4 = parent, MoveType = H
;trigger4 = !Alive
ID = 7245

[State 7243, 10] ;remove jet fire (facing = -1)
type = RemoveExplod
trigger1 = facing = 1
trigger2 = parent, PrevStateNo = 2001
trigger2 = parent, StateNo != [2001, 2002]
trigger3 = Anim = 7240
;;trigger4 = Anim = 7241
;;trigger4 = (parent, StateNo != 2001) 
;;trigger4 = parent, MoveType = H
;trigger4 = !Alive
ID = 7246

[State 7243, 1.2] ;AIR
type = VelAdd
trigger1 = Pos Y < 0
trigger1 = Time >= 0
y = .44

[State 7243, 0] ;turn in finish pose
type = Turn
trigger1 = P2Dist X < -5

[State 7243, 1] ;AIR
type = PosSet
trigger1 = Vel Y > 0                
trigger1 = Pos Y >= -ceil(vel y)    
y = 0

[State 7243, 2]
type = ChangeState
trigger1 = Vel Y > 0     
trigger1 = Pos Y >= 0    
value = 7000

;---------------------------------------------------------------------------
; Jet Rush Super Fireball A: Helper
[Statedef 7244]
type    = A
movetype= A
anim = 7246
sprpriority = 10

[State 7244, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 7244, 1]
type = Helper
trigger1 = !Time
helpertype = normal
name = "Fireball B"
ID = 77245
postype = p1
pos = 0, -5
;facing = facing
stateno = 7245  
supermovetime = 999999
ownpal = 1

[State 7244, 1]
type = Helper
trigger1 = !Time
helpertype = normal
name = "Fireball C"
ID = 77246
postype = p1
pos = 0, 5
;facing = facing
stateno = 7246  
supermovetime = 999999
ownpal = 1

[State 7244, 23]
type = PlaySnd
trigger1 = !Time
value = 20, 3

[state 7244, 1]
type = VelSet
trigger1 = Time > 0
x = 10

[State 7244, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(12/(1+(root,Var(19)/5.0))), 4
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5 ;8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
;fall = 0
;air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 7244, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(13/(1+(root,Var(19)/5.0))), 5
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5 ;8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
;fall = 0
;air.fall = 1

[State 7244, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 7244, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 7247
time = -1

[State 7244, 8]
type = ChangeState
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 7247
ignorehitpause = 1

[State 7244, 8]
type = ChangeState
trigger1 = MoveContact
value = 7248
ignorehitpause = 1

;---------------------------------------------------------------------------
; Jet Rush Super Fireball B: Helper
[Statedef 7245]
type    = A
movetype= A
anim = 7246
sprpriority = 10

[State 7245, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 7245, 1]
type = VelSet
trigger1 = Time > 0
x = 10
y = -5

[State 7245, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(12/(1+(root,Var(19)/5.0))), 4 ;15,6
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5;8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
;fall = 0
;air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 7245, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(13/(1+(root,Var(19)/5.0))), 5 ;16,7
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5;8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
;fall = 0
;air.fall = 1

[State 7245, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 7245, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 7247
time = -1

[State 7245, 8]
type = ChangeState
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 7247
ignorehitpause = 1

[State 7245, 8]
type = ChangeState
trigger1 = MoveContact
value = 7248
ignorehitpause = 1

;---------------------------------------------------------------------------
; Jet Rush Super Fireball C: Helper
[Statedef 7246]
type    = A
movetype= A
anim = 7246
sprpriority = 10

[State 7246, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[state 7246, 1]
type = VelSet
trigger1 = Time > 0
x = 10
y = 5

[State 7246, 2]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X > 80
attr = A, HP                     
damage = floor(12/(1+(root,Var(19)/5.0))), 4
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5;8 ;8, 8 ;2, 2   
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270 
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 15
ground.hittime  = 25             
ground.velocity = -3
airguard.velocity = -1     
air.type = Low                 
air.velocity = -2, 0 ;ifelse((parent, StateType = A), (-7, 8), (-2, -2))           
air.hittime = 25       
;fall = 0
;air.fall = 1 ;ifelse((parent, StateType = A), 1, 0)

[State 7246, 3]
type = HitDef
trigger1 = Time = 0 && P2BodyDist X <= 80
attr = A, HP                     
damage = floor(13/(1+(root,Var(19)/5.0))), 5
animtype = Medium                 
guardflag = MA                  
hitflag = MAF                  
priority = 6, Hit               
sprpriority = 3
pausetime = 0, 0;5;8 ;8, 8 ;3, 3 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8270
sparkxy = 0, -20              
hitsound = S15, 1                  
guardsound = S16, 0                
ground.type = Low               
ground.slidetime = 20
ground.hittime  = 25             
ground.velocity = -4
airguard.velocity = -5
air.type = Low                 
air.velocity = -3, 0 ;ifelse((parent, StateType = A), (-8, 8), (-3, -4))           
air.hittime = 25   
;fall = 0
;air.fall = 1

[State 7246, 6]
type = HitBy
trigger1 = 1
value = SCA, NP,SP,HP

[State 7246, 7]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
stateno = 7247
time = -1

[State 7246, 8]
type = ChangeState
trigger1 = BackEdgeDist < -105 || FrontEdgeDist < -105 
value = 7247
ignorehitpause = 1

[State 7246, 8]
type = ChangeState
trigger1 = MoveContact 
value = 7248
ignorehitpause = 1


;---------------------------------------------------------------------------
; Jet Rush Super Fireball: Helper (end)
[Statedef 7247]
type = A
movetype = I
ctrl = 0
anim = 7280
velset = 0, 0
sprpriority = 3

[State 7247, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 7247, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Jet Rush Super Fireball: Helper (end)
[Statedef 7248]
type = A
movetype = I
ctrl = 0
anim = 7281
velset = 0, 0
sprpriority = 3

[State 7248, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 7248, 1]
type = DestroySelf
trigger1 = AnimTime = 0


;---------------------------------------------------------------------------
; Rush - Broken
[Statedef 7250]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 7262
ctrl = 0
sprpriority = -4

[State 1617, 2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 300  
anim = 8040  
postype = p1
pos = 0, 0
velocity = 0, -.5
accel = 0, 0
random = 80, 20
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1617, 2]
type = Explod
trigger1 = Time % 4 = 0 && Time < 110  
anim = 8041  
postype = p1
pos = 0, 0
velocity = 0, -1.6
accel = 0, -.1
random = 90, 15
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1617, 2]
type = Explod
trigger1 = Time = 350  
trigger2 = Time = 400
trigger3 = Time = 450
trigger4 = Time = 500
trigger5 = Time = 550
trigger6 = Time = 600
trigger7 = Time = 650
trigger8 = Time = 700
trigger9 = Time = 800
trigger10 = Time = 970
trigger11 = Time = 1300
anim = 8040  
postype = p1
pos = 0, -5
velocity = 0, -.3
accel = 0, 0
random = 80, 20
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 1617, 2]
type = Explod
trigger1 = Time = 300
trigger2 = Time = 450  
trigger3 = Time = 610
anim = 8041  
postype = p1
pos = 0, -10
velocity = 0, -.6
accel = 0, 0
random = 80, 10
removetime = -2
ownpal = 1
sprpriority = 6
shadow = -1,0,0
trans = addalpha
alpha = 256, 256

[State 7250, 0.0] 
type = ScreenBound
trigger1 = !Time
value = 1

[State 7250, 0] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7241

[State 7250, 1] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7242

[State 7250, 2] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7243

[State 7250, 3] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7244

[State 7250, 4] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7245

[State 7250, 5] ;remove explods
type = RemoveExplod
trigger1 = !Time
ID = 7246

[State 7250, 10] ;remove super rush back (facing = 1)
type = RemoveExplod
trigger1 = !Time
ID = 7247

[State 7250, 10] ;remove super rush back (facing = -1)
type = RemoveExplod
trigger1 = !Time
ID = 7248

[State 7250, 5] ;back fire explod
type = RemoveExplod
trigger1 = !Time
ID = 7261

;---------------------------------------------------------------------------
; Kamikaze Explosion: Helper
[Statedef 7251]
type    = A
movetype= A
anim = 7263
sprpriority = 10

[State 7251, 0]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

;[State 7251, 2]
;type = HitDef
;trigger1 = Time % 2 = 0 && Time <= 21
;attr = A, HP                     
;damage = 25, 5                 
;animtype = Heavy                 
;guardflag = MA                  
;hitflag = MAFP                  
;priority = 6, Hit               
;sprpriority = 6
;pausetime = 0, 2
;guard.sparkno = S8200
;sparkno = S8271
;sparkxy = 0,0 
;hitsound = S20, 0;15, 5                  
;guardsound = S16, 0                
;ground.type = Low               
;ground.slidetime = 50;57
;ground.hittime  = 60             
;ground.velocity = -5
;airguard.velocity = -1     
;air.type = Low                  
;air.velocity = -5, -1           
;air.hittime = 60
;fall = 1
;air.fall = 1

[State 7251, 3]
type = HitDef
trigger1 = !Time ;> 21
attr = A, HP                     
damage = 450, 40                 
animtype = Up;Heavy                 
guardflag = MA                  
hitflag = MAFPD                  
priority = 7, Hit               
sprpriority = 6
pausetime = 0, 12 
guard.sparkno = s8301 ;S8200              
sparkno = s8330+(random%8) ;S8271                      
sparkxy = 0, 0              
hitsound = S15, 5 ;S20, 0      
guardsound = S16, 0                
ground.type = High               
ground.slidetime = 50
ground.hittime  = 60             
ground.velocity = -28, -27
airguard.velocity = -5
air.type = High                  
air.velocity = -27, -28           
air.hittime = 60
fall = 1
air.fall = 1
yaccel = .7

[State 7251, 6]
type = NotHitBy
trigger1 = 1
value = SCA;, NP,SP,HP

;[State 7251, 7]
;type = HitOverride
;trigger1 = 1
;attr = SCA, AA,AT,AP,NA,NP,SP,HP,NT,HT
;stateno = 7252
;time = -1

;[State 7251, 8]
;type = ChangeState
;trigger1 = AnimTime = 0 ;MoveContact || BackEdgeDist < -105 || FrontEdgeDist < -105 
;value = 7252
;ignorehitpause = 1

[State 7251, 1]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Rush Camera Manipulation: Helper 
[Statedef 7255]
type = A
movetype = I
ctrl = 0
anim = 8930;7260
velset = 0, 0
sprpriority = 3

[State 7255, super 3] 
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 1, 1

[State 7255, 1]
type = DestroySelf
;trigger1 = var(35) != 3
trigger1 = parent, Anim = 7260
trigger2 = root, StateNo != 2001

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush - Coil MODE - stand
[Statedef 7260]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 7270
ctrl = 0
sprpriority = -2

[State 7260, Jet Rush]
type = ChangeState
trigger1 = root, PrevStateNo != 2000
trigger1 = root, StateNo = 2000
value = 7240

[State 7260, S.Adaptor]
type = ChangeState
trigger1 = parent, PrevStateNo != 6028
trigger1 = parent, StateNo = 6028
value = 7230

[State 7260, normal]
type = ChangeState
;trigger1 = command = "normal_mode"
trigger1 = root, PrevStateNo != 2105
trigger1 = root, StateNo = 2105
trigger2 = RoundState != 2
value = 7000

[State 7260, 0]
type = ChangeState
trigger1 = root, StateNo != [3000, 3999] ;Supers
trigger1 = Helper(7000), RootDist X = [-30, 28] ;[-30, 40]
trigger1 = Helper(7000), RootDist Y = [-35, 55] ;[-10, 55]
trigger1 = root, Vel Y > 0
value = 7261

;---------------------------------------------------------------------------
; Rush - Coil MODE - coil active
[Statedef 7261]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 7271
ctrl = 0
sprpriority = -2

;[State 7261, 0] ;closing back
;type = PlaySnd
;trigger1 = AnimTime = 0
;value = 18, 15

[State 7261, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 7260

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Rush - S.Adaptor MODE (start of the round)
[Statedef 7900]
type    = S
movetype= I
physics = N
velset = 0,0 
anim = 8930
ctrl = 0
sprpriority = 9

[State 7900, 2]
type = BindToParent
trigger1 = parent, var(33) = 0
pos = 0, 0
time = 1

[State 7900, 2]
type = ChangeState
trigger1 = parent, var(33) = 0
value = 7231




;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

;[State 0, Turn]
;type = ChangeAnim
;trigger1 = var(33) = 1
;trigger1 = Anim = 5
;;trigger1 = Time = 0
;value = 6003

[State 0, 1]
type = ChangeAnim
triggerall = var(33) = 0
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[State 0, 1.2]
type = ChangeAnim
triggerall = var(33) = 1
trigger1 = Anim != 6002 && Anim != 6003
trigger2 = Anim = 6003 && AnimTime = 0 ;Turn anim over
value = 6002

[State 0, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 0, 3] ;Stop moving if low velocity or 4 ticks pass
type = VelSet
trigger1 = abs(vel x) < 2
trigger2 = Time = 4
x = 0


;---------------------------------------------------------------------------
; Stand to Crouch
[Statedef 10]
type    = C
physics = C
anim = ifelse(var(33) = 1, 6005, 10)

[State 10, 1]
type = PosSet
trigger1 = Time = 0
y = 0

[State 10, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 10, 3]
type = VelMul
trigger1 = Time = 0
x = .75

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

;---------------------------------------------------------------------------
; Crouching
[Statedef 11]
type    = C
physics = C
anim = ifelse(var(33) = 1, 6006, 11)
sprpriority = 0

;[State 11, Turn Crouch]
;type = ChangeAnim
;trigger1 = var(33) = 1
;trigger1 = Anim = 6
;;trigger1 = Time = 0
;value = 6004

[State 11, 1] ;Change from turning animation
type = ChangeAnim
triggerall = var(33) = 0
trigger1 = Anim = 6 && AnimTime = 0
value = 11

[State 11, 1.2] ;Change from turning animation
type = ChangeAnim
triggerall = var(33) = 1
trigger1 = Anim = 6004 && AnimTime = 0
value = 6006

;---------------------------------------------------------------------------
; Crouch to Stand
[Statedef 12]
type    = S
physics = S
anim = ifelse(var(33) = 1, 6007, 12)

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


;---------------------------------------------------------------------------
; Walk
[Statedef 20]
type    = S
physics = S
sprpriority = 0

[State 20, 1]
type = VelSet
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)

[State 20, 2]
type = VelSet
trigger1 = command = "holdback"
x = const(velocity.walk.back.x)

[State 20, 3]
type = ChangeAnim
triggerall = var(33) = 0
triggerall = vel x > 0
trigger1 = Anim != 20 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 20

[State 20, 4]
type = ChangeAnim
triggerall = var(33) = 0
triggerall = vel x < 0
trigger1 = Anim != 21 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0
value = 21

[State 20, 3.2]
type = ChangeAnim
triggerall = var(33) = 1
triggerall = vel x > 0
trigger1 = Anim != 6008 && Anim != 6003
trigger2 = Anim = 6003 && AnimTime = 0
value = 6008

[State 20, 4.2]
type = ChangeAnim
triggerall = var(33) = 1
triggerall = vel x < 0
trigger1 = Anim != 6009 && Anim != 6003
trigger2 = Anim = 6003 && AnimTime = 0
value = 6009


;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = ifelse(var(33) = 1, 6010, 40)
ctrl = 0
sprpriority = 1

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

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

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

[State 40, 4]
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, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

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


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; AirJump Start (Wall Jump) - (by VIB)
[Statedef 70];45
type    = A
physics = N
ctrl = 0
anim = ifelse(var(33) = 1, 6025, 110)
;facep2 = 1

;[State 70, 6]
;type = VelSet
;trigger1 = !Time
;trigger1 = FrontEdgeDist < 16 ;30
;x = -const(velocity.airjump.fwd.x)
;y = 0 ;2

[State 70, 6]
type = VelMul
trigger1 = !Time
y = .01

[State 70, vira]
type = Turn
triggerall = FrontEdgeBodyDist < 6
trigger1 = !Time
trigger1 = p2dist x < 10 ;0

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

[State 70, 4]
type = VarSet
trigger1 = time = 1
trigger1 = command = "holdfwd"
trigger1 = command != "holdback"
sysvar(1) = 1

[State 70, 5]
type = VarSet
trigger1 = time = 1
trigger1 = command = "holdback"
trigger1 = command != "holdfwd"
sysvar(1) = -1

[State 70, Snd]
type = PlaySnd
trigger1 = !AnimTime
value = 17,0

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

[State 70, 7]
type = ChangeState
trigger1 = !AnimTime
value = 50
ctrl = 1


;---------------------------------------------------------------------------
; Jump Up
[Statedef 50]
type    = A
physics = A

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

[State 50, 2]
type = ChangeAnim
trigger1 = PrevStateNo != 45
trigger1 = var(33) = 0
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 2.2]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
value = ifelse((vel x)=0, 6011, ifelse((vel x)>0, 6012, 6013))

[State 50, 3]
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

;[State 50, 4] ;S.Adapt Mode - Special Jump
;type = ChangeState
;trigger1 = var(33) = 1
;trigger1 = Time > 20 
;trigger1 = command = "holdup"
;value = 70
;ctrl = 1



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = ifelse(var(33) = 1, 6014, 47)

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

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

[State 52, 3]
type = CtrlSet
trigger1 = PrevStateNo != 3200
trigger1 = Time = 3
trigger2 = PrevStateNo = 3200
trigger2 = enemy, Alive
value = 1

[State 52, 4]
type = Turn
triggerall = P2Dist X < -5 ;P2BodyDist X < 0
trigger1 = Command = "holdup" || Command = "holddown" 
;trigger3 = Command = "holdfwd" || Command = "holdback" 
trigger2 = Command = "holdup" && Command = "holdfwd" || Command = "holdback"

[State 52, 5]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = AnimElem = 2 && Command = "holddown"
value = ifelse(Command = "holddown", 11, 0);0
ctrl = 1



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Jump Fall (after a move)
[Statedef 53]
type    = A
physics = A
anim = ifelse(var(33) = 1, 6015, 53)

[state 53, 1]
type = VelAdd
triggerall = PrevStateno != 60
trigger1 = Time = 0
y = -0.08;-0.05



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Special Jump Start (Air Jump)
[Statedef 45];70
type    = A
physics = N
;anim = ifelse(var(33) = 1, 6142, Anim)
ctrl = 0
sprpriority = 1

[State 45, 0.0]
type = ChangeState
trigger1 = var(33) = 0
trigger1 = !Time
value = 50
ctrl = 1

[State 45, 0.0]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = !Time
value = 6142

[State 45, 0] ;back fire 1
type = Explod
trigger1 = var(33) = 1
trigger1 = NumExplod(6142) < 1
trigger1 = !Time 
ID = 6142
anim = 6143
postype = p1
pos = 4, -52
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1

[State 45, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = Time > 20 ;AnimElem > 1
trigger2 = MoveType = H
ID = 6142

[State 45, 0.2] ;back fire 2
type = Explod
trigger1 = var(33) = 1
trigger1 = NumExplod(6143) < 1
trigger1 = !Time 
ID = 6143
anim = 6143
postype = p1
pos = -24, -52
velocity = 0, 0
accel = 0, 0
removetime = -1
sprpriority = -2
bindtime = -1
ownpal = 1
removeongethit = 1

[State 45, 0.3] ;back fire 2
type = RemoveExplod
trigger1 = Time > 20 ;AnimElem > 1
trigger2 = MoveType = H
ID = 6143

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

[State 45, 2]
type = VarSet
trigger1 = var(33) = 1
trigger1 = command = "holdfwd"
sysvar(1) = 1

[State 45, 3]
type = VarSet
trigger1 = var(33) = 1
trigger1 = command = "holdback"
sysvar(1) = -1

;[State 45, 4]
;type = VelSet
;trigger1 = Time = 3 ;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 45, 5]
;type = VelSet
;trigger1 = Time = 3 ;AnimTime = 0
;trigger1 = prevstateno = 100 ;RUN_FWD
;trigger1 = sysvar(1) = 1
;x = const(velocity.runjump.fwd.x)

[State 45, Snd]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = Time = 3 ;!AnimTime
value = 18,25

[State 45, 6]
type = VelSet
trigger1 = var(33) = 1
trigger1 = Time = 3 ;!AnimTime
x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
y = const(velocity.airjump.y)

[State 45, 7]
type = ChangeState
trigger1 = Time = 3 ;AnimTime = 0
value = 46
ctrl = 1



;---------------------------------------------------------------------------
; Special Jump Up
[Statedef 46]
type    = A
physics = A

[State 46, 0.1] ;back fire 1
type = RemoveExplod
trigger1 = Time > 20 ;AnimElem != 1
trigger2 = MoveType = H
ID = 6142

[State 46, 0.2] ;back fire 2
type = RemoveExplod
trigger1 = Time > 20 ;AnimElem != 1
trigger2 = MoveType = H
ID = 6143

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

;[State 46, 2]
;type = ChangeAnim
;trigger1 = var(33) = 0
;trigger1 = Time = 0
;value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

;[State 46, 2.2]
;type = ChangeAnim
;;trigger1 = var(33) = 1
;trigger1 = Time = 0
;value = 6142

[State 46, 3]
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hop Forward (start)
[Statedef 100]
type    = A
physics = N
ctrl = 0
anim = ifelse(var(33) = 1, 6016, 100)
sprpriority = 1

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

[state 100, 2]
type = VelAdd
trigger1 = Time >= 1
y = .47

[State 100, 3] 
type = VarRandom
trigger1 = 1
v = 6
range = 4

[State 100, 4]
type = Explod
trigger1 = Time % 2 = 0 
anim = 8100 + var(6) 
postype = p1
pos = -30, -40
velocity = -3, 0
accel = 0, 0
random = 35, 55;75
removetime = -2
sprpriority = 3
ownpal = 1

[State 100, 5]
type = Explod
trigger1 = Time % 4 = 0 
anim = 8104 
postype = p1
pos = -30, -40
velocity = -5, 0
accel = 0, 0
random = 25, 50;70
removetime = -2
sprpriority = 3
ownpal = 1

[State 100, 6] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

;[State 100, 7]
;type = PlaySnd
;trigger1 = Time = 1
;value = 1,1 ;3, 0

[State 100, 8] ;by Hsieh
type = PosSet
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
trigger7 = command = "holdup"
trigger8 = command = "holddown"
y = 0

[State 100, 9] ;cancel with light punch
type = ChangeState
trigger1 = Command = "x"
value = 200

[State 100, 10] ;cancel with medium punch
type = ChangeState
trigger1 = Command = "y"
value = 210

[State 100, 11] ;cancel with strong punch
type = ChangeState
trigger1 = Command = "z"
value = 220

[State 100, 12] ;cancel with light kick
type = ChangeState
trigger1 = Command = "a"
value = 230

[State 100, 13] ;cancel with medium kick
type = ChangeState
trigger1 = Command = "b"
value = 240

[State 100, 14] ;cancel with strong kick
type = ChangeState
trigger1 = Command = "c"
value = 250

[State 100, 25] ;cancel with jumping
type = ChangeState
trigger1 = Command = "holdup"
value = 40
ctrl = 1

[State 100, 16] ;cancel with crouching
type = ChangeState
trigger1 = Command = "holddown"
value = 10
ctrl = 1

[State 100, 17]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 101

;---------------------------------------------------------------------------
; Hop Forward (land) 
[Statedef 101]
type    = S
physics = S
ctrl = 0
anim = ifelse(var(33) = 1, 6017, 101)

[State 101, 0]
type = VelSet
trigger1 = Time = 0
x = Vel X + 1

[State 101, 1] ;brake 
type = VelMul
trigger1 = Time = 9 ;AnimElem = 2;1
x = .01

[State 101, 2]
type = VelSet
trigger1 = Time = 0
y = 0

[State 101, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 101, 4]
type = MakeDust
trigger1 = Time = 2
pos = -5,-2
spacing = 1

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Hop Backward (start)
[Statedef 105]
type    = A
physics = N
ctrl = 0
anim = ifelse(var(33) = 1, 6018, 105)
sprpriority = 1

[State 105, 1]
type = VelSet
trigger1 = Time = 0
x = const(velocity.run.back.x)
y = const(velocity.run.back.y)

[state 105, 2]
type = VelAdd
trigger1 = Time >= 1
y = .48

[State 105, 3] 
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

;[State 105, 4]
;type = PlaySnd
;trigger1 = Time = 1
;value = 1, 0 ;3, 1

[State 105, 5] ;by Hsieh
type = PosSet
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
trigger7 = command = "holdup"
trigger8 = command = "holddown"
y = 0

[State 105, 6] ;cancel with light punch
type = ChangeState
trigger1 = Command = "x"
value = 200

[State 105, 7] ;cancel with medium punch
type = ChangeState
trigger1 = Command = "y"
value = 210

[State 105, 8] ;cancel with strong punch
type = ChangeState
trigger1 = Command = "z"
value = 220

[State 105, 9] ;cancel with light kick
type = ChangeState
trigger1 = Command = "a"
value = 230

[State 105, 10] ;cancel with medium kick
type = ChangeState
trigger1 = Command = "b"
value = 240

[State 105, 11] ;cancel with strong kick
type = ChangeState
trigger1 = Command = "c"
value = 250

[State 105, 12] ;cancel with jumping
type = ChangeState
trigger1 = Command = "holdup"
value = 40
ctrl = 1

[State 105, 13] ;cancel with crouching
type = ChangeState
trigger1 = Command = "holddown"
value = 10
ctrl = 1

[State 105, 14]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 106

;---------------------------------------------------------------------------
; Hop Backward (land) 
[Statedef 106]
type    = S
physics = S
ctrl = 0
anim = ifelse(var(33) = 1, 6019, 106)

[State 106, 1] ;brake 
type = VelMul
trigger1 = Time = 9 ;AnimElem = 1
x = .01

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

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

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

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



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Super Jump (start)
[Statedef 60]
type    = S
physics = S
anim = ifelse(var(33) = 1, 6010, 40)
ctrl = 0
sprpriority = 1

[State 60, VelAdd]; by GGN
type = VelAdd
triggerall = Vel X >= -2
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.1

[State 60, VelAdd]; by GGN
type = VelAdd
triggerall = Vel X <= 2.5
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
x = 0.25

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

[State 60, 2]
type = VarSet
trigger1 = command = "holdfwd"
sysvar(1) = 1

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

[State 60, 4]
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 60, 5] ;Super Jump Dust
type = Explod
trigger1 = Time = 2 
persistent = 0
anim = 8010
postype = p1
pos = 0, 5
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 60, 6]
type = PlaySnd
trigger1 = Time = 1
value = 17, 1

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

;---------------------------------------------------------------------------
; Super Jump (up)
[Statedef 61]
type    = A
physics = A
anim = ifelse(var(33) = 1, 6026, 60) ;ifelse((Vel X) = 0, 60, ifelse((Vel X) > 0, 61, 62));60
ctrl = 1

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

[state 61, 2]
type = VelSet
trigger1 = Time = 0
y = -15

[state 61, 3]
type = VelAdd
trigger1 = Time = 1
y = -.985 ;.105 ;.102

[State 61, 4]
type = VelAdd
trigger1 = Time >= 5 
trigger1 = Command = "holdback" 
trigger1 = Vel X > -1.8
x = -0.18

[State 61, 5]
type = VelAdd
trigger1 = Time >= 5 
trigger1 = Command = "holdfwd" 
trigger1 = Vel X < 1.8
x = 0.74 ;0.18

[State 61, 6]
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 8040  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1

[State 61, 7] 
type = VarRandom
trigger1 = 1
v = 7
range = 2

[State 61, 8]
type = Explod
trigger1 = Time % 4 = 0 && Time > 16 && Time < 34
anim = 8110 + var(7) 
postype = p1
pos = 0, -12
velocity = 0, 0
accel = 0, 0
random = 75, 15
removetime = -2
ownpal = 1

[State 61, 9]
type = Explod
trigger1 = Time % 6 = 0 && Time > 22 && Time < 34
anim = 8112  
postype = p1
pos = 0, -10
velocity = 0, 0
accel = 0, 0
random = 40, 15
removetime = -2
ownpal = 1

[state 61, 10]
type = VelAdd
trigger1 = AnimElem = 15
y = 0.05

[State 61, Variavelzinha muito útil]; from GGN's Ryu (by Soldats)
type = VarSet
trigger1 = Time = 0
v = 12
value = 1

[State 61, 11]
type = Turn
trigger1 = P2Dist X < -5 ;0

;[State 61, 6]
;type = VelSet
;trigger1 = var(33) = 1
;trigger1 = !AnimTime
;x = ifelse(sysvar(1)=0, const(velocity.airjump.neu.x), ifelse(sysvar(1)=1, const(velocity.airjump.fwd.x), const(velocity.airjump.back.x)))
;y = const(velocity.airjump.y)



;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; GUARD (start)
[Statedef 120]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged

[State 120, 1]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(var(33) = 1, 6035, 120) + (statetype = C) + (statetype = A)*2

[State 120, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 120, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 120, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 120, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 120, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 120, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 130 + (statetype = C) + (statetype = A)*2

[State 120, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; STAND GUARD (guarding)
[Statedef 130]
type    = S
physics = S

[State 130, 1]
type = ChangeAnim
trigger1 = Anim != ifelse(var(33) = 1, 6038, 130)
value = ifelse(var(33) = 1, 6038, 130)

[State 130, Hi to Lo]
type = ChangeState
trigger1 = command = "holddown"
value = 131

[State 130, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; CROUCH GUARD (guarding)
[Statedef 131]
type    = C
physics = C

[State 131, 1]
type = ChangeAnim
trigger1 = Anim != ifelse(var(33) = 1, 6039, 131)
value = ifelse(var(33) = 1, 6039, 131)

[State 131, Lo to Hi]
type = ChangeState
trigger1 = command != "holddown"
value = 130

[State 131, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; AIR GUARD (guarding)
[Statedef 132]
type    = A
physics = N

[State 132, 1]
type = ChangeAnim
trigger1 = Anim != ifelse(var(33) = 1, 6040, 132)
value = ifelse(var(33) = 1, 6040, 132)

[State 132, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 132, 3]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 132, 4]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 132, 5]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 132, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 132, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52

[State 132, Stop Guarding]
type = ChangeState
trigger1 = command != "holdback"
trigger2 = !inguarddist
value = 140

;---------------------------------------------------------------------------
; GUARD (end)
[Statedef 140]
type = U    ;Leave state type unchanged
physics = U ;Leave physics unchanged
ctrl = 1

[State 140, 1]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse(var(33) = 1, 6041, 140) + (statetype = C) + (statetype = A)*2

[State 140, 2]
type = StateTypeSet
trigger1 = Time = 0 && statetype = S
physics = S

[State 140, 3]
type = StateTypeSet
trigger1 = Time = 0 && statetype = C
physics = C

[State 140, 4]
type = StateTypeSet
trigger1 = Time = 0 && statetype = A
physics = A

[State 140, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 140, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

;[State 140, 5] ;Implemented within engine
;type = ChangeState
;trigger1 = AnimTime = 0
;value = (statetype = C)*11 + (statetype = A)*51

;---------------------------------------------------------------------------
; SGUARDHIT (shaking)
[Statedef 150]
type    = S
movetype= H
physics = N
velset = 0,0

[State 150, 1]
type = ChangeAnim
trigger1 = 1
value = ifelse(var(33) = 1, 6044, 150)

[State 150, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 150, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 150, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 150, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 3

;---------------------------------------------------------------------------
; SGUARDHIT2 (knocked back)
[Statedef 151]
type    = S
movetype= H
physics = S
anim = ifelse(var(33) = 1, 6044, 150)

[State 151, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 151, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 151, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 151, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 151, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 151, 4]
type = ChangeState
trigger1 = HitOver
value = 130
ctrl = 1

;---------------------------------------------------------------------------
; CGUARDHIT (shaking)
[Statedef 152]
type    = C
movetype= H
physics = N
velset = 0,0

[State 152, 1]
type = ChangeAnim
trigger1 = 1
value = ifelse(var(33) = 1, 6045, 151)

[State 152, 3]
type = ChangeState
trigger1 = HitShakeOver
value = 151 + 2*(command = "holddown")

[State 152, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 152, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 152, 4]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; CGUARDHIT2 (knocked back)
[Statedef 153]
type    = C
movetype= H
physics = C
anim = ifelse(var(33) = 1, 6045, 151)

[State 153, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 153, 2]
type = VelSet
trigger1 = Time = GetHitVar(slidetime)
trigger2 = HitOver
x = 0

[State 153, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 153, Hi to Lo]
type = StateTypeSet
trigger1 = statetype = S && command = "holddown"
statetype = C
physics = C

[State 153, Lo to Hi]
type = StateTypeSet
trigger1 = statetype = C && command != "holddown"
statetype = S
physics = S

[State 153, 4]
type = ChangeState
trigger1 = HitOver
value = 131
ctrl = 1

;---------------------------------------------------------------------------
; AGUARDHIT (shaking)
[Statedef 154]
type    = A
movetype= H
physics = N
velset = 0,0

[State 154, 1]
type = ChangeAnim
trigger1 = 1
value = ifelse(var(33) = 1, 6046, 152)

[State 154, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 155 ;AGUARDHIT2

[State 154, 3]
type = ForceFeedback
trigger1 = time = 0
waveform = square
time = 4

;---------------------------------------------------------------------------
; AGUARDHIT2 (knocked away)
[Statedef 155]
type    = A
movetype= H
physics = N
anim = ifelse(var(33) = 1, 6046, 152)

[State 155, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 155, 2]
type = VelAdd
trigger1 = 1
y = Const(movement.yaccel)

[State 155, 3]
type = CtrlSet
trigger1 = Time = GetHitVar(ctrltime)
value = 1

[State 155, 4]
type = VarSet
trigger1 = 1
sysvar(0) = (pos y >= 0) && (vel y > 0)

[State 155, 5]
type = VelSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = PosSet
trigger1 = sysvar(0)
y = 0

[State 155, 6]
type = ChangeState
trigger1 = sysvar(0)
trigger1 = command = "holdback"
trigger1 = inguarddist
value = 130

[State 155, 7]
type = ChangeState
trigger1 = sysvar(0)
value = 52


;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 5000, 0]
type = PosSet
trigger1 = PrevStateNo = 210
trigger2 = PrevStateNo = 410
y = 0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 1.2] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),6050,6056) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 2.2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 6068

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5000, 3.2] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(6068 + GetHitVar(animtype)))
value = 6068 + GetHitVar(animtype) ;6072 - 4 + type

[State 5000, 4] ;Freeze anim
type = ChangeAnim
trigger1 = PrevStateNo != 3000 ;Super Armor - Hyper Megaman
trigger1 = PrevStateNo != [3101,3107] ;Super Armor - Rush Drill
;trigger1 = PrevStateNo != 3950 ;Super Armor state
trigger1 = PrevStateNo != 3200 ;Beat Plane - get hit in super
trigger1 = Time > 0
value = anim

[State 5000, 5] ;State type gets set to aerial if getting hit up
type = StateTypeSet
trigger1 = Time = 0
trigger1 = GetHitVar(yvel) != 0 && GetHitVar(fall)
trigger2 = Pos Y != 0
type = a

[State 5000, 6]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5001 ;HITG_SLIDE

[State 5000, 7]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5000, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5000, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5000, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITG_SLIDE
[Statedef 5001]
type    = S
movetype= H
physics = S

[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 2]
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = AnimTime = 0
value = 5005 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 2.2]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = AnimTime = 0
value = 6053 + GetHitVar(animtype) + (GetHitVar(groundtype)=2)*10

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = ChangeState
trigger1 = HitOver
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; HITC_SHAKE
[Statedef 5010]
type    = C
movetype= H
physics = N
velset = 0,0

[State 5010, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 1.2] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 6062 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 2.2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 6068

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5010, 3.2] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(6068 + GetHitVar(animtype)))
value = 6068 + GetHitVar(animtype) ;6072 - 4 + type

[State 5010, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5010, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5011 ;HITC_SLIDE

[State 5010, 6]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5010, FFB Light]
type = ForceFeedback
trigger1 = anim = 5020
persistent = 0
time = 6
waveform = square

[State 5010, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5021
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5010, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5022
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITC_SLIDE
[Statedef 5011]
type    = C
movetype= H
physics = C

[State 5011, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5011, 2]
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = AnimTime = 0
value = 5025 + GetHitVar(animtype)

[State 5011, 2.2]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = AnimTime = 0
value = 6065 + GetHitVar(animtype)

[State 5011, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5011, 4]
type = VelSet
trigger1 = HitOver
x = 0

[State 5011, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5011, 6]
type = ChangeState
trigger1 = HitOver
value = 11
ctrl = 1


;---------------------------------------------------------------------------
; HITA_SHAKE
[Statedef 5020]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5020, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 1.2] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),6050,6056) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 2.2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 6068

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

[State 5020, 3.2] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(6068 + GetHitVar(animtype)))
value = 6068 + GetHitVar(animtype) ;6072 - 4 + type

[State 5020, 4] ;Freeze anim
type = ChangeAnim
trigger1 = Time > 0
value = anim

[State 5020, 5]
type = ChangeState
trigger1 = HitShakeOver
value = 5030

[State 5020, FFB Light]
type = ForceFeedback
trigger1 = anim = 5000
trigger2 = anim = 5010
persistent = 0
time = 6
waveform = square

[State 5020, FFB Medium]
type = ForceFeedback
trigger1 = anim = 5001
trigger2 = anim = 5011
persistent = 0
time = 8
waveform = sinesquare
ampl = 110,-1,-.3

[State 5020, FFB Hard]
type = ForceFeedback
trigger1 = anim = 5012
trigger2 = anim = 5002
trigger3 = anim = 5030
trigger4 = anim = [5051,5059]
persistent = 0
time = 15
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HITA_UP (initial going up)
[Statedef 5030]
type    = A
movetype= H
physics = N
ctrl = 0

[State 5030, 1]
type = VelAdd;Gravity
trigger1 = 1
y = GetHitVar(yaccel)

[State 5030, 2]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5030, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5040 ;HITA_RECOV

[State 5030, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver
trigger2 = Vel Y > 0    ;Hit ground
trigger2 = Pos Y >= 10  ;.
value = 5050 ;HITA_FALL

[State 5030, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 5035 ;HITA_UP (transition)

;---------------------------------------------------------------------------
; HITA_UP_T (transition)
[Statedef 5035]
type    = A
movetype= H
physics = N

[State 5035, 1]
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = SelfAnimExist(5035)
trigger1 = Anim != [5051,5059] ;Not if in hit up anim
trigger1 = Anim != 5090 ;Not if hit off ground anim
value = 5035

[State 5035, 1.2]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = SelfAnimExist(6069)
trigger1 = Anim != 6072 ;Not if in hit up anim
trigger1 = Anim != 6076 ;Not if hit off ground anim
value = 6069

[State 5035, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5035, 3]
type = ChangeState
triggerall = !HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Animation over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = var(33) = 0  ;No transition anim
trigger4 = Time = 0     ;.
trigger4 = Anim != 5035 ;.
trigger5 = var(33) = 1  ; for S.Adaptor Mode
trigger5 = Time = 0     ;
trigger5 = Anim != 6069 ;
value = 5040 ;HITA_RECOV

[State 5035, 4]
type = ChangeState
triggerall = HitFall
trigger1 = HitOver  ;Hit is over
trigger2 = AnimTime = 0 ;Anim is over
trigger3 = Vel Y > 0    ;Hit ground
trigger3 = Pos Y >= 10  ;.
trigger4 = var(33) = 0  ;No transition anim
trigger4 = Time = 0     ;.
trigger4 = Anim != 5035 ;.
trigger5 = var(33) = 1  ; for S.Adaptor Mode
trigger5 = Time = 0     ;
trigger5 = Anim != 6069 ;
value = 5050 ;HITA_FALL

;---------------------------------------------------------------------------
; HITA_RECOV (recovering in air, not falling)
[Statedef 5040]
type    = A
movetype= H
physics = N

[State 5040, 1]
type = ChangeState
trigger1 = !Alive
value = 5050

[State 5040, 2]
type = ChangeAnim
triggerall = var(33) = 0
trigger1 = AnimTime = 0
trigger1 = Anim != 5040
trigger2 = Time = 0
trigger2 = Anim != 5035
value = 5040

[State 5040, 2.2]
type = ChangeAnim
triggerall = var(33) = 1
trigger1 = AnimTime = 0
trigger1 = Anim != 6070
trigger2 = Time = 0
trigger2 = Anim != 6069
value = 6070

[State 5040, 3]
type = CtrlSet
trigger1 = HitOver
value = 1

[State 5040, 4]
type = StateTypeSet
trigger1 = HitOver
movetype = I

[State 5040, 5]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5040, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMPLAND

;---------------------------------------------------------------------------
; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
triggerall = var(33) = 0
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 1.2] ;Change anim when done with transition
type = ChangeAnim
triggerall = var(33) = 1
trigger1 = AnimTime = 0
trigger1 = Anim = 6069
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 6069
trigger2 = (Anim != 6072) && (Anim != 6073)
trigger2 = Anim != 6076 ;Not if hit off ground anim
value = 6071

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 2.2] ;Coming down anim
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = anim = [6071,6072]
trigger1 = Vel Y >= ifelse(anim = 6071, 1, -2)
trigger1 = SelfAnimExist(anim+1)
value = ifelse(anim = 6071, anim, anim+1)
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 5]; Recover in mid air
type = ChangeState
triggerall = Vel Y > -1
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

[State 5050, 6]
type = ChangeState
trigger1 = var(33) = 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

[State 5050, 6.2]
type = ChangeState
trigger1 = var(33) = 1
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = 6072) || (anim = 6073), 0, 25)
value = 5100 ;HIT_BOUNCE

;---------------------------------------------------------------------------
; HIT_TRIP (shaking)
[Statedef 5070]
type    = A
movetype= H
physics = N
velset = 0,0

[State 5070, 1]
type = ChangeAnim 
trigger1 = 1
value = ifelse(var(33) = 1, 6074, 5070)

[State 5070, 2]
type = ChangeState
trigger1 = HitShakeOver
value = 5071

[State 5070, 3]
type = ForceFeedback
trigger1 = time = 0
time = 12
waveform = sinesquare
ampl = 140

;---------------------------------------------------------------------------
; HIT_TRIP2 (fall through air)
[Statedef 5071]
type    = A
movetype= H
physics = N

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2] ;Acceleration
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5071, 3] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 15
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = var(33) = 0
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[State 5080, 1.2] ;Set default anim
type = VarSet
trigger1 = var(33) = 1
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 6075, 6076)

[State 5080, 2]
type = VarAdd
trigger1 = time = 0
trigger1 = (anim = [5081,5089]) || (anim = [5111,5119])
trigger1 = SelfAnimExist(sysvar(2) + (anim % 10))
sysvar(2) = anim % 10

[State 5080, 3] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = var(33) = 0
trigger1 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

[State 5080, 3.2] ;If 5090 doesn't exist, default to 5030
type = VarSet
trigger1 = var(33) = 1
trigger1 = time = 0
trigger1 = sysvar(2) = 6076
trigger1 = !SelfAnimExist(6076)
sysvar(2) = 6068

[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = 1
value = sysvar(2)

[State 5080, 4]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) = 0
value = 5081 ;HITL_SLIDE

[State 5080, 5]
type = ChangeState
trigger1 = HitShakeOver
trigger1 = GetHitVar(yvel) != 0
value = 5030 ;HITA_UP

;---------------------------------------------------------------------------
; HITL_SLIDE
[Statedef 5081]
type    = L
movetype= H
physics = C

[State 5081, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5081, 2]
type = VelSet
trigger1 = HitOver
x = 0

[State 5081, 3] ;Don't show hit ground frame
type = VarSet
trigger1 = Time = 0
sysvar(0) = 1

[State 5081, 4]
type = ChangeState
trigger1 = HitOver
value = 5110 ;HIT_LIEDOWN

;---------------------------------------------------------------------------
; HIT_BOUNCE (hit ground)
[Statedef 5100]
type    = L
movetype= H
physics = N

[State 5100, 1]
type = VelSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
trigger1 = vel x > 1
x = 1

[State 5100, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
;trigger1 = GetHitVar(fall.yvel) = 0
sysvar(1) = floor(vel y)

[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = (anim != [5051,5059]) && (anim != [5061,5069])
trigger2 = !SelfAnimExist(5100 + (anim % 10))
value = 5100

[State 5100, 2.2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
trigger1 = (anim != 6072) && (anim != 6073)
trigger2 = !SelfAnimExist(6077 + (anim % 10))
value = 6077

[State 5100, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = time = 0
trigger1 = (anim = [5051,5059]) || (anim = [5061,5069])
trigger1 = SelfAnimExist(5100 + (anim % 10))
value = 5100 + (anim % 10)

[State 5100, 3.2] ;Hit ground anim (for hit up)
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = time = 0
trigger1 = (anim = 6072) || (anim = 6073)
trigger1 = SelfAnimExist(6077 + (anim % 10))
value = 6077 + (anim % 10)

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 7]
type = ChangeState
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) = 0
value = 5110 ;HIT_LIEDOWN

;[State 5100, 8]
;type = GameMakeAnim
;trigger1 = Time = 1
;;value = 61
;;pos = 0, 0
;;under = 1
;value = S8400;60 + (sysvar(1) > 5) + (sysvar(1) > 14)
;pos = 0, 0
;under = sysvar(1) <= 10

[State 5100, 8] ;Hit Ground Spark (front)
type = Explod
trigger1 = Time = 3
persistent = 0
ID = 8400
anim = 8400
postype = p1
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 5100, 9] ;Hit Ground Spark (back)
type = Explod
trigger1 = Time = 1
persistent = 0
ID = 8401
anim = 8401
postype = p1
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State 5100, 10]
type = HitFallDamage
trigger1 = Time = 3

[State 5100, 11]
type = PlaySnd
trigger1 = Time = 1
value = 40, 0 ;Hit ground
;value = S40, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5100, 12]
type = PosFreeze
trigger1 = 1

[State 5100, 13]
type = ChangeState
trigger1 = AnimTime = 0
value = 5101

[State 5100, 14]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 5101]
type    = L
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160

[State 5101, 1.2] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
trigger1 = anim != 6080
trigger2 = !SelfAnimExist(6078 + (anim % 10))
value = 6078

[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 2.2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
trigger1 = anim = 6080
trigger1 = SelfAnimExist(6078 + (anim % 10))
value = 6078 + (anim % 10)

[State 5101, 3]
type = HitFallVel
trigger1 = Time = 0

[State 5101, 4]
type = PosSet
trigger1 = Time = 0
y = 20

[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .4

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 12
type = ChangeState
value = 5110

;---------------------------------------------------------------------------
; HIT_LIEDOWN
[Statedef 5110]
type    = L
movetype= H
physics = N

[State 5110, EnvShake]
type = FallEnvShake
trigger1 = Time = 0

[State 5110, 1] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = var(33) = 0
trigger1 = SelfAnimExist(5110 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 5110 + (anim % 10)

[State 5110, 1.2] ;For hit up/up-diag type (from state 5081)
type = ChangeAnim
persistent = 0
trigger1 = var(33) = 1
trigger1 = SelfAnimExist(6081 + (anim % 10))
trigger1 = anim = [5081,5089]
value = 6081 + (anim % 10)

[State 5110, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 5110, 2.2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
triggerall = anim != 6081 ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(6079 + (anim % 10))
value = 6079

[State 5110, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(5170 + (anim % 10))
value = 5170 + (anim % 10)

[State 5110, 3.2] ;Hit ground anim (for hit up)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
triggerall = anim != 6081 ;Not already changed anim
trigger1 = anim = [5161,5169]
trigger1 = SelfAnimExist(6079 + (anim % 10))
value = 6079 + (anim % 10)

[State 5110, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = VarSet
trigger1 = Time = 0
trigger1 = GetHitVar(fall.yvel) != 0
sysvar(1) = floor(vel y)

[State 5110, 6]
type = PlaySnd
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 40, 0 ;Hit ground
;value = F7, (sysvar(1) > 5) + (sysvar(1) > 14)

[State 5110, 7]
type = GameMakeAnim
trigger1 = Time = 0
trigger1 = !SysVar(0)
value = 60 + (sysvar(1) > 5) + (sysvar(1) > 14)
pos = 0, 0
under = sysvar(1) <= 10

[State 5100, 8] ;Hit Ground Spark (front)
type = Explod
triggerall = PrevStateNo = 5071 
trigger1 = Time = 3
persistent = 0
ID = 8400
anim = 8400
postype = p1
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State 5100, 9] ;Hit Ground Spark (back)
type = Explod
triggerall = PrevStateNo = 5071 
trigger1 = Time = 1
persistent = 0
ID = 8401
anim = 8401
postype = p1
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State 5110, 10]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 11] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = var(33) = 0
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(5110 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 5110 + (anim % 10)

[State 5110, 11.2] ;For hit up type
type = ChangeAnim
persistent = 0
triggerall = var(33) = 1
triggerall = anim = [5171,5179]
triggerall = SelfAnimExist(6081 + (anim % 10))
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground anim
value = 6081 + (anim % 10)

[State 5110, 12] ;For normal
type = ChangeAnim
persistent = 0
triggerall = var(33) = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 12.2] ;For normal
type = ChangeAnim
persistent = 0
triggerall = var(33) = 1
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 6081

[State 5110, 13] ;If just died
type = ChangeState
triggerall = !alive
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
trigger3 = Anim = [5110,5119]
trigger4 = Anim = 6081 ;S.Adaptor Mode
value = 5150

[State 5110, 14]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 15] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5110, 16]
type = ForceFeedback
trigger1 = alive
trigger1 = Time = 0
time = 8
ampl = 240
waveform = sine

[State 5110, 17]
type = ForceFeedback
trigger1 = !alive
trigger1 = Time = 0
ampl = 200, 7, -.467
time = 30
waveform = sine

;---------------------------------------------------------------------------
; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, 1]
type = Turn
trigger1 = P2Dist X < -5
ignorehitpause = 1

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1a.2] ;Get up anim (normal)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(6082 + (anim % 10))
value = 6082

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = var(33) = 0
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 1b.2] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = var(33) = 1
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(6082 + (anim % 10))
value = 6082 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 1
x = -4 ;0

[State 5120, 2.2]
type = VelSet
trigger1 = AnimElem = 6
x = 0

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

[State 5120, 4]
type = HitFallSet
trigger1 = AnimTime = 0
value = 1

[State 5120, 5] ;Can't be thrown right after getting up
type = NotHitBy
trigger1 = AnimTime = 0
value = , NT,ST,HT
time = 12

[State 5120, 6] ;Can't be hit right after getting up (short time)
type = NotHitBy
trigger1 = AnimTime = 0
value2 = SCA
time = 3

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

;---------------------------------------------------------------------------
; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = var(33) = 0
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 1.2] ;Normal anim
type = ChangeAnim
triggerall = var(33) = 1
triggerall = Time = 0
triggerall = SelfAnimExist(6083)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(6083 + (anim % 10))
value = 6083

[State 5150, 2] ;Hit up type anim
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 2.2] ;Hit up type anim
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(6083 + (anim % 10))
value = 6083 + (anim % 10)

[State 5150, 3] ;Match over anim
type = ChangeAnim
persistent = 0
trigger1 = var(33) = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 3.2] ;Match over anim
type = ChangeAnim
persistent = 0
trigger1 = var(33) = 1
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = 6083
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 4] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 4.2] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Time = 0
trigger1 = Anim != 6083
trigger1 = Anim != 6081
value = 6081

[State 5150, 5] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 6] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

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

[State 5150, Vel]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5150, Pos]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5150, bound] 
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

;[State 5150, explosion] 
;type = Helper
;trigger1 = NumHelper(5151) < 1
;trigger1 = !Time
;helpertype = normal
;name = "Explosion"
;ID = 5151 
;pos = 0, 0
;postype = p1
;stateno = 5151 
;ownpal = 1
;ignorehitpause = 1

;[State 5150, explosion] 
;type = Helper
;trigger1 = NumHelper(51511) < 1
;trigger1 = Time = 20
;helpertype = normal
;name = "Explosion 2"
;ID = 51511 
;pos = 0, 0
;postype = p1
;stateno = 5151 
;ownpal = 1
;ignorehitpause = 1


;Start Code made By Hsieh (Roll Character);---------------------------------------------

[State 5150, 6] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(1*pi/4)),-9+floor(10*sin(1*pi/4))
vel = 2*cos(1*pi/4),2*sin(1*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 7] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(2*pi/4)),-9+floor(10*sin(2*pi/4))
vel = 2*cos(2*pi/4),2*sin(2*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 8] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(3*pi/4)),-9+floor(10*sin(3*pi/4))
vel = 2*cos(3*pi/4),2*sin(3*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 9] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(4*pi/4)),-9+floor(10*sin(4*pi/4))
vel = 2*cos(4*pi/4),2*sin(4*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 10] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(5*pi/4)),-9+floor(10*sin(5*pi/4))
vel = 2*cos(5*pi/4),2*sin(5*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 11] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(6*pi/4)),-9+floor(10*sin(6*pi/4))
vel = 2*cos(6*pi/4),2*sin(6*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 12] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(7*pi/4)),-9+floor(10*sin(7*pi/4))
vel = 2*cos(7*pi/4),2*sin(7*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 13] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(8*pi/4)),-9+floor(10*sin(8*pi/4))
vel = 2*cos(8*pi/4),2*sin(8*pi/4)
removetime = 100
sprpriority = 7

[State 5150, 14] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(1*pi/8)),-9+floor(10*sin(1*pi/8))
vel = 1*cos(1*pi/8),1*sin(1*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 15] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(3*pi/8)),-9+floor(10*sin(3*pi/8))
vel = 1*cos(3*pi/8),1*sin(3*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 16] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(5*pi/8)),-9+floor(10*sin(5*pi/8))
vel = 1*cos(5*pi/8),1*sin(5*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 17] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(7*pi/8)),-9+floor(10*sin(7*pi/8))
vel = 1*cos(7*pi/8),1*sin(7*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 18] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(9*pi/8)),-9+floor(10*sin(9*pi/8))
vel = 1*cos(9*pi/8),1*sin(9*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 19] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(11*pi/8)),-9+floor(10*sin(11*pi/8))
vel = 1*cos(11*pi/8),1*sin(11*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 20] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(13*pi/8)),-9+floor(10*sin(13*pi/8))
vel = 1*cos(13*pi/8),1*sin(13*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 21] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(15*pi/8)),-9+floor(10*sin(15*pi/8))
vel = 1*cos(15*pi/8),1*sin(15*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 22] ;Dead Explod
type = Explod
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
anim = 8150
pos = -4+floor(10*cos(9*pi/8)),-9+floor(10*sin(9*pi/8))
vel = 1*cos(9*pi/8),1*sin(9*pi/8)
removetime = 100
sprpriority = 7

[State 5150, 23] ;Die Explode
type = PlaySnd
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
value = 11,2

[State 5150, 24] ;Change to dead explode
type = ChangeAnim
trigger1 = Anim != 8930
trigger1 = RoundState = 4
trigger1 = MatchOver || TeamMode = turns
trigger1 = Time >= 40
value = 8930

;Finish Code made By Hsieh (Roll Character);---------------------------------------------


;---------------------------------------------------------------------------
; Generate 8 explosions within a circle (by SMEE)
[StateDef 5151]
Type = S
movetype = I
physics = N
ctrl = 0
anim = 8930

[state 4002, Scale]
Type = VarSet
trigger1 = time = 0
fvar(1) = 0.2 + 0.8 * random/1000.0

[State 4002, Generate my angle orientation]
Type = VarSet
trigger1 = !var(0)
fvar(0) = 0 ;10.0 + 20.0 * random/1000.0 

[State 4002, Generate my angle orientation]
Type = VarSet
trigger1 = var(0) > 0
fvar(0) = 45 + fvar(0)

[State 4002, Convert it to radians]
Type = VarSet
trigger1 = time = 0
fvar(2) = fvar(0) * 0.01745329

[State 4002, Explod]
Type = Explod
trigger1 = time = 0
anim = 8150
pos = 0,0
;random = 20, 16
ownpal = 1
id = 8150
sprpriority = 3
ignorehitpause = 1
vel = cos(fvar(2)), -(1.0 - abs(cos(fvar(2)))) * ifelse(var(0) >= 4, -1.2, .5)
;accel = -0.01 * cos(fvar(2)), -0.01 * -(1.0 - abs(cos(fvar(2)))) * ifelse(var(0) >= 4, -1, 1)
;scale = fvar(1), fvar(1)
facing = 1
removetime = 200

[State 4002, VarAdd]
Type = VarAdd
trigger1 = time = 0
v = 0
value = 1

[State 4002, Loop]
Type = ChangeState
trigger1 = var(0) < 8
value = 5151

[State 4002, DestroySelf]
Type = DestroySelf
trigger1 = var(0) = 8


;---------------------------------------------------------------------------
; HIT_FALLRECOVER (still falling)
[Statedef 5200]
type    = A
movetype= H
physics = N

[State 5200, 1] ;Change anim if done with transition
type = ChangeAnim
trigger1 = var(33) = 0
trigger1 = Anim = 5035
trigger1 = AnimTime = 0
value = 5050

[State 5200, 1.2] ;Change anim if done with transition
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Anim = 6069
trigger1 = AnimTime = 0
value = 6071

[State 5200, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5200, 3]
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 10
value = 5201

;---------------------------------------------------------------------------
; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = A
movetype= H
physics = A
anim = ifelse(var(33) = 1, 6084, 5200)

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201, 2]
type = VelSet
trigger1 = Time = 0
x = -.15
y = -3.5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

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

[State 5201, 5] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

;---------------------------------------------------------------------------
; HIT_AIRFALLRECOVER
[Statedef 5210]
type    = A
movetype= I
physics = N
anim = ifelse(var(33) = 1, 6085, 5210)
ctrl = 0

[State 5210, 1] ;Blink white
type = PalFX
trigger1 = Time = 0
time = 3
add = 128,128,128 ;256,256,256

[State 5210, 1]
type = PosFreeze
trigger1 = Time = 0
value = 4

[State 5210, 2] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -20

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
x = .8
y = .8

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
y = -4.5

[State 5210, 1] 
type = VelMul
trigger1 = Time = 4
trigger1 = Vel Y > 0
y = .5

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -3
y = -2

[State 5210, 1]
type = VelAdd
trigger1 = Time = 4
trigger1 = Vel Y > -2
y = -1

[State 5210, 2] ;Go up
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdup"
y = -2

[State 5210, 2] ;Go down
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holddown"
y = 1.5

[State 5210, 2] ;Go fwd
type = VelMul
trigger1 = Time = 4
trigger1 = Command = "holdfwd"
x = 1

[State 5210, 2] ;Go back
type = VelAdd
trigger1 = Time = 4
trigger1 = Command = "holdback"
x = -1

[State 5210, 3]
type = NotHitBy
trigger1 = Time = 0
value = SCA
time = 15

[State 5210, 4]
type = CtrlSet
trigger1 = Time = 20
value = 1

[State 5210, 5]
type = VelAdd;Gravity
trigger1 = Time >= 4
y = .35

[State 5210, 5] ;Land on ground
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 52 ;JUMP_LAND
ctrl = 1

;---------------------------------------------------------------------------
; Initialize (at the start of the round)
[Statedef 5900]
type = S

[State 5900, 0] ;S.Adapt Mode 
type = VarSet
trigger1 = roundno = 1;!Time
v = 33
value = 0

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = 1;roundno = 1
value = 0
first = 0
last = 32

[State 5900, 1] ;Clear all int variables
type = VarRangeSet
trigger1 = 1;roundno = 1
value = 0
first = 34
last = 59

[State 5900, 2] ;Clear all float variables
type = VarRangeSet
trigger1 = roundno = 1
fvalue = 0

[State 5900, 3] ;Intro
type = ChangeState
trigger1 = roundno = 1
value = 190

[State 5900, 1] ;Start With S.adapt Mode
type = ChangeAnim
trigger1 = var(33) = 1
value = 6002


;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------

[statedef -2]

[State -2, Projectile Dust]
type = VarSet
trigger1 = 1
v = 1
value = 0

[State -2, Projectile Dust (end)]
type = VarSet
trigger1 = NumHelper(223) > 0
trigger1 = Helper(223), MoveContact || Helper(223), StateNo = 224
trigger2 = NumHelper(227) > 0
trigger2 = Helper(227), MoveContact || Helper(227), StateNo = 228
v = 1
value = 1

;[State -2, Hold Fireball efect]
;type = Explod
;triggerall = NumExplod(229) < 1
;triggerall = var(20) = 1
;trigger1 = Time > 29
;persistent = 1
;ID = 229
;anim = 229
;postype = p1
;pos = 5, ifelse(StateType = C, -20, ifelse(StateType = A, -60, -40))
;velocity = 0, 0
;accel = 0, 0
;removetime = -1
;sprpriority = 6
;bindtime = -1
;ownpal = 0

;[State -2, Remove Fireball efect]
;type = RemoveExplod
;trigger1 = var(20) != 1 
;ID = 229

[State -2] ;by Ribeiro
type = VarAdd
trigger1 = command = "hold_z"
var(20) = 1
ignorehitpause = 1

[State -2] ;by Ribeiro
type = changestate
;triggerall = var(22) = var(20) 
trigger1 = command != "hold_z" && var(20) > 75 && stateno != 220 && ctrl && statetype = S 
value = 220
ignorehitpause = 1

[State -2] ;by Ribeiro
type = changestate
;triggerall = var(22) = var(20) 
trigger1 = command != "hold_z" && var(20) > 75 && stateno != 420 && ctrl && statetype = C
value = 420
ignorehitpause = 1

[State -2] ;by Ribeiro
type = changestate
;triggerall = var(22) = var(20) 
trigger1 = command != "hold_z" && var(20) > 75 && stateno != 620 && ctrl && statetype = A
value = 620
ignorehitpause = 1

;[State -2, 1] ;by Ribeiro
;type = VarSet
;trigger1 = var(20) != 0 && stateno != 220 && stateno != 420 && stateno != 620 && command != "hold_z"
;v = 20
;value = 0
;ignorehitpause = 1

[State -2, 2] 
type = VarSet
trigger1 = var(20) < 76 && command != "hold_z"
trigger2 = RoundState = 0 || RoundState = 1 || RoundState = 4
trigger3 = StateNo = [3000, 4999] ;cancel with supers
trigger4 = StateNo = 6028 ;cancel with S.Adapt transform
v = 20
value = 0
ignorehitpause = 1

[State -2, Hold Fireball efect]
type = Helper
trigger1 = (var(20) > 23 && NumHelper(229) = 0) ;by Ribeiro ;var>23
helpertype = normal
name = "Hold Fireball efect"
ID = 229 
pos = 5, -40
postype = p1
;facing = 1
stateno = 229 
ownpal = 1
ignorehitpause = 1

[State -2] ;by Ribeiro
type = PalFX 
trigger1 = var(20) > 19 && var(20) < 76 ;&& (gametime%10) = 0 ;var>19 - 51
time = 1 ;10
;add = 80,80,256
add = Floor((80 + 40 * sin((2 * pi * (time))/30.0)) + 0.5),Floor((80 + 40 * sin((2 * pi * (time))/30.0))+0.5),Floor((256 + 40 *sin((2 * pi * (time))/30.0))+0.5)
mul = 156,256,256
;sinadd = 40,40,40,10
ignorehitpause = 1

[State -2] ;by Ribeiro
type = PalFX
trigger1 = var(20) > 75 ;&& (gametime%10) = 0 ;50
time = 1 ;10
;add = 255,70,-100
add = Floor((255 + 40 * sin((2 * pi * (time))/30.0)) + 0.5),Floor((70 + 40 * sin((2 * pi * (time))/30.0))+0.5),Floor((-100 + 40 *sin((2 * pi * (time))/30.0))+0.5)
mul = 256,256,186
;sinadd = 40,40,40,10
ignorehitpause = 1

[State -2, Heavy Burst Hand]
type = PalFX
trigger1 = var(33) = 1
trigger1 = var(20) = [349, 359] ;[0, 10]
add = 256,256,256
time = 1
ignorehitpause = 1

[State -2, Heavy Burst Hand]
type = PalFX
trigger1 = var(33) = 1
trigger1 = var(20) = [360, 362] ;[11, 13]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1

[State -2, Heavy Burst Hand]
type = PalFX
trigger1 = var(33) = 1
trigger1 = var(20) = [363, 364] ;[14, 15]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1

[State -2, Heavy Burst Hand]
type = PalFX
trigger1 = var(33) = 1
trigger1 = var(20) = [365, 367] ;[16, 18]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1

;[State -2, Heavy Burst Hand]
;type = PalFX
;trigger1 = var(33) = 1
;trigger1 = var(20) = [368, 369] ;[19, 20]
;add = 60,60,60 ;20,20,95
;time = 1
;ignorehitpause = 1

[State -2, Heavy Burst Hand]
type = PlaySnd
trigger1 = var(33) = 1
trigger1 = var(20) = 350 
value = 18, 22

;[State -2] ;by Ribeiro
;type = PalFX 
;trigger1 = var(20) > 19 && var(20) < 76 
;time = 1 
;add = Floor((155 + (-155)* sin((2 * pi * (time))/40.0)) + 0.5),Floor((155 + (-155)* sin((2 * pi * (time))/40.0))+0.5),Floor((155 + (-155)*sin((2 * pi * (time))/40.0))+0.5)
;mul = 156,156,156
;ignorehitpause = 1

;[State -2] ;by Ribeiro
;type = PalFX
;trigger1 = var(20) > 75 
;time = 1 
;add = Floor((255 + (-175)* sin((2 * pi * (time))/40.0)) + 0.5),Floor((70 + (-70)* sin((2 * pi * (time))/40.0))+0.5),Floor((-100 + (-175)*sin((2 * pi * (time))/40.0))+0.5)
;mul = 912,256,186
;ignorehitpause = 1

[State -2] ;hold calculate 
type = VarSet;Add
trigger1 = command != "hold_z"
trigger1 = var(20) != 0
var(22) = var(20)
ignorehitpause = 1

[State -2, hold sound]
type = PlaySnd
trigger1 = var(20) = 68;76  ;66
value = 20, 1
channel = 1
ignorehitpause = 1

[State -2, end Hold Burst Sound]
type = StopSnd
trigger1 = NumHelper(229) < 1 
channel = 1
ignorehitpause = 1

[State -2, Rush] ;code by VIB
type = Helper
trigger1 = !NumHelper(7000)
stateno = 7000 + 190*(RoundState != 2)
id = 7000
name = "Rush"
pos = -48, 0 ;-70, 6
ownpal = 1
keyctrl = 1
ignorehitpause = 1
supermovetime = 999999

;-----------------------------Fall and Recovery--------------------------------
[State -2, 8] ;Hit Floor Spark (front)
type = Explod
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;651
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 3
persistent = 0
ID = 8400
anim = 8400
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = 3
ownpal = 1

[State -2, 9] ;Hit Floor Spark (back)
type = Explod
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;651
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 1
persistent = 0
ID = 8401
anim = 8401
postype = p2
pos = -4, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -3
ownpal = 1

[State -2, 10]
type = PlaySnd
trigger1 = NumTarget > 0
trigger1 = target, StateNo = 300;651
trigger1 = target, Anim = 5040;5120
trigger1 = target, AnimElem = 1, = 1
value = 17, 0
ignorehitpause = 1
supermovetime = -1
;-----------------------------Fall and Recovery--------------------------------

;---------------------------------------------------------------------------
;Choose Weapon 
;---------------------------------------------------------------------------
[State -2, Rock Ball] 
type = VarSet
trigger1 = command = "choose_weapon_A"
v = 9
value = 0

[State -2, Tornado Hold] 
type = VarSet
trigger1 = command = "choose_weapon_B"
v = 9
value = 10

[State -2, Leaf Shield] 
type = VarSet
trigger1 = command = "choose_weapon_C"
v = 9
value = 20
;---------------------------------------------------------------------------

[State -2, Weapon Letters' Facing Decision +] 
type = VarSet
trigger1 = RoundState = 0 || RoundState = 1
trigger1 = Facing
v = 23
value = 0

[State -2, Weapon Letters' Facing Decision -] 
type = VarSet
trigger1 = RoundState = 0 || RoundState = 1
trigger1 = Facing = -1
v = 23
value = 1


[State -2, 1] ;rock ball
type = VarSet
trigger1 = NumHelper(1102) > 0
;triggerall = (Helper, Anim = 1120) || (Helper, Anim = 1121)
;trigger1 = Helper, RootDist X = [-30, 40]
;trigger1 = Helper, RootDist Y = [-10, 55]
;trigger2 = NumExplod(1150) > 0
trigger1 = Helper(1102), var(10) = 1
trigger1 = !Helper(1102), var(10) = 0
v = 11
value = -10
persistent = 0

[State -2, 2] ;tornado hold
type = VarSet
trigger1 = NumHelper(1102) > 0
;triggerall = (Helper, Anim = 1130) || (Helper, Anim = 1131)
;trigger1 = Helper, RootDist X = [-30, 40]
;trigger1 = Helper, RootDist Y = [-10, 55]
;trigger2 = NumExplod(1151) > 0
trigger1 = Helper(1102), var(10) = 2
trigger1 = !Helper(1102), var(10) = 0
v = 11
value = 0
persistent = 0

[State -2, 3] ;leaf shield
type = VarSet
trigger1 = NumHelper(1102) > 0
;triggerall = (Helper, Anim = 1140) || (Helper, Anim = 1141)
;trigger1 = Helper, RootDist X = [-30, 40]
;trigger1 = Helper, RootDist Y = [-10, 55]
;trigger2 = NumExplod(1152) > 0
trigger1 = Helper(1102), var(10) = 3
trigger1 = !Helper(1102), var(10) = 0
v = 11
value = 10
persistent = 0

[State -2, Invencibility with Leaf Shield]
type = NotHitBy
trigger1 = StateNo != [120, 155]
trigger1 = NumHelper(1145) > 0
trigger1 = Helper(1145), StateNo = 1145 || Helper(1145), StateNo = 1147 || Helper(1145), StateNo = 1148
value = SCA, AA,AP,AT

[State -2, Recovery Roll Reset]
type = VarSet
trigger1 = (StateNo != 5050) && (StateNo != 5071)
v = 24
value = 0

[State -2, Recovery Roll Reset]
type = VarSet
trigger1 = (StateNo != 5050) && (StateNo != 5071)
v = 25
value = 0

[State -2, Recovery Roll Reset]
type = VarSet
trigger1 = (StateNo != 5050) && (StateNo != 5071)
v = 26
value = 0

;-----------------------------------------------
;Supers

[State -2, Hyper Megaman - Time]
type = VarAdd
trigger1 = StateNo = 3000
;trigger2 = StateNo = 3950 ;Super Armor state
;trigger3 = StateNo = 3951 ;Super Armor state
;trigger4 = StateNo = 3952 ;Super Armor state
v = 59
value = 1

[State -2, Hyper Megaman - Time (reset)]
type = VarSet
trigger1 = StateNo != 3000 
trigger1 = StateNo != 3950 ;Super Armor state
v = 59
value = 0


[State -2, Rush Drill - Time]
type = VarAdd
trigger1 = StateNo = 3101 ;[3100, 3106] 
trigger2 = StateNo = 3102 
trigger3 = StateNo = 3103 
trigger4 = StateNo = 3104 
trigger5 = StateNo = 3105 
trigger6 = StateNo = 3106 
trigger7 = StateNo = 3107
;trigger8 = StateNo = 3950 ;Super Armor state
;trigger9 = StateNo = 3951 ;Super Armor state
;trigger10 = StateNo = 3952 ;Super Armor state
v = 45
value = 1

[State -2, Rush Drill - Time (reset)]
type = VarSet
trigger1 = StateNo != [3100, 3107] ;Anim = 3101 ;var(45) >= 183
trigger1 = StateNo != 3950 ;Super Armor state
v = 45
value = 0

[State -2, Remove Wheel Explods - State 3101]
type = RemoveExplod
trigger1 = var(45) = 182 ;Anim = 3101
trigger2 = StateNo != [3100, 3107] 
trigger2 = StateNo != 3950 ;Super Armor state
trigger2 = MoveType = H
ID = 3110

[state -2, displaytoclipboard] ;thanks ixnay
type = displaytoclipboard
trigger1 = 1
text = "var(34) = %d, var(20) = %d, var(21) = %d, var(35) = %d, var(36) = %d"
params = var(34), var(20), var(21), var(35), var(36) 

;----------------------
;GetHit in Super

[State -2, gethit in super] 
type = VarSet
trigger1 = StateNo = [3000, 3299]
v = 48
value = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, gethit in super] 
type = VarSet
trigger1 = var(47) >= 1 ;FIX
trigger2 = StateNo != [3000, 3299]
trigger2 = MoveType != H ;FIX
trigger3 = MoveType = H
trigger3 = StateNo != [5000, 5999] ;Custom States
;trigger2 = StateNo != 3950 ;Super Armor state
v = 48
value = 0
ignorehitpause = 1
supermovetime = 999999

[State -2, gethit in super] 
type = VarSet
;trigger1 = PrevStateNo = [3000, 3299]
;trigger1 = StateNo != [3000, 3299]
trigger1 = var(48) = 1
trigger1 = var(47) = 0
trigger1 = MoveType = H
trigger1 = StateNo != 3950 ;Super Armor state
trigger1 = !(StateNo != [5000, 5999]) ;Custom States
v = 47
value = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, gethit in super] 
type = VarAdd
trigger1 = var(47) != 0 && var(47) < 22
v = 47
value = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, gethit in super] 
type = VarSet
trigger1 = var(48) = 0
trigger1 = var(47) >= 22
v = 47
value = 0
ignorehitpause = 1
supermovetime = 999999

[State -2, 1]
type = PalFX
;trigger1 = var(48) = 1
;trigger1 = var(47) = 0
;trigger1 = MoveType = H
trigger1 = var(47) = [1, 11]
add = 256,256,256
time = 10
ignorehitpause = 1
supermovetime = 999999

[State -2, 2]
type = PalFX
trigger1 = var(47) = [12, 14]
add = 200,200,200 ;120,120,255
time = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, 3]
type = PalFX
trigger1 = var(47) = [15, 16]
add = 150,150,150 ;80,80,256
time = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, 4]
type = PalFX
trigger1 = var(47) = [17, 19]
add = 100,100,100 ;50,50,155
time = 1
ignorehitpause = 1
supermovetime = 999999

[State -2, 5]
type = PalFX
trigger1 = var(47) = [20, 21]
add = 60,60,60 ;20,20,95
time = 1
ignorehitpause = 1
supermovetime = 999999
;----------------------

;----------------------
;S.Adapt:

[State -2, Turn]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Anim = 5
;trigger1 = Time = 0
value = 6003

[State -2, Turn Crouch]
type = ChangeAnim
trigger1 = var(33) = 1
trigger1 = Anim = 6
;trigger1 = Time = 0
value = 6004

;----------------------
;Jet Rush:

[State -2, Jet Rush air] 
type = ChangeState ;TargetState
trigger1 = StateNo != [2001, 2005]
trigger1 = Vel Y != 0 
trigger1 = NumHelper(7000) > 0
trigger1 = Helper, Anim = 7241
trigger1 = Helper, RootDist X = [-30, 40]
trigger1 = Helper, RootDist Y = [-10, 55]
trigger1 = MoveType != H 
value = 2001


;-----------------------
;S.Adapt - Hand Burst

[State -2, 3] ;select var(27)
Type = VarSet
trigger1 = P2StateType = S
trigger2 = P2StateType = A
var(27) = 1

[State -2, 3] ;select var(27)
Type = VarSet
trigger1 = P2StateType = C
var(27) = 2

[State -2, 3] ;select var(27)
Type = VarSet
trigger1 = P2StateNo = [5100, 5150]
trigger2 = P2MoveType = H ;custom
trigger2 = P2StateNo != [5000, 5999] ;custom
var(27) = 3

[State -2, 3] ;select var(28)
Type = VarSet
trigger1 = StateType = S
trigger2 = P2StateType = A
var(28) = 1

[State -2, 3] ;select var(28)
Type = VarSet
trigger1 = StateType = C
var(28) = 2

[State -2, 3] ;select var(28)
Type = VarSet
trigger1 = StateNo = [5100, 5150]
trigger2 = MoveType = H
trigger2 = StateNo != [5000, 5999]
var(28) = 3


;----------------------------------------
[State -2, Hand Helper] 
type = Helper
trigger1 = !NumHelper(1700) 
trigger1 = !NumHelper(1702) 
trigger1 = !NumHelper(6700)
trigger1 = var(33) = 1
trigger2 = NumHelper(1700) > 0
trigger2 = Helper(1700), RootDist X = [-30, 30] 
trigger2 = Helper(1700), RootDist Y = [20, 60] 
trigger2 = !NumHelper(1702)
trigger2 = !NumHelper(6700)
trigger2 = var(33) = 1
trigger3 = NumHelper(1702) > 0
trigger3 = Helper(1702), RootDist X = [-30, 30] 
trigger3 = Helper(1702), RootDist Y = [20, 60] 
trigger3 = !NumHelper(1700)
trigger3 = !NumHelper(6700)
trigger3 = var(33) = 1
;trigger1 = AnimElemNo(0)
;trigger1 = helper,Anim != [6700,6800]
stateno = 6700 ;7000 + 190*(RoundState != 2)
id = 6700
name = "Hand Helper"
pos = 0, 0 
ownpal = 0
ignorehitpause = 1
supermovetime = 999999


;;Shock - S.Adapt
;[State -2, shock]
;type = ChangeAnim
;trigger1 = Anim = 7696
;trigger1 = var(33) = 1
;;trigger1 = MoveType = H
;;trigger1 = StateNo != [5000,5999]
;value = 6089

;[State -2, shock s.adapt hand anim] 
;type = Explod
;trigger1 = var(33) = 1
;trigger1 = Anim = 7696
;trigger1 = NumExplod(6799) < 1
;trigger1 = NumHelper(6700) > 0
;ID = 6799
;anim = 6799
;postype = p1
;pos = 0, 0
;velocity = 0, 0
;accel = 0, 0
;shadow = 0, 0, 0
;removetime = -1
;sprpriority = 3
;supermovetime = 999999
;bindtime = -1
;ownpal = 0
;ignorehitpause = 1
;removeongethit = 1

;[State -2, shock s.adapt body anim] 
;type = Explod
;trigger1 = var(33) = 1
;trigger1 = Anim = 7696
;trigger1 = NumExplod(6089) < 1
;ID = 6089
;anim = 6089
;postype = p1
;pos = 0, 0
;velocity = 0, 0
;accel = 0, 0
;removetime = -1
;sprpriority = 3
;supermovetime = 999999
;bindtime = -1
;ownpal = 0
;ignorehitpause = 1
;removeongethit = 1

;[State -2, remove shock s.adapt hand anim]
;type = RemoveExplod
;trigger1 = Anim != 7696
;trigger2 = NumHelper(6700) < 1
;ID = 6799

;[State -2, remove shock s.adapt body anim]
;type = RemoveExplod
;trigger1 = Anim != 7696
;ID = 6089



;--Jet Rush---
[State -2, Reset Jet Rush Mode - Var(34)]
type = VarSet
trigger1 = var(35) != 3
trigger1 = StateNo != 2001
var(34) = 0

[State -2, Reset Jet Rush Mode - Super Var(35)]
type = VarSet
trigger1 = var(35) != 3
trigger1 = StateNo != 2001
var(35) = 0

[State -2, Reset Jet Rush Mode - Super Var(36)]
type = VarSet
trigger1 = var(35) != 3
trigger1 = StateNo != 2001
var(36) = 0

[State -2, Auto Fix]
type = Helper
trigger1 = NumHelper(18600) < 1
trigger1 = var(35) = 3
trigger1 = RoundState = 4
trigger1 = !Win
helpertype = normal
name = "Auto"
ID = 18600 
pos = 160, 0 ;-340, 0 ;thanks P.O.T.S.
postype = left ;p1
;facing = 1
stateno = 18600
ownpal = 1
ignorehitpause = 1


;--Rush Coil-------------------

[State -2, Jump on Rush Coil]
type = ChangeState
trigger1 = StateNo != [3000, 3999] ;Supers
trigger1 = NumHelper(7000) > 0
trigger1 = Helper(7000), StateNo = [7260, 7261]
;trigger1 = Helper(7000), Anim = 7271 
;trigger1 = Helper(7000), AnimElem = 1, = 0
trigger1 = Helper(7000), RootDist X = [-30, 28] ;[-30, 40]
trigger1 = Helper(7000), RootDist Y = [-35, 55] ;[-10, 55]
trigger1 = StateType = A
;trigger1 = (StateNo = 50 && Vel Y > 0) || (StateNo = 53 && Vel Y > 0)
trigger1 = Vel Y > 0
trigger1 = MoveType != H
value = 2101


;--Uppers - Normal and S.Adapt modes---

[State -2, Remove Mega Upper Power]
type = RemoveExplod
trigger1 = PrevStateNo = [1000, 1002] 
trigger1 = StateNo != [1000, 1002] 
ID = 1010

[State -2, Remove Mega Upper - S.Adapt Mode - back fire]
type = RemoveExplod
trigger1 = PrevStateNo = [1000, 1002] 
trigger1 = StateNo != [1000, 1002] 
trigger2 = PrevStateNo = [1050, 1052] 
trigger2 = StateNo != [1050, 1052]
trigger3 = PrevStateNo = 4100 ;line for Multi Atacks super
trigger3 = StateNo != 4100 ;line for Multi Atacks super
ID = 66142

[State -2, Remove Mega Upper - S.Adapt Mode - back fire]
type = RemoveExplod
trigger1 = PrevStateNo = [1000, 1002] 
trigger1 = StateNo != [1000, 1002]
trigger2 = PrevStateNo = [1050, 1052] 
trigger2 = StateNo != [1050, 1052] 
trigger3 = PrevStateNo = 4100 ;line for Multi Atacks super
trigger3 = StateNo != 4100 ;line for Multi Atacks super
ID = 66143


;--S.Adapt---

[State -2, Special Jump - back fire 1]
type = RemoveExplod
trigger1 = StateNo != 45 && StateNo != 46
trigger2 = MoveType = H
ID = 6142

[State -2, Special Jump - back fire 2]
type = RemoveExplod
trigger1 = StateNo != 45 && StateNo != 46
trigger2 = MoveType = H
ID = 6143

[State -2, Super Slash Attacks AfterImage Off]
type = AfterImageTime
trigger1 = PrevStateNo = [4000, 4050]
trigger1 = StateNo != [4000, 4050] 
time = 0

[State -2, Super Multi Attacks AfterImage Off]
type = AfterImageTime
trigger1 = PrevStateNo = 4100 
trigger1 = StateNo != 4100 
time = 0

[State -2, Intro B - Helix]
type = RemoveExplod
trigger1 = NumHelper(192000) < 1
ID = 12044

[State -2, remove back fire 1 (Dash Attacks)]
type = RemoveExplod
trigger1 = PrevStateNo = 1750
trigger1 = StateNo != 1750
trigger2 = PrevStateNo = 1751
trigger2 = StateNo != 1751
trigger3 = PrevStateNo = 1752
trigger3 = StateNo != 1752
trigger4 = PrevStateNo = 1800
trigger4 = StateNo != 1800
trigger5 = PrevStateNo = 1801
trigger5 = StateNo != 1801
trigger6 = PrevStateNo = 1802
trigger6 = StateNo != 1802
ID = 1750

[State -2, remove back fire 2 (Dash Attacks)]
type = RemoveExplod
trigger1 = PrevStateNo = 1750
trigger1 = StateNo != 1750
trigger2 = PrevStateNo = 1751
trigger2 = StateNo != 1751
trigger3 = PrevStateNo = 1752
trigger3 = StateNo != 1752
trigger4 = PrevStateNo = 1800
trigger4 = StateNo != 1800
trigger5 = PrevStateNo = 1801
trigger5 = StateNo != 1801
trigger6 = PrevStateNo = 1802
trigger6 = StateNo != 1802
ID = 1751

[State -2, Intro B - cancel BG MM7 music]
type = StopSnd
trigger1 = PrevStateNo = 194
trigger1 = StateNo != 194
channel = 2

[State -2, Cancel AfterImage - S.Adapt Mode - Dash attacks]
type = AfterImageTime
trigger1 = PrevStateNo = [1750, 1752]
trigger1 = StateNo != [1750, 1752]
trigger2 = PrevStateNo = [1800, 1802]
trigger2 = StateNo != [1800, 1802]
time = 0


;-----|Super Armor|----- (by Soldats)

[State -2, VarSet]
type = VarSet
trigger1 = (MoveType != H) && (StateNo != 3950)
v = 57
value = ifelse(Anim = 60, 53, ifelse((Anim = 44 && Time > 16) || (Anim = 45 && Time > 16) || (Anim = 46 && Time > 16), 54, StateNo)) ;ifelse for "super jump" and "normal - jump down" compatibility 
ignorehitpause = 1

;[State -2, DefenceMulSet]
;type = DefenceMulSet
;trigger1 = 1;Var(40) = 15
;value = 0.70

[State -2, VarAdd 1];Limits HitOverRide
type = VarAdd
trigger1 = StateNo = 3950
v = 58
value = 5

[State -2, VarAdd 2];Limits HitOverRide
type = VarAdd
trigger1 = (StateNo != 3950) && (Var(58) > 0) && (MoveType != H)
v = 58
value = -1

[State -2, VarSet X]
type = VarSet
trigger1 = StateNo != 3950
fv = 30
value = Vel X

[State -2, VarSet Y]
type = VarSet
trigger1 = StateNo != 3950
fv = 31
value = Vel Y
;------------------


;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[statedef -3]

[State -3, Landing Dust]
type = Explod
triggerall =  NumExplod(8000) < 1
triggerall = Time = 3
trigger1 = StateNo = 52 ;Jump land
trigger2 = StateNo = 101 ;Run-fdw land
trigger3 = StateNo = 106 ;Run-back land
trigger4 = PrevStateNo = 52 && StateNo = 11 ;Jump land/crouch 
trigger5 = PrevStateNo = 3105  ;Rush Drill 
trigger5 = StateNo = 3101      ;
trigger5 = Anim = 3190         ;
trigger5 = Pos Y >= 0          ;
persistent = 0
ID = 8000
anim = 8000
postype = p1
pos = -1, -3
velocity = 0, 0
accel = 0, 0
removetime = -2
sprpriority = -5
ownpal = 1

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = StateNo = 52 ;Jump land
trigger2 = StateNo = 101 ;Run-fwd land
trigger3 = StateNo = 106 ;Run-back land
value = 17, 0

[State -3, Rush Drill Landing Sound]
type = PlaySnd
trigger1 = Time = 1
trigger1 = PrevStateNo = 3105 
trigger1 = StateNo = 3101 
trigger1 = Anim = 3190
trigger1 = Pos Y >= 0
value = 40, 3
persistent = 0

[State -3, Super Jump] ;from GGN's Ryu (by Soldats)
type = VarSet
trigger1 = Stateno = 0
v = 12
value = 0

[State -3, Random GetHit Sounds] 
type = VarRandom
trigger1 = 1
v = 4
range = 3

[State -3, GetHit Sounds] 
type = PlaySnd
triggerall = roundstate = 2
trigger1 = Time = 0 && StateNo = [5000, 5999]
trigger2 = Time = 1 && StateNo = 5100
value = 4, 0 + var(4)
;persistent = 0
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

;--------------------------------
[State -3, Finish Hit Explod - Helper] ;based on FlowaGirl and Ethan Lives codes
type = Helper
triggerall = NumHelper(8920) < 1
triggerall = (WinKO) && (NumHelper(8900) < 1) 
trigger1 = (StateNo = [200,2999]) && (Time >= 0) 
trigger2 = NumHelper(223) > 0 
trigger3 = NumHelper(227) > 0 
trigger4 = NumHelper(1201) > 0 ;beat attack
trigger5 = NumHelper(1212) > 0 ;fliptop bomb
trigger6 = NumHelper(1222) > 0 ;auto missel
trigger7 = NumHelper(1125) > 0 ;rockball 
trigger8 = NumHelper(1130) > 0 ;tornado hold
trigger9 = NumHelper(1145) > 0 ; leaf shield
trigger10 = NumHelper(1700) > 0 ;hand burst
trigger11 = NumHelper(1702) > 0 ; hand burst strong
trigger12 = NumHelper(1505) > 0 || NumHelper(1506) > 0 || NumHelper(1507) > 0 ;slash attack
trigger13 = NumHelper(1610) > 0 || NumHelper(1611) > 0 || NumHelper(1612) > 0 ;tango attack
helpertype = Normal
name = "Finish Hit Explod"
id = 8900
pos = 0, 0
postype = p1
facing = 0
stateno = 8900
keyctrl = 0
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

;--------------------------------
;Author: FlowaGirl
;flowergirl@cutey.com
;http://blargh.i-xcell.com
;and Ethan Lives triggers.
[State -3, Super Finish BG - Helper] 
type = Helper
triggerall = NumHelper(8900) < 1
triggerall = (WinKO) && (NumHelper(8920) < 1) 
trigger1 = (StateNo = [3000,4999]) && (Time >= 0)
trigger2 = NumHelper(3010) > 0 ;HM - beam
trigger3 = NumHelper(3020) > 0 || NumHelper(3021) > 0 || NumHelper(3022) > 0 || NumHelper(3023) > 0 ;HM - missels
trigger4 = NumHelper(3011) > 0 || NumHelper(3013) > 0 || NumHelper(3015) > 0 ;HM - rush,fliptop,beat powers
trigger5 = NumHelper(3210) > 0 || NumHelper(3220) > 0 ;beat plane - fireball and missel
trigger6 = NumHelper(4010) > 0 ;super slash
helpertype = Normal
name = "Super Finish BG"
id = 8920
pos = 0, 0
postype = p1
facing = 0
stateno = 8920
keyctrl = 0
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1



;---------------------------------------------------------------------------
; Combo Counter (from Ethan´s Blaze Agent, code by Soldats)

[State -3, 1]
type = VarSet
trigger1 = P2MoveType != H
ignorehitpause = 1
var(19) = 0

[State -3, 2]
type = VarAdd
trigger1 = HitCount-Var(18)>0
ignorehitpause = 1
var(19) = 1

[State -3, 3]
type = VarSet
trigger1 = 1
ignorehitpause = 1
var(18) = HitCount



;-----------------------------------------------
[State -3, HitOverRide] ;Super Armor by Soldats
type = HitOverRide
triggerall = StateNo != [120,155]
triggerall = Anim != [5000,5999] ;prevent for enemy's custom state
;triggerall = (Var(58) < 15) ;HitOverRide limits
trigger1 = (StateNo = 3000) || (StateNo = 3950) ;only with Hyper Megaman super
trigger1 = (var(59) > 16) && (var(59) < 181) ;((StateNo = 3000) && (var(59) > 16) && (var(59) < 181)) 
trigger2 = (StateNo = [3101,3107]) || (StateNo = 3950) ;only with Rush Drill super
trigger2 = Anim = 3190 ;var(45) < 154 ;((StateNo = [3101,3107]) && (var(45) < 154))
trigger2 = Anim != 3101 && Anim != 53 ;Rush Drill final anims - state 3101
attr = SCA, AA, AP, AT ;NA, NP, SA, SP, HA, HP
slot = 1
stateno = 3950
time = 1
ignorehitpause = 1



;-[Used Var's Slots:]------------------------
;0 - random "jo ken po" anim (win pose)
;1 - projectile dust
;2 - random win pose
;3 - random intro
;4 - random gethit sound
;5 - rush hug - switch anim (win pose) 
;6 - random dash winds
;7 - random super jump winds
;8 - rush hug - switch mode (win pose)
;9 - choose weapon
;10 - use weapon*
;11 - use weapon (part 2)*
;12 - super jump
;;13 - fall and recovery (custom state)
;14 - rock ball (movecontact)
;16 - leaf shield (shield active)
;17 - super letters
;18 - combo counter
;19 - combo counter
;20 - Hold Fireball (by Ribeiro)
;21 - hold fireball - time to helper destroyself
;22 - hold fireball - hold calculate
;23 - use weapon (letters facing decision)
;24 - recovery roll x/a
;25 - recovery roll y/b
;26 - recovery roll z/c
;27 - burst hand - enemy pos y select
;28 - burst hand - mega pos y selet
;30 - use weapon (part 3)*
;31 - rush - pra onde eu vo (ParentDist X) (by VIB)
;32 - rush - facing (by VIB)
;33 - normal mode / jet rush mode / s.adapt mode
;34 - jet rush mode - time
;35 - jet rush mode - supers
;36 - jet rush mode - supers time
;37 - Hand Helper - move var 1 ;by P.O.T.S.
;38 - Hand Helper - move var 2 ;by P.O.T.S.
;39 - Hand Helper - move var 3 ;by P.O.T.S.
;40 - rush - pos x no ultimo tick (by VIB)
;41 - rush - 1 = não da pra ir pra frente, -1 = não da pra ir pra trás (by VIB)
;42 - Rush Drill (sin y simulation)
;43 - Rush Drill (wheel walk - position)
;44 - Rush Drill (wheel walk - time)
;45 - Rush Drill - time
;46 - Beat Plane - missels
;47 - gethit in super
;48 - gethit in super (part 2)
;50 - hit wall reset
;56 - Super Armor (by Soldats)
;57 - Super Armor (by Soldats)
;58 - Super Armor (by Soldats)
;59 - Hyper Megaman - time


;-[Used FVar's Slot]------------------------
;13 - burst hand - pos x
;14 - burst hand - pos y
;15 - burst hand - vetor
;30 - Super Armor (by Soldats)
;31 - Super Armor (by Soldats)