;========================================================================================
;The Green Ranger's Helper states
;========================================================================================

;Call a RANGER
[Statedef 4000]
type = S
movetype = A
physics = S
poweradd = -330
ctrl = 0
anim = 4999

;------------
;Blue Ranger
;------------
[State 4000, Helper]
type = Helper
triggerall = numhelper(4000) = 0
trigger1 = animelem = 2
helpertype = normal
name = "Blue Ranger"
ID = 4000
pos = 0,-100
postype = back
facing = 1
stateno = 4001
ownpal = 1
persistent = 0

[State 4000, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;BLUE RANGER JUMP IN
[Statedef 4001]
type = A
movetype = I
physics = N
ctrl = 0
anim = 4000
sprpriority = 3

[State 4001, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4010

[State 4001, VelSet]
type = VelSet
trigger1 = time = 0
x = 5
y = 4

[State 4001, VelAdd]
type = VelAdd
trigger1 = time > 1
x = .1
y = .3

[State 4001, ChangeState]
type =ChangeState
trigger1 = pos Y >= -3
value = 4002

;Blue Ranger Lance Attack
[Statedef 4002]
type = S
movetype = A
physics = S
ctrl = 0
anim = 4001
sprpriority = 3
velset = 0,0

[State 4002, ChangeAnim]
type = ChangeAnim
trigger1 = time = 3
value = 4002

[State 4002, VelSet]
type = VelSet
trigger1 = animelem = 9
x = 20

[State 4002, 2]
type = HitDef
trigger1 = AnimElem = 4
trigger2 = AnimElem = 5
trigger3 = AnimElem = 6
trigger4 = AnimElem = 7
trigger5 = AnimElem = 8
attr = S, SA
animtype  = Medium
damage    = 30,10
hitflag = MAFD
guardflag = MA
pausetime = 12,12
sparkno = s8000
sparkxy = -10,-70
hitsound   = s16,5
guardsound = 6,0
ground.type = High
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -2.5
air.velocity = -2.5,-4

[State 4002, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 5
trigger3 = AnimElem = 6
trigger4 = AnimElem = 7
trigger5 = AnimElem = 8
value = 14,3

[State 4002, 2]
type = HitDef
trigger1 = AnimElem = 9
attr = S, SA
animtype  = Medium
damage    = 80
guardflag = MA
pausetime = 12,12
sparkno = s8002
sparkxy = -10,-45
hitsound   = s16,5
guardsound = 6,0
ground.type = High
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -12,-6
air.velocity = -8,-4
fall =1

[State 4002, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 9
value = 16,6

[State 4002, MakeDust]
type = MakeDust
trigger1 = animelem = 9
pos = -20,0
spacing = 2

[State 4002, ChangeState1]
type = ChangeState
trigger1 = animelemtime(9) = 40
trigger1 = win = 0
trigger2 = win = 1
trigger2 = var(50) = 1
value = 4003

[State 4002, ChangeState2]
type = ChangeState
trigger1 = animelemtime(9) = 40
trigger1 = win = 1
trigger1 = matchover = 0
value = 4004

[State 4002, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4010

;Blue Ranger Leave
[Statedef 4003]
type = S
movetype = I
physics = S
ctrl = 0
anim = 4003
sprpriority = 3
velset = 0,0

[State 4003, k] 
type = PalFX 
trigger1 =animelemtime(2) = 15
time = 200
add = 30,30,250
contrast = 120,220,30
sinadd = -55,-55,-55,10

[State 4003, 0]
type = AfterImage
trigger1 =animelemtime(2) = 30
time = 200
length = 30 
palbright = 30, 30, 130
palcontrast = 120, 20, 220
palpostbright = 0, 70, 0
paladd = 5,5,15 
palmul = .65,.75,1
sinadd = 100,20,34,8
timegap = 1 
framegap = 1
trans = add1

[State 4003, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(2) >=50
flag = noshadow

[State 4003, VelSet]
type = VelSet
trigger1 =animelemtime(2) = 50
y = -15

[State 4003, DestroySelf]
type = DestroySelf
trigger1 = time = 200

;Blue Ranger Win Pose
[Statedef 4004]
type = S
ctrl = 0
anim = 4004
sprpriority = 3
velset = 0,0

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

;Blue Ranger Get Hit
[Statedef 4010]
type = S
movetype = I
physics = N
ctrl = 0
anim = 4010
sprpriority = 3

[State 4045, Turn]
type = Turn
trigger1 = P2BodyDist X < 0

[State 4010, 1]
type = Velset
trigger1 = time = 0
X = -5
Y = -6

[State 4010, 2]
type = Gravity
trigger1 = time < 100

[State 4010, 3]
type = Velset;changestate
trigger1 = Pos Y >= -1 && time > 10
x = 0
y = 0
;value = 4003

[State 4010, k] 
type = PalFX 
trigger1 = time = 80
time = 200
add = 30,30,250
contrast = 120,220,30
sinadd = -55,-55,-55,10

[State 4010, 0]
type = AfterImage
trigger1 = time = 90
time = 200
length = 30 
palbright = 30, 30, 130
palcontrast = 120, 20, 220
palpostbright = 0, 70, 0
paladd = 5,5,15 
palmul = .65,.75,1
sinadd = 100,20,34,8
timegap = 1 
framegap = 1
trans = add1

[State 4010, AssertSpecial]
type = AssertSpecial
trigger1 = time >=100
flag = noshadow

[State 4010, VelSet]
type = VelSet
trigger1 = time = 100
y = -15

[State 4010, DestroySelf]
type = DestroySelf
trigger1 = time = 300

;-------------------------
;PINK RANGER
;-------------------------

[Statedef 4005]
type = S
movetype = A
physics = S
poweradd = -330
ctrl = 0
anim = 4999
sprpriority = 1

[State 4005, Helper]
type = Helper
triggerall = numhelper(4005) = 0
trigger1 = animelem = 2
helpertype = normal
name = "Pink Ranger"
ID = 4005
pos = 0,0
postype = back
facing = 1
stateno = 4006
ownpal = 1
persistent = 0

[State 4005, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;RUN IN
[Statedef 4006]
type = S
movetype = A
physics = S
poweradd = 0
ctrl = 0
anim = 4005
velset = 6,0
sprpriority = 3

[State 4006, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4011

[State 4006, VelAdd]
type = VelAdd
trigger1 = time >0
x = -.1

[State 4006, VelSet]
type = VelSet
trigger1 = vel X <= 0
x = 0
y = 0

[State 4006, ChangeState]
type = ChangeState
trigger1 = vel X <=0
value = 4007

;Bow Shoot
[Statedef 4007]
type = S
movetype = A
physics = S
poweradd = 0
ctrl = 0
anim = 4006
velset = 6,0
sprpriority = 3

[State 4007, Helper]
type = Helper
trigger1 = animelem = 13
helpertype = normal
name = "Arrow"
ID = 4007
pos = 4,-74
postype = p1
facing = 1
stateno = 8100

[State 4007, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger1 = win = 0
trigger2 = win = 1
trigger2 = var(50) = 1
value = 4008

[State 4007, ChangeState]
type = ChangeState
trigger1 = animtime = 0
trigger1 = win = 1
value = 4009

[State 4007, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4011

;Arrow
[Statedef 8100]
type = A
movetype = A
poweradd = 0
ctrl = 0
anim = 4009
velset =  10,0;ceil((p2bodydist X)/30),ceil((p2bodydist Y)/30) 
sprpriority = 4

[State 8100, d]
type = AngleDraw
trigger1 = time > 0

[State 8100]
type = Null;ChangeAnim
triggerall = anim = 2
trigger1 = p2dist x < 0 ;enemy is behind
trigger1 = p2dist y = [-30,30] ;enemy is not too high or low (would change to diagonal anim)
value = 2 

[State 8100, HitDef]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
attr = A,SA
hitflag = MAF
guardflag = MA 
animtype = Light
air.animtype = Light
fall.animtype = Back
priority = 4,Hit
damage = 50,20
pausetime = 0,15
guard.pausetime = 0,15
sparkno = s8002
sparkxy = 0,0
hitsound = s16,5
guardsound = 4
ground.type = High
air.type = High
ground.slidetime = 10
guard.slidetime = 10
ground.hittime = 10
guard.hittime = 10
air.hittime = 20
ground.velocity = -5,-3
guard.velocity = -2
air.velocity = -3,-2
airguard.velocity = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1

[State 8100, DestroySelf]
type = DestroySelf
trigger1 = Screenpos X > 340

;Pink Ranger Leave
[Statedef 4008]
type = S
movetype = I
physics = S
ctrl = 0
anim = 4007
sprpriority = 3
velset = 0,0

[State 4008, k] 
type = PalFX 
trigger1 =animelemtime(5) = 15
time = 200
add = 250,30,250
contrast = 30,150,30
sinadd = -55,-55,-55,10

[State 4008, 0]
type = AfterImage
trigger1 =animelemtime(5) = 30
time = 200
length = 30 
palbright = 130, 30, 130
palcontrast = 120, 20, 120
palpostbright = 0, 70, 0
paladd = 50,5,50
palmul = 1,.75,1
sinadd = 150,70,10,8
timegap = 1 
framegap = 1
trans = add1

[State 4008, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(2) >=50
flag = noshadow

[State 4008, VelSet]
type = VelSet
trigger1 =animelemtime(5) = 50
y = -15

[State 4008, DestroySelf]
type = DestroySelf
trigger1 = time = 200

;Pink Ranger Win Pose
[Statedef 4009]
type = S
ctrl = 0
anim = 4008
sprpriority = 3

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

;Pink Ranger Get Hit
[Statedef 4011]
type = S
movetype = I
physics = N
ctrl = 0
anim = 4011
sprpriority = 3

[State 4045, Turn]
type = Turn
trigger1 = P2BodyDist X < 0

[State 4011, 1]
type = Velset
trigger1 = time = 0
X = -5
Y = -6

[State 4011, 2]
type = Gravity
trigger1 = time < 100

[State 4011, 3]
type = Velset;changestate
trigger1 = Pos Y >= -1 && time > 10
x = 0
y = 0
;value = 4003

[State 4011, k] 
type = PalFX 
trigger1 =animelemtime(5) = 15
time = 200
add = 250,30,250
contrast = 30,150,30
sinadd = -55,-55,-55,10

[State 4011, 0]
type = AfterImage
trigger1 =animelemtime(5) = 30
time = 200
length = 30 
palbright = 130, 30, 130
palcontrast = 120, 20, 120
palpostbright = 0, 70, 0
paladd = 50,5,50
palmul = 1,.75,1
sinadd = 100,20,100,8
timegap = 1 
framegap = 1
trans = add1

[State 4011, AssertSpecial]
type = AssertSpecial
trigger1 = time >=100
flag = noshadow

[State 4011, VelSet]
type = VelSet
trigger1 = time = 100
y = -15

[State 4011, DestroySelf]
type = DestroySelf
trigger1 = time = 300

;-----------------
;Yellow Ranger
;-----------------
;Jump in rolling
[Statedef 4021]
type = A
movetype = A
physics = N
ctrl = 0
anim = 4021
sprpriority = 1

[State 4021, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4027

[State 4021, Afterimage]
type = AfterImage
trigger1 = time = 0
time = 300
length = 15
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
timegap = 1
framegap = 3
trans = add1

[State 4021, Afterimage]
type = AfterImage
trigger1 = time = 0
trigger1 = numhelper(4040) = 1
time = 300
length = 20
paladd = 0,0,0
palcontrast = 200,200,0
palbright = 0,0,0
palpostbright = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 3
trans = add1

[State 4021, s]
type = velset
trigger1 = time = 0
x = ceil((p2bodydist X)/30)
y = ceil((p2bodydist Y)/30) 

[State 4021, changestate]
type = ChangeState
trigger1 = time = 12
value = 4022

;Jump in rolling
[Statedef 4029]
type = A
movetype = A
physics = N
ctrl = 0
anim = 4021
sprpriority = 1

[State 4021, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4027

[State 4021, Afterimage]
type = AfterImage
trigger1 = time = 0
trigger1 = numhelper(4040) = 1
time = 200
length = 15
paladd = 0,0,0
palcontrast = 200,200,0
palbright = 0,0,0
palpostbright = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 3
trans = add1

[State 4021, s]
type = velset
trigger1 = time = 0
x = ceil((p2bodydist X)/30)
y = ceil((p2bodydist Y)/30) 

[State 4021, changestate]
type = ChangeState
trigger1 = time = 12
value = 4022

;Dagger Dive
[Statedef 4022]
type = A
movetype = A
physics = N
ctrl = 0
anim = 4022
sprpriority = 1
;Velset = 7, 6

[State 4022, s]
type = velset
trigger1 = time = 0
x = ceil((p2bodydist X)/15)
y = ceil((p2bodydist Y)/15)

[State 4022, HitDef]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
attr = A,SA
hitflag = MAFD
guardflag = MA
animtype = diagup
air.animtype = diagup
fall.animtype = Back
priority = 7,Hit
damage = 80,40
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-15
hitsound = s16,5
guardsound = 6,0
ground.type = High
air.type = High
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -8,0
guard.velocity = -4
air.velocity = -8,0
fall.velocity = -1,-4
airguard.velocity = -4,0
ground.cornerpush.veloff = -12
air.cornerpush.veloff = -12
down.cornerpush.veloff = -12
guard.cornerpush.veloff = -12
airguard.cornerpush.veloff = -12
fall = 0
fall.recover = 0
down.velocity = -1,-4
down.hittime = 20
down.bounce = 1
givepower = 20,10

[State 4022, Envshake]
type = EnvShake
trigger1 = movecontact
trigger1 = winko = 1
time = 41
ignorehitpause = 1

[State 4022, changestate]
type = changestate
trigger1 = Pos Y >= 0
value = 4023

;Land
[Statedef 4023]
type = S
movetype = I
physics = S
ctrl = 0
anim = 4023
sprpriority = 1
velset = 4,0

[State 4023, Turn]
type = Turn
trigger1 = time = 4
trigger1 = P2BodyDist X < 0

[state 4023, changestate]
type = Changestate
trigger1 = time = 8
value = 4024

;Dagger Charge
[Statedef 4024]
type = S
movetype = A
physics = N
ctrl = 0
anim = 4024
sprpriority = 1
velset = -(ceil((p2bodydist X)/25)),0

[State 4024, VelSet]
type = VelSet
trigger1 = animelem = 3
x = 6

[State 4024, HitDef]
type = HitDef
trigger1 = animelem = 3
trigger2 = animelem = 4
trigger3 = animelem = 5
trigger4 = animelem = 6
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 30,10
pausetime = 0,0
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-40
hitsound = s14,2
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -8,-2
guard.velocity = -4
air.velocity = -8,-2
airguard.velocity = -4,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10

[State 4022, Envshake]
type = EnvShake
trigger1 = movecontact
trigger1 = winko = 1
time = 41
ignorehitpause = 1

[State 4024, destroy]
type = Changestate
trigger1 = time = 60
value = 4028

;Jump Back 
[Statedef 4028]
type = A
movetype = I
physics = N
ctrl = 0
anim = 4028
velset = -2, -1

[State 4028, d]
type = ChangeAnim
trigger1 = time = 20
value = 4021

[State 4028, Gravity]
type = Gravity
trigger1 = time > 20

[State 4028, VelSet]
type = VelSet
trigger1 = time > 20
trigger1 = pos Y >=0
x = 0
y = 0

[State 4028, 4025]
type = ChangeState
triggerall = time > 20
triggerall = Pos Y >=0
trigger1 = win = 0
trigger2 = win = 1
trigger2 = var(50) = 1
value = 4025
ctrl = 0

[State 4028, ChangeState2]
type = ChangeState
triggerall = time > 20
triggerall = Pos Y >=0
trigger1 = win = 1
trigger1 = matchover = 0
value = 4026

;Win Pose and Leave
[Statedef 4025]
type = S
movetype = I
physics = N
anim = 4025
velset = 0,0

[State 4025, k] 
type = PalFX 
trigger1 =animelemtime(14) = 50
time = 200
add = 220,220,30
contrast = 30,30,150
sinadd = -55,-55,-55,10

[State 4025, 0]
type = AfterImage
trigger1 =animelemtime(14) = 50
time = 200
length = 30 
palbright = 130, 130, 30
palcontrast = 120, 120, 20
palpostbright = 0, 0, 70
paladd = 50,50,5
palmul = 1,1,.75
sinadd = 150,10,70,8
timegap = 1 
framegap = 1
trans = add1

[State 4025, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(14) >=70
flag = noshadow

[State 4025, VelSet]
type = VelSet
trigger1 =animelemtime(14) = 70
y = -15

[State 4025]
type = DestroySelf
trigger1 = time = 300

;Yellow Ranger Get Hit
[Statedef 4027]
type = S
movetype = I
physics = N
ctrl = 0
anim = 4027

[State 4045, Turn]
type = Turn
trigger1 = P2BodyDist X < 0

[State 4027, 1]
type = Velset
trigger1 = time = 0
X = -5
Y = -6

[State 4027, 2]
type = Gravity
trigger1 = time < 100

[State 4027, 3]
type = Velset
trigger1 = Pos Y >= -1 && time > 10
x = 0
y = 0

[State 4027, k] 
type = PalFX 
trigger1 =animelemtime(5) = 50
time = 200
add = 220,220,30
contrast = 30,30,150
sinadd = -55,-55,-55,10

[State 4027, 0]
type = AfterImage
trigger1 =animelemtime(5) = 50
time = 200
length = 30 
palbright = 130, 130, 30
palcontrast = 120, 120, 20
palpostbright = 0, 0, 70
paladd = 50,50,5
palmul = 1,1,.75
sinadd = 150,10,70,8
timegap = 1 
framegap = 1
trans = add1

[State 4027, AssertSpecial]
type = AssertSpecial
trigger1 = time >=100
flag = noshadow

[State 4027, VelSet]
type = VelSet
trigger1 = time = 100
y = -15

[State 4027, DestroySelf]
type = DestroySelf
trigger1 = time = 300

;Yellow Ranger Win Pose
[Statedef 4026]
type = S
ctrl = 0
anim = 4026
sprpriority = 3

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

;-------------------------
;RED RANGER
;-------------------------
;RUN IN
[Statedef 4040]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4040
velset = 6,0
sprpriority = 3

[State 4040, Afterimage]
type = AfterImage
trigger1 = time = 0
time = 200
length = 15
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
timegap = 1
framegap = 3
trans = add1

[State 4040, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4045

[State 4040, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <=80
value = 4041

;RUN IN
[Statedef 4048]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4040
velset = 6,0
sprpriority = 3

[State 4048, Afterimage]
type = AfterImage
trigger1 = time = 0
time = 300
length = 15
paladd = 0,0,0
palcontrast = 170,0,0
palbright = 0,0,0
palpostbright = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 3
trans = add1

[State 4048, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4045

[State 4048, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <=80
value = 4041

;Heel Kick
[Statedef 4041]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4041
sprpriority = 3

[State 4041, HitDef]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 80,10
pausetime = 0,50
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-60
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -8,0
guard.velocity = -4
air.velocity = -8,0
airguard.velocity = -4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10

[State 4041, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 4046

;Land
[Statedef 4046]
type = S
movetype = I
physics = S
poweradd = 0
ctrl = 0
anim = 4046
sprpriority = 3

[State 4046, Got To Turn Around]
type = Turn
trigger1 = P2Bodydist X < 0

[State 4046, ChangeState]
type = ChangeState
trigger1 = time = 10
value = 4042

;Sword Draw
[Statedef 4042]
type = S
movetype = I
physics = S
poweradd = 0
ctrl = 0
anim = 4042
sprpriority = 3
velset = 0

[State 4042, d]
type = ChangeState
trigger1 = animtime = 0
value = 4043

;Sword Slash
[Statedef 4043]
type = S
movetype = A
physics = S
poweradd = 0
ctrl = 0
anim = 4043
sprpriority = 3
velset = 0

[State 4043, HitDef]
type = HitDef
trigger1 = animelem = 1
trigger2 = animelem = 2
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 20,10
pausetime = 0,4
guard.pausetime = 0,10
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 4,0
guard.velocity = 2
air.velocity = 4,0
airguard.velocity = 2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4043, HitDef]
type = HitDef
trigger1 = animelem = 3
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 25,10
pausetime = 0,4
guard.pausetime = 0,10
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -2,-1
guard.velocity = -2
air.velocity = -2,-1
airguard.velocity = -2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4043, Hitdef2]
type = HitDef
trigger1 = animelem = 5
trigger2 = animelem = 6
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 60,20
pausetime = 0,10
guard.pausetime = 0,10
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -12;,1
guard.velocity = -8;,2
air.velocity = -12;,1
airguard.velocity = -8;,2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4043, Hitdef2]
type = HitDef
trigger1 = animelem = 7
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 80,20
pausetime = 0,10
guard.pausetime = 0,10
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -2,-13
guard.velocity = -1
air.velocity = -2,-13
airguard.velocity = -1
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
down.velocity = -3,-13
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4043, ChangeState1]
type = ChangeState
trigger1 = animelemtime(10) = 50
trigger1 = win = 0
trigger2 = win = 1
trigger2 = var(50) = 1
value = 4047

[State 4043, ChangeState2]
type = ChangeState
trigger1 = animelemtime(10) = 50
trigger1 = win = 1
trigger1 = matchover = 0
value = 4044

;Red Ranger Leave
[Statedef 4047]
type = S
movetype = I
physics = N
sprpriority = 3
ctrl = 0
anim = 4047

[State 4047, k] 
type = PalFX 
trigger1 = animelemtime(4) = 20
time = 200
add = 250,30,30
contrast = 30,150,150
sinadd = -55,-55,-55,10

[State 4047, 0]
type = AfterImage
trigger1 =animelemtime(4) = 20
time = 200
length = 30 
palbright = 130, 30, 30
palcontrast = 120, 20, 20
palpostbright = 0,70, 70
paladd = 50,5,5
palmul = 1,.75,.75
sinadd = 100,20,20,8
timegap = 1 
framegap = 1
trans = add1

[State 4047, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(4) >=50
flag = noshadow

[State 4047, VelSet]
type = VelSet
trigger1 =animelemtime(4) = 50
y = -15

[State 4047, DestroySelf]
type = DestroySelf
trigger1 = time = 200

;Red Ranger Win Pose
[Statedef 4044]
type = S
ctrl = 0
anim = 4044
sprpriority = 3
velset = 0, 0

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

;Red Ranger Get Hit
[Statedef 4045]
type = S
movetype = I
physics = N
ctrl = 0
anim = 4045
sprpriority = 3

[State 4045, Turn]
type = Turn
trigger1 = P2BodyDist X < 0

[State 4045, 1]
type = Velset
trigger1 = time = 0
X = -6
Y = -4

[State 4045, 2]
type = Gravity
trigger1 = time < 100

[State 4045, 3]
type = Velset;changestate
trigger1 = Pos Y >= -1 && time > 10
x = 0
y = 0
;value = 4003

[State 4045, k] 
type = PalFX 
trigger1 =animelem = 5
time = 200
add = 250,30,30
contrast = 30,150,150
sinadd = -55,-55,-55,10

[State 4045, 0]
type = AfterImage
trigger1 =animelem = 7
time = 200
length = 30 
palbright = 130, 30, 30
palcontrast = 120, 20, 20
palpostbright = 0,70, 70
paladd = 50,5,5
palmul = 1,.75,.75
sinadd = 100,20,20,8
timegap = 1 
framegap = 1
trans = add1

[State 4045, AssertSpecial]
type = AssertSpecial
trigger1 = time >=100
flag = noshadow

[State 4045, VelSet]
type = VelSet
trigger1 = time = 100
y = -15

[State 4045, DestroySelf]
type = DestroySelf
trigger1 = time = 300



;-------------------------
;BLACK RANGER
;-------------------------
;RUN IN
[Statedef 4050]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4050
velset = 6,0
sprpriority = 3

[State 4050, Afterimage]
type = AfterImage
trigger1 = time = 0
time = 300
length = 15
palbright = 0,0,0
palcontrast = 255,255,255
palpostbright = 0,0,0
paladd = 0,0,0
palmul = .9,.9,.9
timegap = 1
framegap = 3
trans = add1

[State 4050, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4056

[State 4050, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <=130
value = 4051

;RUN IN
[Statedef 4058]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4050
velset = 6,0
sprpriority = 3

[State 4050, Afterimage]
type = AfterImage
trigger1 = time = 0
time = 300
length = 20
paladd = 0,0,0
palcontrast = 0,00,0
palbright = 0,0,0
palpostbright = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 3
trans = add1

[State 4050, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4056

[State 4050, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <=130
value = 4051

;Shoulder Charge
[Statedef 4051]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4051
sprpriority = 3

[State 4051, HitDef]
type = HitDef
;trigger1 = animelem = 4
trigger1 = timemod = 4,1
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 48,10
pausetime = 0,50
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-60
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -8,0
guard.velocity = -4
air.velocity = -8,0
airguard.velocity = -4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10

[State 4051, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <= -60
value = 4057

;Stop
[Statedef 4057]
type = S
movetype = I
physics = S
poweradd = 0
ctrl = 0
anim = 4057
sprpriority = 3

[State 4052, Got To Turn Around]
type = Turn
trigger1 = P2Bodydist X < 0
persistent = 0

[State 4057, ]
type = VelSet
trigger1 = time = 9
x = 0
y = 0

[State 4057, ChangeState]
type = ChangeState
trigger1 = time = 10
value = 4052

;Axe Spin
[Statedef 4052]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4052
sprpriority = 3
velset = 0,0

[State 4052, Vel]
type = VelSet
trigger1 = animelem = 7
x = 3
persistent = 0

[State 4052, Vel]
type = VelSet
trigger1 = P2Bodydist X < -30
trigger1 = animelem = 7 || animelem = 8 || animelem = 9 || animelem = 10
x = -3

[State 4052, Vel]
type = VelSet
trigger1 = P2Bodydist X > 30
trigger1 = animelem = 7 || animelem = 8 || animelem = 9 || animelem = 10
x = 3

[State 4052, ]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
value = 14,4
channel = 5

[State 4052, HitDef]
type = HitDef
triggerall = time < 160
triggerall = numhelper(4021) = 0
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 10,4
pausetime = 0,4
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 6,-1
guard.velocity = 2
air.velocity = 6,-1
airguard.velocity = 2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4052, HitDef]
type = HitDef
triggerall = time >= 160
triggerall = numhelper(4021) = 0
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 20,2
pausetime = 0,4
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -6,-6
guard.velocity = 4
air.velocity = -6,-6
airguard.velocity = 4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4052, HitDef]
type = HitDef
triggerall = time < 160
triggerall = numhelper(4021) = 1
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 10,4
pausetime = 0,4
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 6,-1
guard.velocity = 2
air.velocity = 6,-1
airguard.velocity = 2
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4052, HitDef]
type = HitDef
triggerall = time >= 160
triggerall = numhelper(4021) = 1
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 20,2
pausetime = 0,4
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -6,-6
guard.velocity = 4
air.velocity = -6,-6
airguard.velocity = 4
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1

[State 4052, ChangeState1]
type = ChangeState
trigger1 = time = 178
trigger1 = win = 0
trigger2 = win = 1
trigger2 = var(50) = 1
value = 4053

[State 4052, ChangeState2]
type = ChangeState
trigger1 = time = 178
trigger1 = win = 1
trigger1 = matchover = 0
value = 4055

;Black Ranger Leave
[Statedef 4053]
type = S
movetype = I
physics = N
sprpriority = 3
ctrl = 0
anim = 4053
velset = 0,0

[State 4053, k] 
type = PalFX 
trigger1 = animelemtime(4) = 20
time = 200
add = 30,30,30
contrast = 150,150,150
sinadd = -55,-55,-55,10

[State 4053, 0]
type = AfterImage
trigger1 =animelemtime(4) = 20
time = 200
length = 30 
palbright = 0, 0, 0
palcontrast = 0, 0, 0
palpostbright = 0,0, 0
paladd = 0,0,0
palmul = 1,1,1
sinadd = 20,20,20,8
timegap = 1 
framegap = 1
trans = add1

[State 4053, AssertSpecial]
type = AssertSpecial
trigger1 = animelemtime(4) >=50
flag = noshadow

[State 4053, VelSet]
type = VelSet
trigger1 =animelemtime(4) = 50
y = -15

[State 4053, DestroySelf]
type = DestroySelf
trigger1 = time = 200

;Black Ranger Win Pose
[Statedef 4055]
type = S
ctrl = 0
anim = 4055
sprpriority = 3
velset = 0, 0

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

;Black Ranger Get Hit
[Statedef 4056]
type = S
movetype = H
physics = N
ctrl = 0
anim = 4056
sprpriority = 3

[State 4056, Turn]
type = Turn
trigger1 = P2BodyDist X < 0

[State 4056, 1]
type = Velset
trigger1 = time = 0
X = -6
Y = -4

[State 4056, 2]
type = Gravity
trigger1 = time < 100

[State 4056, 3]
type = Velset;changestate
trigger1 = Pos Y >= -1 && time > 10
x = 0
y = 0
;value = 4003

[State 4056, k] 
type = PalFX 
trigger1 =animelem = 5
time = 200
add = 30,30,30
contrast = 150,150,150
sinadd = -55,-55,-55,10

[State 4056, 0]
type = AfterImage
trigger1 =animelem = 7
time = 200
length = 30 
palbright = 0, 0, 0
palcontrast = 0, 0, 0
palpostbright = 0,0, 0
paladd = 0,0,0
palmul = 1,1,1
sinadd = 20,20,20,8
timegap = 1 
framegap = 1
trans = add1

[State 4056, AssertSpecial]
type = AssertSpecial
trigger1 = time >=100
flag = noshadow

[State 4056, VelSet]
type = VelSet
trigger1 = time = 100
y = -15

[State 4056, DestroySelf]
type = DestroySelf
trigger1 = time = 300

;==========================================================================
;==========================================================================
;--------------------------------------------------------------------------
;Ranger Storm Helpers
;--------------------------------------------------------------------------
;==========================================================================
;==========================================================================
;Red Ranger Heel Kick
;RUN IN
[Statedef 4100]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4040
velset = 6,0
sprpriority = 3

[State 4100, 1]
type = Nothitby
trigger1 = time = 0
time = -1
value = SCA,NT,ST,HT

[State 4100, ChangeState]
type = ChangeState
trigger1 = P2BodyDist X <=80
value = 4101

;Heel Kick
[Statedef 4101]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4041
sprpriority = 3

[State 4101, HitDef]
type = HitDef
trigger1 = animelem = 2
trigger2 = animelem = 3
trigger3 = animelem = 4
trigger4 = animelem = 5
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Light
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 80,10
pausetime = 0,100
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-60
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 0,0
guard.velocity = 0
air.velocity = 0,0
airguard.velocity = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = 0,0
down.hittime = 20
down.bounce = 0
givepower = 20,10
kill = 0

[State 4101, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 4102

;Land
[Statedef 4102]
type = S
movetype = I
physics = S
poweradd = 0
ctrl = 0
anim = 4046
sprpriority = 3

[State 4102, ChangeState]
type = ChangeState
trigger1 = time = 8
value = 4103

;Run Away
[Statedef 4103]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4040
velset = 4,0
sprpriority = 3

[State 4103, 0]
type = Velset
trigger1 = pos X >= 220
x= 0

[State 4103, 0]
type = Turn
trigger1 = pos X >= 210

;Sword Pose
;[Statedef 4106]
;type = S
;movetype = A
;physics = N
;poweradd = 0
;ctrl = 0
;anim = 4102
;velset = 0,0
;sprpriority = 3

[State 4105, changestate]
type = ChangeState
trigger1 = time = 50
value = 4047

;--------------------
;Pink Ranger
;RUN IN
[Statedef 4120]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4005
velset = 6,0
sprpriority = 3

[State 4120, 1]
type = Nothitby
trigger1 = time = 0
time = -1
value = SCA,NT,ST,HT

[State 4120, ChangeState]
type = ChangeState
trigger1 = p2BodyDist X <=80
value = 4121

;Foot Kick
[Statedef 4121]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4014
sprpriority = 3

[State 4121, HitDef]
type = HitDef
trigger1 = animelem = 3
trigger2 = animelem = 4
trigger3 = animelem = 5
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Light
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 80,10
pausetime = 0,100
guard.pausetime = 0,0
sparkno = s8002
sparkxy = 0,-60
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 0,0
guard.velocity = 0
air.velocity = 0,0
airguard.velocity = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = 0,0
down.hittime = 20
down.bounce = 0
givepower = 20,10
kill = 0

[State 4121, ChangeState]
type = ChangeState
trigger1 = animtime = 0
value = 4122

;Land
[Statedef 4122]
type = S
movetype = I
physics = S
poweradd = 0
ctrl = 0
anim = 4015
sprpriority = 3

[State 4122, ChangeState]
type = ChangeState
trigger1 = time = 8
value = 4123

;Run Away
[Statedef 4123]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4005
velset = 4,0
sprpriority = 3

[State 4123, 0]
type = VelSet
trigger1 = pos X <= -220
x = 0

[State 4123, 0]
type = Turn
trigger1 = pos X <= -220

;Bow Pose
;[Statedef 4125]
;type = S
;movetype = A
;physics = N
;poweradd = 0
;ctrl = 0
;anim = 4103
;velset = 0,0
;sprpriority = 3

[State 4125, changestate]
type = ChangeState
trigger1 = time = 50
value = 4008

;--------------------
;Black Ranger
;RUN IN
[Statedef 4140]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4050
velset = 6,0
sprpriority = 3

[State 4140, 1]
type = Nothitby
trigger1 = time = 0
time = -1
value = SCA,NT,ST,HT

[State 4140, ChangeState]
type = ChangeState
trigger1 = p2Dist X = 0
value = 4141

;Axe Spin
[Statedef 4141]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4052
sprpriority = 3
velset = 0,0

[State 4141, ]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 8
trigger3 = animelem = 9
trigger4 = animelem = 10
value = 14,4
channel = 5

[State 4141, hurricane helper]
type = Helper
trigger1 = animelem = 10
helpertype = normal
name = "Hurricane"
ID = 4142
pos = 0,0
postype = p1
facing = 1
stateno = 4142
ownpal = 1
persistent = 0

[State 4141, n]
type = Changestate;changeanim
trigger1 = time = 200
value = 4053;40530

;Hurricane
[Statedef 4142]
type = S
movetype = A
physics = N
poweradd = 0
ctrl = 0
anim = 4059
sprpriority = 5
velset = 0,0

[State 4142, d]
type = SprPriority
trigger1 = 1
value = 5

[State 4142, HitDef]
type = HitDef
triggerall = p2Dist X <= 0
triggerall = Pos Y > -180
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 4
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 7,7
pausetime = 0,0
guard.pausetime = 0,0
sparkno = -1;s8002
sparkxy = 0,0;-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = -9,-2.5
guard.velocity = -9
air.velocity = -9,-2.5
airguard.velocity = -9
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = -1
kill = 0

[State 4142, HitDedf]
type = HitDef
triggerall = p2Dist X > 0
triggerall = Pos Y > -180
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 4
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 7,7
pausetime = 0,0
guard.pausetime = 0,0
sparkno = -1;s8002
sparkxy = 0,0;-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 9,-2.5
guard.velocity = 9
air.velocity = 9,-2.5
airguard.velocity = 9
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1
kill = 0

[State 4142, HitDedf]
type = HitDef
triggerall = time > 130
trigger1 = animelem = 1
trigger2 = animelem = 2
trigger3 = animelem = 3
trigger4 = animelem = 4
attr = S,SA
hitflag = MAFD
guardflag = MA
animtype = Back
air.animtype = Back
fall.animtype = Back
priority = 7,Hit
damage = 10,10
pausetime = 0,0
guard.pausetime = 0,0
sparkno = -1;s8002
sparkxy = 0,0;-50
hitsound = s2,1
guardsound = 6,0
ground.type = Low
air.type = Low
ground.slidetime = 30
guard.slidetime = 20
ground.hittime = 30
guard.hittime = 20
air.hittime = 30
ground.velocity = 0,0
guard.velocity = 0 
air.velocity = 0,0
airguard.velocity = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall = 0
fall.recover = 0
down.velocity = -3,-3
down.hittime = 20
down.bounce = 0
givepower = 20,10
p2facing = 1
kill = 0
p2stateno = 41420

[State 4142, ]
type = DestroySelf
trigger1 = time = 150

;--------------------------
;P2 States
;--------------------------
[Statedef 41420]
movetype = H
type = A
physics = N
velset = 0,-10
anim = 5051

[State 41420, k]
type = VelAdd
trigger1 = time > 1
y = .45

[State 41420,l]
type = PosSet
trigger1 = Pos X !=0
x = 0

[State 41420, ]
type = Turn
trigger1 = timemod = 6,2;5000

[State 3810, g]
type = ChangeAnim
trigger1 = vel Y >= 0
value = 5061
elem = 6
persistent = 0

[State 41420, g]
type = ChangeState
trigger1 = vel X = 0
trigger1 = Pos Y >= -1
trigger1 = time > 10
value = 41421

;Hit Ground
[Statedef 41421]
type    = L
movetype= H
physics = N

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

[State 3811, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
triggerall = anim != [5110,5119] ;Not already changed anim
trigger1 = anim != [5161,5169]
trigger2 = !SelfAnimExist(5170 + (anim % 10))
value = 5170

[State 3811, 3] ;Hit ground anim (for hit up)
type = ChangeAnim
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, 4]
type = HitFallDamage
trigger1 = Time = 0

[State 5110, 5]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5110, Var] ;Get fall velocity
type = null;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 = F7, 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 5110, 8]
type = VelSet
trigger1 = Time = 0
y = 0

[State 5110, 9] ;For hit up type
type = ChangeAnim
persistent = 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, 10] ;For normal
type = ChangeAnim
persistent = 0
triggerall = Anim != [5111,5119]
trigger1 = AnimTime = 0
trigger2 = SysVar(0) ;SysVar(0) = 1 avoids hit ground frame
value = 5110

[State 5110, 12]
type = VarSet
trigger1 = SysVar(0)
trigger1 = Time = 0
sysvar(0) = 0

[State 5110, 13] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

;-----------------------
;Blue Ranger
;-----------------------
;JUMP IN
[Statedef 4150]
type = A
physics = N
ctrl = 0
anim = 4000
sprpriority = 3

[State 4120, 1]
type = Nothitby
trigger1 = time = 0
time = -1
value = SCA,NT,ST,HT

[State 4150, j]
type = Turn
trigger1 = P2Dist X < 0
;ignorehitpause = 0
;persistent = 1

[State 4150, 1]
type = HitOverride
trigger1 = time = 0
time = -1
attr = SCA, AA, AT, AP
slot = 0 
stateno = 4010

[State 4150, VelSet]
type = VelSet
trigger1 = time = 0
x = 5
y = 4

[State 4150, VelAdd]
type = VelAdd
trigger1 = time > 1
x = .1
y = .3

[State 4150, ChangeState]
type =ChangeState
trigger1 = pos Y >= -1
value = 4151

;---------------------
;UPPERCUT
[Statedef 4151]
type = S
movetype = A
physics = N
ctrl = 0
anim = 4017
sprpriority = 3
velset = 0,0

[State 4151, k]
type = Pause
trigger1 = animelem = 1
time = 40
movetime = 35

[State 4151, ]
type = VelSet
trigger1 = animelem = 10
x = 5
y = -4

[State 3820, Afterimage]
type = AfterImage
trigger1 = animelem = 10
time = 800
length = 40
paladd = 0,0,0
palcontrast = 0,0,200
palbright = 0,0,0
palpostbright = 0,0,0
palmul = 1,1,1
timegap = 1
framegap = 3
trans = add1

[State 4151, 2]
type = HitDef
trigger1 = animelem = 10
attr = S, HA
animtype  = Light
damage    = 100, 100
priority  = 7
guardflag = MA
hittime = 0,100
pausetime = 0,100
sparkno = s8002
sparkxy = -10,-60
hitsound = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 200
air.hittime = 200
ground.velocity = 0,0
air.velocity = 0,0
fall = 1
getpower = 0
givepower = 40
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
fall.recover = 0
kill = 1

[State 3819, g]
type = EnvColor
trigger1 = movehit
value = 0,0,200
time = 8
persistent = 0

[State 4151, k]
type = Pause
trigger1 = animelemtime(10) = 30
time = 50

[State 4151, 11] ;Gravity
type = VelAdd
trigger1 = animelemTime(10) >= 30
y = .60

[State 4151, ]
type = PlayerPush
trigger1 = time > 0
value = 0

[State 4151, 12] ;Change to coming down animation
type = Changestate
trigger1 = time = 72
value = 4152
persistent = 0

;------------------
;Uppercut down
;------------------
[Statedef 4152]
type = S
movetype = A
physics = N
ctrl = 0
anim = 4018
sprpriority = 3
velset = 2,0

[State 4152, 11] ;Gravity
type = Gravity
trigger1 = Time >= 10

[State 4152, ]
type = AfterImageTime
trigger1 = pos Y >= -1
time = 0
;ignorehitpause = 0
;persistent = 1

[State 4152, ChangeState]
type = ChangeState
trigger1 = pos Y >= -1
value = 4003






