;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

; HIT_GETUP
[Statedef 5120]
type    = L
movetype= I
physics = N

[State 5120, effect]
type = explod
trigger1 = time = 0
trigger2 = time = 6
trigger3 = time = 12
trigger4 = time = 18
trigger5 = time = 24
trigger6 = time = 30
trigger7 = time = 36
anim = 15121
postype = P1
bindtime = -1
pos = 0,-10
ontop = 1

[State 5120, 1a] ;Get up anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5111,5119]
trigger2 = !SelfAnimExist(5120 + (anim % 10))
value = 5120

[State 5120, 1b] ;Get up anim (for hit up/diag-up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5111,5119]
trigger1 = SelfAnimExist(5120 + (anim % 10))
value = 5120 + (anim % 10)

[State 5120, 2]
type = VelSet
trigger1 = Time = 0
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



;Get Hit--------------------------------------------------------------------
;---------------------------------------------------------------------------
; HITG_SHAKE
[Statedef 5000]
type    = S
movetype= H
physics = N
velset = 0,0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(groundtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5000, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5000, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

;This is what "pauses" the animation. I commented it out, but you can just remove it.
;[State 5000, 4] ;Freeze anim
;type = ChangeAnim
;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 = AnimTime = 0
value = 5005 + 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 = time = 12
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 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = 5020 + GetHitVar(animtype)

[State 5010, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5010, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

;This is what "pauses" the animation. I commented it out, but you can just remove it.
;[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

;---------------------------------------------------------------------------
; 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 = Time = 0
trigger1 = GetHitVar(animtype) != [3,5]
value = ifelse((GetHitVar(airtype) = 1),5000,5010) + GetHitVar(animtype)

[State 5020, 2] ;Anim for HIT_BACK
type = ChangeAnim
trigger1 = Time = 0
trigger1 = GetHitVar(animtype) = [3,5]
value = 5030

[State 5020, 3] ;Anim for HIT_UP/HIT_DIAGUP (only if it exists)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = (GetHitVar(animtype) = [4,5]) && (SelfAnimExist(5047 + GetHitVar(animtype)))
value = 5047 + GetHitVar(animtype) ;5051 - 4 + type

;This is what "pauses" the animation. I commented it out, but you can just remove it.
;[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

;---------------------------------------------------------------------------
; HITL_SHAKE
[Statedef 5080]
type    = L
movetype= H
physics = N
velset = 0,0

[State 5080, 1] ;Set default anim
type = VarSet
trigger1 = time = 0
sysvar(2) = ifelse (GetHitVar(yvel) = 0, 5080, 5090)

[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 = time = 0
trigger1 = sysvar(2) = 5090
trigger1 = !SelfAnimExist(5090)
sysvar(2) = 5030

;I changed trigger1 to Time = 0, rather than trigger1 = 1
[State 5080, 3] ;Freeze
type = ChangeAnim
trigger1 = Time = 0
;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
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Stand
[Statedef 0]
type = S
physics = S
sprpriority = 0

[State 0, windsnd]
type = playsnd
trigger1 = animelem = 7
value = 1,1
channel = 2

[State 0, windsnd]
type = playsnd
trigger1 = animelem = 12
value = 1,0
channel = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 7
anim = 2
sprpriority = 2
postype = p1
pos = -5,10
bindtime = 1
pausemovetime = -1
supermovetime = -1
name = "Wind"
id = 2

[State 0, Explod]
type = Explod
trigger1 = animelem = 12
anim = 3
sprpriority = 2
postype = p1
pos = -5,5
bindtime = 1
pausemovetime = -1
supermovetime = -1
name = "Lightning"
id = 3

[State 0, 1]
type = ChangeAnim
trigger1 = Anim != 0 && Anim != 5
trigger2 = Anim = 5 && AnimTime = 0 ;Turn anim over
value = 0

[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

[State 0, 4] ;Are you dead?
type = ChangeState
trigger1 = !alive
value = 5050

[State 0]
type = posset
trigger1 = time >= 0
y = 5*sin(time/15.0)

;Cape for standing
;[State 0]
;type = Helper
;;trigger1 = stateno = 0;!NumHelper(1)
;trigger1 = numhelper(1) < 1
;stateno = 1
;postype = p1
;pos = 0,0
;bindtime = -1
;id = 1
;name = "Cape"


; Cape
;[Statedef 1]
;type = S
;physics = N
;anim = 1
;sprpriority = 0
;
;[State 1, AssertSpecial]
;type = AssertSpecial
;trigger1 = parent, Anim != 0
;flag = Invisible
;
;[State 1, PosSet]
;type = PosSet
;trigger1 = 1
;x = parent, Pos X
;y = parent, Pos Y
;
;[State 1, Turn]
;type = Turn
;trigger1 = facing != parent, facing
;
;[State 1]
;type = posset
;trigger1 = time >= 0
;y = 5*sin(time/15.0)
;
;[State 1]
;type = destroyself
;trigger1 = parent, stateno != 0


; RUN_BACK
[Statedef 105]
type    = A
physics = N
ctrl = 1 
anim = 105
sprpriority = 1

[State 105, walking forward]
type = ChangeState
trigger1 = Command = "holdfwd" && Time > 3
value = 20
ctrl = 1

[State 105, Cancel into crouching]
type = ChangeState
trigger1 = Command = "holddown"
value = 10
ctrl = 1

[State 105, Cancel into jumping]
type = ChangeState
trigger1 = Command = "holdup"
value = 40
ctrl = 1

[State 105, snd]
type = playsnd
trigger1 = animelem = 1
value = S0,7
persistent = 0

[State 105, Explod]
type = Explod
trigger1 = AnimElem = 2
anim = 106
sprpriority = 2
postype = p1
pos = 12,0
bindtime = -1
removetime = 15
name = "Run Back Wind"
id = 106

[State 105, a]
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 105, 1]
type = VelSet
trigger1 = AnimElem = 2
x = -10;const(velocity.run.back.x)
y = 0;const(velocity.run.back.y)

[State 105, 1]
type = VelSet
trigger1 = AnimElem = 10
x = -1;const(velocity.run.back.x)
y = 0;const(velocity.run.back.y)

[State 105, 1]
type = VelSet
trigger1 = AnimElem = 11
x = 0;const(velocity.run.back.x)
y = 0;const(velocity.run.back.y)

[State 105, 2]
type = StateTypeSet
trigger1 = AnimElem = 14
physics = S

[State 105, Sound]
type = playsnd
trigger1 = animelem = 2
value = 0, 26

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


; RUN_forward
;[Statedef 100]
;type    = A
;physics = N
;ctrl = 1
;anim = 100
;sprpriority = 1
;
;[State 100, 6]
;type = CtrlSet
;trigger1 = command = "holdup"
;value = 1
;
;[State 100, crouching]
;type = ChangeState
;trigger1 = Command = "holddown"
;value = 10
;ctrl = 1
;
;[State 100, 6]
;type = CtrlSet
;trigger1 = command = "holdback"
;value = 1
;
;[State 100, 6]
;type = CtrlSet
;trigger1 = command = "holdfwd"
;value = 0
;
;
;[State 100, 6]
;type = CtrlSet
;trigger1 = command = "holdupfwd"
;value = 1
;
;
;
;[State 105, snd]
;type = playsnd
;trigger1 = animelem = 2
;value = 100,0
;persistent = 0
;
;[State 105, a]
;type = AssertSpecial
;trigger1 = 1
;flag = NoWalk
;
;[State 100, Explod]
;type = Explod
;trigger1 = AnimElem = 2
;anim = 101
;sprpriority = 2
;postype = p1
;pos = 0,0
;bindtime = -1
;removetime = 15
;name = "Run Forward Wind"
;id = 101
;
;[State 105, 1]
;type = VelSet
;trigger1 = AnimElem = 2
;x = const(velocity.run.fwd.x)
;y = const(velocity.run.fwd.y)
;
;[State 105, 2]
;type = StateTypeSet
;trigger1 = AnimElem = 14
;physics = S
;
;[State 105, 3]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

; RUN_FWD
[Statedef 100]
type    = S
movetype = I
physics = N
anim = 100
sprpriority = 1
VelSet= const(velocity.run.fwd.x);-const(velocity.run.fwd.x)*(0.25*var(21)),const(velocity.run.fwd.y)

[State 100, Explod]
type = Explod
trigger1 = AnimElem = 2
trigger2 = animelem = 5
anim = 101
sprpriority = 2
postype = p1
pos = 0,0
bindtime = -1
removetime = 15
name = "Run Forward Wind"
id = 101

[State 105, snd]
type = playsnd
trigger1 = animelem = 2
trigger2 = animelem = 5
value = S0,7
persistent = 0
;



[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk

[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 4]
type = ChangeState
triggerall = !Var(59)
trigger1 = command != "holdfwd";Time = 135
value = 0
ctrl = 1

[State 100, 4]
type = ChangeState
triggerall = Var(59)
trigger1 = time > 15
value = 0
ctrl = 1

; Jump Up
[Statedef 50]
type    = A
physics = A

[State 50, 1]
type = veladd
trigger1 = command = "holdfwd"
trigger1 = vel X < 1.5
X = .25

[State 50, 1]
type = veladd
trigger1 = command = "holdback"
trigger1 = vel X > -1.5
X = -.1

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

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

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

[State 50, 4]
type = changeanim
triggerall = anim != 1199
trigger1 = prevstateno = 111
trigger2 = prevstateno = 113
trigger3 = prevstateno = 114
trigger4 = prevstateno = 116
trigger5 = prevstateno = 117
trigger6 = prevstateno = 119
trigger7 = prevstateno = 2000
trigger8 = prevstateno = 2003
trigger9 = prevstateno = 2004
value = 1199


[State 50, 5]
type = velset
triggerall = time = 0
trigger1 = prevstateno = 111
trigger2 = prevstateno = 113
trigger3 = prevstateno = 117
trigger4 = prevstateno = 119
trigger5 = prevstateno = 114
trigger6 = prevstateno = 116
x = 0
y = 0

[State 52, 4]
type = turn
trigger1 = p2dist X <= -3
trigger1 = time = 0

; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47

[State 192, sound]
type = Playsnd
trigger1 = AnimElemTime(1) = 0
value = 1000,0

[State 192, Explod]
type = Explod
trigger1 = AnimElemTime(1) = 0
anim = F8510;10004
id = 10004
postype = P1
pos = 0,0
sprpriority = -1
ownpal = 0

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

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

[State 52, 3]
type = CtrlSet
trigger1 = Time = 3;ifelse(var(7)=1,15,3)
value = 1

;[State 52, 5]
;type = changestate
;trigger1 = prevstateno = 251
;value = 250

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

[State 52, 4]
type = turn
trigger1 = p2dist X <= -3
trigger1 = time >= 0
;value = 5











;---------------------------------------------------------------------------
; Air Dash Up-Backward
[Statedef 117]
type    = A
physics = N
anim = 114
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 117, VarSet]
type = VarSet
trigger1 = 1
var(29) = 7

[State 117, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = -9
y = -9

[State 117, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Up
[Statedef 118]
type    = A
physics = N
anim = 118
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 118, VarSet]
type = VarSet
trigger1 = 1
var(29) = 8

[State 118, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
y = -11

[State 118, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Up-Forward
[Statedef 119]
type    = A
physics = N
anim = 116
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 119, VarSet]
type = VarSet
trigger1 = 1
var(29) = 9

[State 119, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = 9
y = -9

[State 119, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Backward
[Statedef 114]
type    = A
physics = N
anim = 114
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 114, VarSet]
type = VarSet
trigger1 = 1
var(29) = 4

[State 114, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = -10

[State 114, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Forward
[Statedef 116]
type    = A
physics = N
anim = 116
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 116, VarSet]
type = VarSet
trigger1 = 1
var(29) = 6

[State 116, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = 10

[State 116, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Down-Backward
[Statedef 111]
type    = A
physics = N
anim = 114
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 111, VarSet]
type = VarSet
trigger1 = 1
var(29) = 1

[State 111, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = -9
y = 9

[State 111, PosSet]
type = PosSet
trigger1 = Pos Y > -15
y = -15

[State 111, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Down
[Statedef 112]
type    = A
physics = N
anim = 112
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 112, VarSet]
type = VarSet
trigger1 = 1
var(29) = 2

[State 112, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
y = 11

[State 112, PosSet]
type = PosSet
trigger1 = Pos Y > -15
y = -15

[State 112, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; Air Dash Down-Forward
[Statedef 113]
type    = A
physics = N
anim = 116
velset = 0,0
ctrl = 1;!((PrevStateNo = [600,699]) && !var(10))

[State 113, VarSet]
type = VarSet
trigger1 = 1
var(29) = 3

[State 113, VelSet]
type = VelSet
trigger1 = AnimElem = 1, = 0
x = 9
y = 9

[State 113, PosSet]
type = PosSet
trigger1 = Pos Y > -15
y = -15

[State 113, ChangeState]
type = ChangeState
trigger1 = time = 21
value = 50
ctrl = 1

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------
[Statedef -2]

[State -2] ;Omega Red Life Drain
type = lifeadd
triggerall = roundstate = 2
trigger1 = enemynear, name = "Omega Red"
trigger1 = timemod = 50,0
value = -1

[State 0, PowerSet]
type = PowerSet
triggerall = enemynear, name ="Trainingroom"
trigger1 = power != 3000
value = 3000

[State -2, Super Jump Spark VarSet]
type = VarSet
trigger1 = StateNo = 0
trigger2 = StateNo = 52
trigger3 = MoveType = H
trigger4 = Vel Y >= 0
trigger5 = stateno != 901 && prevstateno != 901
v = 12
value = 0

;---------------------------------------------------------------------------
;X-Men BG
;---------------------------------------------------------------------------
;[State -2, BG]
;type = Explod
;trigger1 = stateno = 1020
;name = "BGXMEN"
;id = 15000
;anim = 15000
;ownpal = 1
;pos = 0,0
;postype = back
;facing = 1
;bindtime = -1
;;supermovetime = -1
;sprpriority = -5
;;removetime = -2
;removeongethit = 1
;
;[State -2, 3300]
;type = removeexplod
;trigger1 = lose = 1
;id = 15000
;
;[State -2, 3300]
;type = removeexplod
;trigger1 = stateno != 1020
;id = 15000

;---------------------------------------------------------------------------
;Rain Invokation
;---------------------------------------------------------------------------
[State -2, 3300]
type = Stopsnd
trigger1 = !NumExplod(3310)
channel = 10

[State -2, 3300]
type = Stopsnd
trigger1 = !NumExplod(3310)
channel = 6

[State -2, 3300]
type = removeexplod
trigger1 = lose = 1
id = 3310

[State -2, 3300]
type = removeexplod
trigger1 = lose = 1
id = 8700

[State -2, 3300]
type = PlaySnd
triggerall = NumExplod(3310)&& roundstate=2
trigger1 = time = 80
value = 198,0
channel = 6
volume = 250

[State -2, 3300]
type = PlaySnd
triggerall = NumExplod(3310)&& roundstate=2
trigger1 = time = 120
value = 198,0
channel = 6
volume = 250

[State -2, 3300]
type = Helper
triggerall = NumExplod(3310)&& roundstate=2
trigger1 = Random <= 9
name = "thunderain"
ID = 3350
pos = 0,0
postype = back
stateno = 3350

[State -2, 3300] 
type = Explod
triggerall = NumExplod(3310)&& roundstate=2
trigger1 = Random <= 10
anim = 8901
ownpal = 1
pos = 0,0
postype = back
facing = 1 
bindtime = -1
supermovetime = -1
sprpriority = -5
removetime = -2
scale = 1,1
removeongethit = 1

[State -2, 3300] 
type = Explod
triggerall = NumExplod(3310)&& roundstate=2
triggerall = Random <= 90
trigger1 = !statetype = A
anim = 3315
id = 3315
ownpal = 1
pos = 0,0
random = 150,2
postype = p1
facing = 1 
supermovetime = -1
sprpriority = -3
removetime = -2

[State -2, 3300] 
type = Explod
triggerall = NumExplod(3310)&& roundstate=2
triggerall = Random <= 90
trigger1 = !P2statetype = A
id = 3316
anim = 3315
ownpal = 1
pos = 0,0
random = 150,2
postype = p2
facing = 1 
supermovetime = -1
sprpriority = -3
removetime = -2

;[State 0, PosSet]
;type = PosSet
;trigger1 = pos y > 5
;y = 0
;ignorehitpause =
;persistent =




;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

[State -3, varreset];for airdashes
type = varset
trigger1 = statetype = S
trigger1 = var(29) != 0
v = 29
value = 0

[State -3, varreset];for hailstorm hitsounds
type = varset
trigger1 = statetype = S
trigger1 = var(28) != 0
v = 28
value = 0

[State -3, varreset];for hailstorm hitsounds
type = varset
trigger1 = statetype = S
trigger1 = var(26) != 0
v = 26
value = 0


[State -3, varreset];for hailstorm hitsounds
type = varset
trigger1 = statetype = S
trigger1 = var(27) != 0
v = 27
value = 0

[State -3, varreset];for lightning attack
type = varset
trigger1 = statetype = S
trigger1 = var(10) != 0
v = 10
value = 0

[State -3, varreset];for lightning attack
type = varset
trigger1 = statetype = S
trigger1 = var(8) != 0
v = 8
value = 0

[State -3, varreset];for lightning attack
type = varset
trigger1 = statetype = S
trigger1 = var(9) != 0
v = 9
value = 0

[State -3]
type = DisplayToClipboard
trigger1 = 1
text="Tip: Play MvC3 Everyday"


[State -3, change super jump var]
type = varset
trigger1 = stateno != 420
trigger1 = stateno != 900
v = 3
value = 0


;Float if player holds up
[State -3]
type = velset
triggerall = vel Y > 0
;trigger1 = stateno = 50
trigger3 = stateno = 600
trigger4 = stateno = 610
trigger5 = stateno = 620
trigger6 = stateno = 630
trigger7 = stateno = 640
trigger8 = stateno = 650
trigger11 = stateno = 611
trigger12 = stateno = 612
triggerall = command = "holdup"
trigger13 = stateno = 50
trigger1 = anim = 44
trigger2 = anim = 51
trigger9 = anim = 45
trigger10 = anim = 46
y = 1.5


        ;hover
[State 0, VelAdd]
type = VelAdd
triggerall = statetype = A
triggerall = vel y > 2
triggerall = movetype != A
triggerall = movetype != H
triggerall = ctrl
trigger1= command = "holdup"
y = -0.55


;Remove Explods if not in that state
[State -3]
type = removeexplod
id = 195
trigger1 = numexplod(195) > 0
trigger1 = stateno != 195

[State -3]
type = removeexplod
id = 2000
trigger1 = numexplod(2000) > 0
trigger1 = stateno != 2000

[State -3]
type = removeexplod
id = 2001
trigger1 = numexplod(2001) > 0
trigger1 = stateno != 2001

[State -3]
type = removeexplod
id = 2002
trigger1 = numexplod(2002) > 0
trigger1 = stateno != 2002

[State -3]
type = removeexplod
id = 2003
trigger1 = numexplod(2003) > 0
trigger1 = stateno != 2003

[State -3]
type = removeexplod
id = 2004
trigger1 = numexplod(2004) > 0
trigger1 = stateno != 2004

[State -3]
type = removeexplod
id = 614
trigger1 = numexplod(614) > 0
trigger1 = stateno != 611

[State -3]
type = removeexplod
id = 615
trigger1 = numexplod(615) > 0
trigger1 = stateno != 612

[State -3]
type = removeexplod
id = 200
trigger1 = numexplod(200) > 0
trigger1 = stateno != 200

[State -3]
type = removeexplod
id = 210
trigger1 = numexplod(210) > 0
trigger1 = stateno != 210

[State -3]
type = removeexplod
id = 220
trigger1 = numexplod(220) > 0
trigger1 = stateno != 220

[State -3]
type = removeexplod
id = 230
trigger1 = numexplod(230) > 0
trigger1 = stateno != 230

[State -3]
type = removeexplod
id = 240
trigger1 = numexplod(240) > 0
trigger1 = stateno != 240

[State -3]
type = removeexplod
id = 250
trigger1 = numexplod(250) > 0
trigger1 = stateno != 250

[State -3]
type = removeexplod
id = 400
trigger1 = numexplod(400) > 0
trigger1 = stateno != 400

[State -3]
type = removeexplod
id = 410
trigger1 = numexplod(410) > 0
trigger1 = stateno != 410

[State -3]
type = removeexplod
id = 420
trigger1 = numexplod(420) > 0
trigger1 = stateno != 420

[State -3]
type = removeexplod
id = 430
trigger1 = numexplod(430) > 0
trigger1 = stateno != 430

[State -3]
type = removeexplod
id = 440
trigger1 = numexplod(440) > 0
trigger1 = stateno != 440

[State -3]
type = removeexplod
id = 450
trigger1 = numexplod(450) > 0
trigger1 = stateno != 450

[State -3]
type = removeexplod
id = 600
trigger1 = numexplod(600) > 0
trigger1 = stateno != 600

[State -3]
type = removeexplod
id = 610
trigger1 = numexplod(610) > 0
trigger1 = stateno != 610

[State -3]
type = removeexplod
id = 620
trigger1 = numexplod(620) > 0
trigger1 = stateno != 620

[State -3]
type = removeexplod
id = 630
trigger1 = numexplod(630) > 0
trigger1 = stateno != 630

[State -3]
type = removeexplod
id = 640
trigger1 = numexplod(640) > 0
trigger1 = stateno != 640

[State -3]
type = removeexplod
id = 650
trigger1 = numexplod(650) > 0
trigger1 = stateno != 650

[State -3]
type = removeexplod
id = 3
trigger1 = numexplod(3) > 0
trigger1 = stateno != 0

[State -3]
type = removeexplod
id = 2
trigger1 = numexplod(2) > 0
trigger1 = stateno != 0

[State -3]
type = removeexplod
id = 101
trigger1 = numexplod(101) > 0
trigger1 = stateno != 100

[State -3]
type = removeexplod
id = 106
trigger1 = numexplod(106) > 0
trigger1 = stateno != 105


[State -3]; Keep Postition after floating for standing state
type = posset
triggerall = prevstateno = 0
triggerall = pos y != 0
trigger1 = stateno != 0
trigger1 = stateno != 3100
persistent = 0
y = 0

;This controller plays a sound everytime the player lands from a jump, or
;from a back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = S0,6




[State -3, Medium Hit]
type = playsnd
triggerall = random < 350
triggerall = time = 1
trigger1 = stateno = 5000; && anim = 5001
trigger2 = stateno = 5000; && anim = 5011
trigger3 = stateno = 5010; && anim = 5021
trigger4 = stateno = 5020; && anim = 5001 
trigger5 = stateno = 5020; && anim = 5011 
value = 500, 0
channel = 1


[State -3, Super Jump Spark 1]
type = Explod
triggerall = Var(12) = 1
triggerall = NumExplod(901) <= 4
trigger1 = (GameTime%10) = 0
trigger1 = GameTime >= 0
ID = 901
anim = 901
postype = P1
pos = 18,30

[State -3, Super Jump Spark 2]
type = Explod
triggerall = Var(12) = 1
triggerall = NumExplod(901) <= 4
trigger1 = (GameTime%10) = 5
ID = 901
anim = 901
postype = P1
pos = -4,30
sprpriority = 2
ownpal = 1
ignorehitpause = 1



; Combo HitCount
[State -3, hitadd]
type = VarAdd
trigger1 = (HitPauseTime = 1) && (P2MoveType = H) && (MoveHit = 1)
trigger2 = ProjHitTime(0) = 1
v = 21
value = 1
ignorehitpause = 1

[State -3, VarReset];resets normal attacks
type = VarSet
trigger1 = P2MoveType != H
v = 21
value = 0


