;================================
; CNS File for Vegeta Z2 by Balthazar & Cybaster
; Majin Vegeta Z2 by XGargoyle
; Special and EX moves
;================================

;===========================================================================
; <<<<< KI BLAST >>>>>
;===== LIGHT =====
; Ki Blast Light : 1000
; Ki blast throw anim = 1001
; Ki blast max throw anim = 1002
;---------------------------------------
; Ki blast light 2nd charge : 1003
; Ki blast throw 2nd anim = 1004
;---------------------------------------
; Ki Blast Light Helper : 1005
; Ki Blast Light Helper charge : 1006
; Ki Blast Light Helper charge MAX: 1007
;===== MEDIUM =====
; Ki Blast Medium : 1010
; Ki blast light 2nd charge : 1013
;---------------------------------------
; Ki Blast Medium Helper : 1015
; Ki Blast Medium Helper charge : 1016
; Ki Blast Medium Helper charge MAX: 1017
;===== STRONG =====
; Ki Blast Strong : 1020
; Ki blast Strong 2nd charge : 1023
;---------------------------------------
; Ki Blast Strong Helper : 1025
; Ki Blast Strong Helper charge : 1026
; Ki Blast Strong Helper charge MAX: 1027
;===========================================================================

;----------------------------------------------
;Light Ki Blast - 1st Attack
[Statedef 1000]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10


[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<600
triggerall = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H
trigger2 = (enemynear,Stateno!=[1000,4999])
var(3) = 1+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200
triggerall = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L && (p2bodydist x=[20,70]) && enemynear,Movetype=H
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1000)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = AILevel<=0 && command != "hold_x" && var(4)<60
trigger2 = AILevel>0 && var(4)<60
value = 1001

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = var(4)>=60 ; && command != "hold_x"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1001 && AnimElemtime(1)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%2
channel = 0
volume = 300

[State 200, random Jap "Take it" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,0
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1005
id = 1005

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1006
id = 1006

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1007
id = 1007

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320

[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(3)>=2
trigger1 = power>=2000 && var(18)=0
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 10
triggerall = AnimElemTime(3)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && power>=1000 && power<2000
value = 2000
ctrl = 0

[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
value = 1003
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 2
trigger2 = Var(3) = 4 && power < 1000
value = 1013
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 3
trigger2 = Var(3) = 4 && power < 1000
value = 1023
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1001 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------
;Light Ki Blast - 2nd Attack
[Statedef 1003]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1003
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1003)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = AILevel<=0 && command != "hold_x" && var(4)<60
trigger2 = AILevel>0 && var(4)<60
value = 1004

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = var(4)>=60 ; && command != "hold_x"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1004 && AnimElemtime(1)=0
var(14) = 1

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat this/Fun's Over" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%5  ;3+random%3
channel = 0
volume = 300

[State 200, random Jap "Daa" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,1
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1005
id = 1005

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1006
id = 1006

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1007
id = 1007

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320

[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)

[State 1000, Chou Galick Ho/Big Bang Attack]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(4)>=2
trigger1 = power>=2000; && var(18)=0
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 10
triggerall = AnimElemTime(4)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0
[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1004 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------
;Medium Ki Blast - 1st Attack
[Statedef 1010]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9
[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<600
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H
trigger2 = (enemynear,Stateno!=[1000,4999])
var(3) = 1+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200 && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1000)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = AILevel<=0 && command != "hold_y" && var(4)<60
trigger2 = AILevel>0 && var(4)<60
value = 1001

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = var(4)>=60 ; && command != "hold_x"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1001 && AnimElemtime(1)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%2
channel = 0
volume = 300

[State 200, random Jap "Take it" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,0
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1015
id = 1015

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1016
id = 1016

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1017
id = 1017

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320

[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(3)>=2
trigger1 = power>=2000
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(3)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0
[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
value = 1003
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 2
trigger2 = Var(3) = 4 && power < 1000
value = 1013
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 3
trigger2 = Var(3) = 4 && power < 1000
value = 1023
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1001 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------
;Medium Ki Blast - 2nd Attack
[Statedef 1013]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1003
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy && enemynear,Movetype=H
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1003)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = AILevel<=0 && command != "hold_y" && var(4)<60
trigger2 = AILevel>0 && var(4)<60
value = 1004

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = var(4)>=60 ; && command != "hold_x"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1004 && AnimElemtime(1)=0
var(14) = 1

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat this/Fun's Over" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%5
channel = 0
volume = 300

[State 200, random Jap "Daa" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,1
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1015
id = 1015

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1016
id = 1016

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1017
id = 1017

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
;triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(4)>=2
trigger1 = power>=2000
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 10
triggerall = AnimElemTime(4)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0
[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1004 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------
;Strong Ki Blast - 1st Attack
[Statedef 1020]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<600
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H
trigger2 = enemynear,Stateno!=[1000,4999]
var(3) = 1+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1000)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = AILevel<=0 && command != "hold_z" && var(4)<60
trigger2 = AILevel>0 && var(4)<60
value = 1001

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1000
triggerall = animelemtime(5) >= 0
trigger1 = var(4)>=60 ; && command != "hold_z"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1001 && AnimElemtime(1)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1001 && AnimElemtime(1)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%2
channel = 0
volume = 300

[State 200, random Jap "Take it" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1001 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,0
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1025
id = 1025

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1001 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1026
id = 1026

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1027
id = 1027

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)
[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(3)>=2
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 10
triggerall = AnimElemTime(3)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0
[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 1
trigger2 = Var(3) = 4 && power < 1000
value = 1003
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 2
trigger2 = Var(3) = 4 && power < 1000
value = 1013
ctrl = 0
[State 1000, non max charge]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1001
triggerall = AnimElemTime(3)>=2
trigger1 = Var(3) = 3
trigger2 = Var(3) = 4 && power < 1000
value = 1023
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1001 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;----------------------------------------------
;Strong Ki Blast - 2nd Attack
[Statedef 1023]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1003
ctrl = 0
sprpriority = 2
poweradd = 35

[State 3000, width]
type = width
trigger1 = 1
value = 20,0

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet] ;Big Bang Attack
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 8 && numenemy && random<200
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = enemynear,Movetype=H && (power=[600,1200]) && random<100
var(3) = 10
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = (power=[1200,1800]) && random<200
var(3) = 4+random%3
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 5 && numenemy
triggerall = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1 = power>1500 && random<100
var(3) = 7+random%3

[State 800, Charge Variable]
type = VarSet
trigger1 = !time
var(4) = 0
[State 800, Charge Variable]
type = VarAdd
trigger1 = (time > 8) && (anim=1003)
var(4) = 1

[State 1000, flash at 0.5s]
type = PalFX
trigger1 = var(4)=30
add = -10, 20, 60
sinadd = -10,20,60,10
time = 10

[state 1000, Change Animation - no charge or Lv1]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = AILevel<=0 && command != "hold_z" && var(4)<60
trigger2 = AILevel>0 && numenemy && (enemynear,vel x>0||enemynear,Movetype=A||inguarddist)
value = 1004

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1003
triggerall = animelemtime(4) >= 0
trigger1 = var(4)>=60 ; && command != "hold_z"
value = 1002

[State 220, gethit gut ?]
type = VarSet
trigger1 = Anim=1004 && AnimElemtime(1)=0
var(14) = 1

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = Anim=1004 && AnimElemtime(1)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1002 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, Ki Blast Charging Sound]
type = PlaySnd
trigger1 = var(4)=1
value = 1001,0
channel = 7

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 10,0
channel = 1

[State 200, "Eat this/Fun's Over" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1000,1+random%5
channel = 0
volume = 300

[State 200, random Jap "Daa" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1004 && AnimElemtime(1)=0
trigger2 = Anim=1002 && AnimElemtime(2)=0
value = 1003,1
channel = 0
volume = 300

[State 1000, helper no charge]
type = Helper
helpertype = normal
triggerall = var(4)<30
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-0"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1025
id = 1025

[State 1000, helper charge little]
type = Helper
helpertype = normal
triggerall = var(4)>=30 && var(4)<60
trigger1 = Anim=1004 && AnimElemtime(1)=0
name = "Ki Blast 1-1"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1026
id = 1026

[State 1000, helper charge max]
type = Helper
helpertype = normal
triggerall = var(4)>=60
trigger1 = Anim=1002 && AnimElemtime(2)=0
name = "Ki Blast 1-2"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1027
id = 1027

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=6 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=5 && (power>=1000 || var(53)>0)
trigger2 = var(3)=6 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = IfElse(var(1)=1,2300,3400)
[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(4)>=2
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0

[State 1000, Big Bang Attack]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(4)>=2
trigger1 = (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Galick Ho]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = AnimElemTime(4)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0
[State 1000, EX Machine Gun]
type = ChangeState
triggerall = var(1) = 1 ;Normal Vegeta only
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=7 && (power>=500 || var(53)>0)
value = 1450
ctrl = 0
[State 1000, EX Ki Blast]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1004
triggerall = AnimElemTime(4)>=2
trigger1 = Var(3)=10 && (power>=500 || var(53)>0)
value = 1050
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1004 && AnimTime = 0
trigger2 = Anim=1002 && AnimTime = 0
value = 0
ctrl = 1

;===========================================================================
; <<<<< WOLVERINE FLIP >>>>>
; Back flip start = 1100
; Back flip in air + land = 1101
; Wolverine sweep start (hold K) = 1110
; Wolverine sweep in air + land = 1111
; Recover from Wolverine Flip = 1115
; Wolverine dashing elbow (hold P) = 1120
; Explosion Grab (hold P+K) = 1130
;===========================================================================
[Statedef 1100]
type = C
movetype = A
physics = C
anim = 1100
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4000, momentum]
type = velset
trigger1 = prevstateno = 300
X = 3

[State 4000, momentum]
type = velmul
trigger1 = 1
X = 0.95

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1101
ctrl = 0

;---------------------
[StateDef 1101]; Wolverine flip in air
type = U
movetype = A
physics = N
ctrl = 0
anim = 1101
poweradd = 0
juggle = 5

[State 220, VarSet]
type=VarSet
trigger1 =AILevel>0 && !time && numenemy
var(15)=Ifelse(p2bodydist y<=-70,3,Ifelse(enemynear,statetype=S,1,2))
ignorehitpause=1

[State 220, Alley Oop voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1101,0
channel = 0
volume = 300

[State 220, "watch out" voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 301,0
channel = 0
volume = 300

[State 220, "Tuuu" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1101,1
channel = 0
volume = 300

[State 1201, Alternate Dashing Elbow anim]
type = varset
trigger1 = !time
var(12) = 1

[State 4000, Invincible]
type = NotHitBy
trigger1 = anim = 1101
trigger1 = animelemtime(2) < 10
value = SCA

[State 6000, VelIni]; LK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 1
Y = -4.5

[State 6000, VelIni]; MK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 2
Y = -5.5
X = -2.5

[State 6000, VelIni]; SK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 3
Y = -5.5
X = -4.5

[State 6000, ToAir]
type = StateTypeSet
trigger1 = Time = 0
statetype = A
physics = N

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216+var(2)
id = 1216
pos = -70,8
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1101 && (vel Y < 0)
Y = .7

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0)
Y = .9

[State 4001, Fall]
type = VelSet
trigger1 = (Anim = 1101) && (Animelemtime(2)=3) && (var(15) = 1)
Y = 0

[State 4001, Fall]
type = PosSet
trigger1 = (Anim = 1101) && (Animelemtime(2)=3) && (var(15) = 1)
Y = 0

;-------- LANDING ---------
[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1101
trigger1 = Pos Y >= 0 && time>4
value = 1102

[State 450, 2];woosh
type = PlaySnd
trigger1 = anim = 1102 && AnimElem = 1
value = 1110,0
volume = 300

[State 4001, Pos]
type = PosAdd
triggerall = Anim = 1102
trigger1 = animelemtime(1)=0
X = -25

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1102
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y >= 0
Y = 0

[State 210, 1]
type = HitDef
trigger1 = anim=1102 && animelem=1
attr = S, SA
;damage = 30+5*(var(15)=2)+10*(var(15)=3),3+(var(15)=2)+2*(var(15)=3)
damage = ceil(ifElse(fvar(11) * (30+5*(var(15)=2)+10*(var(15)=3)) < 7, 7, fvar(11) * (30+5*(var(15)=2)+10*(var(15)=3)))), 3+(var(15)=2)+2*(var(15)=3)
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -63
hitsound = s5,5
guardsound = s6,1
ground.type = High
pausetime = 8,9
guard.pausetime = 8,7
ground.slidetime = 15
ground.hittime = 15
guard.hittime = 15
guard.slidetime = 15
guard.ctrltime = 15
ground.velocity = -7
air.type = High
air.velocity = -4.6,-6.5
air.hittime = 13
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5

[state 1215, flip FX]
type = explod
trigger1 = anim=1102 && animelem=1
anim = 1105
id = 1105
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1102
statetype = S
physics = N

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1102
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1102
anim=17100
id=17100
pos=0,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

[state 1215, sweep FX for wolverine sweep]
type = explod
triggerall = command="hold_a" || command="hold_b" || command="hold_c"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2
anim = 1115
id = 1115
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

;-------- FOLLOW UP ---------

[State 4001, End];Explosion grab
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="hold_a" && command="hold_x"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2
trigger2 = AILevel>0 && numenemy && Anim = 1102 && animelemtime(2)=2 && enemynear,statetype != L && enemynear,statetype != A
trigger2 = (enemynear,stateno=[120,155]) && (p2bodydist x =[2,30]) && random<300
value = 1130

[State 4001, End];Wolverine Sweep
type = ChangeState
triggerall = var(1) = 1 ; Normal Vegeta only
trigger1 = AILevel<=0
trigger1 = command="hold_a" || command="hold_b" || command="hold_c"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2
trigger2 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && power<1000 && numenemy && random<650
trigger2 = enemynear,statetype != L 
trigger3 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && movecontact && random<350
trigger3 = enemynear,statetype != L
value = 1110

[State 4001, End];Wolverine Dashing Elbow
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="hold_x" || command="hold_y" || command="hold_z"
trigger1 = Anim = 1102
trigger1 = animelemtime(4)=2
trigger2 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && power>1000 && numenemy && random<650
trigger2 = enemynear,statetype != L 
trigger3 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && movecontact && random<350
trigger3 = enemynear,statetype != L
value = 1120

[State 4001, End];Super jump
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="holdup"
trigger1 = Anim = 1102
trigger1 = !AnimTime
trigger2 = AILevel>0 && Anim = 1102 && !animtime && numenemy && random<150 && enemynear,movetype!=H
trigger2 = enemynear,statetype != L && (enemynear,vel x>0||enemynear,movetype=A)
value = 10231

[State 4001, End];back dash
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="holdback"
trigger1 = Anim = 1102
trigger1 = !AnimTime
trigger2 = AILevel>0 && Anim = 1102 && !animtime && numenemy && random<350 && enemynear,movetype!=H
trigger2 = enemynear,statetype != L && (enemynear,vel x>0||enemynear,movetype=A||inguarddist)
value = 105

[State 4001, End];Fwd dash
type = ChangeState
triggerall = command="holdfwd"
trigger1 = Anim = 1102
trigger1 = !AnimTime
trigger2 = AILevel>0 && numenemy && Anim = 1102 && !animtime
trigger2 = (enemynear,vel x<=0||p2bodydist x < -10) && random<150 
value = 100

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1102
trigger1 = !AnimTime
value = 1115
ctrl = 0

;---------------------------------------
;Wolverine Combination END

[Statedef 1115]
type = C
movetype = I
physics = C
anim = 1111
ctrl = 0
velset = 0,0

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

;---------------------------------------
;Wolverine Sweep kick

[Statedef 1110]
type = C
movetype = A
physics = C
anim = 1110
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3

[State 6000, VarSet]
type=VarSet
trigger1 =AILevel>0 && !time && numenemy
var(15)=Ifelse(p2bodydist y<=-50,3,Ifelse((p2bodydist y=[-30,-50]),2,1))

[State 6000, Var for vels]
type = VarSet
triggerall =AILevel<=0
triggerall = Time = 0
trigger1 = command="hold_a"
var(15) = 1

[State 6000, Var for vels]
type = VarSet
triggerall =AILevel<=0
triggerall = Time = 0
trigger1 = command="hold_b"
trigger2 = command="hold_a" && command="hold_b"
var(15) = 2

[State 6000, Var for vels]
type = VarSet
triggerall =AILevel<=0
triggerall = Time = 0
trigger1 = command="hold_c"
trigger2 = command="hold_b" && command="hold_c"
trigger3 = command="hold_a" && command="hold_c"
trigger4 = command="hold_a" && command="hold_b" && command="hold_c"
var(15) = 3

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1111
ctrl = 0

;---------------------
[StateDef 1111]; Wolverine Sweep in air
type = U
movetype = A
physics = N
ctrl = 0
anim = 451
poweradd = 0

[State 6000, VelIni]
type = VelSet
trigger1 = Time = 0
X = 12 ;6*(var(15)=1) + 8*(var(15)=2) + 10*(var(15)=3)
Y = -5.5 + (var(15)=2) + 2*(var(15)=1)

[State 6000, ToAir]
type = StateTypeSet
trigger1 = Time = 0
statetype = A

[State 220, "Not so Fast" voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 1111,random%2
channel = 0
volume = 300

[State 220, "I'm right here" voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=1 && random<500
value = 1112,0
channel = 0
volume = 300

[State 220, "diaaa, got you" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=1 && random<500
value = 1113,random%2
channel = 0
volume = 300

[State 450, 2];woosh
type = PlaySnd
trigger1 = AnimElem = 1
value = 1100,0
channel = 1

[State 4001, Stop]
type = VelAdd
trigger1 = time>5 && time<10
Y = -0.7

[state 1215, Rising Effect]
type = explod
trigger1 = !time && prevstateno=450
anim = 1216+var(2)
id = 1216
pos = -70,8
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1

[State 450, 3]
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3 & MoveContact = 0
trigger3 = AnimElem = 4 & MoveContact = 0
attr = C, SA
animtype = Back
priority = 4, Hit
;damage = 50+12*(var(15)=2)+25*(var(15)=3),6+2*(var(15)=2)+3*(var(15)=3)
damage = ceil(ifElse(fvar(11) * (50+12*(var(15)=2)+25*(var(15)=3)) < 7, 7, fvar(11) * (50+12*(var(15)=2)+25*(var(15)=3)))), 6+2*(var(15)=2)+3*(var(15)=3)
hitflag = MAF
guardflag = L
pausetime = 13,13
guard.pausetime = 13,13
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-50
hitsound   = s5,5
guardsound = s6,1
ground.type = Trip
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -2,-3
guard.velocity = -5
air.velocity = -5,-3
getpower= ifelse(p2movetype=H,40,210)
givepower = 35,35
yaccel = 0.5

[State 4001, AirFriction]
type = VelMul
triggerall = Vel X !=0 && time%2
trigger1 = var(15)=1
x = 0.86

[State 4001, AirFriction]
type = VelMul
triggerall = Vel X !=0 && time%2
trigger1 = var(15)=2
x = 0.9

[State 4001, AirFriction]
type = VelMul
triggerall = Vel X !=0 && time%2
trigger1 = var(15)=3
x = 0.95

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 451 && (vel Y < 0)
Y = .55

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0)
Y = .4

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 451
trigger1 = Pos Y >= 0 && time>6
value = 1111

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1111
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y > 10
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1111
persistent = 0
statetype = S
physics = N

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1111
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1111
anim=17100
id=17100
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1111
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Wolverine Dashing Elbow

[Statedef 1120]
type = S
movetype = A
physics = N
anim = 1120
ctrl = 0
poweradd = 20
sprpriority = 3
velset = 2*const(velocity.run.fwd.x),0

[State 220, "Rock You" voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 300,random%2
channel = 0
volume = 300

[State 220, "Watch out" (koko da) voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 301,0
channel = 0
volume = 300

[State 220, "drop dead, take this" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 300,2+random%2
channel = 0
volume = 300

[State 6000, VarSet]
type=VarSet
trigger1 =AILevel>0 && !time && numenemy
var(15)=Ifelse(p2bodydist x>=80,3,Ifelse((p2bodydist y=[40,79]),2,1))

[State 6000, Var for vels]
type = VarSet
triggerall = AILevel<=0 && Time = 0
trigger1 = command="hold_x"
var(15) = 1

[State 6000, Var for vels]
type = VarSet
triggerall = AILevel<=0 && Time = 0
trigger1 = command="hold_y"
trigger2 = command="hold_x" && command="hold_y"
var(15) = 2

[State 6000, Var for vels]
type = VarSet
triggerall = AILevel<=0 && Time = 0
trigger1 = command="hold_z"
trigger2 = command="hold_y" && command="hold_z"
trigger3 = command="hold_x" && command="hold_z"
trigger4 = command="hold_x" && command="hold_y" && command="hold_z"
var(15) = 3

[state 1215, Smoke FX]
type = explod
trigger1 = !time
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 3000, dust FX]
type = helper
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[State 240, 1]
type = VelMul
trigger1 = animelemtime(4)>0
trigger1 = var(15) = 1
X = 0.5

[State 240, 1]
type = VelMul
trigger1 = animelemtime(5)>0
trigger1 = var(15) = 2
X = 0.8

[State 240, 1]
type = VelMul
trigger1 = animelemtime(6)>0
trigger1 = var(15) = 3
X = 0.95

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 450, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0, 2

[State 420, 3]
type = HitDef
trigger1 = animelem=2
trigger2 = animelem=3 && !movecontact
trigger3 = animelem=4 && !movecontact
trigger4 = animelem=5 && !movecontact
attr = S, SA
;damage    = 45+10*(var(15)=2)+20*(var(15)=3),4+(var(15)=2)+2*(var(15)=3)
damage = ceil(ifElse(fvar(11) * (45+10*(var(15)=2)+20*(var(15)=3)) < 7, 7, fvar(11) * (45+10*(var(15)=2)+20*(var(15)=3)))), 4+(var(15)=2)+2*(var(15)=3)
animtype = Hard
air.animtype = back
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 13,13
guard.pausetime = 13,7
sparkno = s7030
guard.sparkno = s7000
sparkxy = -0,-55
hitsound   = s3100,0 ;s5, 5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-4
guard.velocity = -4
air.velocity =-6,-4
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
fall = 1
fall.recover = 0
yaccel = 0.5

[State 100, snd]
type = playsnd
trigger1 = animelemtime(7)=0
value = 5,8
persistent = 0

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


;---------------------------------------------------------------------------
; Wolverine Explosion Grab
[Statedef 1130]
type = S
movetype = A
physics = N
anim = 1130
ctrl = 0
poweradd = 20
sprpriority = 3
velset = 1.3*const(velocity.run.fwd.x),0

[state 1215, Smoke FX]
type = explod
trigger1 = !time
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 240, 1]
type = VelMul
trigger1 = animelemtime(5)>0
X = 0.9

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 220, voice]
type = playsnd
triggerall = var(1)=1 ;Normal Vegeta only
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 3,20+random%2
channel = 0
volume = 300

[State 220, voice]
type = playsnd
triggerall = var(1)=2 ;Majin only
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 220, voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=1 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 220, voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=1 && random<500
value = 3,70+random%2
channel = 0
volume = 300

[State 450, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0, 2

[State 100, snd]
type = playsnd
trigger1 = animelemtime(7)=0
value = 5,8
persistent = 0

[State 800, hit]
type = hitdef
trigger1 = 1
attr = S,ST
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 0, ChangeState]
type = ChangeState
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 801
persistent = 1

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

;===========================================================================
; <<<<< WOLVERINE FLIP FORWARD >>>>>
; Back flip start = 1200
; Back flip in air + land = 1201
;===========================================================================

[Statedef 1200]
type = C
movetype = A
physics = C
anim = 1100
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3

[State 4000, momentum]
type = velset
trigger1 = prevstateno = 300
X = 2

[State 4000, momentum]
type = velmul
trigger1 = 1
X = 0.95

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1201
ctrl = 0

;---------------------
[StateDef 1201]; Wolverine flip in air
type = U
movetype = A
physics = N
ctrl = 0
anim = 1101
poweradd = 0
juggle = 5

[State 220, VarSet]
type=VarSet
trigger1 =AILevel>0 && !time && numenemy
var(15)=Ifelse(p2bodydist y<=-70,3,Ifelse(enemynear,statetype=S,1,2))
ignorehitpause=1

[State 220, Alley Oop voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1101,0
channel = 0
volume = 300

[State 220, "I'm right there" voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1112,0
channel = 0
volume = 300

[State 220, "Tuuu" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1101,1
channel = 0
volume = 300

[State 1201, Alternate Dashing Elbow anim]
type = varset
trigger1 = !time
var(12) = 1

[State 4000, Invincible]
type = Null ;NotHitBy
trigger1 = anim = 1101
trigger1 = animelemtime(2) < 6
value = SCA

[State 6000, VelIni]; LK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 1
Y = -4.5
X = 4.5

[State 6000, VelIni]; MK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 2
Y = -5.5
X = 2.5

[State 6000, VelIni]; SK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 3
Y = -5.5
X = 4.5

[State 6000, ToAir]
type = StateTypeSet
trigger1 = Time = 0
statetype = A
physics = N

[state 1215, Rising Effect]
type = explod
trigger1 = !time
anim = 1216+var(2)
id = 1216
pos = -70,8
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1101 && (vel Y < 0)
Y = .7

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0)
Y = .9

[State 4001, Fall]
type = VelSet
trigger1 = (Anim = 1101) && (Animelemtime(2)=3) && (var(15) = 1)
Y = 0

[State 4001, Fall]
type = PosSet
trigger1 = (Anim = 1101) && (Animelemtime(2)=3) && (var(15) = 1)
Y = 0

;-------- LANDING ---------
[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1101
trigger1 = Pos Y >= 0 && time>4
value = 1102

[State 450, 2];woosh
type = PlaySnd
trigger1 = anim = 1102 && AnimElem = 1
value = 1110,0
volume = 300

[State 4001, Pos]
type = PosAdd
triggerall = Anim = 1102
trigger1 = animelemtime(1)=0
X = -25

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1102
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y >= 0
Y = 0

[State 210, 1]
type = HitDef
trigger1 = anim=1102 && animelem=1
attr = S, SA
;damage = 38+5*(var(15)=2)+9*(var(15)=3),2+(var(15)=2)+2*(var(15)=3)
damage = ceil(ifElse(fvar(11) * (38+5*(var(15)=2)+9*(var(15)=3)) < 7, 7, fvar(11) * (38+5*(var(15)=2)+9*(var(15)=3)))), 2+(var(15)=2)+2*(var(15)=3)
animtype = Hard
air.animtype = back
guardflag = MA
hitflag = MAF
priority = 4, Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -63
hitsound = s5,2
guardsound = s6,1
ground.type = High
pausetime = 8,9
guard.pausetime = 8,7
ground.slidetime = 15
ground.hittime = 15
guard.hittime = 15
guard.slidetime = 15
guard.ctrltime = 15
ground.velocity = -7
air.type = High
air.velocity = -4.6,-6.5
air.hittime = 13
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
air.fall = 1
fall.recover = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = .5
envshake.time = 14
envshake.ampl = 5

[state 1215, flip FX]
type = explod
trigger1 = anim=1102 && animelem=1
anim = 1105
id = 1105
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1102
statetype = S
physics = N

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1102
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1102
anim=17100
id=17100
pos=0,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

[state 1215, sweep FX for wolverine sweep]
type = explod
triggerall = command="hold_a" || command="hold_b" || command="hold_c"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2
anim = 1115
id = 1115
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

;-------- FOLLOW UP ---------

[State 4001, End];Explosion grab
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="hold_a" && command="hold_x"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2  
trigger2 = AILevel>0 && numenemy && Anim = 1102 && animelemtime(2)=2 && enemynear,statetype != L && enemynear,statetype != A
trigger2 = (enemynear,stateno=[120,155]) && (p2bodydist x =[5,60]) && random<400
value = 1130

[State 4001, End];Wolverine Sweep
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="hold_a" || command="hold_b" || command="hold_c"
trigger1 = Anim = 1102
trigger1 = animelemtime(2)=2
trigger2 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && power<1000 && numenemy && random<750
trigger2 = enemynear,statetype != L 
trigger3 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && movecontact && random<500
trigger3 = enemynear,statetype != L 
value = 1110

[State 4001, End];Wolverine Dashing Elbow
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="hold_x" || command="hold_y" || command="hold_z"
trigger1 = Anim = 1102
trigger1 = animelemtime(4)=2
trigger2 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && power>1000 && numenemy && random<750
trigger2 = enemynear,statetype != L 
trigger3 = AILevel>0 && Anim = 1102 && animelemtime(2)=2 && movecontact && random<500
trigger3 = enemynear,statetype != L
value = 1120

[State 4001, End];Super jump
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="holdup"
trigger1 = Anim = 1102
trigger1 = !AnimTime
trigger2 = AILevel>0 && Anim = 1102 && !animtime && numenemy && random<150 && enemynear,movetype!=H
trigger2 = enemynear,statetype != L && (enemynear,vel x>0||enemynear,movetype=A)
value = 10231

[State 4001, End];back dash
type = ChangeState
trigger1 = AILevel<=0
trigger1 = command="holdback"
trigger1 = Anim = 1102
trigger1 = !AnimTime
trigger2 = AILevel>0 && Anim = 1102 && !animtime && numenemy && random<350 && enemynear,movetype!=H
trigger2 = enemynear,statetype != L && (enemynear,vel x>0||enemynear,movetype=A||inguarddist)
value = 105

;[State 4001, End];Fwd dash
;type = ChangeState
;triggerall = command="holdfwd"
;trigger1 = Anim = 1102
;trigger1 = !AnimTime
;value = 100

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1102
trigger1 = !AnimTime
value = 1115
ctrl = 0


;===========================================================================
; <<<<< SLASHING CHOP >>>>>
; Charge state 1 = 1300
; Charge state 2 (when hit) = 1301
; Actual attack = 1302
; Helper for repel = 1305
; Destroyed helper = 1306
; Reflect with random projectile = 1308
; Reflected projectile = 1315
; Reflected projectile explods = 1316
; Custom state when hit by slashing chop max charge = 1320
;===========================================================================

;Focus Strike - charge state 1
;This state covers the charging aspect of the Focus Strike attack at the start.
[Statedef 1300]
type = S
movetype = I
physics = S
juggle = 10
anim = 1300
ctrl = 0
poweradd = 0
velset = 0,0
 
; These next two sctrls cover initial charge value and building it up
[State 900, starting value]
type = VarSet
trigger1 = time = 1 && var(20)
fvar(9) = 0
 
[State 900, adding to value]
type = VarAdd
trigger1 = time >= 1
fvar(9) = 1
persistent = 1

[State 8000, flash]
type = PalFX
trigger1 = time =10 
add = 40, 30, -40
sinadd = 50,50,50,16
time = 40
 
; These change states control dash cancels and moving into the attack portion
[State 900, dash cancel back]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command = "BB"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,vel x>0||enemynear,Movetype=A||inguarddist)&&random<200
value = 105
 
[State 900, dash cancel forward]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command = "FF"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,vel x>0||enemynear,Movetype=A||inguarddist)&&random<200
trigger3 = time>=8 && AILevel>0&&p2bodydist x<-20
value = 100
 
[State 900, stopping early]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command != "hold_c" && command !="hold_z"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,inguarddist)&&Movetype=A
trigger2 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L 
value = 1302
 
[State 900, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 1302
 
;---------------------------------------------
;Focus Strike - charge state 2
;This state covers the charging aspect of the Focus Strike attack if hit
[Statedef 1301]
type = S
movetype = I
physics = S
juggle = 10
ctrl = 0
poweradd = 0
velset = 0,0
 
; This part covers the after effects of getting hit from earlier.
[state 901, no more saving hit]
type = varset
trigger1 = time = 1
var(20) = 0

[State 8000, hitsnd]
type = Playsnd
trigger1 = time = 0
value = 1301,0

[State 8000, flash]
type = PalFX
trigger1 = time%10=0
;add = 40, 30, -40
add = 150, 30, 30
sinadd = 50,50,50,16
time = 10
 
[State 901, life removal]
type = LifeAdd
trigger1 = time = 1 && !var(20)
value = -(gethitvar(damage))
kill = 1

[State 901, Killed]
type = ChangeState
trigger1 = life <= 0
value = 5950
 
; This ctrl changes the animframe back to the last active one
[State 901, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 1300
elem = var(23)
 
; This varset is the continuation of charging
[State 901, adding to charge]
type = VarAdd
trigger1 = time >= 1
fvar(9) = 1
persistent = 1
 
; These change states control dash cancels and moving into the attack portion
[State 901, dash cancel]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command = "BB"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,vel x>0||enemynear,Movetype=A||inguarddist)&&random<200
value = 105
 
[State 901, dash cancel forward]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command = "FF"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,vel x>0||enemynear,Movetype=A||inguarddist)&&random<200
trigger3 = time>=8 && AILevel>0&&p2bodydist x<-20
value = 100
 
[State 901, early release]
type = ChangeState
trigger1 = time>=8 && AILevel<=0 && command != "hold_c" && command !="hold_z"
trigger2 = time>=8 && AILevel>0&&numenemy&&(enemynear,inguarddist)&&enemynear,Movetype=A
trigger2 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L 
value = 1302
 
[State 901, fully charged]
type = ChangeState
trigger1 = fvar(9)>=60
value = 1302
 
;----------------------------------------
;Focus Attack - actual attack
[Statedef 1302]
type = S
movetype = A
physics = S
juggle = 10
anim = 1301
ctrl = 0
velset = 0,0
 
;PalFX sctrls; the first removes any earlier stuff, and the second the white flash that appears if you have maxed out focus
[state 901, cancel earlier fx flash]
type = PalFx
trigger1 = time = 0
add = 0,0,0
time = 0
 
[state 901, bright flash if maxed out]
type = PalFx
triggerall = FVar(9) = 60
trigger1 = time = 1
add = 128,128,128
sinadd = -128,-128,-128,32
time = 8

[State 1302, voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = AnimElem = 3
value = 3,10+6*(Var(1)=2)
channel = 0

[State 200, Jap "Take it" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = AnimElem = 3
value = 1002,1
channel = 0
volume = 300

[State 200, Jap "Eat this" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = AnimElem = 3
value = 1003,0
channel = 0
volume = 300

[State 1302, 2]
type = PlaySnd
trigger1 = AnimElem = 3 && (FVar(9) < 60)
value = 0,2 ;20,1

[State 1302, 2]
type = PlaySnd
trigger1 = AnimElem = 3 && (FVar(9) = 60)
value = 0,2 ;20,2

[State 4000, Invincible]
type = NotHitBy
trigger1 = animelemtime(3) >= 0 && animelemtime(8) < 0
value = ,NP, SP

[State 1300, repel helper]
type = helper
trigger1 = animelemtime(3) = 0
helpertype = normal
stateno = 1305
ID = 1305
name = "repel"
postype = p1
pos = 50, -40

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(3)=1
anim = 1208;+(var(2)=0)
id = 1206
pos = 0,0  ;30,0
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
 
; The hitdef used depends on the how long you've been charging. In case you are wondering why there are 2 versions of each lvl's
; hitdef, the second one has been refined to compensate for hitting air opponents.
; LV 1
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 3 && (FVar(9) < 60)
attr = S, NA
;damage = 32,0
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
animtype = Hard
guardflag = M
hitflag = M
priority = 4, Hit
pausetime = 9, 9
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -8.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
fall = (p2movetype=H)
 
[State 902, 0-30]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 3 && (FVar(9) < 60)
attr = S, NA
;damage= 32,0
damage = ceil(ifElse(fvar(11) * 32 < 7, 7, fvar(11) * 32)), 0
animtype = Hard
guardflag = A
hitflag = A
priority = 4, Hit
pausetime = 9, 9
sparkno = s7020
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 2
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -6.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
fall = (p2movetype=H)
 
; LV 2 MAX
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
trigger1 = AnimElem = 3 && FVar(9) = 60
attr = S, NA
;damage = 59,0
damage = ceil(ifElse(fvar(11) * 59 < 7, 7, fvar(11) * 59)), 0
animtype = Hard
;guardflag = MA ;<-- Commented out as you will not be blocking this. This will hurt, and you will fall!
hitflag = MAF
priority = 4, Hit
pausetime = 14, 14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 6
guardsound = S6,1
ground.type = Low
ground.slidetime = 20  ;14
ground.hittime  = 20   ;14
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15
;p2stateno = 1320 ; <- Opponent sent to flying state

[State 0, TargetState]
type = TargetState
triggerall = FVar(9) = 60
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 1320
ignorehitpause = 1
persistent = 0
 
[State 902, max-charge]
type = HitDef
triggerall = P2stateno != [5020,5040]
triggerall = p2stateno != [154,155]
triggerall = p2statetype = A
trigger1 = AnimElem = 3 && FVar(9) = 60
attr = S, NA
;damage = 59,0
damage = ceil(ifElse(fvar(11) * 59 < 7, 7, fvar(11) * 59)), 0
animtype = Hard
hitflag = A
priority = 6, Hit
pausetime = 14, 14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5, 6
guardsound = S6,1
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -4.95
guard.slidetime = 18
guard.hittime = 18
guard.ctrltime = 12
airguard.velocity = -3.5,-4
air.type = High
air.velocity = -3.5,-6
air.hittime = 9
getpower = 101,101
givepower = 35,35
ground.cornerpush.veloff = -7.25
air.cornerpush.veloff = 0
yaccel = .55
air.fall = 1
air.juggle = 15

[State 902, Majin dash elbow]
type = ChangeState
triggerall = var(1)=2 ; Majin only
trigger1 = Movecontact
Trigger1 = command = "qcbx" || command = "BBz"
value = 301 ;300

 
[State 902, fvar reset]
type = VarSet
trigger1 = !AnimTime
fvar(9) = 0
 
;Dash Cancels upon movecontact
[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "FF"
trigger2 = AILevel>0 && movecontact && random<150
value = 100

[State 902, dash cancel]
type = ChangeState
trigger1 = Movecontact && command = "BB"
trigger2 = AILevel>0 && movecontact && random<250
value = 301
 
[State 902, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
[Statedef 1320]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5052),5052,5030)
ctrl = 0
velset = -7, -5
facep2 = 1
 
[State 9011, VelAdd]
type = VelAdd
trigger1 = (Pos Y < 0)
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
 
[State 9011, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;===========================================================================
; <<<<< MACHINE GUN TEMPER >>>>>
; state light = 1400
; helper light = 1410
; state medium = 1401
; helper medium = 1411
; state strong = 1402
; helper strong = 1412
;===========================================================================

;MACHINE GUN TEMPER - LIGHT VERSION
[Statedef 1400]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1400
ctrl = 0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 200, "Eat Shit and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)>=18	;Adult version
trigger1 = !time
value = 1400,1+random%2
channel = 0
volume = 300

[State 200, "Eat This and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)<18		;Child version
trigger1 = !time
value = 1400,11
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "FFc")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,50])
triggerall = AILevel>0 && time > 15 && (power>=1000) && numenemy && random<100
trigger1 = enemynear,Movetype=H
trigger1 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger2 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L 
trigger2 = enemynear,Stateno!=[1000,4999]
var(3) = 1
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = (power>=1000) && random<300
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = enemynear,Movetype=H && random<250
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 5
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>2000 && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 8

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(10)=0
trigger2 = animelemtime(20)=0
var(14) = 1
[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(5)=0
trigger2 = animelemtime(15)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX 2]
type = null ;explod
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[State 200, 1]
type = PlaySnd
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
value = 10,0

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
name = "machine13"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1410
id = 1410

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
name = "machine24"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1410
id = 1410

[State 1000, Can chain if far]
type = Changestate
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=5
value = 1420

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=2 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = 2300

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(22)>=4
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0
[State 1000, Galick Ho]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElemTime(22)>=4
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 23
movetype = I

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

;---------------------------------------
;MACHINE GUN TEMPER - MEDIUM VERSION
[Statedef 1401]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1400
ctrl = 0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 200, "Eat Shit and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)>=18	;Adult version
trigger1 = !time
value = 1400,1+random%2
channel = 0
volume = 300

[State 200, "Eat This and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)<18		;Child version
trigger1 = !time
value = 1400,11   ;+random%2
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "FFc")
var(3) = 5
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,50])
triggerall = AILevel>0 && time > 15 && (power>=1000) && numenemy && random<100
trigger1 = enemynear,Movetype=H
trigger1 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger2 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L 
trigger2 = enemynear,Stateno!=[1000,4999]
var(3) = 1
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = (power>=1000) && random<300
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = enemynear,Movetype=H && random<250
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 5
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>2000 && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 8

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(10)=0
trigger2 = animelemtime(20)=0
var(14) = 1
[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(5)=0
trigger2 = animelemtime(15)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX 2]
type = null ;explod
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 2
ignorehitpause = 0
removeongethit = 1

[State 200, 1]
type = PlaySnd
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
value = 10,0

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
name = "machine13"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1411
id = 1411

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
name = "machine24"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1411
id = 1411

[State 1000, Can chain if far]
type = Changestate
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=5
;trigger1 = abs(p2bodydist X) > 100
value = 1420

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=2 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = 2300

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(22)>=4
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0
[State 1000, Galick Ho]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElemTime(22)>=4
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 23
movetype = I

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

;---------------------------------------
;MACHINE GUN TEMPER - STRONG VERSION
[Statedef 1402]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1400
ctrl = 0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 200, "Eat Shit and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)>=18	;Adult version
trigger1 = !time
value = 1400,1+random%2
channel = 0
volume = 300

[State 200, "Eat This and Die" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
triggerall = var(39)<18		;Child version
trigger1 = !time
value = 1400,11   ;+random%2
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 15
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "FFc")
var(3) = 5
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,50])
triggerall = AILevel>0 && time > 15 && (power>=1000) && numenemy && random<100
trigger1 = enemynear,Movetype=H
trigger1 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger2 = numenemy && (enemynear,stateno != [120, 155]) && enemynear,statetype != L 
trigger2 = enemynear,Stateno!=[1000,4999]
var(3) = 1
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = (power>=1000) && random<300
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = enemynear,Movetype=H && random<250
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 5
[State 800, VarSet]
type = VarSet
;triggerall = (p2bodydist x=[10,60])
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>2000 && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L && enemynear,movetype=H
var(3) = 8


[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(10)=0
trigger2 = animelemtime(20)=0
var(14) = 1
[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(5)=0
trigger2 = animelemtime(15)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 3
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX 2]
type = null ;explod
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 3
ignorehitpause = 0
removeongethit = 1

[State 200, 1]
type = PlaySnd
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
value = 10,0

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
name = "machine13"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1412
id = 1412

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
name = "machine24"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1412
id = 1412


[State 1000, Can chain if far]
type = Changestate
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=5
;trigger1 = abs(p2bodydist X) > 100
value = 1420

[State 1000, baku 3]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=9 && power>=3000
value = 2340
[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=2 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2320
[State 1000, baku 1]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = roundstate = 2
triggerall = animelemtime(22) >= 4
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
trigger3 = var(3)=9 && ((power>=1000 && power<2000) || var(53)>0)
value = 2300

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(22)>=4
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0
[State 1000, Galick Ho]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElemTime(22)>=4
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 23
movetype = I

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


;===========================================================================
; DASH CANCEL INTO SLIDING KICK
;===========================================================================
[Statedef 1420]
type    = S
physics = S
anim = 100
sprpriority = 1
ctrl = 0

[State 3000, dust FX]
type = helper
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[State 115, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

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

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

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

[State 100, to sliding kick];jnpedit
type = ChangeState
triggerall = time > 7
trigger1 = abs(p2bodydist X) < 60
trigger2 = time>120
value = 455

;[State 100, to sliding kick]
;type = ChangeState
;triggerall = time > 7
;trigger1 = abs(p2bodydist X) < 60
;trigger2 = time>120
;trigger3 = p2bodydist X < -10 && time>30
;value = 455


;===========================================================================
; <<<<< RISING KNEE ARROW >>>>>
; Rising Knee start = 1500
; Rising Knee in air = 1501
; Going back down (anim 44)
;===========================================================================

[StateDef 1500];On ground
type = S
movetype = A
physics = S
ctrl = 0
anim = 1500
poweradd = 35
velset = 0,0

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0&& !time
var(15)=ifelse(random<300,2,3)
ignorehitpause=1

[State 200, "In your Face" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1501,random%4
channel = 0
volume = 300

[State 200, "Idiot" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1502,0
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1003,1   ;1503,random%3
channel = 0
volume = 300

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1501
ctrl = 0

;------------------------------
[StateDef 1501];Rising
type = A
movetype = A
physics = N
ctrl = 0
anim = 1501

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcfa") || (command = "qcfb") || (command = "qcfc")
var(3) = 3
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy
trigger1 = movehit && random<400 && (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 3

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy
trigger1 = power>=1000 && movehit && random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 1+random%2
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy
trigger1 =  movehit && Ifelse(var(53),power>1000,power>3000) && random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy && movehit
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)&&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 9

[state 1215, Rising Effect smoke]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = -10,ifelse(var(15)=1,6,ifelse(var(15)=2,8,9))
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 6000, VelIni]; LK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 1
Y = -6
X = 5

[State 6000, VelIni]; MK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 2
Y = -8
X = 7

[State 6000, VelIni]; SK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) >= 3
Y = -9
X = 8.5

[State 6100, jump sound]
type = playsnd
trigger1 = !time
value = 40,1

[State 6100, woosh sound]
type = playsnd
trigger1 = !time
value = 0,5  ;1500,0

[state 1215, Rising Effect]
type = explod
trigger1 = (Anim = 1501) && !time
anim = 1503
id = 1503
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 12
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 4001, Invincible]
type = NotHitBy
trigger1 = (Anim = 1501) && animelemtime(2)<0
value = SCA

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X != 0
X = .9

[State 4001, 3rd Hit]
type = HitDef
trigger1 = Anim = 1501
trigger1 = !time
ID = 4001
attr = A, SA
hitflag = MAF
guardflag = MA
animtype = Back
priority = 7, Hit
;damage = 40+10*var(10),4+var(10)
damage = ceil(ifElse(fvar(11) * (40+10*var(10)) < 7, 7, fvar(11) * (40+10*var(10)))), 4+var(10)
pausetime = 12,14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -75
hitsound = s5,6
guardsound = s6,1
p2facing = 1
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -2,-9
air.velocity = -2,-8
fall = 1
fall.recover = 0
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
yaccel = 0.5

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1501
trigger1 = Pos Y < -30
trigger2 = Anim = 44
Y = .55

[State 1000, Bomber Kick Follow-up]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=3
value = 1530

[State 1000, Air Rage Galactic Gunfire]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=4 && power>=1000 && var(53)>0 && var(58) >= 700
value = 2803
[State 1000, Air Galactic Gunfire]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=4 && power=3000 && var(53)=0
value = 2603

[State 1000, Air baku 3]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
triggerall = var(1) = 1 ;Normal Vegeta only
trigger1 = var(3)=9 && power>=3000
value = 2350
[State 1000, Air baku 2]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
triggerall = var(1) = 1 ;Normal Vegeta only
trigger1 = var(3)=2 && power>=2000
trigger2 = var(3)=9 && power>=2000 && power<3000
value = 2330
[State 1000, air baku 1/tantrum]
type = Changestate
triggerall = !NumHelper(9995) ;Baku Limiter
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=1 && power>=1000 && !NumHelper(9995) ;Baku Limiter
trigger2 = var(3)=2 && power>=1000 && power<2000
trigger3 = var(3)=9 && power>=1000 && power<2000
value = IfElse(var(1)=1,2310,3430)

[State 1000, Air galick 2]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
triggerall = var(1) = 1 ;Normal Vegeta only
trigger1 = var(3)=6 && power>=2000
value = 2450
[State 1000, air galick 1]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
triggerall = var(1) = 1 ;Normal Vegeta only
trigger1 = var(3)=5 && power>=1000
trigger2 = var(3)=6 && power>=1000 && power<2000
value = 2100

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1501
trigger1 = Vel Y >= 0.0
value = 44

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 44
trigger1 = Pos Y = 0
value = 1111

[State 4001, StopFwd]
type = VelSet
trigger1 = Vel X = (0,0.4]
X = 0

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1111
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1111
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = Anim = 1111
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0

[State 800, VarSet]  ; Reset
type = VarSet
trigger1 = AnimTime = 0
var(15) = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1111
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;--------------------------------
; BOMBER KICK FOLLOW-UP

[StateDef 1530]
type = A
movetype = A
physics = N
ctrl = 0
anim = 1530

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X != 0
X = .9

[State 250, Break You voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Anim=1530 && AnimElem=2
value = 1530,random%3
channel = 0
volume = 300

[State 200, strong hitsnd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = Anim=1530 && AnimElem=2
value = 4,20+random%4
channel = 0
volume = 300

[State 250, "Huu haha" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = Anim=1530 && AnimElem=2
value = 1531,0
channel = 0
volume = 300

[State 250, 1]
type = PlaySnd
trigger1 = Anim=1530 && AnimElem=3
value = 0, 5

[State 4001, 3rd Hit]
type = HitDef
trigger1 = Anim = 1530 && !movecontact
attr = A, SA
hitflag = MAF
guardflag = MA
animtype = Back
priority = 4, Hit
;damage = 25,2
damage = ceil(ifElse(fvar(11) * 25 < 7, 7, fvar(11) * 25)), 2
pausetime = 12,12
guard.pausetime = 12,12
sparkno = s7030
guard.sparkno = s7000
sparkxy = -15,-80
hitsound   = s5,6
guardsound = S6,1
p2facing = 1
ground.type = high
ground.slidetime = 15
ground.hittime = 20
ground.velocity = -7
air.velocity = -4,-4
air.animtype = back
fall = 1
fall.recover = 0
getpower = 40, 35
givepower = 35,35
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
yaccel = 0.5
;p2stateno = 1535 ; <- Opponent sent to flying state

[State 0, TargetState]
type = TargetState
triggerall = Anim = 1530
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 1535
ignorehitpause = 1
persistent = 0

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1530
trigger1 = Pos Y < -30
trigger2 = Anim = 44
Y = .55

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1530
trigger1 = !animtime ;Vel Y >= 2.0
value = 44

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 44
trigger1 = Pos Y = 0
value = 1111

[State 4001, StopFwd]
type = VelSet
trigger1 = Vel X = (0,0.4]
X = 0

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1111
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1111
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = Anim = 1111
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0

[State 800, VarSet]  ; Reset
type = VarSet
trigger1 = AnimTime = 0
var(15) = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1111
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------
;P2 custom state, sent away
[Statedef 1535]
type = A
movetype = H
physics = N
anim = ifelse(selfanimexist(5937),5937,ifelse(selfanimexist(5052),5052,5030))
ctrl = 0
facep2 = 1

[State 4005, vel]
type = velset
trigger1 = animelemtime(2)=0
x = -4
y = -6
persistent = 0

[State 6100, turning snd]
type = playsnd
triggerall = anim=5937
trigger1 = !time
trigger2 = time = 10
trigger3 = time = 20
trigger4 = time = 30
trigger5 = time = 40
trigger6 = time = 50
trigger7 = time = 60
trigger8 = time = 70
trigger9 = time = 80
value = 21,1
persistent = 1

[state 17100, Flip KO FX]
type=explod
trigger1 = Anim=5937 && !numexplod(59370) && animelemtime(3)=0
anim = 5938
id = 5938
pos = 0,-50
postype = P1
sprpriority = 3
ownpal = 1
;supermovetime = -1
removetime = -1
persistent = 0
bindtime = -1
ignorehitpause = 1
 
[State 9011, VelAdd]
type = VelAdd
trigger1 = Pos Y < 0
y = 0.35
 
[State 9011, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA
 
[State 9011, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;===========================================================================
; <<<<< AIR KI BLAST >>>>>
; Light state : 1600
; Light Helper : 1601
; Medium state : 1610
; Medium Helper : 1611
; Strong state : 1620
; Strong Helper : 1621
; Helper vanishes : 1630
;===========================================================================

;LIGHT AERIAL KI BLAST
[Statedef 1600]
type = A
physics = N
movetype = A
anim = 1600
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 35

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 3000, LKB]
type = helper
trigger1 = anim=1600 && animelem=3
helpertype = normal
stateno = 1601
ID = 1601
name = "light air ki blast"
postype = p1
pos = 10,-40
ownpal = 1

;[State 40, 4]; Rebound in air
;type = VelSet
;trigger1 = animelemtime(4)=0
;x = 0
;y = const(velocity.jump.y)/4.0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(4)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 0

;--------------------------------
;MEDIUM AERIAL KI BLAST
[Statedef 1610]
type = A
physics = N
movetype = A
anim = 1600
ctrl = 0
;velset = 0,0
sprpriority = 2
poweradd = 35

[State 200, save vel]
type = varset
trigger1 = !time
fvar(4) = vel X

[State 200, stop vel]
type = velset
trigger1 = !time
X = vel X /3.0
Y = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 3000, LKB]
type = helper
trigger1 = anim=1600 && animelem=3
helpertype = normal
stateno = 1611
ID = 1611
name = "medium air ki blast"
postype = p1
pos = 10,-40
ownpal = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = animelemtime(4)=0
x = ifelse(fvar(4)/2<3, fvar(4)/2, 3)
;y = const(velocity.jump.y)/4.0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(4)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 0

;--------------------------------
;STRONG AERIAL KI BLAST
[Statedef 1620]
type = A
physics = N
movetype = A
anim = 1600
ctrl = 0
;velset = 0,0
sprpriority = 2
poweradd = 35

[State 200, save vel]
type = varset
trigger1 = !time
fvar(4) = vel X

[State 200, stop vel]
type = velset
trigger1 = !time
X = vel X /2.0
Y = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
value = 10,0

[State 3000, LKB]
type = helper
trigger1 = anim=1600 && animelem=3
helpertype = normal
stateno = 1621
ID = 1621
name = "medium air ki blast"
postype = p1
pos = 10,-40
ownpal = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = animelemtime(4)=0
x = ifelse(fvar(4)<4, fvar(4), 4)
;y = const(velocity.jump.y)/3.0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(4)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 50
ctrl = 0


;===========================================================================
; <<<<< AIR MACHINE GUN TEMPER >>>>>
; Light state : 1700
; Light Helper : 1701
; Medium state : 1710
; Medium Helper : 1711
; Strong state : 1720
; Strong Helper : 1721
; Helper vanishes : 1630
;===========================================================================

;LIGHT AERIAL MACHINE GUN TEMPER
[Statedef 1700]
type = A
physics = N
movetype = A
anim = 1700
ctrl = 0
velset = 0,0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 2

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>=1000 && random<200 && enemynear,Movetype=H 
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,1)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-30)
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)
trigger1 = enemynear,Movetype=H &&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,1)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-30)
var(3) = 2

[State 200, "Surprise" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1700,random%3
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
value = 10,0

[State 1315, Flash 1]
type = explod
trigger1 = Animelemtime(3)=0
trigger2 = AnimElemtime(17)=0
anim = 2621
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 1315, Flash 2]
type = explod
trigger1 = Animelemtime(10)=0
anim = 2622
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=3
trigger2 = animelem=17
helpertype = normal
stateno = 1701
ID = 1701
name = "light air mgt"
postype = p1
pos = 10,-40
ownpal = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=10
helpertype = normal
stateno = 1701
ID = 1701
name = "light air mgt"
postype = p1
pos = -10,-40
ownpal = 1

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(18)>=0
physics = A

[State 1000, air Galick Ho 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = animelemtime(19)>=0
trigger1 = var(3)=2 && power>=2000
value = 2450
[State 1000, air Galick Ho 1]
type = Changestate
triggerall = animelemtime(19)>=0
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
value = 2100

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 1740 ;50
ctrl = 0

;-------------------------------------
;MEDIUM AERIAL MACHINE GUN TEMPER
[Statedef 1710]
type = A
physics = N
movetype = A
anim = 1700
ctrl = 0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 2

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>=1000 && random<200 && enemynear,Movetype=H 
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,2)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-30)
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)
trigger1 = enemynear,Movetype=H &&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,1)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-30)
var(3) = 2

[State 200, "Surprise" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1700,random%3
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 200, save vel]
type = varset
trigger1 = !time
fvar(4) = vel X

;[State 200, stop vel]
;type = velset
;trigger1 = !time
;X = vel X /3.0
;Y = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
value = 10,0

[State 1315, Flash 1]
type = explod
trigger1 = Animelemtime(3)=0
trigger2 = AnimElemtime(17)=0
anim = 2621
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 1315, Flash 2]
type = explod
trigger1 = Animelemtime(10)=0
anim = 2622
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=3
trigger2 = animelem=17
helpertype = normal
stateno = 1711
ID = 1711
name = "medium air mgt"
postype = p1
pos = 10,-40
ownpal = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=10
helpertype = normal
stateno = 1711
ID = 1711
name = "medium air mgt"
postype = p1
pos = -10,-40
ownpal = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
x = ifelse(fvar(4)/2<3, fvar(4)/2, 3)
y = const(velocity.jump.y)/8.0

[State 1000, air Galick Ho 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = animelemtime(19)>=0
trigger1 = var(3)=2 && power>=2000
value = 2450
[State 1000, air Galick Ho 1]
type = Changestate
triggerall = animelemtime(19)>=0
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
value = 2100

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(18)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 1740 ;50
ctrl = 0

;-------------------------------------
;STRONG AERIAL MACHINE GUN TEMPER
[Statedef 1720]
type = A
physics = N
movetype = A
anim = 1700
ctrl = 0
sprpriority = 2
poweradd = 100

;RAGE MODE
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 1
trigger1 = (command = "2qcf2p")
var(3) = 2

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = power>=1000 && random<200 && enemynear,Movetype=H 
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,1)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-40)
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 1 && numenemy
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)
trigger1 = enemynear,Movetype=H &&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
trigger1= (p2bodydist x=[-20,20]) && (p2bodydist y=[-40,355]) && (enemynear,vel x=[0,1)) && (enemynear,pos y=0&&enemynear,Statetype=S||enemynear,pos y<=-40)
var(3) = 2

[State 200, "Surprise" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1700,random%3
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1401,0
channel = 0
volume = 300

[State 200, "Hyaa, daaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1402,random%2
channel = 0
volume = 300

[State 200, save vel]
type = varset
trigger1 = !time
fvar(4) = vel X

;[State 200, stop vel]
;type = velset
;trigger1 = !time
;X = vel X /2.0
;Y = 0

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
value = 10,0

[State 1315, Flash 1]
type = explod
trigger1 = Animelemtime(3)=0
trigger2 = AnimElemtime(17)=0
anim = 2621
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 1315, Flash 2]
type = explod
trigger1 = Animelemtime(10)=0
anim = 2622
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=3
trigger2 = animelem=17
helpertype = normal
stateno = 1721
ID = 1721
name = "strong air mgt"
postype = p1
pos = 10,-40
ownpal = 1

[State 3000, helper]
type = helper
triggerall = anim=1700 
trigger1 = animelem=10
helpertype = normal
stateno = 1721
ID = 1721
name = "strong air mgt"
postype = p1
pos = -10,-40
ownpal = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
x = ifelse(fvar(4)<4, fvar(4), 4)
y = const(velocity.jump.y)/6.0

[State 1000, air Galick Ho 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = animelemtime(19)>=0
trigger1 = var(3)=2 && power>=2000
value = 2450
[State 1000, air Galick Ho 1]
type = Changestate
triggerall = animelemtime(19)>=0
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
value = 2100

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(18)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 1740 ;50
ctrl = 0

;---------------------------
;Return & Landing from Air Machine Gun Temper

[Statedef 1740]
type = A
physics = N
movetype = I
anim = 44
ctrl = 0
sprpriority = 2

[State 40, 4]; fall
type = Veladd
trigger1 = anim = 44
Y = 0.9

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 44
trigger1 = Pos Y = 0
value = 1740

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Stop]
type = VelSet
trigger1 = anim = 1740
X = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger2 = pos Y > 10
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1740
persistent = 0
statetype = S
physics = N

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1740
value = 40, 0
persistent = 0

[state 17100, twirl FX]
type=explod
trigger1 = Anim = 1740
anim=17100
id=17100
pos=7,0
postype=P1
sprpriority=-2
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0
scale = 1,1

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1740
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===========| EX MOVES |===========

;===========================================================================
; <<<<< EX RISING KNEE >>>>>
; Rising Knee start = 1550
; Rising Knee in air = 1551
; Going back down (anim 44)
;===========================================================================
[StateDef 1550];On ground
type = S
movetype = A
physics = S
ctrl = 0
anim = 1500
poweradd = ifelse(var(53)>0,0,-500)
;poweradd = -500
velset = 0,0

;RAGE MODE
[State 3000, Buffer var]
type = varadd
trigger1 = !time
var(53) = -100
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+200>2100, 2100-var(58), 200)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 100, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 100, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 200, "In your Face" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1501,random%4
channel = 0
volume = 300

[State 200, "Idiot" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1502,0
channel = 0
volume = 300

[State 200, Sabbat voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1003,1   ;1503,random%3
channel = 0
volume = 300

[State 6100, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 1

[State 8000, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 1551
ctrl = 0

;------------------------------
[StateDef 1551];Rising
type = A
movetype = A
physics = N
ctrl = 0
anim = 1501

[State 8000, flash]
type = PalFX
trigger1 = anim=1501
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcfa") || (command = "qcfb") || (command = "qcfc")
var(3) = 3
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
triggerall = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 6

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy && movehit
trigger1 = power>=1000 && random<200
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 1+random%2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel>0 && time > 5 && numenemy && movehit && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 3
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy && movehit
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)&&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 4

[state 1215, Rising Effect smoke]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = -10,ifelse(var(15)=1,6,ifelse(var(15)=2,8,9))
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0

[State 6000, VelIni]; SK button
type = VelSet
trigger1 = Time = 0
Y = -10
X = 11

[State 6100, jump sound]
type = playsnd
trigger1 = !time
value = 40,1

[State 6100, woosh sound]
type = playsnd
trigger1 = !time
value = 0,5  ;1500,0

[state 1215, Super Rising Effect]
type = explod
trigger1 = (Anim = 1501) && !time
anim = 1553
id = 1553
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = -1
persistent = 0
ignorehitpause = 1
removeongethit = 1
bindtime = -1

[State 4001, Invincible]
type = NotHitBy
trigger1 = (Anim = 1501) && animelemtime(2)<0
value = SCA

[State 4001, AirFriction]
type = VelMul
trigger1 = Vel X != 0
X = .9

[State 282, varset]
type = varset
trigger1 = !time
var(9)=0
[State 282, varadd]
type = varadd
trigger1 = movecontact
var(9) = 1

[State 4001, 3rd Hit]
type = HitDef
trigger1 = Anim=1501 && var(9)<3
attr = A, SA
hitflag = MAF
guardflag = MA
animtype = Back
priority = 7, Hit
;damage = 40,4
damage = ceil(ifElse(fvar(11) * 40 < 7, 7, fvar(11) * 40)), 4
pausetime = 12,14
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10, -75
hitsound = s5,6
guardsound = s6,1
p2facing = 1
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -2,-11
air.velocity = -3,-10
fall = 1
fall.recover = 0
getpower = 0,0
givepower = 35,35
envshake.time = 16
envshake.freq = 60
envshake.ampl = 4
yaccel = 0.5

[State 4001, Fall]
type = VelAdd
trigger1 = Anim = 1501
trigger1 = Pos Y < -30
trigger2 = Anim = 44
Y = .55

[State 1000, Bomber Kick Follow-up]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=3
value = 1530

[State 1000, Air Rage Galactic Gunfire]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=4 && power>=1000 && var(53)>0 && var(58) >= 700
value = 2803

[State 1000, Air baku 2]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=2 && power>=2000
value = 2330
[State 1000, air baku 1/tantrum]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=1 && power>=1000
trigger2 = var(3)=2 && power>=1000 && power<2000
value = IfElse(var(1)=1,2310,3430)

[State 1000, Air galick 2]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=6 && power>=2000
value = 2450
[State 1000, air galick 1]
type = Changestate
triggerall = Anim=1501 && animelemtime(3)>=0 && movecontact
trigger1 = var(3)=5 && power>=1000
trigger2 = var(3)=6 && power>=1000 && power<2000
value = 2100

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 1501
trigger1 = Vel Y >= 0.0
value = 44

[State 4001, Return&Landing]
type = ChangeAnim
trigger1 = Anim = 44
trigger1 = Pos Y = 0
value = 1111

[State 4001, StopFwd]
type = VelSet
trigger1 = Vel X = (0,0.4]
X = 0

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
Y = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
Y = 0

[State 4001, ToGround]
type = StateTypeSet
trigger1 = Anim = 1111
persistent = 0
statetype = S
physics = S

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = anim=1111
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = Anim = 1111
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0

[State 4001, End]
type = ChangeState
trigger1 = Anim = 1111
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;===========================================================================
; <<<<< EX MACHINE GUN TEMPER >>>>>
; EX MGT state = 1450
;===========================================================================
[Statedef 1450]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1450
ctrl = 0
sprpriority = 2
poweradd = ifelse(var(53)>0,0,-500)
;poweradd = -500

;RAGE MODE
[State 3000, Buffer var]
type = varadd
trigger1 = !time
var(53) = -150 ;-100
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+200>2100, 2100-var(58), 200)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 200, "Ratatata" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1450,0
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1451,0
channel = 0
volume = 300

[State 200, "Hyaaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1452,0
channel = 0
volume = 300

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 1
[State 8000, flash]
type = PalFX
trigger1 = anim=1450
add = 40, 30, -40
time=1
ignorehitpause = 1
[State 8000, Train];<<<<<<<<<<<<<<<<<<<<<<<<<<<
type = AfterImage
trigger1 = Time = 0
time = 86
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 10
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 10
trigger1 = (command = "qcbf2p")
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 10
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 10
trigger1 = (command = "FFc")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 10
trigger1 = (command = "2qcf2p")
var(3) = 8

[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy && movehit
trigger1 = power>=1000 && random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 1+random%2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel>0 && time > 5 && numenemy && movehit && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 4
[State 800, VarSet]
type = VarSet
triggerall = (p2bodydist x=[10,60])
trigger1 = AILevel>0 && time > 5 && numenemy && movehit && random<500
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 5
[State 800, VarSet]
type = VarSet
triggerall = AILevel>0 && time > 5 && numenemy && movehit
trigger1 = Ifelse(var(53),power>=1000&&power<=2000,power>=2000)&&random<100
trigger1 = (enemynear,stateno != [120, 155]) && enemynear,statetype != L
var(3) = 8

[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(10)=0
trigger2 = animelemtime(20)=0
trigger3 = animelemtime(30)=0
var(14) = 1
[State 220, gethit gut ?]
type = VarSet
trigger1 = AnimElemtime(5)=0
trigger2 = animelemtime(15)=0
trigger3 = animelemtime(25)=0
var(14) = 0

[state 1215, Smoke FX]
type = explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
trigger5 = animelemtime(25)=0
trigger6 = animelemtime(30)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = null ;explod
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
trigger3 = animelemtime(25)=0
anim = 1401
id = 1401
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 4
ignorehitpause = 0
removeongethit = 1

[state 1215, Flash FX 2]
type = null ;explod
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
trigger3 = animelemtime(30)=0
anim = 1402
id = 1402
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = 4
ignorehitpause = 0
removeongethit = 1

[State 200, 1]
type = PlaySnd
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(10)=0
trigger3 = animelemtime(15)=0
trigger4 = animelemtime(20)=0
trigger5 = animelemtime(25)=0
trigger6 = animelemtime(30)=0
value = 10,0

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(5)=0
trigger2 = animelemtime(15)=0
trigger3 = animelemtime(25)=0
name = "machine135"
postype = P1
pos = 50,-63
ownpal = 1
stateno = 1412
id = 1450

[State 1000, helper]
type = Helper
helpertype = normal
trigger1 = animelemtime(10)=0
trigger2 = animelemtime(20)=0
trigger3 = animelemtime(30)=0
name = "machine246"
postype = P1
pos = 50,-58
ownpal = 1
stateno = 1412
id = 1450

[State 3010, Helper Limiter]
type = Helper
trigger1 =  animelemtime(30)=0
helpertype = normal
name =  "Limiter"
ID = 9997
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999

[State 1000, Can chain if far]
type = Changestate
triggerall = animelemtime(31) >= 4
trigger1 = var(3)=5
;trigger1 = abs(p2bodydist X) > 100
value = 1420

[State 1000, baku 2]
type = Changestate
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = animelemtime(31) >= 4
trigger1 = var(3)=2 && power>=2000
value = 2320
[State 1000, baku 1]
type = Changestate
triggerall = roundstate = 2
triggerall = animelemtime(31) >= 4
trigger1 = var(3)=1 && (power>=1000 || var(53)>0)
trigger2 = var(3)=2 && ((power>=1000 && power<2000) || var(53)>0)
value = 2300

[State 1000, Chou Galick Ho]
type = ChangeState
triggerall = var(53)=0 ;No rage mode
triggerall = roundstate = 2
triggerall = Var(3) = 8
triggerall = AnimElemTime(31)>=4
trigger1 = power>=2000 ;&& var(18)=0
value = 2400
ctrl = 0
[State 1000, Galick Ho]
type = ChangeState
triggerall = roundstate = 2
triggerall = AnimElemTime(31)>=4
trigger1 = var(3)=4 && (power>=1000 || var(53)>0)
trigger2 = var(3)=8 && ((power>=1000 && power<2000) || var(53)>0)
value = 2000
ctrl = 0

[State 1000, Relax]
type = statetypeset
trigger1 = animelem = 32
movetype = I

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

;===========================================================================
; <<<<< EX KI BLAST >>>>>
; EX KB state = 1050
;===========================================================================

[Statedef 1050]
type    = S
movetype= A
physics = N
juggle  = 7
velset = 0,0
anim = 1003
ctrl = 0
sprpriority = 2
poweradd = ifelse(var(53)>0,0,-500)

;RAGE MODE
[State 3000, Buffer var]
type = varadd
trigger1 = !time
var(53) = -100
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+200>2100, 2100-var(58), 200)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = time > 1
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 1

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 2
[State 8000, flash]
type = PalFX
trigger1 = anim=1003
add = 40, 30, -40
time=1
ignorehitpause = 1
[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 86
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[state 1000, Change Animation]
type = changeanim
triggerall = anim = 1003
trigger1 = animelemtime(4) >= 0
value = 1050

[state 1215, Smoke FX]
type = explod
trigger1 = Anim=1050 && AnimElemtime(2)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -25,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

[state 1215, Flash FX]
type = explod
trigger1 = Anim=1050 && AnimElemtime(2)=0
anim = 804
id = 804
pos = 0,0
postype = P1
sprpriority = 5
ownpal = 1
removetime = 3
persistent = 0
ignorehitpause = 0
bindtime = -1

[State 200, eat this/fun's over voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1000,1+random%5
channel = 0
volume = 300

[State 200, random "Take it/Daa!" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1002,random%5
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1003,1
channel = 0
volume = 300

[State 200, 1]
type = PlaySnd
trigger1 = Anim=1050 && AnimElemtime(2)=0
value = 10,0

[State 1000, helper EX KB]
type = Helper
helpertype = normal
trigger1 = Anim=1050 && AnimElemtime(2)=0
name = "EX Ki Blast"
postype = P1
pos = 65,-56
ownpal = 1
stateno = 1051
id = 1051

[State 1000, to EX Machine Gun in Rage mode]
type = ChangeState
triggerall = roundstate = 2
triggerall = anim = 1050
triggerall = AnimElemTime(4)>=13 ;3
trigger1 = Var(3)=1 && var(53)>0
value = 1450
ctrl = 0

[State 1000, 7]
type = ChangeState
trigger1 = Anim=1050 && AnimTime = 0
value = 0
ctrl = 1


;===========================================================================
; <<<<< EX AERIAL MACHINE GUN TEMPER >>>>>
; EX AIR MGT state = 1730
; Return and landing = 1731
;===========================================================================
[Statedef 1730]
type = A
physics = N
movetype = A
anim = 1730
ctrl = 0
sprpriority = 2
;poweradd = ifelse(var(53)>0,0,-500)
poweradd = -500

;RAGE MODE
[State 3000, Buffer var]
type = varadd
trigger1 = !time
var(53) = -100
[State 3000, Flame var]
type = varadd
trigger1 = !time
var(58) = ifelse(var(58)+200>2100, 2100-var(58), 200)
[State 3000, Timer var]
type = varset
trigger1 = !time
var(59) = 360 ;180

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 1
[State 8000, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1
[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 86
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 200, "Ratatata" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1450,0
channel = 0
volume = 300

[State 200, "Take This" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1451,0
channel = 0
volume = 300

[State 200, "Hyaaa" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1452,0
channel = 0
volume = 300

[State 200, save vel]
type = varset
trigger1 = !time
fvar(4) = vel X

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
trigger4 = AnimElemtime(24)=0
trigger5 = AnimElemtime(31)=0
value = 10,0

[State 1315, Flash 1]
type = explod
trigger1 = Animelemtime(3)=0
trigger2 = AnimElemtime(17)=0
trigger3 = AnimElemtime(31)=0
anim = 2621
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 1315, Flash 2]
type = explod
trigger1 = Animelemtime(10)=0
trigger2 = AnimElemtime(24)=0
anim = 2622
sprpriority = 5
postype = p1
pos = 0,0
removetime = 2
ownpal = 1
bindtime = -1
ignorehitpause = 0
removeongethit = 1

[State 3000, helper]
type = helper
trigger1 = animelem=3
trigger2 = animelem=17
trigger3 = animelem=31
helpertype = normal
stateno = 1721
ID = 1721
name = "strong air mgt"
postype = p1
pos = 10,-40
ownpal = 1

[State 3000, helper]
type = helper
trigger1 = animelem=10
trigger2 = animelem=24
helpertype = normal
stateno = 1721
ID = 1721
name = "strong air mgt"
postype = p1
pos = -10,-40
ownpal = 1

[State 40, 4]; Rebound in air
type = VelSet
trigger1 = AnimElemtime(3)=0
trigger2 = AnimElemtime(10)=0
trigger3 = AnimElemtime(17)=0
trigger4 = AnimElemtime(24)=0
trigger5 = AnimElemtime(31)=0
x = ifelse(fvar(4)<4, fvar(4), 4)
y = const(velocity.jump.y)/7.0

[State 2200, sts]
type = statetypeset
trigger1 = animelemtime(32)>=0
physics = A

[State 3000, end]
type = changestate
trigger1 = !animtime
value = 1740 ;50
ctrl = 0



;===========================================================================
;===========================================================================
;<<<<<<<<<<<<<<<<<<<<<<<<| MAJIN EXCLUSIVE MOVES |>>>>>>>>>>>>>>>>>>>>>>>>>>
;===========================================================================
;===========================================================================

;===========================================================================
; <<<<< MAJIN BAKUHATSUHA >>>>>
; start = 3010
; recovery = 3011
; Helper = 3020
; Helper vanish = 3021
;===========================================================================

;-------------------------------------------------------------------------------
;[MAJIN]
; MAJIN BAKUHATSUHA
[Statedef 3010]
type    = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
anim = 3010+2*(random<50)
ctrl = 0
sprpriority = 2
poweradd = 35

[State 0, VarSet]
type = VarSet
trigger1 = AILevel<=0 && !time
var(15) = IfElse((command = "qcfx"),1,IfElse((command = "qcfy"),2,3))
;ignorehitpause =
;persistent =

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0 && !time
var(15)=ifelse(random<300,1,ifelse(random<500,2,3))
ignorehitpause=1

;SANITY MODE
[State 3000, Flame var]
type = varadd
triggerall = var(53)>0   ;only add when in Sanity mode
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)

[State 3010, woosh]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 0,0
volume = 0
channel = -1

[State 3010, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = time = 5
value = 3010,random%3
channel = 0
volume = 300

[State 3010, random Jap "Take it" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = time = 5
value = 1002,random%5
channel = 0
volume = 300

[State 3010, "Eat This" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = time = 5
value = 1003,0
channel = 0
volume = 300

[State 3010, Helper]
type = Helper
trigger1 = AnimElemTime(3)=0
helpertype = normal
name = "BKH Ball"
ID =   3020
stateno = 3020
pos = IfElse(FrontEdgeDist<150,75,30+45*(var(15))),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0


[State 3010, Smoke]
type = Explod
trigger1 = AnimElemTime(3)=0
anim =  17100
ID =  17100
pos = IfElse(FrontEdgeDist<150,72,30+42*(var(15))),0
postype = p1  ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 0.5,0.5
sprpriority = 0
ownpal = 1
removeongethit = 0
ignorehitpause = 1


[State 3010, end]
type = changestate
trigger1 = AnimElemTime(4)>0 && !NumHelper(3020)
value = 3011
ctrl = 0

; M.Bakuhatsuha Recovery
[Statedef 3011]
type    = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
anim = 3011
ctrl = 0
sprpriority = 2
poweradd = 0


[State 3011, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;===========================================================================
; <<<<< EX MAJIN BAKUHATSUHA >>>>>
; start = 3050
; recovery = 3051
; Helper = 3022
; Helper vanish = 3023
;===========================================================================

;-------------------------------------------------------------------------------
;[MAJIN]
; EX MAJIN BAKUHATSUHA
[Statedef 3050]
type    = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
anim = 3010+2*(random<50)
ctrl = 0
sprpriority = 2
poweradd = ifelse(var(53)>0,0,-500)


[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 2
[State 8000, flash]
type = PalFX
trigger1 = anim=3010
add = 40, 30, -40
time=1
ignorehitpause = 1
[State 8000, Train]
type = AfterImage
trigger1 = Time = 0
time = 86
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 3010, woosh]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 0,0
volume = 0
channel = -1

[State 3010, "Bakuhatsuha" voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = time = 5
value = 2300,random%5
channel = 0
volume = 300

[State 3010, "What the, FU BItch !!!" voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = time = 5
value = 2305,0
channel = 0
volume = 300

[State 3010, "Bakuhatsuha" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = time = 5
value = 2300,10+random%4
channel = 0
volume = 300


[State 3010, Helper 1]
type = Helper
trigger1 = Time = 19 ;AnimElemTime(3)=0
helpertype = normal
name = "BKH Ball 1"
ID =   3020
stateno = 3022
pos = IfElse(FrontEdgeDist<105,45,75),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 3010, Helper 2]
type = Helper
trigger1 = Time = 25 ;AnimElemTime(3)=0
helpertype = normal
name = "BKH Ball 2"
ID =   3020
stateno = 3022
pos = IfElse(FrontEdgeDist<105,45,125),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0

[State 3010, Helper 3]
type = Helper
trigger1 = Time = 31 ;AnimElemTime(3)=0
helpertype = normal
name = "BKH Ball 3"
ID =   3020
stateno = 3022
pos = IfElse(FrontEdgeDist<105,45,175),0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0


[State 3010, Smoke 1]
type = Explod
trigger1 = Time = 19 ;AnimElemTime(3)=0
anim =  17100
ID =  17100
pos = IfElse(FrontEdgeDist<105,45,75),0
postype = p1  ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 0.5,0.5
sprpriority = 0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3010, Smoke 2]
type = Explod
trigger1 = Time = 25 ;AnimElemTime(3)=0
anim =  17100
ID =  17100
pos = IfElse(FrontEdgeDist<105,45,125),0
postype = p1  ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 0.5,0.5
sprpriority = 0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3010, Smoke 3]
type = Explod
trigger1 = Time = 31 ;AnimElemTime(3)=0
anim =  17100
ID =  17100
pos = IfElse(FrontEdgeDist<105,45,175),0
postype = p1  ;p2,front,back,left,right
supermovetime = 9999
pausemovetime = 9999
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 0.5,0.5
sprpriority = 0
ownpal = 1
removeongethit = 0
ignorehitpause = 1

[State 3010, end]
type = changestate
trigger1 = AnimElemTime(4)>0 && !NumHelper(3020)
value = 3051
ctrl = 0

; EX M.Bakuhatsuha Recovery
[Statedef 3051]
type    = S
movetype= A
physics = S
juggle  = 7
velset = 0,0
anim = 3011
ctrl = 0
sprpriority = 2
poweradd = 0


[State 3011, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1


;===========================================================================
; <<<<< SURPRISE ELBOW ATTACK >>>>>
; start = 3100
; dash = 3101
; End = 3102
; P2 custom state when hit (wall bounce) = 3103,3104,3105
;===========================================================================

; Surprise Elbow Attack (start)
[Statedef 3100]
type = S
movetype = A
physics = S
anim = 3100
ctrl = 0
velset = 0,0
poweradd = 0 ;20
sprpriority = 3

[State 3100, VarSet]
type = VarSet
trigger1 = Time = 0
var(15) = ifelse(Command = "qcbx", 10, ifelse(Command = "qcby", 20, 30))

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0&& !time
var(15)=ifelse(random<500,20,30)
ignorehitpause=1

[State 3100, NotHitBy Medium]
type = NotHitBy
triggerall = var(15)=20
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA
ignorehitpause = 1

[State 3100, NotHitBy Strong]
type = NotHitBy
triggerall = var(15)=30
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, NP, SP
ignorehitpause = 1

[State 3100, HitBy Medium]
type = HitBy
triggerall = var(15)=20
trigger1 = Time >= 0
value = SCA, HA, NP, SP, HP, NT, ST, HT
time = 1
ignorehitpause = 1

[State 3100, HitBy Strong]
type = HitBy
triggerall = var(15)=30
trigger1 = Time >= 0
value = SCA, HA, HP, NT, ST, HT
time = 1
ignorehitpause = 1

[State 3100, VelIni]
type = null ;VelSet
trigger1 = AnimElemTime(4) > 0
x = const(velocity.walk.back.x)
;x = 1.5*const(velocity.run.back.x)*var(15)

[State 3100, VelIni]
type = VelSet
trigger1 = AnimElemTime(3) = 0
x = 3*const(velocity.run.back.x) ;*var(15)

[State 3100, VelMul]
type = VelAdd
trigger1 = AnimElemTime(3) = 0
x = -2*var(15)/10

[State 3100, dust FX]
type = null ;helper
triggerall = AnimElemTime(4) = 0
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[state 3100, Smoke FX]
type = null ;explod
trigger1 = AnimElemTime(4) = 0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 3100, dash Sound]
type = PlaySnd
trigger1 = AnimElemTime(3) = 0
value = 5, 8

[State 0, Cancel]
type = ChangeState
triggerall = var(15)>10 ; medium/hard only
triggerall = AnimElemTime(4) > 0
trigger1 = command = "mp_sp"
trigger2 = command = "mk_sk"
value = 106
ctrl = 0
;anim =
;ignorehitpause =
;persistent =


[State 3100, 5]
type = ChangeState
triggerall = AnimElemTime(5) > 0
trigger1 = vel x = 0 ;AnimTime = 0
trigger2 = time >= 25 ;p2bodydist X > 150
value = 3101

;-------------------------------------
; Surprise Elbow Attack (dash)
[Statedef 3101]
type = S
movetype = A
physics = S
anim = 3101
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3

;SANITY MODE
[State 3000, Flame var]
type = varadd
triggerall = var(53)>0   ;only add when in Sanity mode
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)

[State 3101, NotHitBy Medium]
type = NotHitBy
triggerall = var(15)=20
trigger1 = AnimElemTime(3) < 0
time = 1
value = SCA, NA, SA
ignorehitpause = 1

[State 3101, NotHitBy Strong]
type = NotHitBy
triggerall = var(15)=30
trigger1 = AnimElemTime(3) < 0
time = 1
value = SCA, NA, SA, NP, SP
ignorehitpause = 1

[State 3101, HitBy Medium]
type = HitBy
triggerall = var(15)=20
trigger1 = AnimElemTime(3) < 0
value = SCA, HA, NP, SP, HP, NT, ST, HT
time = 1
ignorehitpause = 1

[State 3101, HitBy Strong]
type = HitBy
triggerall = var(15)=30
trigger1 = AnimElemTime(3) < 0
value = SCA, HA, HP, NT, ST, HT
time = 1
ignorehitpause = 1

[State 3101, VelIni]
type = VelSet
trigger1 = AnimElemTime(3) = 0
x = 3*const(velocity.run.fwd.x) ;*var(15)

[State 3101, VelMul]
type = null ;VelAdd
trigger1 = AnimElemTime(3) = 0
x = 2*var(15)/10

[State 3101, VelMul]
type = VelMul
trigger1 = AnimElemTime(3) = 0
x = 1 + 0.2*var(15)/10

[State 3101, 2]
type = PlaySnd
trigger1 = AnimElemTime(3) = 0
value = 100, 2

[State 3101, dust FX]
type = helper
triggerall = AnimElemTime(3) = 0
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[state 3101, Smoke FX]
type = explod
trigger1 = AnimElemTime(3) = 0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[state 3101, Smoke FX]
type = explod
trigger1 = AnimElemTime(3) = 0 && !NumExplod(3105)
anim = 3105
id = 3105
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
bindtime = -1
removetime = -1
persistent = 0
ignorehitpause = 1


[State 3101, light-medium]
type = HitDef
triggerall = var(15) != 30
trigger1 = Time > 0
attr = S, SA
;damage    = 45+10*var(15)/10,4+2*var(15)/10
damage = ceil(ifElse(fvar(11) * (45+10*var(15)/10) < 7, 7, fvar(11) * (45+10*var(15)/10))), 4+2*var(15)/10
animtype = Hard
air.animtype = back
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 13, 13 ;13,13
guard.pausetime = 13,7
sparkno = s7030
guard.sparkno = s7000
sparkxy = -0,-50
hitsound   = s3100,0 ;s5, 5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-4
guard.velocity = -4
air.velocity =-6,-4
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
fall = 1
fall.recover = 0
yaccel = 0.5
persistent = 0

[State 3101, strong]
type = HitDef
triggerall = var(15) = 30
trigger1 = Time > 0
attr = S, SA
;damage    = 45+10*var(15)/10,4+2*var(15)/10
damage = ceil(ifElse(fvar(11) * (45+10*var(15)/10) < 7, 7, fvar(11) * (45+10*var(15)/10))), 4+2*var(15)/10
animtype = Hard
air.animtype = back
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 13, 13 ;13,13
guard.pausetime = 13,7
sparkno = s7030
guard.sparkno = s7000
sparkxy = -0,-50
hitsound   = s3100,0 ;s5, 5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-4
guard.velocity = -4
air.velocity =-6,-4
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
fall = 1
fall.recover = 0
yaccel = 0.5
persistent = 0
;p2stateno = 3103

[State 3302, Helper Limiter]
type = Helper
trigger1 = movehit
helpertype = normal
name = "Limiter"
ID = 9993
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 0, TargetState]
type = TargetState
triggerall = var(15) = 30
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 3103
ignorehitpause = 1
persistent = 0


[State 3101, VelSet]
type = VelSet
trigger1 = movecontact
x = 0
;ignorehitpause = 1

[State 3101, RemoveExplod]
type = RemoveExplod
trigger1 = movecontact
trigger2 = vel x = 0
id = 3105
ignorehitpause = 1
;persistent =


[State 3101, 5]
type = ChangeState
trigger1 = AnimElemTime(3) > 0
trigger1 = vel x = 0 ;AnimTime = 0
value = 3102

;-------------------------------------
; Surprise Elbow Attack (end)

[Statedef 3102]
type = S
movetype = A
physics = S
anim = 3102
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3

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

;-------------------------------------
; P2 Hit by Surprise Elbow Attack (custom state)

[Statedef 3103]
type = A
movetype = H
physics = N ;A
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3

[State 3103, ChangeAnim2]
type = null ;ChangeAnim2
trigger1 = !time
value = IfElse(SelfAnimExist(5052),5052,3103)

[State 3103, ChangeAnim]
type = ChangeAnim
trigger1 = !time && SelfAnimExist(5052)
value = 5052

[State 3103, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && !SelfAnimExist(5052)
value = 3103

[State 0, Gravity]
type = Gravity
trigger1 = 1

[State 3103, VelAdd]
type = VelSet
trigger1 = !Time ;(Pos Y < 0)
x = -10
y = -5

[State 3103, NotHitBy]
type = null ;NotHitBy
trigger1 = 1
value = SCA

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

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

[State 3103, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;-------------------------------------
;Wall Hit by Surprise Elbow Attack (custom state)
[Statedef 3104]
type    = A
movetype= H
physics = N
;anim = IfElse(SelfAnimExist(5052),5052,3103)
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3

[State 3104, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time
;value = IfElse(SelfAnimExist(5052),5052,3104)
value = 3104

[State 3104, VelAdd]
type = VelSet
trigger1 = !Time ;(Pos Y < 0)
x = -10
y = -5

[State 3104, NotHitBy]
type = null ;NotHitBy
trigger1 = 1
value = SCA

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

[State 3104, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

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

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

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

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

[State 3104, Spark]
type = null;Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 3104, Sound]
type = null;PlaySnd
trigger1 = Time = 0
value = 15000,2 ;F7,0

[State 3104, State]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = time>8
value = 3105

;-------------------------------------
;Wall Bounce by Surprise Elbow Attack (custom state)
[Statedef 3105]
type    = A
movetype= H
physics = N
facep2 = 1

[State 3105, 1]
type = null ;NotHitBy
trigger1 = 1
value = , NA, NP

[State 3105, Vel]
type = VelSet
trigger1 = Time = 0
x = 1.6
y = -6

[State 3105, Turn]
type = null ;Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 3105, Gravity]
type = VelAdd
trigger1 = 1
y = .35

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

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

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

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

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


;-------------------------------------------------------------------------------
;[MAJIN]
; Weak Surprise Elbow Attack
[Statedef 3110]
type = S
movetype = A
physics = N
anim = 300+random%2
ctrl = 0
poweradd = 20
sprpriority = 3
juggle = 7
velset = 2.2*const(velocity.run.fwd.x),0

[State 0, Width]
type = null ;Width
trigger1 = 1
value = 40,40
;ignorehitpause =
;persistent =



[State 800, VarSet]   ;Big Bang
type = null;VarSet
trigger1 = AILevel<=0
trigger1 = time >= 0
trigger1 = (command = "2qcf2p")
trigger1 = (power>=2000 || var(53)>0)
var(3) = 10
[State 3400, VarSet] ;Big Bang
type = VarSet
trigger1 = AILevel<=0
trigger1 = time >=0
trigger1 = (command = "2qcbx") || (command = "2qcby") || (command = "2qcbz")
var(3) = 10

[State 800, VarSet]   ;Photon Bomber
type = VarSet
trigger1 = AILevel<=0
trigger1 = time >= 0
trigger1 = (command = "2qcfx") || (command = "2qcfy") || (command = "2qcfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 11

[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time >= 0
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 12
[State 800, VarSet]   ;Machine Gun Tantrum
type = VarSet
trigger1 = AILevel<=0
trigger1 = time >= 0
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 13

[State 800, VarSet]   ;Atomic Bomber
type = null ;VarSet
trigger1 = AILevel<=0
trigger1 = time >= 0
trigger1 = (command = "qcbfa") || (command = "qcbfb") || (command = "qcbfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 14




[State 3110, "Rock You" voice]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 300,random%2
channel = 0
volume = 300

[State 3110, "Watch out" (koko da) voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 301,0
channel = 0
volume = 300

[State 3110, "drop dead, take this" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 300,2+random%2
channel = 0
volume = 300

[State 3110, dust FX]
type = helper
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

;Surprise elbow follow up?
[State 3110, Elbow]
type = Varset
trigger1 = !time
var(15) = 0

[State 3110, Elbow weak]
type = Varset
triggerall = var(3)<3 ;Elbow weak dash limiter
trigger1 = time>=3 ;1
trigger1 = (command = "qcbx")
var(15) = 10*(command = "qcbx")


[State 3110, Elbow]
type = Varset
trigger1 = time>=3 ;1
trigger1 = (command = "qcby") || (command = "qcbz")
var(15) = 20*(command = "qcby") + 30*(command = "qcbz")


;Dash Elbow variable
[State 3110, VarSet]
type = null ;VarSet
trigger1 = !time
var(3) = 0

[state 3110, Smoke FX]
type = explod
trigger1 = !time
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 3110, 1]
type = VelMul
trigger1 = animelemtime(6)>0
X = 0.9

[State 3110, dash Sound]
type = PlaySnd
trigger1 = time=0
value = 100,0

[State 3110, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 0, 2

[State 3110, 3]
type = HitDef
trigger1 = animelem=2
trigger2 = animelem=3 && !movecontact
trigger3 = animelem=4 && !movecontact
trigger4 = animelem=5 && !movecontact
attr = S, NA
;damage = 55,5
damage = ceil(ifElse(fvar(11) * 55 < 7, 7, fvar(11) * 55)), 5
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 13,18 ;13,13
guard.pausetime = 13,7
sparkno = s7030
guard.sparkno = s7000
sparkxy = -0,-55
hitsound   = s3100,0 ;s5, 5
guardsound = S6,1
animtype = Hard
ground.type = High
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -8
guard.velocity = -4
air.velocity =-4,-4
air.animtype = back
getpower= ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5

[State varset];elbow limiter
type = VarAdd
triggerall = var(3)<3
triggerall = var(15)=10
trigger1 = MoveGuarded ;movecontact
var(3) = 1

;Elbow Surprise Weak follow up
[State 3110, Elbow]
type = changestate
triggerall = var(3)<3
triggerall = var(15)=10
trigger1 = MoveGuarded ;movecontact
value = 3110

;Elbow Surprise follow up
[State 3110, Elbow]
type = changestate
triggerall = var(15)>10
trigger1 = MoveGuarded ;movecontact
value = 3100

[State 3110, snd]
type = playsnd
trigger1 = animelemtime(7)=0
value = 5,8
persistent = 0

[State 1000, Big Bang]
type = ChangeState
triggerall = !NumHelper(33210)
triggerall = !NumProjID(3335)
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(6)>=4
trigger1 = var(3)=10 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3320
ctrl = 0

[State 1000, Photon Bomber]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(6)>=4
trigger1 = var(3)=11 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3300
ctrl = 0

[State 1000, Royal Edict]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(6)>=4
trigger1 = var(3)=12 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3550
ctrl = 0

[State 1000, Tantrum]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(6)>=4
trigger1 = var(3)=13 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3400
ctrl = 0

[State 1000, Atomic Blast]
type = null ;ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(6)>=4
trigger1 = var(3)=14 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3200
ctrl = 0


;Reset Dash Elbow weak variable
[State 3110, VarSet]
type = VarSet
trigger1 = AnimTime = 0
var(3) = 0


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

;-------------------------------------------------------------------------------
;[MAJIN]
; EX Surprise Elbow Attack
[Statedef 3120]
type = S
movetype = A
physics = N
anim = 3120
ctrl = 0
poweradd = ifelse(var(53)>0,0,-500)
sprpriority = 5
juggle = 7
velset = 2.2*const(velocity.run.fwd.x),0

[State 3120, A must for dashes everywhere]
type = Assertspecial
trigger1 = 1
flag = nowalk
[State 3120, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 3120, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
;ignorehitpause =
;persistent =

[State 3001, screen]
type = Screenbound
trigger1 = 1
movecamera = 0,0
value = 0

[State 3120, snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 1

[State 3120, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 3120, Train]
type = AfterImage
trigger1 = Time = 0
time = 20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1


[State 3120, NotHitBy EX]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, NP, SP, NT, ST
ignorehitpause = 1


[State 3120, HitBy EX]
type = HitBy
trigger1 = Time >= 0
value = SCA, HA, HP, HT
time = 1
ignorehitpause = 1


[State 3120, dash Sound]
type = PlaySnd
trigger1 = AnimElemTime(2) = 0
value = 5, 8


[State 3120, hit] ;grounded enemies
type = HitDef
trigger1 = P2Statetype!=A
trigger1 = time>0
attr = S, SA
damage    = 0,0
animtype = light
hitflag = M ;MAF
guardflag = M;A
priority = 4, Hit
pausetime = 0,0 ;13,13
guard.pausetime = 0,0 ;13,7
sparkno = -1 ;s7030
guard.sparkno = -1 ;s7000
hitsound   = -1 ;s5, 5
guardsound = -1 ;S6,1
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-4
guard.velocity = -4
air.velocity =-6,-4
getpower = 0,0
givepower = 0,0
fall = 1
fall.recover = 0
yaccel = 0.5
persistent = 0
p2facing = 1
ID = 3120
;p2stateno = 3123

[State 0, AttackDist] ;prevent air block
type = AttackDist
trigger1 = p2statetype =A
value = 0
ignorehitpause = 1
;persistent =

[State 0, StateTypeSet] ;allow whiffing if not surprise
type = StateTypeSet
trigger1 = !numtarget
trigger1 = time>6
movetype = I
ignorehitpause = 1
;persistent =


[State 0, TargetState]
type = TargetState
trigger1 = P2Statetype!=A
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 3123
ignorehitpause = 1
persistent = 0


[State 3120, dust FX]
type = null ;helper
triggerall = AnimElemTime(4) = 0
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[state 3120, Smoke FX]
type = null ;explod
trigger1 = AnimElemTime(4) = 0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[State 3120, 5]  ;whiff
type = ChangeState
triggerall = !numtarget
trigger1 = P2Dist X < -50
trigger2 = time >= 90 ;180
;trigger1 = vel x = 0 ;AnimTime = 0
;trigger2 = time >= 25 ;p2bodydist X > 150
value = 3122

[State 3120, 5]  ;hit
type = ChangeState
triggerall = numtarget
trigger1 = P2Dist X < -50
trigger2 = time >= 90 ;180
;trigger1 = vel x = 0 ;AnimTime = 0
;trigger2 = time >= 25 ;p2bodydist X > 150
value = 3121

;-------------------------------------------------------------------------------
; EX Surprise Elbow Attack
[Statedef 3121]
type = S
movetype = A
physics = S
anim = 3121
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3
facep2 = 1

[State 3121, PlaySnd]  ;teleport SFX
type = PlaySnd
trigger1 = !time
value = 2302,0

[State 3121, NotHitBy EX]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NA, SA, NP, SP, NT, ST
ignorehitpause = 1


[State 3121, HitBy EX]
type = HitBy
trigger1 = Time >= 0
value = SCA, HA, HP, HT
time = 1
ignorehitpause = 1


[State 3121, VelIni]
type = VelSet
trigger1 = AnimElemTime(3) = 0
x = 3*const(velocity.run.fwd.x) ;*var(15)


[State 3121, VelMul]
type = VelMul
trigger1 = AnimElemTime(3) = 0
x = 1 + 0.2*var(15)/10

[State 3121, 2]
type = PlaySnd
trigger1 = AnimElemTime(3) = 0
value = 100, 2

[State 3121, dust FX]
type = helper
triggerall = AnimElemTime(3) = 0
trigger1 = (time%13)=0
helpertype = normal
stateno = 10000
ID = 10000
name = "run_dust"
postype = p1
pos = 0,0
ownpal = 1

[state 3121, Smoke FX]
type = explod
trigger1 = AnimElemTime(3) = 0
anim = 1206+(var(2)=0)
id = 1206
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 1
scale = .8,.8

[state 3121, Smoke FX]
type = explod
trigger1 = AnimElemTime(3) = 0 && !NumExplod(3105)
anim = 3105
id = 3105
pos = 0,0
postype = P1
sprpriority = 3
ownpal = 1
bindtime = -1
removetime = -1
persistent = 0
ignorehitpause = 1

[State 0, StateTypeSet] ;safevalue
type = null;StateTypeSet
trigger1 = !numtarget
movetype = I
ignorehitpause = 1
;persistent =


[State 3121, strong]
type = HitDef
trigger1 = Time > 0
attr = S, SA
;damage    = 75,7
damage = ceil(ifElse(fvar(11) * 75 < 7, 7, fvar(11) * 75)), 7
animtype = Hard
air.animtype = back
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 18,36 ;36,36 ;18, 18 ;13,13
guard.pausetime = 13,3 ;7
sparkno = s7030
guard.sparkno = s7000
sparkxy = 0,-50
hitsound   = s3100,0 ;s5, 5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime = 15
ground.velocity = -8,-4
guard.velocity = -4
air.velocity =-6,-4
getpower = ifelse(p2movetype=H,40,140), 35
givepower = 35,35
fall = 1
fall.recover = 0
yaccel = 0.5
persistent = 0
;p2facing = -1 ;(P2Statetype=A) ;1
;p2stateno = 3124

[State 3302, Helper Limiter]
type = Helper
trigger1 = movehit
helpertype = normal
name = "Limiter"
ID = 9993
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 0, TargetState]
type = TargetState
trigger1 = movehit = 1
trigger1 = numtarget
trigger1 = !(target, ishelper)
value = 3124
ignorehitpause = 1
persistent = 0


[State 220, Sound] ; Surprise!
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = movehit
value = 3121, random%6
channel = 0
persistent = 0
ignorehitpause = 1

[State 220, "Watch out" (koko da) voice]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = movehit
value = 301,0
channel = 0
persistent = 0
ignorehitpause = 1

[State 220, "drop dead, take this" voice]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = movehit
value = 300,2+random%2
channel = 0
persistent = 0
ignorehitpause = 1

[State 3121, VelSet]
type = VelSet
trigger1 = movecontact
x = 0
;ignorehitpause = 1

[State 3121, RemoveExplod]
type = RemoveExplod
trigger1 = movecontact
trigger2 = vel x = 0
id = 3105
ignorehitpause = 1
;persistent =

[State 3121, 5]
type = ChangeState
trigger1 = AnimElemTime(3) > 0
trigger1 = vel x = 0 ;AnimTime = 0
value = 3122


; EX Surprise Elbow Attack (end)
[Statedef 3122]
type = S
movetype = A
physics = S
anim = 3122
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3

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

; P2 Hit by EX Surprise Elbow Attack (custom state)
[Statedef 3123]
type = U
movetype = H ;I
physics = U
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3



[State 3123, PosAdd]
type = PosAdd
trigger1 = !time
trigger1 =  BackEdgeBodyDist < 30
x = 60
y = 0
;ignorehitpause =
;persistent =


[State 3123, No Turn]
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn


[State 3123, ChangeState]
type = SelfState
trigger1 = time = 20 ;(Pos Y >= 0) && (Vel Y > 0)
value = 5100


; P2 Hit by EX Surprise Elbow Attack (custom state)
[Statedef 3124]
type = A
movetype = H
physics = N ;A
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3
facep2=1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1
;persistent =


[State 0, Turn]
type = Turn
trigger1 = !time
ignorehitpause = 1
;persistent =


[State 3124, ChangeAnim2]
type = null ;ChangeAnim2
trigger1 = !time
value = IfElse(SelfAnimExist(5052),5052,3103)

[State 3124, ChangeAnim]
type = ChangeAnim
trigger1 = !time && SelfAnimExist(5052)
value = 5052

[State 3124, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && !SelfAnimExist(5052)
value = 3103


[State 3124, VelAdd]
type = VelSet
trigger1 = !Time ;(Pos Y < 0)
x = IfElse(Facing,13,-13) ;10
y = -8;-5

[State 0, Gravity]
type = Gravity
trigger1 = 1

[State 3124, NotHitBy]
type = null ;NotHitBy
trigger1 = 1
value = SCA

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

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

[State 3124, ChangeState]
type = SelfState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 5100

;-------------------------------------------------------------------------------
;[MAJIN]
;Royal Fist 1
[Statedef 3500]
type = S
movetype = A
physics = S
anim = 3500
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3
juggle = 0 ;7

;SANITY MODE
[State 3000, Flame var]
type = varadd
triggerall = var(53)>0   ;only add when in Sanity mode
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)

[State 3100, VarSet]
type = VarSet
trigger1 = Time = 0
var(15) = IfElse(Command = "dpx",1,IfElse(Command = "dpy", 2, 3))

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0&& !time
var(15)=ifelse(random<300,1,ifelse(random<500,2,3))
ignorehitpause=1

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AnimElemTime(2)=0
trigger1 = var(15)>1
value = 3503
elem = 2
;ignorehitpause =
;persistent =

[State 0, Width]
type = Width
triggerall = var(15)>1
trigger1 = AnimElemTime(2)=0
value = 70,0

[State 220, voice snd]
type = null ;playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=2 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=2 && random<500
value = 3,70+random%2
channel = 0
volume = 300

[State 0, PosAdd]
type = PosAdd
triggerall = var(15)>1
;trigger1 = 3503   ;WTF
trigger1 = AnimElemTime(3)=0
trigger2 = AnimElemTime(3)=1
x = IfElse(var(15)=2,15,34)

[state 1215, Smoke FX]
type = explod
trigger1 = AnimElemTime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -5,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

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

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 6
attr = S, SA
animtype  = hard
;damage    = 35,3
damage = ceil(ifElse(fvar(11) * 35 < 7, 7, fvar(11) * 35)), 3
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 15, 15 ;20,20 ;0,10
guard.pausetime = 19,15 ;25,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s3500,5
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = 3,0 ;-7.8,0
guard.velocity = -5 ;-7.5
air.velocity = 3,-3 ;-5.8,-3
airguard.velocity = -5,-3 ;-5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3511
ID = 3511
pos = 0,-50 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3203, Voice]  ;bullseye!
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Movehit
value = 3500,1+random%4
channel = 0
persistent = 0
ignorehitpause = 1


[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

[State 1000, Royal Edict]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3550
ctrl = 0

[State 3100, VarSet]
type = VarSet
trigger1 = AnimTime = 0
var(15) = 0

[State 210, 5]
type = ChangeState
triggerall= movehit
trigger1 = AnimTime = 0
value = 3501
ctrl = 0

[State 210, 5]
type = ChangeState
triggerall= !movehit
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------------------
;[MAJIN]
;Royal Fist 2
[Statedef 3501]
type = S
movetype = A
physics = S
anim = 3501
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3
juggle = 0 ;7

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 220, snd]
type = null ;playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=1 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=1 && random<500
value = 3,70+random%2
channel = 0
volume = 300

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 0, 2

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(3)=0
x = 33

[State 200, 1]
type = HitDef
trigger1 = AnimElemTime(3)=0
attr = S, SA
;damage = 50, 5
damage = ceil(ifElse(fvar(11) * 50 < 7, 7, fvar(11) * 50)), 5
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 15,20 ;20,20 ;13,15 ;18
guard.pausetime = 15,15 ;20 ;20,20 ;13,15 ;18
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-55
hitsound = s5,2 ;s3500,5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = 3,0 ;-3
guard.velocity = 3 ;-5
air.velocity = 3,-3 ; -4,-4
airguard.velocity = 3,-3 ;-2.5,-1.3
air.type = High
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0 ;ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3512
ID = 3512
pos = 0,-55 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

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

[State 1000, Royal Edict]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3550
ctrl = 0

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 3502
ctrl = 0

;-------------------------------------------------------------------------------
;[MAJIN]
;Royal Fist 3
[Statedef 3502]
type = S
movetype = A
physics = S
anim = 3502
ctrl = 0
velset = 0,0
poweradd = 20
sprpriority = 3
juggle = 0

[State 220, voice snd]
type = null ;playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=1 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=1 && random<500
value = 3,70+random%2
channel = 0
volume = 300

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

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
;damage = 18, 2 ;38,0
damage = ceil(ifElse(fvar(11) * 18 < 7, 7, fvar(11) * 18)), 2
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 ;s3500,5
guardsound = S6,1
animtype = Up
ground.type = High
ground.slidetime = 12
ground.hittime = 12
ground.velocity = -9.5,-1
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
fall = 1
fall.recover = 0
air.animtype = back
getpower= 0, 0 ;ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.45

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3513
ID = 3513
pos = 10,-60 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

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

;-------------------------------------------------------------------------------
;[MAJIN]
;EX Royal Bullseye 1
[Statedef 3520]
type = S
movetype = A
physics = S
anim = 3500
ctrl = 0
velset = 0,0
poweradd = ifelse(var(53)>0,0,-500)
sprpriority = 3
juggle = 0 ;7

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 2
[State 8000, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 3120, Train]
type = AfterImage
trigger1 = Time = 0
time = 100 ;20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

;SANITY MODE
[State 3000, Flame var]
type = varadd
triggerall = var(53)>0   ;only add when in Sanity mode
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = AnimElemTime(2)=0
value = 3503
elem = 2
;ignorehitpause =
;persistent =

[State 0, Width]
type = Width
trigger1 = AnimElemTime(2)=0
value = 70,0


[State 220, voice snd]
type = null ;playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=2 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=2 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=2 && random<500
value = 3,70+random%2
channel = 0
volume = 300

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(3)=0
trigger2 = AnimElemTime(3)=1
x = 15

[state 1215, Smoke FX]
type = explod
trigger1 = AnimElemTime(3)=0
anim = 1206+(var(2)=0)
id = 1206
pos = -5,3
postype = P1
sprpriority = 3
ownpal = 1
removetime = -2
ignorehitpause = 1
scale = .7,.7

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

[State 420, 3]
type = HitDef
trigger1 = !NumExplod(3522); jnpedit
trigger1 = AnimElem = 6
attr = S, SA
animtype  = hard
;damage    = 35,3
damage = ceil(ifElse(fvar(11) * 35 < 7, 7, fvar(11) * 35)), 3
priority  = 4,Hit
guardflag = MA
hitflag = MAF
pausetime = 15, 15 ;20,20 ;0,10
guard.pausetime = 19,15 ;25,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s3500,5
guardsound = S6,1
ground.type = low
air.type = low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = 3,0 ;-7.8,0
guard.velocity = -5 ;-7.5
air.velocity = 3,-3 ;-5.8,-3
airguard.velocity = -5,-3 ;-5, -4
envshake.time = 5
envshake.ampl = 4
envshake.freq = 176
fall.envshake.time = 10
fall.envshake.ampl = 4
fall.envshake.freq = 176
yaccel = 0.5
air.fall = 0
fall.recover = 0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
down.cornerpush.veloff = 0
airguard.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
getpower = 0,0  ;ifelse(p2movetype=H,40,140), 10
givepower = 35,35

[State 0, Explod]; jnpedit
type = Explod
trigger1 = MoveHit = 1
anim = 15999
ID = 3522
removetime = -1
removeongethit = 1

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3511
ID = 3511
pos = 0,-50 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3203, Voice]  ;bullseye!
type = null;PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = Movehit
value = 3500,1+random%4
channel = 0
persistent = 0
ignorehitpause = 1


[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

;[State 3302, Helper Limiter]
;type = Helper
;triggerall = !NumHelper(9992)
;trigger1 = movehit
;helpertype = normal
;name = "Limiter"
;ID = 9992
;stateno = 9999
;pos = 0,0
;postype = p1    ;p2,front,back,left,right
;facing = 1
;keyctrl = 0
;ownpal = 1
;supermovetime = 9999
;pausemovetime = 9999
;ignorehitpause = 1
;persistent = 0

[State 1000, Royal Edict]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3550
ctrl = 0

[State 210, 5]
type = ChangeState
triggerall= movehit
trigger1 = AnimTime = 0
value = 3521
ctrl = 0

[State 3100, VarSet]
type = VarSet
triggerall= !movehit
trigger1 = AnimTime = 0
var(3) = 0

[State 210, 5]
type = ChangeState
triggerall= !movehit
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;-------------------------------------------------------------------------------
;[MAJIN]
;EX Royal Bullseye 2
[Statedef 3521]
type = S
movetype = A
physics = S
anim = 3501
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3
juggle = 0 ;7

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfx"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 220, snd]
type = null ;playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = animelem=1 && random<500
value = 3,22+random%5
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = animelem=1 && random<500
value = 4,20+random%4
channel = 0
volume = 300

[State 200, snd]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = animelem=1 && random<500
value = 3,70+random%2
channel = 0
volume = 300

[State 200, 1]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 0, 2

[State 0, PosAdd]
type = PosAdd
trigger1 = AnimElemTime(3)=0
x = 33

[State 200, 1]
type = HitDef
trigger1 = AnimElemTime(3)=0
attr = S, SA
;damage = 50, 5
damage = ceil(ifElse(fvar(11) * 50 < 7, 7, fvar(11) * 50)), 5
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 10,22 ;20,20 ;13,15 ;18
guard.pausetime = 15,15 ;20 ;20,20 ;13,15 ;18
sparkno = s7030
guard.sparkno = s7000
sparkxy = -10,-55
hitsound = s5,2 ;s3500,5
guardsound = S6,1
ground.type = High
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = 3,0 ;-3
guard.velocity = 3 ;-5
air.velocity = 3,-3 ; -4,-4
airguard.velocity = 3,-3 ;-2.5,-1.3
air.type = High
air.hittime = 12
air.animtype = back
fall.recover = 0
getpower= 0, 0 ;ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.5
ID = 1098

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3512
ID = 3512
pos = 0,-55 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

[State 3302, Helper Limiter]
type = Helper
triggerall = !NumHelper(9992)
trigger1 = movehit
helpertype = normal
name = "Limiter"
ID = 9992
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

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

[State 1000, Royal Edict]
type = ChangeState
triggerall = var(1) = 2 ;Majin only
triggerall = roundstate = 2
triggerall = AnimElemTime(3)>=2
trigger1 = var(3)=4 && var(18)=0 && (power>=1000 || var(53)>0)
value = 3550
ctrl = 0

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 3522
ctrl = 0

;-------------------------------------------------------------------------------
;[MAJIN]
;EX Royal Bullseye 3
[Statedef 3522]
type = S
movetype = A
physics = S
anim = 3504 ;3502
ctrl = 0
velset = 0,0
poweradd = 0
sprpriority = 3
juggle = 0

[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0

[State 821, Bullseye!]
type = playsnd
triggerall = var(55)=0		;Voice=English
trigger1 = AnimElem=3
value = 3500,1+random%2
channel = 0
volume = 300
ignorehitpause = 1
persistent = 0

[State 821, HAHAHA!]
type = playsnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = AnimElem=3
value = 2800,5
channel = 0
volume = 300
ignorehitpause = 1
persistent = 0

[State 821, Diee!]
type = playsnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = AnimElem=3
value = 2845,5+random%3
channel = 0
volume = 300
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 6 ;3
value = 0, 2

[State 420, 3]
type = HitDef
trigger1 = AnimElem = 7 ;4
attr = S, SA
;damage = 18, 2 ;38,0
damage = ceil(ifElse(fvar(11) * 18 < 7, 7, fvar(11) * 18)), 2
hitflag = MAF
guardflag = MA
priority = 4, Hit
pausetime = 10,15
guard.pausetime = 10,15
sparkno = s7030
guard.sparkno = s7000
sparkxy = -20,-65
hitsound   = s5,2 ;s3500,5
guardsound = S6,1
animtype = Hard ;Up
ground.type = Low ;High
ground.slidetime = 20 ;12
ground.hittime = 20 ;12
ground.velocity = -16,0 ;-9.5,-1
guard.velocity = -9
air.velocity = ifelse(p2movetype=H,-3,-1),ifelse(p2movetype=H,-5,-10)
fall = 0 ;1
fall.recover = 0
air.animtype = back
getpower= 0, 0 ;ifelse(p2movetype=H,40,210), 35
givepower = 35,35
yaccel = 0.45
ID = 3505

[State 3551, EnvShake]
type = EnvShake
trigger1 = Movehit
time = 12
ignorehitpause = 1
persistent = 0

[State 3201, FX spark]
type = Null ;Explod
trigger1 = Movehit
anim = 2515
id = 2515
pos = 0,-55
postype = p2
facing = -1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 3321, FX lightning]
type = Explod
trigger1 = Movehit
anim = 3513
ID = 3513
pos = 15,-70 ;30, -75
postype = p1
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 5
ownpal = 1
bindtime = -1
scale = 1,1
persistent = 0
ignorehitpause = 1

[State 0, FX spark Helper]
type = null ;Helper
trigger1 = Movehit
helpertype = normal
name =  "FX spark"
ID =  3511
stateno =  3511
pos = 0,-55 ;30, -75
postype = p2
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

[State 3321, FX dust]
type = Explod
triggerall = !NumExplod(3505)
trigger1 = NumTarget(3505)
trigger1 = target(3505),statetype!=A
trigger1 = target(3505),vel x!=0
anim = 10000
ID = 3505
pos = -50,5
postype = p2
supermovetime = 9999
pausemovetime = 9999
supermove = 1
removetime = -2
sprpriority = 10
ownpal = 1
bindtime = -1
scale = -1,1
persistent = 0
ignorehitpause = 1

[State 3203, FX Snd]
type = PlaySnd
trigger1 = Movehit
value = 3500,0
channel = 5
persistent = 0
ignorehitpause = 1

[State 3302, Helper Limiter]
type = Helper
triggerall = !NumHelper(9992)
trigger1 = movehit
helpertype = normal
name = "Limiter"
ID = 9992
stateno = 9999
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 9999
pausemovetime = 9999
ignorehitpause = 1
persistent = 0

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

;[MAJIN]
;===========================================================================
; <<<<< DOUBLE SLASH KICK >>>>>
; Double Slash Kick start = 3600
; Double Slash Kick in air = 3601
; Going back down (anim 44)
;===========================================================================

;[MAJIN]
; Double Slash Kick start
[StateDef 3600];On ground
type = S
movetype = A
physics = S
ctrl = 0
anim = 3600
poweradd = 35
velset = 0,0

;SANITY MODE
[State 3000, Flame var]
type = varadd
triggerall = var(53)>0   ;only add when in Sanity mode
trigger1 = !time
var(58) = ifelse(var(58)+100>2100, 2100-var(58), 100)

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0&& !time
var(15)=ifelse(random<300,1,ifelse(random<500,2,3))
ignorehitpause=1

[State 200, "In your Face" voice]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1501,random%4
channel = 0
volume = 300

[State 200, "Idiot" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1502,0
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1003,1   ;1503,random%3
channel = 0
volume = 300

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 256, PosSet]
type = PosAdd
trigger1 =  Animelemtime(2)=0
x = 15


[State 256, PosSet]
type = PosAdd
trigger1 =  Animelemtime(3)=0
x = 11


[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3601
ctrl = 0

;[MAJIN]
; Double Slash Kick (air UP)
[StateDef 3601];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3601
poweradd = 0
velset = 0,0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
;ignorehitpause =
;persistent =


[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfc"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]  ; Air Machine Gun Tantrum
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 3
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 3601, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

[State 3601, jump SND]
type = playsnd
trigger1 = !time
value = 40,1

[state 1215, Rising Effect smoke]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = -10,ifelse(var(15)=1,6,ifelse(var(15)=2,8,9))
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0


[State 3601, VelIni]; LK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 1
X = 5
Y = -8.66


[State 3601, VelIni]; MK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 2
X = 7.07
Y = -7.07


[State 3601, VelIni]; SK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) >= 3
X = 8.66
Y = -5

[State 3601, woosh sound]
type = playsnd
trigger1 = AnimElemTime(2)=0
value = 0,5

[State 3601, PosAdd]
type = null ;PosAdd
trigger1 = AnimElemTime(2)=0
x = -10
y = 6
;ignorehitpause =
;persistent =


[state 3601, Rising Effect]
type = explod
trigger1 = AnimElemTime(3)=0
anim = 1503
id = 1503
pos = 25,-15
postype = P1
facing = 1
vfacing = 1
sprpriority = 5
ownpal = 1
removetime = 9 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,1


[State 3601, hit]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
hitflag = MAF
;damage    = 16,2
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 2
guardflag = MA
animtype = Light
priority = 3, Hit
priority = 3
pausetime = 6,18 ;9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,5
guardsound = S6,0
ground.type = High
ground.slidetime = 0 ;8
ground.hittime  = 18 ;0 ;15
ground.velocity = 0 ;-3
air.velocity = 0, 0 ;-2,-4
airguard.cornerpush.veloff= 0
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5

[State 3600, HA...HA!]
type = PlaySnd
trigger1 = movehit
value = 3600,2+random%2
channel = 0
persistent = 0

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
triggerall = time<12
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0


[State 3601, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3602
ctrl = 0


;[MAJIN]
; Double Slash Kick (Teleport)
[StateDef 3602];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3602
poweradd = 0
velset = 0,0


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 3121, PlaySnd]  ;teleport SFX
type = null ;PlaySnd
trigger1 = AnimElemTime(3)=0
value = 2302,0

[State 4000, Invincible]
type = NotHitBy
trigger1 = AnimElemTime(3)=0
value = SCA
time = 2

[State 1000, Air Machine Gun Tantrum]
type = Changestate
triggerall = animelemtime(3)>=0 ;&& movecontact
trigger1 = var(3)=5 && power>=1000
value = 3430

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3603
ctrl = 0

;[MAJIN]
; Double Slash Kick (air DOWN)
[StateDef 3603];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3603
poweradd = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 0, Turn]
type = Turn
trigger1 = !time
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
y = -30
;ignorehitpause =
;persistent =

[State 6100, woosh sound]
type = playsnd
trigger1 = !time
value = 0,5


[State 6000, VelIni]; LK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 1
X = 5
Y = 8.66

[State 6000, VelIni]; MK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) = 2
X = 7.07
Y = 7.07

[State 6000, VelIni]; SK button
type = VelSet
triggerall = Time = 0
trigger1 = var(15) >= 3
X = 8.66
Y = 5

[state 1215, Rising Effect]
type = explod
trigger1 = AnimElemTime(2)=0
anim = 1503
id = 1503
pos = 20,-75
postype = P1
facing = 1
vfacing = -1
sprpriority = 5
ownpal = 1
removetime = 9 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,1

[State 640, hit]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
;damage = 29,3
damage = ceil(ifElse(fvar(11) * 29 < 7, 7, fvar(11) * 29)), 3
guardflag = HA
hitflag = MAF
animtype  = Hard
priority = 3,Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -50,-10
hitsound   = s5,5
guardsound = S6,1
ground.type = High
pausetime = 11,15
guard.pausetime = 11,12
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 = 1
fall.recover = 0

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0


[State 4000, Landing]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3604
ctrl = 0

;[MAJIN]
; Double Slash Kick (landing)
[StateDef 3604];
type = S
movetype = A
physics = S
ctrl = 0
anim = 3604
poweradd = 0
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = !time
y = 0
;ignorehitpause =
;persistent =


[State 0, Turn]
type = Turn
trigger1 = !time
;ignorehitpause =
;persistent =


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = !time
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = !time
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0


[State 4000, ToAir]
type = ChangeState
trigger1 = !Animtime
value = 0
ctrl = 1

;[MAJIN]
;===========================================================================
; <<<<< DOUBLE SLASH KICK >>>>>
; Double Slash Kick start = 3600
; Double Slash Kick in air = 3601
; Going back down (anim 44)
;===========================================================================

;[MAJIN]
; EX Double Slash Kick start
[StateDef 3650];On ground
type = S
movetype = A
physics = S
ctrl = 0
anim = 3650
poweradd = ifelse(var(53)>0,0,-500)
velset = 0,0

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 2
[State 8000, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 1500, VarSet]
type=VarSet
trigger1 =AILevel>0&& !time
var(15)=ifelse(random<300,1,ifelse(random<500,2,3))
ignorehitpause=1

[State 200, "In your Face" voice]
type = null ;PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 1501,random%4
channel = 0
volume = 300

[State 3600, taste my foot!]
type = PlaySnd
triggerall = var(55)=0		;Voice=English
trigger1 = !time
value = 3600,4
channel = 0
persistent = 0

[State 200, "Idiot" voice]
type = PlaySnd
triggerall = var(55)=1		;Voice=Japan
trigger1 = !time
value = 1502,0
channel = 0
volume = 300

[State 200, "Beat this punk" voice]
type = PlaySnd
triggerall = var(55)=2		;Voice=Eng Sabbat
trigger1 = !time
value = 1003,1   ;1503,random%3
channel = 0
volume = 300

[State 4000, Invincible]
type = NotHitBy
trigger1 = 1
value = SCA

[State 3120, Train]
type = AfterImage
trigger1 = Time = 0
time = 100 ;20
palbright = 40,30,-40
palcontrast = 256,206,206
trans = add1
ignorehitpause = 1

[State 256, PosSet]
type = PosAdd
trigger1 =  Animelemtime(2)=0
x = 15


[State 256, PosSet]
type = PosAdd
trigger1 =  Animelemtime(3)=0
x = 11


[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3651
ctrl = 0

;[MAJIN]
; EX Double Slash Kick (air UP)
[StateDef 3651];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3651
poweradd = 0
velset = 0,0

[State 6100, EX snd]
type = playsnd
trigger1 = !time
value = 7,0
channel = 2
[State 8000, flash]
type = PalFX
trigger1 = 1
add = 40, 30, -40
time=1
ignorehitpause = 1

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
;ignorehitpause =
;persistent =


[State 800, VarSet]
type = VarSet
trigger1 = !time
var(3) = 0
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfc"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]  ; Air Machine Gun Tantrum
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 3
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 3601, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

[State 3601, jump SND]
type = playsnd
trigger1 = !time
value = 40,1


[state 1215, Rising Effect smoke]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = -10,8
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0


[State 3601, VelIni]; MK button
type = VelSet
trigger1 = Time = 0
X = 14.14 ;7.07
Y = -14.14 ;-7.07


[State 3601, woosh sound]
type = playsnd
trigger1 = AnimElemTime(2)=0
value = 0,5

[State 3601, PosAdd]
type = null ;PosAdd
trigger1 = AnimElemTime(2)=0
x = -10
y = 6
;ignorehitpause =
;persistent =


[state 3601, Rising Effect]
type = explod
trigger1 = AnimElemTime(3)=0
anim = 1503
id = 1503
pos = 25,-15
postype = P1
facing = 1
vfacing = 1
sprpriority = 5
ownpal = 1
removetime = 5 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,1

[State 3601, hit]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
hitflag = MAF
;damage    = 16,2
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 2
guardflag = HA
animtype = Light
priority = 3, Hit
priority = 3
pausetime = 11,15 ;9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,5
guardsound = S6,0
ground.type = High
ground.slidetime = 0 ;8
ground.hittime  = 15
ground.velocity = 0 ;-3
air.velocity = 0, 0 ;-2,-4
airguard.cornerpush.veloff= 0
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
id = 3650

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
triggerall = time<7
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0

[State 0, Bullet Time Helper]
type = null ;Helper
triggerall = !NumHelper(9998)
trigger1 =  movehit
helpertype = normal
name =  "Bullet Time"
ID = 9998
stateno = 9998
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 9999
pausemovetime = 9999
persistent = 0


[State 3601, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3652
ctrl = 0


;[MAJIN]
; EX Double Slash Kick (Teleport)
[StateDef 3652];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3652
poweradd = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 3121, PlaySnd]  ;teleport SFX
type = null ;PlaySnd
trigger1 = AnimElemTime(3)=0
value = 2302,0

[State 4000, Invincible]
type = NotHitBy
trigger1 = AnimElemTime(3)=0
value = SCA
time = 2

[State 1000, Air Machine Gun Tantrum]
type = Changestate
triggerall = animelemtime(3)>=0 ;&& movecontact
trigger1 = var(3)=5 && power>=1000
value = 3430

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3653
ctrl = 0

;[MAJIN]
; EX Double Slash Kick (air DOWN)
[StateDef 3653];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3653
poweradd = 0
velset = 0,0


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfc"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]  ; Air Machine Gun Tantrum
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 3
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9


[State 0, Turn]
type = Turn
trigger1 = !time
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
y = -30
;ignorehitpause =
;persistent =

[State 6100, woosh sound]
type = playsnd
trigger1 = !time
value = 0,5


[State 6000, VelIni]; MK button
type = VelSet
trigger1 = Time = 0
X = 14.14 ;7.07
Y = 14.14 ;-7.07


[state 1215, Rising Effect]
type = explod
trigger1 = AnimElemTime(2)=0
anim = 1503
id = 1503
pos = 20,-75
postype = P1
facing = 1
vfacing = -1
sprpriority = 5
ownpal = 1
removetime = 5 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,1

[State 640, hit]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
;damage = 29,3
damage = ceil(ifElse(fvar(11) * 29 < 7, 7, fvar(11) * 29)), 3
guardflag = HA
hitflag = MAF
animtype  = Hard
priority = 3,Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -50,-10
hitsound   = s5,5
guardsound = S6,1
ground.type = High
pausetime = 11,15
guard.pausetime = 11,12
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 = 0
fall.recover = 0
id = 3650

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0


[State 4000, ToAir]
type = ChangeState
trigger1 = Pos Y >= 0 ;-5
value = 3654
ctrl = 0

;[MAJIN]
; EX 2 Double Slash Kick (Teleport)
[StateDef 3654];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3652
poweradd = 0
velset = 0,0

[State 0, Repositioning]
type = PosAdd
trigger1 = !time
x = -30

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 0, Turn]
type = null ;Turn
trigger1 =  !time
;ignorehitpause =
;persistent =


[State 3121, PlaySnd]  ;teleport SFX
type = null ;PlaySnd
trigger1 = AnimElemTime(3)=0
value = 2302,0

[State 4000, Invincible]
type = NotHitBy
trigger1 = AnimElemTime(3)=0
value = SCA
time = 2


[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3655
ctrl = 0

;[MAJIN]
; EX 2 Double Slash Kick (air UP)
[StateDef 3655];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3651
poweradd = 0
velset = 0,0
facep2 = 1

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0
;ignorehitpause =
;persistent =

[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfc"
var(3) = 1
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfy"
var(3) = 2
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcfz"
var(3) = 3
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 8
trigger1 = command = "qcf2p" && power>=500
var(3) = 10
[State 800, VarSet] ;Royal Edict
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcfa") || (command = "2qcfb") || (command = "2qcfc")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 4
[State 800, VarSet]  ; Air Machine Gun Tantrum
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 3
trigger1 = (command = "qcbfx") || (command = "qcbfy") || (command = "qcbfz")
trigger1 = (power>=1000 || var(53)>0)
var(3) = 5
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbx") || (command = "qcby") || (command = "qcbz") || (command = "qcb2p")
var(3) = 7
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf2p")
var(3) = 6
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "2qcf2p")
var(3) = 8
[State 800, VarSet]
type = VarSet
trigger1 = AILevel<=0
trigger1 = time > 5
trigger1 = (command = "qcbf3p")
var(3) = 9

[State 3601, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn
ignorehitpause = 1

[State 3601, jump SND]
type = playsnd
trigger1 = !time
value = 40,1


[state 1215, Rising Effect smoke]
type = explod
trigger1 = !time
anim = 1216
id = 1216
pos = -10,8
postype = P1
sprpriority = -3
ownpal = 1
removetime = -2
persistent = 0
ignorehitpause = 0


[State 3601, VelIni]; MK button
type = VelSet
trigger1 = Time = 0
X = 14.14 ;7.07
Y = -14.14 ;-7.07


[State 3601, woosh sound]
type = playsnd
trigger1 = AnimElemTime(2)=0
value = 0,5

[State 3601, PosAdd]
type = null ;PosAdd
trigger1 = AnimElemTime(2)=0
x = -10
y = 6
;ignorehitpause =
;persistent =


[state 3601, Rising Effect]
type = explod
trigger1 = AnimElemTime(3)=0
anim = 1503
id = 1503
pos = 25,-15
postype = P1
facing = 1
vfacing = 1
sprpriority = 5
ownpal = 1
removetime = 5 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(3)=0
value = 3600,1

[State 3601, hit]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
hitflag = MAF
;damage    = 16,2
damage = ceil(ifElse(fvar(11) * 16 < 7, 7, fvar(11) * 16)), 2
guardflag = HA
animtype = Hard ;Light
priority = 3, Hit
pausetime = 1,15 ;11,15 ;9,11
sparkno = s7010
guard.sparkno = s7000
sparkxy = -10,-70
hitsound   = s5,5
guardsound = S6,0
ground.type = High
ground.slidetime = 0 ;8
ground.hittime  = 0 ;15
ground.velocity = 0 ;-3
air.velocity = 0, 0 ;-2,-4
airguard.cornerpush.veloff= 0
getpower= ifelse(p2movetype=H,40,140), 35
givepower = 35,35
yaccel = 0.5
id = 3650

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
triggerall = time<7
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0

[State 0, Bullet Time Helper]
type = null ;Helper
triggerall = !NumHelper(9998)
trigger1 =  movehit
helpertype = normal
name =  "Bullet Time"
ID = 9998
stateno = 9998
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 9999
pausemovetime = 9999
persistent = 0


[State 3601, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3656
ctrl = 0


;[MAJIN]
; EX 2 Double Slash Kick (Teleport)
[StateDef 3656];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3652
poweradd = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 3121, PlaySnd]  ;teleport SFX
type = null ;PlaySnd
trigger1 = AnimElemTime(3)=0
value = 2302,0

[State 4000, Invincible]
type = NotHitBy
trigger1 = AnimElemTime(3)=0
value = SCA
time = 2

[State 1000, Air Machine Gun Tantrum]
type = Changestate
triggerall = animelemtime(3)>=0 ;&& movecontact
trigger1 = var(3)=5 && power>=1000
value = 3430

[State 4000, ToAir]
type = ChangeState
trigger1 = AnimTime = 0
value = 3657
ctrl = 0

;[MAJIN]
; EX 2 Double Slash Kick (air DOWN)
[StateDef 3657];
type = A
movetype = A
physics = N
ctrl = 0
anim = 3653
poweradd = 0
velset = 0,0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 0, Turn]
type = Turn
trigger1 = !time
;ignorehitpause =
;persistent =

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
y = -30
;ignorehitpause =
;persistent =

[State 6100, woosh sound]
type = playsnd
trigger1 = !time
value = 0,5


[State 6000, VelIni]; MK button
type = VelSet
trigger1 = Time = 0
X = 14.14 ;7.07
Y = 14.14 ;-7.07


[state 1215, Rising Effect]
type = explod
trigger1 = AnimElemTime(2)=0
anim = 1503
id = 1503
pos = 20,-75
postype = P1
facing = 1
vfacing = -1
sprpriority = 5
ownpal = 1
removetime = 5 ;10
persistent = 0
ignorehitpause = 0
removeongethit = 1
bindtime = -1

[State 200, Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,0

[State 200, Burst Aura SFX]
type = PlaySnd
trigger1 = AnimElemTime(2)=0
value = 3600,1

[State 640, hit]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
;damage = 29,3
damage = ceil(ifElse(fvar(11) * 29 < 7, 7, fvar(11) * 29)), 3
guardflag = HA
hitflag = MAF
animtype  = Hard
priority = 3,Hit
sparkno = s7030
guard.sparkno = s7000
sparkxy = -50,-10
hitsound   = s5,5
guardsound = S6,1
ground.type = High
pausetime = 11,15
guard.pausetime = 11,12
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 = 1
fall.recover = 0
id = 3650

[State 0, VelMul]
type = VelMul
trigger1 = movehit
x = 2
y = 2
ignorehitpause = 1
persistent = 0

[State 0, Advance Frame]
type = ChangeAnim
trigger1 = movehit
value = Anim
elem = AnimElemno(0)+1
ignorehitpause = 1
persistent = 0


[State 4000, ToAir]
type = ChangeState
trigger1 = Pos Y >= 0
value = 3658
ctrl = 0


;[MAJIN]
; EX 2 Double Slash Kick (landing)
[StateDef 3658];
type = S
movetype = A
physics = S
ctrl = 0
anim = 3654
poweradd = 0
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = !time
y = 0
;ignorehitpause =
;persistent =


[State 0, Turn]
type = Turn
trigger1 = !time
;ignorehitpause =
;persistent =


[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noautoturn

[State 17100, Landing Sound]
type = PlaySnd
trigger1 = !time
value = 40, 0
persistent = 0

[state 17100, Landing Effect]
type=explod
trigger1 = !time
anim=17100
id=17100
pos=-15,0
postype=P1
sprpriority=-3
ownpal=1
supermovetime=-1
removetime = -2
persistent = 0


[State 4000, ToAir]
type = ChangeState
trigger1 = !Animtime
value = 0
ctrl = 1
