;==============================================================
; CNS File for Gotenks by Team Z2
; Normal states : standing, crouching & jumping basics, etc.
;==============================================================
;---------------------------------------------------------------------------

; TAUNT
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 1
poweradd= Cond(Var(50)>0,40,10)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 40

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

[State 0, VarRandom]
type = VarRandom
trigger1 = !Time
v = 9
range = 1,3

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
trigger1 = Var(9)>=2
value = 260+random%3

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
trigger1 = Anim = 195
value = 195,0+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
trigger1 = Anim = 260
value = 195,10+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = !Time
trigger1 = Anim = 261
value = 3,0+random%4
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
trigger1 = Anim = 195
value = 195,20+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
trigger1 = Anim = 260
value = 195,25+random%2
channel = 0
[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = !Time
trigger1 = Anim = 261
value = 3,100+random%4
channel = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Time = 30
value = 1

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

; AIR TAUNT
[Statedef 660]
type = A
ctrl = 0
anim = 660
movetype = I
physics = A
sprpriority = 1
poweradd= Cond(Var(50)>0,40,10)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 40

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 660+random%2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 661
trigger1 = !Time
value = 1001,0 + Random%28
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Anim = 660
trigger1 = !Time
value = 660,0
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Anim = 660
trigger1 = !Time
value = 660,10
channel = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1

; CROUCH TAUNT
[Statedef 460]
type = C
ctrl = 0
anim = 460
velset = 0,0
movetype = I
physics = C
sprpriority = 1
poweradd= Cond(Var(50)>0,40,10)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !Time
value = 460+random%2

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 40

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Anim = 460
trigger1 = AnimElem = 1
movetype = A

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Anim = 460
trigger1 = AnimElem = 3
movetype = I

[State 0, Explod]
type = Explod
trigger1 = Anim = 460
trigger1 = !Time
anim = 1216
ID = 460
pos = -20,0
postype = p1  ;p2,front,back,left,right
facing = -1
scale = .5,.5

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Anim = 460
trigger1 = !Time
value = 460,0
channel = -1

[State 200, HitDef]
type = HitDef
trigger1 = Anim = 460
trigger1 = AnimElem = 2
attr = C, NA
damage = 1
animtype = light
guardflag = MA
hitflag = MAFD
priority = 1, Hit
pausetime = 4,4
guard.pausetime = 2,2
sparkno = s7010
guard.sparkno = s7000
sparkxy = 10, 0
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 3
ground.hittime  = 3
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 3
air.animtype = back
getpower= 40,35
givepower = 0,0
yaccel = 0.5
fall = NumExplod(1000)

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Time = 30
value = 1

[State 195, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

; SALUTE
[Statedef 269]
type = S
ctrl = 0
anim = 269
velset = 0,0
movetype = I
physics = S
sprpriority = 1
poweradd= Cond(Var(50)>0,80,40)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 80

[State 0, VarAdd]
type = VarAdd
trigger1 = Var(50)>0
trigger1 = !Time
var(52) = 60

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = 3000,6
channel = 0

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

;---------------------------------------------------------------------------
; STAND LIGHT PUNCH
[Statedef 200]
type = S
movetype = A
physics = S
anim = 200
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 300

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,0  + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,10 - (5 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 9 < 3,3, fvar(11) * 9)), 0
animtype = light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 40,35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

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

;---------------------------------------------------------------------------
; STAND MEDIUM PUNCH
[Statedef 210]
type = S
movetype = A
physics = N
anim = 210
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10
 
[State 0, VarSet]
type = VarSet
trigger1 = 1
v = 9   
value = -1
persistent = 1
 
[State 210, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 211
 
;---------------------------------------------------------------------------
 ;MP Loop
 [Statedef 211]
type = S
movetype = A
physics = S
anim = 211
ctrl = 0
velset = 0,0
poweradd= 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 311

[State 211, VelSet]
type = VelSet
trigger1 = Time >=0
x = 2
y = 0
persistent = 1
 
[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1= (animelemtime(1)=1)||(animelemtime(2)=1)
trigger2= (animelemtime(3)=1)||(animelemtime(4)=1)
value=3,0 + (random%4)
channel = -1

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 1
value=3,120 + (random%2)
channel = -1
 
[State 211, 1]
type = PlaySnd
trigger1= (animelem=1 && random<350)||(animelem=2 && random<350)
trigger2= (animelem=3 && random<350)||(animelem=4 && random<350)
value = 0, 1
channel = 1
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 1
attr = S, NA
damage = ceil(ifElse(fvar(11) * 6 < 1, 1, fvar(11) * 6)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5
guard.pausetime = 4,4
sparkno = s7010+10*(random%3)  ;s7030
guard.sparkno = s7000
sparkxy = -17,-60
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
air.fall =1
fall.recover = 0
getpower= ifelse(p2movetype=H,5,10), 5
givepower = 0,0
yaccel = 0.5
fall = NumExplod(1000)
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 6 < 1, 1, fvar(11) * 6)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
air.fall =1
fall.recover = 0
getpower= ifelse(p2movetype=H,5,10), 5
givepower = 0,0
fall = NumExplod(1000)
yaccel = 0.5
 
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 6 < 1, 1, fvar(11) * 6)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -10,-70
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
air.fall =1
fall.recover = 0
getpower= ifelse(p2movetype=H,5,10), 5
givepower = 0,0
yaccel = 0.5
fall = NumExplod(1000)
 
[State 211, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = ceil(ifElse(fvar(11) * 6 < 1, 1, fvar(11) * 6)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 4,5 ;8,8
guard.pausetime = 4,4 ;8,8
sparkno = s7010+10*(random%3)
guard.sparkno = s7000
sparkxy = -23,-57
hitsound = s5, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = 1
guard.velocity = -3
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
air.fall =1
fall.recover = 0
getpower= ifelse(p2movetype=H,5,10), 5
givepower = 0,0
yaccel = 0.5
fall = NumExplod(1000)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,5,10)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 5

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1
 
[State 0, VarSet]
type = VarSet
trigger1 = MoveContact = 1
var(9) = Time
persistent = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 211, 1]
type =  ChangeState
triggerall = !AILevel
trigger1 = (!command = "holdy") && (Time >= 20) && (!MoveContact)
trigger2 = var(9) + 16 = Time && var(9) >= 0
trigger3 = RoundState !=2
value = 212
 
 [State 211, 1]
type =  ChangeState
triggerall = AILevel>0
trigger1 = enemy, Pos X < Pos X || Time >16+random%150
trigger1 = (Time >= 20) && (!MoveContact)
value = 212
persistent = 30


 [State 211, 1]
type =  ChangeState
triggerall = AILevel>0
trigger1 = var(9) + 16 = Time && var(9) >= 0
trigger2 = RoundState !=2
value = 212
 
 
 
 
;---------------------------------------------------------------------------
;MP Ender
[Statedef 212]
type = S
movetype = A
physics = S
anim = 212
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 312
 
[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelemtime(3)=0
value=3,50 + (random%2)
channel = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelemtime(3)=0
value=3,108
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 1
channel = 1

[State 0, PosSet]
type = PosAdd
trigger1 = AnimElemTime(5) = 0
x = 30
y = 0
 
    [State 212, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0
 
    [State 212, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(3) >= 0 && AnimElemTime(4) <= 0
    trigger1 = hitPauseTime = [1,11 - (13 - var(15))]
    value = anim
    elem = 4
    ignorehitpause = 1
 
[State 212, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 16 < 3,3, fvar(11) * 16)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 1
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 12;8
ground.velocity = -8 ;-3
guard.velocity = -6
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = Cond(Var(50)>0,11,20)
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,50,100), 25
givepower = 15,15
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,50,100)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 25

[State 0, CtrlSet]
type = CtrlSet
triggerall = Var(50)>0
trigger1 = AnimElem = 7
value = 1

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1
 
;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0 
 
[State 212, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; STAND STRONG PUNCH
[Statedef 220]
type = S
movetype = I
physics = N
anim = 220
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = 7

[State 0, Projectile]
type = Projectile
trigger1 = AILEVEL = 8
trigger1 = PrevStateNo = 241
trigger1 = P2StateType != A
trigger1 = NumExplod(220)<2
ProjID = 220
projanim = 1
projremovetime = 10
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = NumExplod(220)<3
trigger1 = Time = 0
anim = 15999
ID = 220
removetime = -1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 200, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 224
;---------------------------------------------------------------
;SPINSPINSPIN
[Statedef 224]
type    = A
movetype= I
physics = N
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 224

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Pos Y < 0 && anim != 215
value = 215

[State 0, VarAdd]
type = VarAdd
triggerall = (Var(50) >0)
trigger1 = Var(52)<3000
trigger1 = P2MoveType != H
var(52) = Cond((NumHelper(1110)||NumHelper(1116)),1 + (time/200),1 + (time/200))

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = Pos Y >= 0 && anim != 224
value = 224

[State 0, VarRandom]
type = VarRandom
triggerall = Var(37)<3
trigger1 = !Time
trigger2 = Time = 40
v = 37
range = 0,3

[State 0, VelSet]
type = VelSet
trigger1 = !AILEVEL
trigger1 = ifElse(Facing = 1, (NumExplod(90000006)|| NumExplod(90000009) || NumExplod(90000003)) ,(NumExplod(90000004)|| NumExplod(90000007) || NumExplod(90000001)))
triggerall = Pos Y < 0
trigger2 = AILevel>0&&AILEVEL<5
trigger2 = enemy, Vel X <0
trigger2 = Var(37)>=3
x = .5
ignorehitpause = 1
[State 0, VelSet]
type = VelSet
trigger1 = !AILEVEL
trigger1 = ifElse(Facing = 1, (NumExplod(90000004)|| NumExplod(90000007) || NumExplod(90000001)) ,(NumExplod(90000006)|| NumExplod(90000009) || NumExplod(90000003)))
triggerall = Pos Y < 0
trigger2 = AILevel>0&&AILEVEL<5
trigger2 = enemy, Vel X >0
trigger2 = Var(37)>=3
x = -.5
ignorehitpause = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = !AILEVEL
trigger1 = NumExplod(90000007) || NumExplod(90000008) || NumExplod(90000009)
trigger2 = AILevel>0&&AILEVEL<5
trigger2 = P2BodyDist X >100
trigger2 = Time>=20+random%200
trigger2 = Var(37)>=3
x = 0
y = -.005

[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90000007) || NumExplod(90000008) || NumExplod(90000009)
trigger2 = AILevel>0&&AILEVEL<5
trigger2 = P2BodyDist X >100
trigger2 = Time>=20+random%200
trigger2 = Var(37)>=3
var(9) = 1

[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = !NumExplod(90000007) && !NumExplod(90000008) && !NumExplod(90000009)
var(9) = 0


[State 0, VelAdd]
type = VelAdd
triggerall =   Pos Y < 0
trigger1 = !AILEVEL
trigger1 = !NumExplod(90000007) && !NumExplod(90000008) && !NumExplod(90000009)
x = 0
y = .01

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = pos y<0
statetype = A       ;S,A,C,L
physics = N        ;A,C,S,N
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >= 0
statetype = S       ;S,A,C,L
physics = S    

[State 0, VelAdd]
type = VelAdd
trigger1 = Pos Y <= -50
y = .006

[State 0, VelAdd]
type = VelAdd
trigger1 = Pos Y <= -70
y = .006

[State 0, VelMul]
type = VelMul
trigger1 = Pos Y >= -20 && Var(9) = 1 && Vel Y >=.1
y = -.3


[State 0, VelSet]
type = VelSet
triggerall = Pos Y >= 0
trigger1 = var(9)=0
trigger2 = vel Y >0
x = 0
y = 0


[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Time = 12
value = 3,53
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = Time = 12
value = 3,109
channel = 0

[State 224, spin1]
type = PlaySnd
trigger1 = Time = 10
value = 220, 0
channel = 2

[State 224, StopSnd]
type = StopSnd
trigger1 = Time = 35
channel = 2

[State 224, spin2]
type = PlaySnd
trigger1 = Time = 36
value = 220, 1
channel = 2

[State 224, StopSnd]
type = StopSnd
trigger1 = Time = 71
channel = 2

[State 224, spin2]
type = PlaySnd
trigger1 = Time = 72
value = 220, 2
channel = 2
loop = 1

[State 224, LVLup]
type = PlaySnd
trigger1 = Time = 36
value = 220, 3
channel = 4


[State 224, LVLup]
type = PlaySnd
trigger1 = Time = 72
value = 220, 5
channel = 4


[State 224, LVLupLoop]
type = PlaySnd
trigger1 = Time = 319
value = 220, 4
channel = 4
Loop = 1


[State 224, 1]
type = PalFx
trigger1 = Time = 36
trigger2 = Time = 72
time = 3
add = 256, 256, 0

[State 224, Explod]
type = Explod
trigger1 = Time = 0
anim = 214
ID = 214
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 224, Explod]
type = Explod
trigger1 = Time = 36
anim = 216
ID = 216
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 224, Explod]
type = Explod
trigger1 = Time = 72
anim = 228
ID = 228
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -1
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, VarRandom]
type = VarRandom
trigger1 = Time >= 41
v = 37
range = 7,18
persistent = 30

[State 224, 1]
type = ChangeState
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  && command = "holdback" && Pos Y >= 0
triggerall = Time >= 72
trigger2 = AILEVEL
trigger2 = !NumProjID(220)
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <40
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
value = 227

[State 224, 1]
type = ChangeState
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  && command = "holdback" && Pos Y >= 0
triggerall = Time = [36,71]
trigger2 = AILEVEL
trigger2 = !NumProjID(220)
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <40
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
value = 226

[State 224, 1]
type = ChangeState
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  && command = "holdback" && Pos Y >= 0
trigger2 = AILEVEL
trigger2 = !NumProjID(220)
triggerall = Time <= 36
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <40
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
value = 225

[State 224, 1]
type = ChangeState
triggerall = Anim = 224
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  
triggerall = Time >= 72
trigger2 = AILEVEL
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = Time >=180
trigger5 = AILevel && Var(37)=8
trigger6 = AILevel && P2MoveType = I && P2StateType !=A
trigger6 = (Random<200*((AIlevel**2)/64.0))
value = 223

[State 224, 1]
type = ChangeState
triggerall = Anim = 224
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  
triggerall = Time = [36,71]
trigger2 = AILEVEL
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = AILevel && Var(37)=8
value = 222


[State 224, 1]
type = ChangeState
triggerall = Anim = 224
trigger1 = !AILEVEL
trigger1 = !(command = "holdz") 
trigger2 = AILEVEL
trigger2 = !NumProjID(220)
trigger2 = Time <36
trigger2 = Pos Y >= 0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = AILevel && Var(37)=8
trigger4 = !NumProjID(220)
value = 221

[State 224, 1]
type = ChangeState
triggerall = Anim = 215
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  
triggerall = Time >= 72
trigger2 = AILEVEL
trigger2 = Pos Y < 0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = AILEVEL
trigger4 = Time >=180
trigger5 = AILevel && Var(37)=8
trigger6 = AILevel && P2MoveType = I && P2StateType !=A
trigger6 = (Random<200*((AIlevel**2)/64.0))
value = 22223

[State 224, 1]
type = ChangeState
triggerall = Anim = 215
trigger1 = !AILEVEL
trigger1 = !(command = "holdz")  
triggerall = Time = [36,71]
trigger2 = AILEVEL
trigger2 = Pos Y < 0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = AILevel && Var(37)=8
value = 22222


[State 224, 1]
type = ChangeState
trigger1 = !AILEVEL
triggerall = Anim = 215
trigger1 = !(command = "holdz") 
trigger2 = AILEVEL
trigger2 = Time <36
trigger2 = Pos Y <0
trigger2 = P2BodyDist X <151
trigger2 = random < (600 * (AILevel ** 2 / 64.0))
trigger3 = RoundState !=2
trigger4 = AILevel && Var(37)=8
value = 22221

[State 0, ChangeState]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = NumProjID(220)
value = 100



;---------------------------------------------------------------
;SP1
[Statedef 221]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 221

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 321

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y < 0 && animelem = 3
trigger2 = MoveContact
y = 4

[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(10)=1
y = 0


[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=4 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=4 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1


[State 221, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 7
y = 0

[State 221, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = -1
y = 0


    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 221
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 321
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (9 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1


[State 221, hit]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 3,3, fvar(11) * 47)), 0
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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


;---------------------------------------------------------------
;SP2
[Statedef 222]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 222

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 322

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 216

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y < 0 && animelem = 3
trigger2 = MoveContact
y = 4

[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(9)=1
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=3
value = 3,52
channel = 0

[State 222, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 17
y = 0

[State 222, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = -3
y = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 220, 6
channel = 1

    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 222
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 322
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (9 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

[State 222, hit]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = ceil(ifElse(fvar(11) * 57 < 3,3, fvar(11) * 57)), 10
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
ground.velocity = -6,-6
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -3,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
fall = 1
ID = 1098

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;---------------------------------------------------------------
;SP3
[Statedef 223]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 223

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 323

[State 0, VelSet]
type = VelSet
triggerall = Pos Y < 0
trigger1 =  animelem = 3
trigger2 = MoveContact 
y = 4



[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(18)=1
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=5
value = 3,54 
channel = 0

[State 223, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 34
y = 0

[State 223, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = 0
y = 0

[State 223, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 220, 7
channel = 1

[State 224, Explod]
type = Explod
trigger1 = AnimElem = 1
anim = 229
ID = 229
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 227
ID = 227
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 3
shadow = 0,0,0
ownpal = 0
removeongethit = 1



[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 228


[State 223, Trans]
type = Trans
trigger1 = AnimElemTime(3) = 0 || AnimElemTime(3) = 1
trigger2 = AnimElemTime(3) = 4 || AnimElemTime(3) = 5
trigger3 = AnimElemTime(5) = 2 || AnimElemTime(5) = 3
trans = addalpha
alpha = 0,256
ignorehitpause = 1

[State 223, Explod]
type = Explod
trigger1 = AnimElem = 2 
anim = 226
ID = 226
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type =  Explod
trigger1 = MoveContact =1 
anim = 3436
ID = 3436
pos = 80,-40
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = MoveContact = 1
value = 220,8
channel = -1
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = MoveContact = 1 && Pos Y = 0
x = 0
y = 0

[state 17100, wave power FX]
type = explod
trigger1 = MoveContact = 1
anim = 18202
id = 18202
pos = 20,-70
postype = P1
sprpriority = 3
ownpal = 1
supermovetime = 999999
pausemovetime = 999999
removetime = -2
persistent = 0
scale = 1,1
ignorehitpause = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = movecontact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(3) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,35 - (22 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

[State 227, hit]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 77 < 3,3, fvar(11) * 77)), 0
animtype = Back
air.animtype = back
fall.animtype = back
guardflag = A
hitflag = MAF
priority = 4, Hit
pausetime = 35,35
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
ground.velocity = -6,-6
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -8,-7
ground.cornerpush.veloff = 0
p2facing = 1 
fall = 1
fall.recover = 0
envshake.time = 35
envshake.freq = 72.5
envshake.ampl = 10

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, TargetState]
type = TargetState
triggerall = NumTarget > 0
trigger1 = MoveHit 
value = 1223
ignorehitpause = 1
persistent = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;---------------------------------------------------------------
;A SP1
[Statedef 22221]
type    = A
movetype= A
physics = A
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 232

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >=0
statetype = S       ;S,A,C,L
physics = S         ;A,C,S,N

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y >= -10
x = 1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 332

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y < 0 && animelem = 3
trigger2 = MoveContact
y = 4

[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(10)=1
y = 0


[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=4 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=4 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1


[State 221, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 7
y = 0

[State 221, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = -1
y = 0


    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 232
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 332
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (9 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1


[State 221, hit]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 3,3, fvar(11) * 47)), 0
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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


;---------------------------------------------------------------
;A SP2
[Statedef 22222]
type    = A
movetype= A
physics = A
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 233

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >=0
statetype = S       ;S,A,C,L
physics = S         ;A,C,S,N

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 333

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 216

[State 0, VelSet]
type = VelSet
trigger1 = Pos Y < 0 && animelem = 3
trigger2 = MoveContact
y = 4

[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(9)=1
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=3
value = 3,52
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 
value = 3,110 + (random%6)
channel = 0

[State 222, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 17
y = 0

[State 222, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = -3
y = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 220, 6
channel = 1

    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 233
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 333
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (9 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

[State 222, hit]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = ceil(ifElse(fvar(11) * 57 < 3,3, fvar(11) * 57)), 10
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
ground.velocity = -6,-6
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -3,-4
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
fall = 1
ID = 1098

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;---------------------------------------------------------------
;A SP3
[Statedef 22223]
type    = A
movetype= A
physics = A
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 234

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = Pos Y >=0
statetype = S       ;S,A,C,L
physics = S         ;A,C,S,N

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 334

[State 0, VelSet]
type = VelSet
triggerall = Pos Y < 0
trigger1 =  animelem = 3
trigger2 = MoveContact 
y = 4

[State 0, VelSet]
type = VelSet
trigger1 = MoveContact 
x=0

[State 0, VelSet]
type = VelSet
triggerall = Pos Y > -vel y
trigger1 = var(9)=0
trigger2 = vel Y >0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = AnimElemTime(18)=1
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=5
value = 3,54 
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=5 
value = 3,110 + (random%6)
channel = 0

[State 223, VelSet]
type = VelAdd
trigger1 = AnimElem = 3
x = 34
y = 0

[State 223, VelSet]
type = VelAdd
trigger1 = AnimElem = 6
x = 0
y = 0

[State 223, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 220, 7
channel = 1


[State 224, Explod]
type = Explod
trigger1 = AnimElem = 1
anim = 229
ID = 229
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 227
ID = 227
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 3
shadow = 0,0,0
ownpal = 0
removeongethit = 1

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 228


[State 223, Trans]
type = Trans
trigger1 = AnimElemTime(3) = 0 || AnimElemTime(3) = 1
trigger2 = AnimElemTime(3) = 4 || AnimElemTime(3) = 5
trigger3 = AnimElemTime(5) = 2 || AnimElemTime(5) = 3
trans = addalpha
alpha = 0,256
ignorehitpause = 1

[State 223, Explod]
type = Explod
trigger1 = AnimElem = 2 
anim = 235
ID = 226
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause = 1

[State 0, Explod]
type =  Explod
trigger1 = MoveContact =1 
anim = 3436
ID = 3436
pos = 80,-40
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = MoveContact = 1
value = 220,8
channel = -1
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = MoveContact = 1 && Pos Y = 0
x = 0
y = 0

[state 17100, wave power FX]
type = explod
trigger1 = MoveContact = 1
anim = 18202
id = 18202
pos = 20,-70
postype = P1
sprpriority = 3
ownpal = 1
supermovetime = 999999
pausemovetime = 999999
removetime = -2
persistent = 0
scale = 1,1
ignorehitpause = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = movecontact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(3) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,35 - (22 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1


[State 227, hit]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 77 < 3,3, fvar(11) * 77)), 0
animtype = Back
air.animtype = back
fall.animtype = back
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 35,35
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s5, 2
guardsound = S6,0
ground.type = High
ground.slidetime = 18
ground.hittime  = 24
ground.velocity = -6,-6
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High
air.velocity = -8,-7
ground.cornerpush.veloff = 0
p2facing = 1 
fall = 1
fall.recover = 0
envshake.time = 35
envshake.freq = 72.5
envshake.ampl = 10

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, TargetState]
type = TargetState
triggerall = NumTarget > 0
trigger1 = MoveHit 
value = 1223
ignorehitpause = 1
persistent = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;--------------------------------------------------
;Launcher SP1
[Statedef 225]
type    = S
movetype= A
physics = S
juggle  = 1
poweradd= 0
ctrl = 0
velset = 0,0
anim = 225

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 325

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214


[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 216

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 228

[State 0, PosAdd]
type = PosAdd
trigger1 = !Time
trigger1 = NumExplod(225)
x = 10

    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 225
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,13 - (14 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 325
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,13 - (12 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1


[State 225, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 47 < 3,3, fvar(11) * 47)), 0
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 15,15
guard.pausetime = 15,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -1,-11
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
fall = 1
fall.recovertime = 46
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 0
givepower = 35,35
yaccel = 0.45
p2facing = 1

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;--------------------------------------------------
;Launcher SP2
[Statedef 226]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= Cond(Var(50)>0,10,0)
ctrl = 0
velset = 0,0
anim = 231

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 331

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214


[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 216

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 228

[State 0, PosAdd]
type = PosAdd
trigger1 = !Time
trigger1 = NumExplod(225)
x = 10

[State 0, Helper]
type = Helper
trigger1 = Anim = 331
trigger1 = AnimElemTime(3)=0
name = "Shield"
ID = 2705
stateno = 2705
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 999999
pausemovetime = 999999

    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 231
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,13 - (14 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = Anim = 331
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,13 - (12 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1


[State 225, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 67 < 3,3, fvar(11) * 67)), 0
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 15,15
guard.pausetime = 15,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -1,-11
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
fall = 1
fall.recovertime = 0
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.45
p2facing = 1
id = 226

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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

;--------------------------------------------------
;Launcher SP3
[Statedef 227]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= Cond(Var(50)>0,20,0)
ctrl = 0
velset = 0,0
anim = 231

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 331

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 214


[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 216

[State 223, RemoveExplod]
type = RemoveExplod
trigger1 = 1
id = 228

[State 0, PosAdd]
type = PosAdd
trigger1 = !Time
trigger1 = NumExplod(225)
x = 10

[State 0, Helper]
type = Helper
trigger1 = Anim = 331
trigger1 = AnimElemTime(3)=0
name = "Shield"
ID = 2705
stateno = 2705
pos = 0,0
postype = p1    ;p2,front,back,left,right
ownpal = 1
supermovetime = 999999
pausemovetime = 999999

    [State 221, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 221, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1


[State 1900, dust]
type = explod
trigger1 = animelemtime(4)=0
anim = 908
id = 909
pos = 17,5
sprpriority = 4
bindtime = 1
ownpal = 1
removeongethit = 0
ignorehitpause = 1
facing = -1
removetime = -2
persistent = 0
pausemovetime = 99999
supermovetime = 99999

[State 3000, SFX]
type = PlaySnd
trigger1 = MoveContact = 1
value = 227,0
ignorehitpause = 1
persistent = 0

[State 3000, Effect]
type = palfx
trigger1 = MoveContact 
time = 1
add = 30,30,50
mul = 256,256,200
sinadd = -5,-5,-5,15

[state 17100, wave power FX]
type = explod
trigger1 = MoveContact = 1
anim = 18202
id = 18202
pos = 20,-70
postype = P1
sprpriority = 3
ownpal = 1
supermovetime = 999999
pausemovetime = 999999
removetime = -2
persistent = 0
scale = 1,1
ignorehitpause = 1

[State 225, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 87 < 3,3, fvar(11) * 87)), 0
hitflag = MAF
priority = 4, Hit
pausetime = 35,35
guard.pausetime = 15,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -1,-11
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
fall = 1
fall.recovertime = 0
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.45
p2facing = 1
id = 226
envshake.time = 35
envshake.freq = 72.5
envshake.ampl = 10

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

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


;--------------------------------------------------
;Launcher SP2
;[Statedef 226]
;type    = S
;movetype= A
;physics = S
;juggle  = 1
;poweradd= Cond(Var(50)>0,= 0
;ctrl = 0
;velset = 0,0
;anim = 225


;[State 200, 1];voice
;type = PlaySnd
;triggerall = var(55)=1		;Voice=English
;trigger1 = animelem=2 
;value = 3,9 + (random%7)
;channel = 0

;[State 221, 1]
;type = PlaySnd
;trigger1 = animelem = 5
;value = 0, 2
;channel = 1

;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 214


;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 216

;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 228

;[State 0, Helper]
;type = Helper
;trigger1 = !Time
;name = "Lightening Uppercut"
;ID = 217
;stateno = 217
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1

    ;[State 221, Time Offset]
    ;type = VarSet
    ;trigger1 = moveContact = 1
    ;var(15) = Time
   ; ignorehitpause = 1
   ; persistent = 0

   ; [State 221, Play Anim]
  ;  type = ChangeAnim
   ; triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
   ; trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    ;value = anim
   ; elem = 6
   ; ignorehitpause = 1


;[State 3000, basics limiter]
;type = helper
;trigger1 = !NumHelper(15999)
;trigger1 = movehit
;stateno = 15999
;ID = 15999
;name = "basics"
;postype = p1
;pos = 0,0
;ownpal = 1

;[State 0, VarSet]
;type = VarSet
;trigger1 = command = "dda" || command = "ddb" || command = "ddc"
;var(12) = 2

;[State 0, VarSet]
;type = VarSet
;trigger1 = command = "ddx" || command = "ddy" || command = "ddz"
;var(12) = 1

;[State 221, Idle]
;type= statetypeset
;trigger1= animelemtime(6)>=0
;movetype= I

;[State 221, finish]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

;--------------------------------------------------
;Launcher SP3
;[Statedef 227]
;type    = S
;movetype= A
;physics = S
;juggle  = 1
;poweradd= Cond(Var(50)>0,= 0
;ctrl = 0
;velset = 0,0
;anim = 225


;[State 200, 1];voice
;type = PlaySnd
;triggerall = var(55)=1		;Voice=English
;trigger1 = animelem=2 
;value = 3,9 + (random%7)
;channel = 0

;[State 221, 1]
;type = PlaySnd
;trigger1 = animelem = 5
;value = 0, 2
;channel = 1

;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 214


;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 216

;[State 223, RemoveExplod]
;type = RemoveExplod
;trigger1 = 1
;id = 228

;[State 0, Helper]
;type = Helper
;trigger1 = !Time
;name = "EX Lightening Uppercut"
;ID = 218
;stateno = 218
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1

    ;[State 221, Time Offset]
    ;type = VarSet
    ;trigger1 = moveContact = 1
    ;var(15) = Time
    ;ignorehitpause = 1
    ;persistent = 0

   ; [State 221, Play Anim]
    ;type = ChangeAnim
    ;triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    ;trigger1 = hitPauseTime = [1,13 - (20 - var(15))]
    ;value = anim
    ;elem = 6
    ;ignorehitpause = 1


;[State 225, 3]
;type = HitDef
;trigger1 = AnimElem = 3
;attr = S, NA
;damage = ceil(ifElse(fvar(11) * 67 < 3,3, fvar(11) * 67)), 0
;hitflag = MAF
;priority = 4, Hit
;pausetime = 15,15
;sparkno = s7030
;guard.sparkno = s7000
;sparkxy = -20,-65
;hitsound   = s5, 2
;guardsound = S6,1
;animtype = Up
;ground.type = High
;ground.slidetime = 12
;ground.hittime = 12
;ground.velocity = -1,-11.5
;guard.velocity = -9
;air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
;fall = 1
;fall.recover = 0
;air.animtype = back
;getpower= ifelse(p2movetype=H,110,310), 100
;givepower = 35,35
;yaccel = 0.45
;p2facing = 1

;[State 3000, basics limiter]
;type = helper
;trigger1 = !NumHelper(15999)
;trigger1 = movehit
;stateno = 15999
;ID = 15999
;name = "basics"
;postype = p1
;pos = 0,0
;ownpal = 1

;[State 0, VarSet]
;type = VarSet
;trigger1 = command = "dda" || command = "ddb" || command = "ddc"
;var(12) = 2

;[State 0, VarSet]
;type = VarSet
;trigger1 = command = "ddx" || command = "ddy" || command = "ddz"
;var(12) = 1

;[State 221, Idle]
;type= statetypeset
;trigger1= animelemtime(6)>=0
;movetype= I

;[State 0, Helper]
;type = Helper
;trigger1 = MoveHit
;name = "Teleportahhh"
;ID = 213
;stateno = 213
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1

;[State 200, teleport sfx]
;type = PlaySnd
;trigger1 = MoveHit
;trigger2 = NumHelper(218)
;trigger2 = helper(218), MoveContact
;value = 2302, 0

;[State 221, finish]
;type = ChangeState
;trigger1 = MoveHit
;value = 228
;ctrl = 0

;[State 221, finish]
;type = ChangeState
;trigger1 = NumHelper(218)
;trigger1 = helper(218), MoveContact
;value = 11228
;ctrl = 0

;[State 221, finish]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

;--------------------------------------------------
;Hit with Launcher SP3
[Statedef 228]
type    = A
movetype= A
physics = N
velset = 0,0
Anim = 218

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 1
x = (P2Dist X) -16
y = (P2Dist Y) -110

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

;--------------------------------------------------
;Hit by Launcher SP3
[Statedef 11228]
type    = A
movetype= A
physics = N
velset = 0,0
Anim = 218

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 1
x = (P2Dist X) -50
y = (P2Dist Y) -110

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

;--------------------------------------------------
;Falling
[Statedef 229]
type    = A
movetype= A
physics = A
velset = 0,0
anim = 219


[State 0, VelSet]
type = VelSet
trigger1 = Time <= 5
x = 3
y = -4

[State 0, ChangeState]
type = ChangeState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 52
ctrl = 1

;------------------
; - shaking from hit
[Statedef 1223]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1223, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1223

[State 1223, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1224

;--------------------------------------------------
; - shaking from hit
[Statedef 1223]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1223, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1223

[State 1223, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1224



;------------------
;  - flying through the air
[Statedef 1224]
type    = A
movetype= H
physics = N

[State VelSet]
type = velset
trigger1 = Time = 0
x = gethitvar(xvel)* facing
y = gethitvar(yvel) 

[State 1224, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1224, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1224, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1225

[State 1224, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; - hit wall
[Statedef 1225]
type    = A
movetype= H
physics = N

[State 1225, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1225, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1225, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1225, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1225, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1224

[State 1225, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 1226



;------------------
; - bounce off wall
[Statedef 1226]
type    = A
movetype= H
physics = N


[State 1226, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -7

[State 1226, Vel X]
type = VelSet
trigger1 = Time = 0
x = 1.6



[State 1226, Gravity]
type = VelAdd
trigger1 = 1
y = .25

[State 1226, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1226, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1226, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1226, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1226, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100



;---------------------------------------------------------------
;STAND LIGHT KICK
[Statedef 230]
type = S
movetype = A
physics = S
anim = 230
ctrl = 0
velset = 0,0
poweradd= 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 330

[State 230, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 230, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 3
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(3) >= 0 && AnimElemTime(4) <= 0
    trigger1 = hitPauseTime = [1,10 - (6 - var(15))]
    value = anim
    elem = 4
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = ceil(ifElse(fvar(11) * 9 < 3,3, fvar(11) * 9)), 0
animtype = light
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -52
hitsound = s5, 3
guardsound = S6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 12
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 12
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 40,35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

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

;---------------------------------------------------------------
;STAND MEDIUM KICK
[Statedef 240]
type = S
movetype = A
physics = S
anim = 240
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 340

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1  && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

[State 0, VelSet]
type = VelAdd
trigger1 = AnimElem = 2
x = 7
y = 0

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 16;8
ground.velocity = -8 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(225)
trigger1 = MoveContact = 1
anim = 1606
ID = 225
removetime = -1
removeongethit = 1
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
triggerall = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
trigger1 = !AILEVEL
trigger1 = NumExplod(90000240) ;&& !(command = "holdback")  
trigger2 = AILEVEL = 8
trigger2 = MoveHit
trigger3 = AILEVEL
trigger3 = random < 600*(AIlevel ** 2 / 64.0)
var(9) = 1

;[State 0, VarSet]
;type = VarSet
;trigger1 = (Command = "b") && (command = "holdback")  
;trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
;var(9) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, ChangeState]
type = ChangeState
trigger1 = var(9)=1 && AnimElem = 5
value = 241
ctrl = 0

[State 0, ChangeState]
type = null;ChangeState
trigger1 = var(9)=2 && AnimElem = 5
value = 243
ctrl = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(3)>=0
value = 0

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

;---------------------------------------------------------------
;STAND MEDIUM KICK 2
[Statedef 241]
type = S
movetype = A
physics = S
anim = 241
ctrl = 0
velset = 7,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 0

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = !Time
id = 225

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 341

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1 && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 1
value = 0, 4
channel = 1


    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(1) >= 0 && AnimElemTime(2) <= 0
    trigger1 = hitPauseTime = [1,11 - (3 - var(15))]
    value = anim
    elem = 2
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = Cond(Anim = 341,22,20);8
ground.velocity = -8 ;-3
guard.velocity = -6
guard.slidetime = 12
guard.hittime = 20
guard.ctrltime = 20
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = !NumExplod(225)
trigger1 = MoveContact = 1
anim = 1606
ID = 225
removetime = -1
removeongethit = 1
ignorehitpause = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(3)>=0
value = 0

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

;---------------------------------------------------------------
;Reverse STAND MEDIUM KICK
[Statedef 242]
type = S
movetype = A
physics = S
anim = 242
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1  && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

[State 0, VelSet]
type = VelAdd
trigger1 = AnimElem = 2
x = -7
y = 0

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 12;8
ground.velocity = -8 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, VarSet]
type = VarSet
trigger1 = (Command = "b") && !(command = "holdback")  
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
var(9) = 1

[State 0, VarSet]
type = VarSet
trigger1 = (Command = "b") && (command = "holdback")  
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
var(9) = 2

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, ChangeState]
type = ChangeState
trigger1 = var(9)=1 && AnimElem = 5
value = 241
ctrl = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = var(9)=2 && AnimElem = 5
value = 243
ctrl = 0

[State 221, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I


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

;---------------------------------------------------------------
;Reverse STAND MEDIUM KICK 2
[Statedef 243]
type = S
movetype = A
physics = S
anim = 243
ctrl = 0
velset = -7,0
poweradd = 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 343

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1 && random<=300
value=3,0+random%4
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem=1  && random<=300
value=3,104+random%4
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 1
value = 0, 4
channel = 1


    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(1) >= 0 && AnimElemTime(2) <= 0
    trigger1 = hitPauseTime = [1,11 - (3 - var(15))]
    value = anim
    elem = 2
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -62
hitsound = s5, 4
guardsound = S6,0
ground.type = High
ground.slidetime = 12;8
ground.hittime  = 12;8
ground.velocity = -8 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 221, Idle]
type= statetypeset
trigger1= animelemtime(3)>=0
movetype= I


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

;---------------------------------------------------------------
;STAND STRONG KICK Far
[Statedef 251]
type = S
movetype = A
physics = S
anim = 251
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 351

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(5) <= 0
x = 5
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(15) <= 0
x = 2
y = 0


[State 221, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 40, 1
channel = 1

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 5
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 1

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,13 - (13 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37)), 0
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s250, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 12
guard.hittime = Cond(Anim = 351,20,22)
guard.ctrltime = Cond(Anim = 351,20,22)
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 82
air.animtype = back
fall.recover = 0
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 9
value = 0, 5
channel = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 221
trigger1 = Anim = 351
trigger1 = !Time
x = 15

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=3  && random<=300
value = 3,8 + (random%10)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 && random<=300
value = 3,110 + (random%6)
channel = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(9) >= 0 && AnimElemTime(10) <= 0
    trigger1 = hitPauseTime = [1,13 - (28 - var(15))]
    value = anim
    elem = 10
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 9
attr = S, NA
damage = ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37)), 0
animtype = Hard	
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -17,-73
hitsound = s250, 0
guardsound = S6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
guard.slidetime = 12
guard.hittime = Cond(Anim = 351,20,22)
guard.ctrltime = Cond(Anim = 351,20,22)
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 82
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
air.fall = 1
fall.recover = 0
fall = NumExplod(1000)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, VarSet]
type = VarSet
trigger1 = animelem = 9 
var(9) = 0

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 15 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 15
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(11)>=0
value = 0

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

;---------------------------------------------------------------
;Dashing SP
[Statedef 270]
type = S
movetype = A
physics = S
juggle = 2
ctrl = 0
sprpriority = 1
poweradd= Cond(Var(50)>0,20,0)
velset = 7,0
anim = 270

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(1)>=0
x = 7

[State 0, Explod]
type = Explod
trigger1 = animelem = 2
anim = 10000
ID = 11111
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime = -2

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1
value = 270,0 + (random&1)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=1
value = 3,122
channel = 0

[State 100, steps]
type = playsnd
trigger1 = animelem=2
value = 0,50

[State 100, steps]
type = playsnd
trigger1 = animelem=4
value = 0,51


[State 100, steps]
type = playsnd
trigger1 = animelem=7
value = 0,50

[State 100, steps]
type = playsnd
trigger1 = animelem=9
value = 0,51

 [State 221, hit]
type = HitDef
trigger1 = NumExplod(270)<=1
trigger1 = AnimElem = 2
attr = S, NA
p1facing = 1
p2facing = 1
damage = ceil(ifElse(fvar(11) * 47 < 3,3, fvar(11) * 47)), 0
guardflag = MA
hitflag = MAF
animtype = back
priority = 4, Hit
;pausetime = 3,13
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = 0,-30
hitsound = s270, 2
guardsound = S6,1
ground.type = Low
ground.slidetime = 15
ground.hittime  = 24
;P2StateNo = 274
;ground.velocity = -7
ground.velocity = 0, -11.5
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
;air.velocity = -4,-4
air.velocity = 6,-11.5
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 270
fall = NumExplod(1000)

;juggle limit LVL2
[State 0, ParentVarAdd]
type = ParentVarAdd
trigger1 = MoveHit = 1
trigger1 = P2StateType = A
var(1) = 2

[State 0, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 1
ID = 270
removetime = -1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 0, VarSet]
type = VarSet
trigger1 = MoveHit = 1
var(9) = Time
persistent = 0
 
[State 211, 1]
type =  ChangeState
trigger1 = (Time >= 15) && (MoveHit)
trigger2 = var(9) + 16 = Time && var(9) >= 0
value = 101

[State 0, ChangeState]
type = ChangeState
trigger1 = MoveGuarded
value = 272
ctrl = 0


[State 0, Explod]
type = Explod
trigger1 = animelem = 12
anim = 1216
ID =  1216
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 2
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = animelem = 12
x = -1

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

;---------------------------------------------------------------
;Hit by Dashing SP 
[Statedef 274]
type    = A
movetype= H
physics = N


[State 1226, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5937)
value = 5061

[State 1226, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5937)
value = 5937

[State 0, VelSet]
type = VelSet
trigger1 = Time = 0
x = 0
y = -11.5

[State 1226, Gravity]
type = VelAdd
trigger1 = 1
y = .51

[State 1224, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100





;---------------------------------------------------------------
;Dashing SP Connects
;[Statedef 271]
;type    = A
;movetype= I
;physics = S
;juggle  = 1
;poweradd= 0
;ctrl = 0
;anim = 271

;[State 200, 1];voice
;type = PlaySnd
;triggerall = var(55)=1		;Voice=English
;trigger1 = animelem=1
;value = 200,0  + (random%8)
;channel = 0


;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 2
;x = 5
;y = -2

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 3
;x = 5
;y = -1

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 4
;x = 5
;y = 0

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 5
;x = 5
;y = 1

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 5
;x = 5
;y = 5

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 6
;x = 4

;[State 0, StateTypeSet]
;type = StateTypeSet
;trigger1 = AnimElem = 9
;statetype = S       ;S,A,C,L
;movetype = I        ;I,A,H
;physics = S         ;A,C,S,N

;[State 251, Landing Sound]
;type = PlaySnd
;trigger1 = AnimElem = 9 ;Jump land
;value = 40, 0

;[state 52, Land FX]
;type = helper
;trigger1 = AnimElem = 9
;name = "LandFX"
;stateno = 17100
;id = 17100
;postype = P1
;ownpal = 1
;keyctrl = 0
;supermovetime = 99999
;pausemovetime = 99999

;[State 0, PosSet]
;type = PosSet
;trigger1 = Pos Y >= 0
;y = 0

;[State 221, finish]
;type = ChangeState
;trigger1 = AnimTime = 0
;value = 0
;ctrl = 1

;---------------------------------------------------------------
;Dashing SP Blocked
[Statedef 272]
type    = S
movetype= I
physics = S
juggle  = 1
poweradd= 0
ctrl = 0
velset = -1,-1
anim = 272

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem = 1
value = 5000,11
channel = -1

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem = 1
value = 5000,11
channel = -1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 2
statetype = A       ;S,A,C,L
physics = A

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x = -3
y = -3



[State 251, Landing Sound]
type = PlaySnd
trigger1 = Pos Y = 0 ;Jump land
value = 40, 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

;---------------------------------------------------------------
;Hit by Dashing SP 
;[Statedef 273]
;type    = A
;movetype= H
;physics = N

;[State 1223, Anim] ;Custom animation
;type = ChangeAnim2
;trigger1 = time = 0
;value = 273

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 2
;y = -7

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 3
;y = 1

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 4
;y = 3

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 5
;y = 4

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 6
;y = 4

;[State 0, VelAdd]
;type = VelAdd
;trigger1 = animelem = 7
;y = 5

;[State 0, AngleDraw]
;type = AngleDraw
;trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(5) < 0
;value = -90

;[State 0, SelfState]
;type = SelfState
;trigger1 = AnimElemTime(6) >= 0
;trigger1 = command = "recovery"
;value = 5040

;[State 0, SelfState]
;type = SelfState
;trigger1 = (Vel y > 0) && (Pos y >= -3)
;trigger1 = command = "recovery"
;value = 5200
;
;[State 1224, Hit ground]
;type = SelfState
;trigger1 = (Vel y > 0) && (Pos y >= 0)
;value = 5100


;---------------------------------------------------------------
;CROUCH LIGHT PUNCH
[Statedef 400]
type = C
movetype = A
physics = C
anim = 400
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 405

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
channel = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage = ceil(ifElse(fvar(11) * 9 < 3,3, fvar(11) * 9)), 0
animtype = light
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = 0, -38
hitsound = s5, 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 7
ground.hittime  = 7
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 10
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 40,35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = MoveHit
value = 240
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------
;CROUCH MEDIUM PUNCH
[Statedef 410]
type = c
movetype = A
physics = c
anim = 410
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 415

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=3  && random<=300
value=3,4+random%5
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 && random<=300
value=3,104 + (random%4)
channel = 0
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 1
channel = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 7 || animelem = 8
x = 15
y = 0
 
    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,11 - (12 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -42
hitsound = s5, 1
guardsound = S6,0
ground.type = Low
ground.slidetime = 10;8
ground.hittime  = 10;8
ground.velocity = -6 ;-3
guard.velocity = -4
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = MoveHit
value = 240
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------
;CROUCH MEDIUM PUNCH Chain'd
[Statedef 411]
type = c
movetype = A
physics = c
anim = 411
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=3  && random<=300
value=3,4+random%5
channel = 0
 
[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 && random<=300
value=3,104 + (random%4)
channel = 0

[State 212, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 1
channel = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 7 || animelem = 8
x = 15
y = 0
 
    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,11 - (8 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage = ceil(ifElse(fvar(11) * 25 < 3,3, fvar(11) * 25)), 0
animtype = Medium
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -42
hitsound = s5, 1
guardsound = S6,0
ground.type = Low
ground.slidetime = 10;8
ground.hittime  = 10;8
ground.velocity = -6 ;-3
guard.velocity = -4
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = MoveHit
value = 240
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1


;---------------------------------------------------------------
;CROUCH STRONG PUNCH
[Statedef 420]
type = c
movetype = A
physics = c
anim = 420
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 425

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=4  && random<=300
value = 3,6 + (random%6)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=4 && random<=300
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 5
x = Cond(Anim = 425,10,7)
[State 0, VelSet]
type = VelSet
trigger1 = AnimElem = 6
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 5
x = 18
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 6
x = 8
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 7 || animelem = 8
x = 6
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 9
x = 6
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 10
x = 6
y = 0

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 5
attr = C, NA
damage =  Cond((PrevStateNo = 450||PrevStateNo = 451),ceil(ifElse(fvar(11) * 18 < 3,3, fvar(11) * 18)),ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37))), 0
animtype = Hard	
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 1,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-48
hitsound = s5,2
guardsound = S6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 24
ground.velocity = -7
guard.velocity = -9
airguard.velocity = -2.5,-1.3
air.type = High	
air.velocity = -4,-4
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = 1
fall.recover = 0

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 0, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1 
value = 421
ctrl = 0
ignorehitpause = 1

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 11 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 11
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(7)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1


;---------------------------------------------------------------
;CROUCH Strong Punch Connects
[Statedef 421]
type = c
movetype = I
physics = c
anim = 421
ctrl = 0
velset = 0,0
sprpriority = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 5 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 5
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999


[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------
;CROUCH LIGHT KICK
[Statedef 430]
type = C
movetype = A
physics = C
anim = 430
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 1
juggle = 7

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 435

[State 200, 1];voice
type = PlaySnd
;triggerall = var(55)=1		;Voice=English
trigger1 = animelem=3  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 0, 3
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
    trigger1 = hitPauseTime = [1,10 - (7 - var(15))]
    value = anim
    elem = 5
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage = ceil(ifElse(fvar(11) * 8 < 3,3, fvar(11) * 8)), 0
animtype = light
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 10,10
guard.pausetime = 10,10
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10, -32
hitsound = s5, 3
guardsound = S6,0
ground.type = Low
ground.slidetime = 7
ground.hittime  = 8
ground.velocity = -2.5 ;-3
guard.velocity = -4.5
airguard.velocity = -1.9,-.8	
guard.slidetime = 7
guard.hittime  = 12
guard.ctrltime = 12
air.velocity = -2,-2
air.hittime = 12
air.animtype = back
getpower= 40,35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(6)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = MoveHit
value = 240
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1


;---------------------------------------------------------------
;CROUCH MEDIUM KICK
[Statedef 440]
type = c
movetype = A
physics = c
anim = 440
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 445

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=1  && random<=300
value=3,3+random%3
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 1 && random<=300
value=3,104 + (random%4)
channel = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 410 || PrevStateNo = 411 || PrevStateNo = 212
trigger1 = Time <=10
x = 3
 
[State 212, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1


[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage = ceil(ifElse(fvar(11) * 16 < 3,3, fvar(11) * 16)), 0
animtype = Medium
guardflag = LA
hitflag = MAFD
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -32
hitsound = s5, 4
guardsound = S6,0
ground.type = Low
ground.slidetime = 4;8
ground.hittime  = 12;8
ground.velocity = -2 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, VarSet]
type = VarSet
triggerall = !AILEVEL
triggerall = NumExplod(90000240) ||  command = "b"
triggerall = NumExplod(90000021) || NumExplod(90000022) || NumExplod(90000023)
triggerall = StateType != A
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
var(9) = 1

[State 0, VarSet]
type = VarSet
triggerall = AILEVEL
triggerall = StateType != A
triggerall = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
trigger1 = random < 100*(AIlevel ** 2 / 64.0)
trigger2 = MoveHit
var(9) = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = var(9)=1 && AnimElem = 5
value = 441
ctrl = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AILEVEL = 8
trigger1 = MoveHit
value = 441
ctrl = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------
;CROUCH MEDIUM KICK 2 
[Statedef 441]
type = C
movetype = A
physics = C
anim = 441
ctrl = 0
velset = 5,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 0

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 446

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 && random<200
value = 3,3 + (random%4)
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 1 && random<200
value=3,104 + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,11 - (7 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage = ceil(ifElse(fvar(11) * 16 < 3,3, fvar(11) * 16)), 0
animtype = Medium
guardflag = LA
hitflag = MAFD
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -32
hitsound = s5, 4
guardsound = S6,0
ground.type = Low
ground.slidetime = 4;8
ground.hittime  = 12;8
ground.velocity = -2 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, VarSet]
type = VarSet
triggerall = !AILEVEL
triggerall = NumExplod(90000240) ||  command = "b"
triggerall = NumExplod(90000021) || NumExplod(90000022) || NumExplod(90000023)
triggerall = StateType != A
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
var(9) = 1

[State 0, VarSet]
type = VarSet
triggerall = AILEVEL
triggerall = StateType != A
triggerall = AnimElemTime(2) >= 0 && AnimElemTime(6) < 0 
trigger1 = random < 100*(AIlevel ** 2 / 64.0)
trigger2 = MoveHit
var(9) = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = var(9)=1 && AnimElem = 6
value = 442
ctrl = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------
;CROUCH MEDIUM KICK 3 
[Statedef 442]
type = C
movetype = A
physics = C
anim = 442
ctrl = 0
velset = 5,0
poweradd= Cond(Var(50)>0,10,0)
sprpriority = 1
juggle = 0

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 447

 [State 0, VarSet]
type = VarSet
trigger1 = !Time
var(9) = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,3 + (random%4)
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 2 && random<=300
value=3,104 + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,11 - (4 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 2
attr = C, NA
damage = ceil(ifElse(fvar(11) * 16 < 3,3, fvar(11) * 16)), 0
animtype = Medium
guardflag = LA
hitflag = MAF
priority = 4, Hit
pausetime = 11, 11
guard.pausetime = 11,11
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10, -32
hitsound = s5, 4
guardsound = S6,0
ground.type = Low
ground.slidetime = 8;8
ground.hittime  = 14;8
ground.velocity = -8 ;-3
guard.velocity = -6
airguard.velocity = -2,-1.1
air.type = High	
air.velocity = -3,-3
air.hittime = 12
air.animtype = back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
ID = 1098
fall = NumExplod(1000)

[State 0, Explod]
type = Explod
triggerall = !NumExplod(221)
trigger1 = MoveHit=1
anim = 15999
ID = 221
removetime = 5
removeongethit = 1
ignorehitpause = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(4)>=0
value = 0

[State -1, Insult!]
type = ChangeState
value = 1100
triggerAll = AILevel=8
triggerall = Var(29)=0
triggerall = !NumHelper(1110)  
triggerall = !NumHelper(1116)
triggerall = MoveHit
trigger1 = RoundState = 2 && StateType != A

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1


;---------------------------------------------------------------
;CROUCH STRONG KICK
[Statedef 450]
type = c
movetype = A
physics = c
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)<=0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = Cond(PrevStateNo = 251,456,450)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = PrevStateNo = 251
trigger1 = !Time
value = 2302,0
channel = -1

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = Cond(PrevStateNo = 251,457,455)

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(9) = 0

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, Width]
type = Width
trigger1 = AnimElemTime(4)>=0&&AnimElemTime(9)<=0
player = -30,0

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime (4) = 0
x = 30
y = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = AnimElemTime (4) = 0
x = 10
y = 0
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(7) < 0
x = 5
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=3  && random<=300
value = 3,5 + (random%11)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 && random<=300 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 5, 8
channel = 1

[State ]
type=explod
trigger1=AnimElemTime(3)>=0&&AnimElemTime(5)<=0
anim=f120
pos=16,0
sprpriority = 3
persistent = 4

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
animtype = Back
priority = 4, Hit
damage    = Cond(PrevStateNo = 251,ceil(ifElse(fvar(11) * 18 < 3,3, fvar(11) * 18)),ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37))), 0
hitflag = MAF
guardflag = L
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-10
hitsound   = s450,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -2,-6
guard.velocity = -9
air.velocity = -3,-1
guard.velocity = -2
getpower= ifelse(prevstateno!=750,ifelse(p2movetype=H,40,210),0), ifelse(prevstateno!=750,35,0)
givepower = 35,35
yaccel = 0.5
fall=1
fall.recover = 0

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 3000, basics limiter]
type = helper
trigger1 = !NumHelper(15999)
trigger1 = movehit
stateno = 15999
ID = 15999
name = "basics"
postype = p1
pos = 0,0
ownpal = 1

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(8)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1


;---------------------------------------------------------------
;RUNNING SLIDE
[Statedef 451]
type = c
movetype = A
physics = c
anim = 451
ctrl = 0
velset = 0,0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = 7

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, Width]
type = Width
trigger1 = AnimElemTime(3)>=0&&AnimElemTime(6)<=0
player = -30,0

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime (3) = 0
x = 30
y = 0

[State 0, VelSet]
type = VelSet
trigger1 =  AnimElemTime(6) < 0
x = 5
y = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=3  && random<=300
value = 3,55
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=3 && random<=300 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 4
value = 5, 8
channel = 1

[State ]
type=explod
trigger1=AnimElemTime(3)>=0&&AnimElemTime(5)<=0
anim=f120
pos=16,0
sprpriority = 3
persistent = 4

[State 200, HitDef]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
animtype = Back
priority = 4, Hit
damage    = ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37)), 0
hitflag = MAF
guardflag = L
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-10
hitsound   = s450,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -2,-6
guard.velocity = -9
air.velocity = -3,-1
guard.velocity = -2
getpower= ifelse(prevstateno!=750,ifelse(p2movetype=H,40,210),0), ifelse(prevstateno!=750,35,0)
givepower = 35,35
yaccel = 0.5
fall.recover = 0
fall = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,210)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(8)>=0
value = 0

[State 221, finish]
type = ChangeState
trigger1 = AnimTime = 0
value = 11+(!NumExplod(90000001) && !NumExplod(90000002) && !NumExplod(90000003))
ctrl = 1

;---------------------------------------------------------------------------
; JUMP LIGHT PUNCH
[Statedef 600]
type = A
movetype = A
physics = A
anim = 600
ctrl = 0
poweradd = 0
sprpriority = 1
juggle = 2

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 605

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

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,9 - (6 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 600, 2]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = A, NA
hitflag = MAF
damage    = ceil(ifElse(fvar(11) * 11 < 3,3, fvar(11) * 11)), 0
guardflag = HA
animtype = Light
pausetime = 9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 8  ;7
ground.hittime  = 15
ground.velocity = -3  ;-4
air.velocity = -2,-4
airguard.cornerpush.veloff= 0
getpower= 40, 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || NumExplod(1000))

[State 600, 2]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = A, NA
hitflag = MAF
damage    = ceil(ifElse(fvar(11) * 11 < 3,3, fvar(11) * 11)), 0
guardflag = MA
animtype = Light
pausetime = 9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 8  ;7
ground.hittime  = 15
ground.velocity = -3  ;-4
air.velocity = -2,-4
airguard.cornerpush.veloff= 0
getpower= 40, 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || NumExplod(1000))

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1

;---------------------------------------------------------------------------
; JUMP MEDIUM PUNCH
[Statedef 610]
type    = A
movetype = A
physics = A
juggle = 2
poweradd= Cond(Var(50)>0,10,0)
ctrl = 0
anim = 610
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 615

[State 212, 1];voice
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem=3  && random<=300
value=3,4+random%5
channel = 0
 
[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 3 && random<=300
value=3,104 + (random%4)
channel = 0

[State 212, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 0, 1
channel = 1

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(3) >= 0 && AnimElemTime(4) <= 0
    trigger1 = hitPauseTime = [1,11 - (10 - var(15))]
    value = anim
    elem = 4
    ignorehitpause = 1

[State 610, 2]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, NA
damage = ceil(ifElse(fvar(11) * 36 < 3,3, fvar(11) * 36)), 0
guardflag = HA
hitflag = MAF
animtype  = Medium
priority = 4,Hit
pausetime = 11,15
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,1
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4   ;-5
air.velocity = -2,-4
airguard.cornerpush.veloff= 0
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || prevstateno=600 || prevstateno=630 || NumExplod(1000))

[State 610, 2]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, NA
damage = ceil(ifElse(fvar(11) * 36 < 3,3, fvar(11) * 36)), 0
guardflag = MA
hitflag = MAF
animtype  = Medium
priority = 4,Hit
pausetime = 11,15
sparkno = s7020
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,1
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4   ;-5
air.velocity = -2,-4
airguard.cornerpush.veloff= 0
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || prevstateno=600 || prevstateno=630 || NumExplod(1000))

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1


;---------------------------------------------------------------------------
; JUMP STRONG PUNCH [NORMAL]
[Statedef 620]
type = A
movetype = A
physics = A
anim = 620
ctrl = 0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 2
juggle = ifelse(p2statetype=A,3,15)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 625

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 610
y = -2

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=4  && random<=300
value = 3,6 + (random%6)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=4 && random<=300
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 2
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(5) >= 0 && AnimElemTime(6) <= 0
    trigger1 = hitPauseTime = [1,16 - (10 - var(15))]
    value = anim
    elem = 6
    ignorehitpause = 1

[State 620, 3]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 5
attr = A, NA
damage = ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30)), 0
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 16,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-50
hitsound   = s5,2
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -7,7
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = 1
fall.recover = 0
P2facing = 1

[State 620, 3]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 5
attr = A, NA
damage = ceil(ifElse(fvar(11) * 37 < 3,3, fvar(11) * 37)), 0
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4, Hit
pausetime = 16,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-50
hitsound   = s5,2
guardsound = S6,1
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -7,7
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = 1
fall.recover = 0
P2facing = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = 50 ;ifelse(vel X >= 0,50,116)
ctrl = 0

;---------------------------------------------------------------------------
; JUMP LIGHT KICK
[Statedef 630]
type = A
movetype = A
physics = A
anim = 630
ctrl = 0
poweradd = 0
sprpriority = 1
juggle = 2

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 635

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1  && random<=300
value = 3,0 + (random%4)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=1 && random<=300
value = 3,100  + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 3
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,9 - (7 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 630, 2]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, NA
damage = ceil(ifElse(fvar(11) * 15 < 3,3, fvar(11) * 15)), 0
hitflag = MAF
guardflag = HA
animtype = Light
priority = 4, Hit
pausetime = 9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-50
hitsound   = s5,3
guardsound = S6,0
ground.type = High
ground.slidetime = 8  ;6
ground.hittime  = 15
ground.velocity = -3  ;-4
air.velocity = -2,-3
airguard.cornerpush.veloff= 0
getpower= 40, 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || NumExplod(1000))

[State 630, 2]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 3
attr = A, NA
damage = ceil(ifElse(fvar(11) * 15 < 3,3, fvar(11) * 15)), 0
hitflag = MAF
guardflag = MA
animtype = Light
priority = 4, Hit
pausetime = 9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-50
hitsound   = s5,3
guardsound = S6,0
ground.type = High
ground.slidetime = 8  ;6
ground.hittime  = 15
ground.velocity = -3  ;-4
air.velocity = -2,-3
airguard.cornerpush.veloff= 0
getpower= 40, 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || NumExplod(1000))

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = 40
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1

;---------------------------------------------------------------------------
; JUMP MEDIUM KICK
[Statedef 640]
type    = A
movetype = A
physics = A
juggle = 2
poweradd= Cond(Var(50)>0,10,0)
ctrl = 0
anim = 640
sprpriority = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 10

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Var(50)>0
trigger1 = PrevStateNo != 100
trigger1 = !Time
;trigger1 = Var(51)>=3000
;trigger2 = Power >=3000
value = 645

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = PrevStateNo = 100
trigger1 = !Time
value = 641

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo = 100
x = 3.5

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 100
trigger1 = !Time
x = 20
y = -30

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 && random<200
value = 3,3 + (random%4)
channel = 0

[State 211, 1];voice
type = PlaySnd
triggerall = var(55)=2
trigger1 = AnimElem = 2 && random<200
value=3,104 + (random%4)
channel = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 4
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 0
    trigger1 = hitPauseTime = [1,11 - (7 - var(15))]
    value = anim
    elem = 3
    ignorehitpause = 1

[State 640, 2]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = A, NA
damage = ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30)), 0
guardflag = HA
hitflag = MAF
animtype  = Medium
priority = 4,Hit
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-50
hitsound   = s5,4
guardsound = S6,0
ground.type = High
pausetime = 11,15
guard.pausetime = 11,15
ground.slidetime = 8
ground.hittime = 15
ground.velocity = -4  ;-8
air.velocity = -2,-2
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || prevstateno=600 || prevstateno=630 || NumExplod(1000))

[State 640, 2]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 2
attr = A, NA
damage = ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30)), 0
guardflag = MA
hitflag = MAF
animtype  = Medium
priority = 4,Hit
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-50
hitsound   = s5,4
guardsound = S6,0
ground.type = High
pausetime = 11,15
guard.pausetime = 11,15
ground.slidetime = 8
ground.hittime = 15
ground.velocity = -4  ;-8
air.velocity = -2,-2
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall = (numhelper(15999) || NumExplod(52)=3 || prevstateno=600 || prevstateno=630 || NumExplod(1000))

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1

;---------------------------------------------------------------------------
; JUMP STRONG KICK 
[Statedef 650]
type = A
movetype = A
physics = A
anim = 650
ctrl = 0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = ifelse(p2statetype=A,3,15)
facep2 = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo = 251
x = 1.5

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = !Time
x = 20
y = -50

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 640
y = -4

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 && random<=300 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 6
value = 0, 5
channel = 1

    [State 200, Time Offset]
    type = VarSet
    trigger1 = moveContact = 1
    var(15) = Time
    ignorehitpause = 1
    persistent = 0

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = Anim=650
    triggerall = AnimElemTime(6) >= 0 && AnimElemTime(7) <= 0
    trigger1 = hitPauseTime = [1,16 - (18 - var(15))]
    value = anim
    elem = 7
    ignorehitpause = 1

    [State 200, Play Anim]
    type = ChangeAnim
    triggerall = Anim=655
    triggerall = AnimElemTime(6) >= 0 && AnimElemTime(7) <= 0
    trigger1 = hitPauseTime = [1,16 - (12 - var(15))]
    value = anim
    elem = 7
    ignorehitpause = 1

[State 650, 3]
type = HitDef
triggerall = Vel Y >=0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 6
attr = A, NA
damage = ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30)), 0
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 16,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s250,0
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2,8
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
air.fall = 1
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall =  NumExplod(52)=3 || NumExplod(1000)

[State 650, 3]
type = HitDef
triggerall = Vel Y <0
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 6
attr = A, NA
damage = ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30)), 0
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4, Hit
pausetime = 16,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s250,0
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2,8
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
air.fall = 1
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall =  NumExplod(52)=3 || NumExplod(1000)

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 0, VelSet]
type = VelSet
trigger1 = MoveContact
x = 0
y = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
value = 651
ctrl = 0

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 0

;---------------------------------------------------------------------------
; JUMP STRONG KICK 
[Statedef 659]
type = A
movetype = A
physics = A
anim = 659
ctrl = 0
poweradd= Cond(Var(50)>0,20,0)
sprpriority = 1
juggle = ifelse(p2statetype=A,3,15)
facep2 = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = !Time
var(51) = 20

[State 0, VelSet]
type = VelSet
trigger1 = PrevStateNo = 251
x = 1.5

[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 251
trigger1 = !Time
x = 20
y = -50

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, PosAdd]
type = PosAdd
trigger1 = PrevStateNo = 640
y = -4

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2  && random<=300
value = 3,9 + (random%7)
channel = 0

[State 200, 1];voice
type = PlaySnd
triggerall = var(55)=2		;Voice=English
trigger1 = animelem=2 && random<=300 
value = 3,110 + (random%6)
channel = 0

[State 221, 1]
type = PlaySnd
trigger1 = animelem = 6
value = 0, 5
channel = 1

[State 650, 3]
type = HitDef
triggerall = Var(1) <= 20 && Var(18) = 0 || Var(18) = 1
trigger1 = AnimElem = 6
attr = A, NA
damage = Cond(PrevStateNo = 251,ceil(ifElse(fvar(11) * 15 < 3,3, fvar(11) * 15)),ceil(ifElse(fvar(11) * 30 < 3,3, fvar(11) * 30))), 0
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4, Hit
pausetime = 16,16
sparkno = s7030
guard.sparkno = s7000
sparkxy = -30,-55
hitsound   = s250,0
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = Cond(!NumExplod(659),15,15-NumExplod(659)-1)
ground.velocity = -5
air.velocity = -2,8
envshake.time = 12
envshake.freq = 60
envshake.ampl = 3
airguard.cornerpush.veloff= 0
air.animtype = Back
fall.animtype = Back
air.fall = 1
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
fall =  NumExplod(52)=3 || NumExplod(1000)

[State 0, Explod]
type = Explod
trigger1 = MoveHit=1
anim = 1
ID = 659
removetime = -1
removeongethit = 1

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveHit = 1
var(51) = Cond(P2MoveType = H,40,140)
[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = MoveGuarded = 1
var(51) = 35

[State 0, VelSet]
type = VelSet
trigger1 = MoveContact
x = 0
y = -1



[State 0, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
value = 651
ctrl = 0



[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 0

;---------------------------------------------------------------------------
; Bounce off on connect
[Statedef 651]
type = A
movetype = I
physics = A
ctrl = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 651

[State 0, VelAdd]
type = VelSet
trigger1 = animelemtime(2) >= 1
x = -4
y = -10

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 = NumExplod(90000230)
trigger2 = AILEVEL
trigger2 = P2BodyDist X >60
trigger2 = random < 50*(AIlevel ** 2 / 64.0)
var(12) = 10
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000240) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >80
trigger2 = random < 80*(AIlevel ** 2 / 64.0)
var(12) = 11
persistent = Cond(AILEVEL>0,15,1)

;ghost headslam
[State 0, VarSet]
type = VarSet
triggerall = Var(34) > 0
trigger1 = !AILEVEL
trigger1 = NumExplod(90010808)
trigger1 =  NumExplod(90000250) 
trigger2 = AILEVEL
trigger2 = P2BodyDist X >100
trigger2 = random < 100*(AIlevel ** 2 / 64.0)
var(12) = 12
persistent = Cond(AILEVEL>0,15,1)

;ghost mine
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000230) || NumExplod(90000240) || NumExplod(90000250)
trigger2 = AILEVEL
trigger2 = random < 40*(AIlevel ** 2 / 64.0)
var(12) = 2
persistent = Cond(AILEVEL>0,25,1)

;ghost fire
[State 0, VarSet]
type = VarSet
trigger1 = !AILEVEL
trigger1 = NumExplod(90012602)
trigger1 = NumExplod(90000200) || NumExplod(90000210) || NumExplod(90000220) 
trigger2 = command = "x" && command = "a"
trigger3 = AILEVEL
trigger3 = random < 250*(AIlevel ** 2 / 64.0)
trigger4 = AILEVEL
trigger4 = random < 350*(AIlevel ** 2 / 64.0)
trigger4 = MoveHit
trigger5 = AILEVEL
trigger5 = random < 450*(AIlevel ** 2 / 64.0)
trigger5 = MoveGuarded && P2MoveType = A
trigger6 = AILEVEL
trigger6 = random < 450*(AIlevel ** 2 / 64.0)
trigger6 = P2StateType = A && P2MoveType = H
var(12) = 1 
persistent = Cond(AILEVEL>0,10,1)
[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime 
value = 653
ctrl = 0

;---------------------------------------------------------------------------
; Bounce off gain ctrl
[Statedef 653]
type = A
movetype = I
physics = A
ctrl = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 652

[State 0, VelAdd]
type = VelSet
trigger1 = time = 0
x = -2
y = -5

[State 1400, EndState]
type = ChangeState
trigger1 = !animtime
value = ifelse(vel X >= 0,50,116)
ctrl = 1

;===========================================================================
; <<<<< REVERSE THROW >>>>>
; Grab state : 800
; Gotenks throws : 801
; P2 Throw State : 802
; P2 Flying away : 803
;===========================================================================
;-------------------------------------------------------------------------------

;Forward Throw (Grab)
[Statedef 800]
type = S
movetype = A
physics = S
juggle = 15
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 1
facep2 = 1
poweradd = 0

[State 810, Don't Guard]
type = attackdist
trigger1 = 1
value = 0

[State 810, hit]
type = hitdef
trigger1 = Var(0)=0 || enemy, AuthorName != "Team Z2";NEW
trigger1 = animelem=4 && !var(38)
attr = S,NT
hitflag = M-
priority = 1,Miss
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 801
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1

[State 810, hit]
type = hitdef
trigger1 = animelem=4 && !var(38)
trigger1 = Var(0)>0 ;NEW
attr = S,NT
hitflag = M-
priority = 1,Miss
sparkno = -1
p1facing = 1
p2facing = 1
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1
id = Cond((enemynear, NumExplod(98000000)),800,801);NEW

[State 0, TargetState]
type = TargetState
trigger1 = MoveHit =1
trigger1 = NumTarget(800)
trigger1 = target, StateNo != [800,899]
trigger1 = target, AuthorName = "Team Z2"
value = 899
ignorehitpause = 1
 
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(0)=2
trigger1 = NumTarget(800)
trigger1 = target, time<=5
trigger1 = target, StateNo = 5949
value = 5940
ignorehitpause = 1
persistent = 0
 
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(0)=1
trigger1 = enemynear, StateNo = 950
value = 950
ignorehitpause = 1
persistent = 0
 
[State 0, ChangeState]
type = ChangeState
trigger1 = NumTarget(800)
trigger1 = target, time>=6
trigger1 = target, StateNo = 899
trigger2 = !NumTarget(800)
trigger2 = MoveHit=1
value = 801
ignorehitpause = 1
persistent = 0

[State 810, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 1

[State 810, missed voice]
type = PlaySnd
trigger1 = animelem = 5
value = 5000+(var(55)=1),6
channel = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 810, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;----------------------------
;Gotenks Stomps foot
[Statedef 801]
type = S
movetype = A
physics = S
anim = 801
ctrl = 0
sprpriority = 1

[State 0, PosAdd]
type = PosAdd
triggerall = !Time
trigger1 = Enemy, BackEdgeBodyDist <= 2
x = -40

[State 220, snd]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 3,0+random%5
channel = 0
volumescale = 300

[State Throw]
type = targetstate
trigger1 = !time
value = 802

[State 820, 1]
type = TargetBind
trigger1 = AnimElemTime(7) < 0
pos = ceil(38 * const(size.xScale)),0
[State 820, 1]
type = TargetBind
trigger1 = AnimElemTime(7)>=0 && AnimElemTime(19) < 0
pos = ceil(68 * const(size.xScale)),0
[State 820, 1]
type = TargetBind
trigger1 = AnimElemTime(19)>=0 && AnimElemTime(20) < 0
pos = ceil(88 * const(size.xScale)),0

[State 810, power]
type = poweradd
trigger1 = animelemtime(7)=0
value = 180

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = animelemtime(7)=0
var(51) = 180

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 7
anim = 7020
ID = 7020
pos = 30,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 7
value = 813,0
channel = 0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 15
anim = 7030
ID = 7030
pos = 60,-40
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 15
value = 5,5
channel = -1

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(22) = 0
x = 28

[State 810, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;----------------------------
;P2 Hit by forward Throw
[Statedef 802]
type = S
movetype = H
physics = N
ctrl = 0
sprpriority = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = SelfAnimExist(5886)
value = 802

[State 0, ChangeAnim2] 
type = ChangeAnim2
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5886)
value = 804

[State 0, PlaySnd]
type = null;PlaySnd
triggerall = var(55)=0
trigger1 = animelemtime(11)=0
value = 5000,0 + (random%7)
channel = 0

[State 0, PlaySnd]
type = null;PlaySnd
triggerall = var(55)=2
trigger1 = animelemtime(11)=0
value = 5000,20 + (random%7)
channel = 0

[State 810, Normal throw]
type = LifeAdd
trigger1 = animelemtime(7)=0
value = -10
kill = 0
[State 810, hurt]
type = poweradd
trigger1 = animelemtime(7)=0
value = 35
[State 810, Normal throw]
type = LifeAdd
trigger1 = animelemtime(15)=0
value = -30
kill = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !animtime
value = 803
ctrl = 0

;----------------------------
;P2 flung by forward Throw
[Statedef 803]
type = S
movetype = H
physics = N
ctrl = 0
sprpriority = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 5061

[State 0, VelSet]
type = VelSet
trigger1 = facing != enemy, facing
x = -6.5
y = -6

[State 0, VelSet]
type = VelSet
trigger1 = facing = enemy, facing
x = 6.5
y = -6

[State 0, VelAdd]
type = VelAdd
trigger1 = Time >= 6 && vel X < 0
y = 9
 
[State 0, VelAdd]
type = VelAdd
trigger1 = Time >= 6 && vel X > 0
y = 9

[State 810, Normal throw]
type = LifeAdd
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = -10

[State 1224, Hit ground]
type = SelfState
triggerall = time >= 10
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100


;===========================================================================
; <<<<< REVERSE THROW >>>>>
; Grab state : 810
; Gotenks throws : 811
; Rocket HeadButt : 812
; Contact! : 813
; Lands & turns : 814
; P2 thrown state : 815
; P2 launched state : 816
; P2 Break Back : 5946
; P2 fall : 5061
;===========================================================================
;-------------------------------------------------------------------------------

;Reverse Throw (Grab)
[Statedef 810]
type = S
movetype = A
physics = S
juggle = 15
velset = 0,0
ctrl = 0
anim = 810
sprpriority = 1
facep2 = 1
poweradd = 0

[State 810, Don't Guard]
type = attackdist
trigger1 = 1
value = 0

[State 810, hit]
type = hitdef
trigger1 = Var(0)=0 || enemy, AuthorName != "Team Z2";NEW
trigger1 = animelem=4 && !var(38)
attr = S,NT
hitflag = M-
priority = 1,Miss
sparkno = -1
p1facing = 1
p2facing = 1
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1

[State 810, hit]
type = hitdef
trigger1 = animelem=4 && !var(38)
trigger1 = Var(0)>0 ;NEW
attr = S,NT
hitflag = M-
priority = 1,Miss
sparkno = -1
p1facing = 1
p2facing = 1
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1
id = Cond((enemynear, NumExplod(98000000)),800,801);NEW\

[State 0, TargetState]
type = TargetState
trigger1 = MoveHit =1
trigger1 = NumTarget(800)
trigger1 = target, StateNo != [800,899]
trigger1 = target, AuthorName = "Team Z2"
value = 899
ignorehitpause = 1
 
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(0)=2
trigger1 = NumTarget(800)
trigger1 = target, time<=5
trigger1 = target, StateNo = 5949
value = 5940
ignorehitpause = 1
persistent = 0
 
[State 0, ChangeState]
type = ChangeState
trigger1 = Var(0)=1
trigger1 = enemynear, StateNo = 950
value = 950
ignorehitpause = 1
persistent = 0
 
[State 0, ChangeState]
type = ChangeState
trigger1 = NumTarget(800)
trigger1 = target, time>=6
trigger1 = target, StateNo = 899
trigger2 = !NumTarget(800)
trigger2 = MoveHit=1
value = 811
ignorehitpause = 1
persistent = 0

[State 810, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 1

[State 810, missed voice]
type = PlaySnd
triggerall = var(55)=0
trigger1 = animelem = 5
value = 5000+(var(55)=1),6
channel = 0

[State 810, missed voice]
type = PlaySnd
triggerall = var(55)=2
trigger1 = animelem = 5
value = 5000,23
channel = 0

[State 0, AttackDist]
type = AttackDist
trigger1 = AnimElemTime(5)>=0
value = 0

[State 810, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;----------------------------
;Gotenks's State (flip)
[Statedef 811]
type = S
movetype = A
physics = S
anim = 811
ctrl = 0
sprpriority = 1

[State 220, snd]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 3,0+random%8
channel = 0
volumescale = 300

[State 220, snd]
type = playsnd
triggerall = var(55)=2		;Voice=English
trigger1 = !time
value = 3,110+random%4
channel = 0
volumescale = 300

[State Throw]
type = targetstate
trigger1 = !time
value = 815

[State 820, 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = ceil(37 * const(size.xScale)),0

[State 0, Explod]
type = Explod
trigger1 = AnimElem = 5
anim = 7020
ID = 7020
pos = 30,-70
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,4
channel = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 5
value = 5,4
channel = -1

[State 810, power]
type = poweradd
trigger1 = animelemtime(3)=0
value = 180

[State 0, VarAdd]
type = VarAdd
triggerall = Power>=3000
trigger1 = Var(50)>0
trigger1 = animelemtime(3)=0
var(51) = 180

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElem = 8
x = -65

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 9 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 9
name = "LandFX"
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

[State 811, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 812
ctrl = 0

;----------------------------
;Gotenks's Launch Headbutt
[Statedef 812]
type = A
movetype = A
physics = N
anim = 812
ctrl = 0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 11
value = 0,24
channel = -1

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

[State 811, ChangeState]
type = ChangeState
trigger1 = AnimTime = 19
value = 813
ctrl = 0

;----------------------------
;Gotenks's Connects Headbutt
[Statedef 813]
type = A
movetype = A
physics = N
anim = 813
ctrl = 0
sprpriority = 1

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

[State 0, PosAdd]
type = PosAdd
trigger1 = Time >=40
trigger1 = P2Dist X>-30
x = .5

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=0
trigger1 = Time = 13
value = 5000,9
channel = 0

[State 0, PlaySnd]
type = PlaySnd
triggerall = var(55)=2
trigger1 = Time = 13
value = 5000,35+random%2
channel = 0

[State 0, Explod]
type = Explod
trigger1 = Time = 0
anim = 7030
ID = 7030
pos = -10,-130
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
sprpriority = 4

[State 0, Explod]
type = Explod
trigger1 = Time = 0
anim = 3559
ID = 3559
pos = 10,-120
postype = p1
sprpriority = 5
bindtime = 1
scale = 1,1
supermovetime = 9999
pausemovetime = 9999
removetime = -2
ignorehitpause = 1
persistent = 0
ontop = 1



[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 0
value = 813,0
channel = -1


[State 0, VelSet]
type = VelSet
trigger1 = Time <= 30;14
x = 0
y = -1

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(2) >= 0
y = .6

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElemTime(27) >= 0
y = -.5

[State 0, VelSet]
type = VelSet
trigger1 = (Vel y > 0) && (Pos y >= 0)
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = Pos Y > 0
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = (Pos y >= 0)
value = 814
ctrl = 0



;----------------------------
;Gotenks's Lands
[Statedef 814]
type = S
movetype = I
physics = S
anim = 814
ctrl = 0
sprpriority = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = Anim = 814
value = 0
movecamera = 1,0

[State 251, Landing Sound]
type = PlaySnd
trigger1 = AnimElem = 3 ;Jump land
value = 40, 0

[state 52, Land FX]
type = helper
trigger1 = AnimElem = 3
name = "LandFX"
helpertype = normal
stateno = 17100
id = 17100
postype = P1
ownpal = 1
keyctrl = 0
supermovetime = 99999
pausemovetime = 99999

[State 0, Turn]
type = Turn
trigger1 = AnimElem = 4

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

;----------------------------
;P2 Hit by Back Throw
[Statedef 815]
type = S
movetype = H
physics = S
ctrl = 0
sprpriority = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 0
value = 815

[State 810, Normal throw]
type = LifeAdd
trigger1 = animelemtime(5)=0
value = -10
kill = 0
[State 810, hurt]
type = poweradd
trigger1 = animelemtime(5)=0
value = 35

[State 811, ChangeState]
type = ChangeState
trigger1 = AnimTime = 0
value = 816
ctrl = 0

;----------------------------
;P2 Launched
[Statedef 816]
type = A
movetype = H
physics = A
ctrl = 0
sprpriority = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 0
value = 816



[State 0, VelSet]
type = VelSet
trigger1 = AnimElemTime(1) = 0 && AnimElemTime(2) < 0
x = 4
y = -11.5

[State 0, AngleDraw]
type = AngleDraw
trigger1 = Anim = 816 && AnimElemTime(2) >= 7 && AnimElemTime(2) <= 11
value = -60
[State 0, AngleDraw]
type = AngleDraw
trigger1 = Anim = 816 && AnimElemTime(2) >= 12 && AnimElemTime(2) <= 16
value = -90

[State 3020, 2]
type = ChangeAnim2
trigger1 = P2Dist Y >= 3 && Time = 26
value = 817

[State 810, Normal throw]
type = LifeAdd
trigger1 = Anim = 817 && AnimTime = 1
value = -50
kill = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 26
x = 5
y = -45

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 26
time = 14
freq = 120
ampl = -4
phase = 90

[State 0, Turn]
type = Turn
trigger1 = Anim = 817 && AnimTime = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 1
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 2
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 3
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 4
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 5
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 6
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 7
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 8
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 9
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 10
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 11
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 12
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 13
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 14
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 15
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 16
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 17
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 18
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 19
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 20
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 21
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 22
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 23
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 24
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 25
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 26
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 27
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 28
y = -2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 29
y = 2
[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 30
y = -2


[State 0, PosFreeze]
type = PosFreeze
trigger1 = Anim = 817 && AnimTime <= 28;14
value = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = Anim = 817 && AnimTime = 29
y = -30

[State 0, VelSet]
type = VelSet
trigger1 = Anim = 817 && AnimTime = 29;15
x = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = Anim = 817 && AnimTime >= 30 && AnimTime < 32;17
y = -9

[State 0, VelAdd]
type = VelAdd
trigger1 = Anim = 817 && AnimTime >= 32;17
y = -1

[State 0, ChangeState]
type = ChangeState
trigger1 = Anim = 817 && AnimTime = 38;23
value = 818
ctrl = 0

;----------------------------
;P2 Falling 
[Statedef 818]
type = A
movetype = H
physics = N
ctrl = 0
sprpriority = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = Time = 0
value = 818

[State 0, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(3) <= 1
value = 25
[State 0, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(3) >= 0 && AnimElemTime(4) <= 1
value = 50
[State 0, AngleDraw]
type = AngleDraw
trigger1 = AnimElemTime(4) >= 0 && AnimElemTime(5) <= 0
value = 95

[State 0, PosAdd]
type = PosAdd
trigger1 = Time = 0
x = -40
y = 0

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElem = 1
x = -1
y = 10.5

[State 0, VelAdd]
type = VelAdd
trigger1 = AnimElem >= 3
y = 10

[State 0, VelAdd]
type = VelAdd
trigger1 = PrevStateNo = 817 && AnimElem = 1
y = 10.5

[State 0, VelAdd]
type = VelAdd
trigger1 = PrevStateNo = 817 && AnimElem >= 3
y = 10

[State 0, Turn]
type = Turn
trigger1 = (Vel y > 0) && (Pos y >= 0)

[State 0, AngleDraw]
type = AngleDraw
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 0

[State 1224, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;----------------------------
;Enemy Grabbed
[Statedef 899]
type    = S
movetype= H
physics = N
 
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !Time
value = 899
 
[State 0, PosSet]
type = PosSet
trigger1 = 1
y = 0
 
[State 0, ChangeState]
type = ChangeState
trigger1 = ((NumExplod(90000800))|| (command = "x" && command = "a")) && command != "up"
value = Cond(enemynear,Var(0)=1,950,5940)
 
[State 0, ChangeState]
type = ChangeState
trigger1 = Time >= 6
value = 0
ctrl = 1





