; _____________________________________
;| Rare Akuma by Phantom.of.the.Server |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;===============================================================================
;SUPER STATES>
;===============================================================================
;========================<MESSATSU GOU HADOU>=============================
[Statedef 3000]
type=S
physics=S
movetype=A
anim=3000
ctrl=0
velset=0,0
sprpriority=1
facep2=1

[State 3000, strengthvar]
type=varset
trigger1= var(10)!=5
var(10)=5
[State 3000, width]
type=width
trigger1= anim=3001 && animelemtime(7)<0
value=30,0

[State 3000, snd]
type=playsnd
trigger1= anim=3000 && !animelemtime(3)
value=4,5
channel=0
volume=200
[State 3000, aura]
type=helper
trigger1= anim=3000 && !animelemtime(3)
helpertype=normal
stateno=6000
ID=6000
name="Aura"
postype=p1
ownpal=1
persistent=0
supermovetime=9999

[State 3000, superchargehelper]
type=helper
trigger1= anim=3000 && !animelemtime(3)
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=-22,-48
ownpal=1
persistent=0
supermovetime=9999

[State 3000, superchargepause]
type=superpause
trigger1= anim=3000 && !animelemtime(3)
time=45
anim=-1
sound=s7,0
poweradd=-1000
p2defmul=1
darken=0
movetime=45

[State 3000, nhb]
type=nothitby
trigger1= anim=3000
trigger2= anim=3001 && animelemtime(6)<0
time=1
value=SCA

[State 3000, anim]
type=changeanim
trigger1= anim=3000 && time=48
value=3001

[State 3000, hadouken]
type=helper
trigger1= anim=3001 && animelem=2
helpertype=normal
stateno=3005
ID=3005
name="Hadouken"
postype=p1
pos=83,-68
size.xscale=2
size.yscale=2
ownpal=1

[State 3000, dust]
type=explod
trigger1= anim=3001 && !animelemtime(2)
vel=0,0
anim=7106
sprpriority=3
postype=p1
pos=42,0
ownpal=1
scale=.75,.75

[State 3000, snd]
type=playsnd
trigger1= anim=3001 && !animelemtime(2)
value=3,7
channel=0
[State 3000, snd]
type=playsnd
trigger1= anim=3001 && !animelemtime(2)
value=5,2

[State 3000, end]
type=changestate
trigger1= anim=3001 && !animtime
value=0
ctrl=1


;========================<TENMA GOU ZANKUU 2>=============================
[Statedef 3050]
type=A
physics=N
movetype=A
anim=3050
ctrl=0
velset=0,0
sprpriority=1
[State 3050, strengthvar]
type=varset
trigger1= var(10)!=5
var(10)=5

[State 3050, snd]
type=playsnd
trigger1= !animelemtime(2)
value=4,14
channel=0
volume=200

[State 3050, superchargehelper]
type=helper
trigger1= !animelemtime(2)
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=-8,-103
ownpal=1
persistent=0
supermovetime=9999

[State 3050, superchargepause]
type=superpause
trigger1= !animelemtime(2)
time=53
anim=-1
sound=s7,0
poweradd=-1000
p2defmul=1
darken=0

[State 3050, nhb]
type=nothitby
trigger1= animelemtime(16)<0
time=1
value=SCA

[State 3050, hadoukens]
type=projectile
trigger1= !(animelemtime(5)%2)
trigger1= animelemtime(5)>=0 && animelemtime(31)<0
ProjID=3055
projanim=1005
projhitanim=1006
projscale= .75, .75
velocity= 7.5+(random/200.0), 7.5+(random/200.0)
projsprpriority=4
projedgebound=320
projheightbound=-9999,0
postype=back
offset= (-160 + (random%320)), ceil(pos y-screenpos y)-80
attr=A,HP
damage=20,4
animtype=Hard
guardflag=MH 
hitflag=MAFD
priority=7,Hit
pausetime=4,12
sparkno=2
guard.sparkno=41 
sparkxy=-10,0
hitsound=s2,7
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=-10,0
air.velocity=-1,-.5
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=12
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
p2stateno=100115

[State 3050, snd]
type=playsnd
trigger1= animelem=5 || animelem=11 || animelem=17 || animelem=23 || animelem=29
trigger2= animelem=8 || animelem=14 || animelem=20 || animelem=26
value=3,0
channel=0
[State 3050, snd]
type=playsnd
trigger1= animelem=5 || animelem=11 || animelem=17 || animelem=23 || animelem=29
trigger2= animelem=8 || animelem=14 || animelem=20 || animelem=26
value=5,0
channel=1

[State 3050, vel]
type=velset
trigger1= animelemtime(5)>=0 && animelemtime(29)<0
x=ifelse(command="holdback", -3, ifelse(command="holdfwd", 3, 0))
y=ifelse((command="holddown" && pos y<=-3), 3, ifelse(command="holdup", -3, 0))

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


;========================<MESSATSU GOU SHORYUU>=============================
[Statedef 3100]
type=A
physics=N
movetype=A
anim=3100
ctrl=0
velset=0,0
juggle=0
sprpriority=1
facep2=1

[State 3100, strengthvar]
type=varset
trigger1= var(10)!=5
var(10)=5

[State 3100, snd]
type=playsnd
trigger1=!time
value=4,4
channel=0

[State 3100, superchargehelper]
type=helper
trigger1=!time
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=12,-53
ownpal=1
persistent=0
supermovetime=9999

[State 3100, superchargepause]
type=superpause
trigger1=!time
time=45
anim=-1
sound=s7,0
poweradd=-1000
p2defmul=1
darken=0

[State 3100, nhb]
type=nothitby
trigger1= time<16
time=1
value=SCA
ignorehitpause=1
[State 3100]
type=screenbound
trigger1= animelemtime(4)>=0
value=0
movecamera=0,0
[State 3100, vel]
type=playerpush
trigger1= animelemtime(4)>=0
value=0

[State 3100, snd]
type=playsnd
trigger1= animelem=2
value=3,6
channel=0
[State 3100, snd]
type=playsnd
trigger1= animelem=2
value=0,41

[State 3100, vel]
type=velset
trigger1= animelem=4
x=5
y=-20

[State 3100, hit]
type=hitdef
trigger1= animelem=2 || animelem=3
attr=A,HA
damage=20,4
animtype=Hard 
guardflag=M
hitflag=MAFD 
priority=7,Hit
pausetime=12,11
sparkno=2
guard.sparkno=41 
sparkxy=-10,ifelse((animelem=3),-77,-52)
hitsound=s2,3
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=0,-6
air.type=Low
air.velocity=0,-6
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
p2stateno=100115

[State 3100, hit]
type=hitdef
trigger1= animelemtime(4)>=0
trigger1= !(animelemtime(4)%4)
attr=A,HA
damage=20,4
animtype=Hard 
guardflag=MA
hitflag=MAFD 
priority=7,Hit
pausetime=4,4
sparkno=2
guard.sparkno=41 
sparkxy=-10,-10
hitsound=s2,3
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-6,-2.5
air.type=Low
air.velocity=-6,-2.5
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
p2stateno=100115

[State 3100, end]
type=changestate
trigger1= facing=1 && pos x>200
trigger2= facing=-1 && pos x<-200
trigger3= animelemtime(4)>=0
trigger3= screenpos y<0 && time>=180
value=3101

[State 3100, pos]
type=playsnd
trigger1= animelemtime(4)>=0
trigger1= screenpos y<0
value=3,(random%12)
channel=0
[State snd]
type=playsnd
trigger1= animelemtime(4)>=0
trigger1= screenpos y<0
value=5,16
channel=2
[State 3100, pos]
type=posset
trigger1= animelemtime(4)>=0
trigger1= screenpos y<0
y=ceil(pos y-screenpos y)+400


;---Finish---
[Statedef 3101]
type=A
physics=A
movetype=A
anim=1101
velset=0,0
ctrl=0

[State 3101, snd]
type=posset
trigger1=!time
x=0
y=ceil(pos y-screenpos y)-80

[State 3101]
type=screenbound
trigger1=1
value=1
movecamera=1,0


;========================<MESSATSU GOU RASEN>=============================
[Statedef 3200]
type=A
physics=N
movetype=A
anim=3200
ctrl=0
velset=0,0
juggle=0
sprpriority=1
facep2=1

[State 3200, strengthvar]
type=varset
trigger1= var(10)!=5
var(10)=5

[State 3200, snd]
type=playsnd
trigger1= anim=3200 && !animelemtime(2)
value=4,4
channel=0

[State 3200, superchargehelper]
type=helper
trigger1= anim=3200 && !animelemtime(2)
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=-32,-8
ownpal=1
persistent=0
supermovetime=9999

[State 3200, superchargepause]
type=superpause
trigger1= anim=3200 && !animelemtime(2)
time=45
anim=-1
sound=s7,0
poweradd=-1000
p2defmul=1
darken=0
movetime=45

[State 3200, nhb]
type=nothitby
trigger1= anim=3200
trigger2= anim=3201 && animelemtime(14)<0
time=1
value=SCA
ignorehitpause=1

[State 3200, snd]
type=playsnd
trigger1= anim=3200 && animelem=7
trigger2= anim=3201 && animelem=55
value=3,ifelse((animelem=7),6,7)
channel=0
[State 3200, snd]
type=playsnd
trigger1= anim=3201
value=5,13
persistent=0

[State 3200, snd]
type=playsnd
trigger1= anim=3200 && !animelemtime(8)
value=0,40

[State 3200, vel]
type=velset
trigger1= anim=3200 && !animelemtime(10)
x=0
y=-8
[State 3200, vel]
type=velset
trigger1= anim=3201 && vel y>0
y=0
[State 3200, vel]
type=veladd
trigger1= anim=3201 && vel y<0
y=.14

[State 3200, anim]
type=changeanim
trigger1= anim=3200 && !animtime
value=3201
[State 3200, anim]
type=changeanim
trigger1= anim=3201 && !animtime
value=3205
persistent=0
[State 3200, statetype]
type=statetypeset
trigger1= anim=3205
statetype=A
physics=A

[State 3200, ctrlvel]
type=velset
trigger1= anim=3201 && vel y<0
x= sin(animelemtime(1)/8.0*pi)*20
[State 3200, ctrlvel]
type=velset
trigger1= anim=3201 && vel y>=0
x=0

[State 3200]
type=posset
trigger1= anim=3201 && numenemy
trigger1= animelem=2 || animelem=7 || animelem=13 || animelem=19 || animelem=25
trigger2= animelem=31 || animelem=37 || animelem=43 || animelem=49
x= (enemynear,pos x)-70+(random/7.15)
y= (enemynear,pos y)+35-(random/16.67)
[State 3200]
type=posadd
trigger1= anim=3201 && numenemy
trigger1= animelem=54
x= ceil(p2dist x-60)
y= ceil(p2dist y)
[State 3200]
type=posset
trigger1= animelemtime(55)<0 && pos y>0
y=0

[State snd]
type=playsnd
triggerall= anim=3201
trigger1= animelem=2 || animelem=7 || animelem=13 || animelem=19 || animelem=25
trigger2= animelem=31 || animelem=37 || animelem=43 || animelem=49 || animelem=54
value=5,16
channel=2

[State 3200, spin]
type=playsnd
triggerall= anim=3201
trigger1= animelem=1 || animelem=7 || animelem=13 || animelem=19 || animelem=25
trigger2= animelem=31 || animelem=37 || animelem=43 || animelem=49 || animelem=55
value=1,5
channel=1

[State 3200, 1sthit]
type=hitdef
trigger1= anim=3200 && animelem=8
attr=S,HA
damage=24,5
animtype=Hard 
guardflag=M
hitflag=MAFD 
priority=7,Hit
pausetime=16,16
sparkno=2
guard.sparkno=41 
sparkxy=-10,-62
hitsound=s2,6
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(p2bodydist x>15,2,0),-6
air.type=Low
air.velocity=ifelse(p2bodydist x>15,2,0),-5
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
p2facing=1
p2stateno=100115

[State 3200, mainhits]
type=hitdef
triggerall= anim=3201
trigger1= animelem=2 || animelem=8 || animelem=14 || animelem=20
trigger2= animelem=26 || animelem=32 || animelem=38 || animelem=44 || animelem=50
attr=A,HA
damage=24,5
animtype=Up 
guardflag=MA
hitflag=MAFD 
priority=7,Hit
pausetime=2,2
sparkno=2
guard.sparkno=41 
sparkxy=-10,-69
hitsound=s2,ifelse(random<500,6,5)
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(p2bodydist x>15,1.5,0),-10
air.type=Low
air.velocity=ifelse(p2bodydist x>15,1.5,0), (vel y - 1.5)
getpower=91
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 3200, mainhitsb]
type=hitdef
triggerall= anim=3201
trigger1= animelem=5 || animelem=11 || animelem=17 || animelem=23
trigger2= animelem=29 || animelem=35 || animelem=41 || animelem=47
attr=A,HA
damage=24,5
animtype=Up
guardflag=MA
hitflag=MAFD 
priority=7,Hit
pausetime=2,2
sparkno=2
guard.sparkno=41 
sparkxy=-10,-69
hitsound=s2,ifelse(random<500,6,5)
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=ifelse(p2bodydist x>15,1.5,0),-10
air.type=Low
air.velocity=ifelse(p2bodydist x>15,1.5,0), (vel y - 1.5)
getpower=91
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 3200, lasthit]
type=hitdef
trigger1= anim=3201 && animelem=56
attr=S,HA
damage=24,5
animtype=Diagup 
guardflag=MA
hitflag=MAFD 
priority=7,Hit
pausetime=24,24
sparkno=2
guard.sparkno=41 
sparkxy=-10,-70
hitsound=s2,6
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-7,-2
air.type=Low
air.velocity=-7,-2
getpower=91
envshake.time=16
envshake.freq=60
envshake.ampl=7
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115


;========================<TENMA SHINZUI WARI>=============================
[Statedef 3300]
type=A
physics=N
movetype=A
anim=3300
ctrl=0
velset=0,0
juggle=0
sprpriority=-1
facep2=1

[State 3300, strengthvar]
type=varset
trigger1= var(10)!=5
var(10)=5

[State 3300, comboposition]
type=posadd
trigger1= !time
trigger1= (prevstateno=[200,4999])
y=-30

[State 3300, snd]
type=playsnd
trigger1= !time
value=4,14
channel=0

[State 3300, superchargehelper]
type=helper
trigger1= !time
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=5,-45
ownpal=1
persistent=0
supermovetime=9999

[State 3300, superchargepause]
type=SuperPause
trigger1= !time
time=45
anim=-1
sound=s7,0
poweradd=-1000
p2defmul=1
darken=0

[State 3300, nhb]
type=nothitby
trigger1= anim=3300 && time<12
time=1
value=SCA
ignorehitpause=1

[State 3300, push]
type=playerpush
trigger1= 1
value=0
ignorehitpause=1

[State 3300, sprpriority]
type=sprpriority
trigger1= anim=3300
value=-1
ignorehitpause=1

[State 3300, trail]
type=helper
trigger1= anim=3300 && !animelemtime(2)
helpertype=normal
stateno=3305
ID=3305
name="Tenma trail"
postype=p1
ownpal=1
persistent=0
[State 3300, dust]
type=explod
trigger1= anim=3300 && !animelemtime(2)
anim=3306
ID=3306
sprpriority=2
postype=p1
ownpal=1

[State 3300, vel]
type=velset
trigger1= anim=3300 && animelemtime(2)>=0
x=16
y=16

[State 3300, pos]
type=posadd
trigger1= anim=3300
trigger1= movecontact=1 && hitcount<5
x=-160
y=-160
[State snd]
type=playsnd
trigger1= anim=3300
trigger1= movecontact=1 && hitcount<5
value=5,16

[State 3100]
type=screenbound
trigger1= hitcount>=1 && pos y<0
value=0
movecamera=0,0

[State 3300, snd]
type=playsnd
trigger1= anim=3300 && animelem=2
value=3,7
channel=0
[State 3300, snd]
type=playsnd
trigger1= anim=3300 && animelem=2
value=1,6
channel=1

[State 3300, hit]
type=hitdef
trigger1= anim=3300 && animelemtime(2)>=0 && hitcount<5
attr=A,HA 
damage=54,6
animtype=Hard
guardflag=HA
hitflag=MAFD
priority=7,Hit
pausetime= ifelse(hitcount=4,18,0), ifelse(hitcount=4,30,12)
sparkno=2
guard.sparkno=41
sparkxy=-10,-15
hitsound=s2,11 
guardsound=s2,0
ground.type=High
animtype=Diagup
fall.animtype=Diagup
ground.slidetime=16
ground.hittime=16
ground.velocity=0,-6.85
air.velocity=0,-6.85
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=24
envshake.freq=60
envshake.ampl=6
palfx.sinadd=64,64,64,4
palfx.mul=128,128,128
palfx.time=40
fall=1
fall.recover=0
sprpriority=-1
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 3300, flames]
type=helper
triggerall= movehit && numtarget && numhelper(7181)<1
trigger1= !(target,time) && (target,movetype=H)
helpertype=normal
stateno=7181
ID=7181
name="flames"
postype=p2
bindtime=1000
ownpal=1
facing=-1
size.ground.front=0
size.ground.back=0
ignorehitpause=1
persistent=0

[State 3300, anim]
type=changeanim
trigger1= anim=3300 && animelemtime(2)>0 && pos y>=-5
value=3301
persistent=0

[State 3300, sts]
type=statetypeset
trigger1= anim=3301
statetype=S
physics=N
[State 3300, sts]
type=velmul
trigger1= anim=3301
x=.8

[State 3300, stop]
type=posset
trigger1= anim=3301
y=0
[State 3300, stop]
type=velset
trigger1= anim=3301
y=0

[State 3300, dust]
type=explod
trigger1= anim=3301 && !animelemtime(1)
anim=7102
ID=7102
sprpriority=-2
postype=p1
ownpal=1
ignorehitpause=1
[State 3300, dust]
type=explod
trigger1= anim=3301 && vel x>1 && !(time%5)
anim=7103
ID=7103
sprpriority=3
postype=p1
pos=42,0
vel=-1,0
ownpal=1
ignorehitpause=1
[State 3300, snd]
type=playsnd
trigger1= anim=3301 && !animelemtime(1)
value=0,52
[State 3300, snd]
type=playsnd
trigger1= anim=3301 && !animelemtime(1)
value=5,14

[State 3300, end]
type=changestate
trigger1= anim=3301 && !animtime
value=0
ctrl=1


;========================<SHUN GOKU SATSU>=============================
[Statedef 4000]
type=A
physics=N
movetype=A
anim=4000
ctrl=0
velset=0,0
juggle=0
facep2=1

[State 4000, strengthvar]
type=varset
trigger1= var(10)!=7
var(10)=7

[State 4000, snd]
type=playsnd
trigger1= !time
value=4,13
channel=0
volume=200

[State 4000, superchargehelper]
type=helper
trigger1= !time
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=14,-104
ownpal=1
persistent=0
supermovetime=9999

[State 4000, superchargepause]
type=superpause
trigger1= !time
time=60
anim=-1
sound=s7,0
poweradd=-3000
p2defmul=1
darken=0

[State 4000, nhb]
type=nothitby
trigger1=1
time=1
value=SCA

[State 4000, vel]
type=velset
trigger1= 1
x=8
y=ifelse(p2dist y<0,-4,ifelse(p2dist y>0,4,0))

[State 4000, vel]
type=posadd
trigger1= time=1
x=ceil(p2dist x+24)
y=ceil(p2dist y)

[State 4000, vel]
type=turn
trigger1=p2dist x<0

[State snd]
type=playsnd
trigger1=time=1
value=5,16

[State 4000, snd]
type=playsnd
trigger1= animelemtime(1)>1
value=5,6
persistent=0

[State 4000, hit]
type=hitdef
trigger1= time
attr=S,HT
hitflag=MAFD
priority=1,Miss
numhits=0
sparkno=-1
p1facing=1
p1stateno=4001
fall=1 
fall.recover=0

[State 4000, end]
type=changestate
trigger1= !animtime
value=ifelse(pos y, 51, 0)
ctrl=1


;---PLAYER---
[Statedef 4001]
type=S
physics=N
movetype=A
anim=4001
ctrl=0
velset=0,0
sprpriority=1

[State 4001, throw]
type=targetstate
trigger1=1
value=4002

[State 4001, snd]
type=playsnd
trigger1= !time
value=4,10
channel=0

[State 4001, grabsound]
type=playsnd
trigger1= !time
value=0,800

[State 4001, snd]
type=playsnd
trigger1= animelem=2
value=5,8
channel=7

[State 4001, loop]
type=changeanim
trigger1= hitcount<999
trigger1= animelemtime(33)>=0 && animelemtime(34)<0
value=4001
elem=2+(random%30)

[State 4001, loop]
type=changeanim
triggerall= animelemtime(34)<0
trigger1= hitcount>=999
trigger2= numtarget
trigger2= target,ishelper && hitcount>=333
value=4001
elem=34

[State 4001, nothitby]
type=nothitby
trigger1=1
value=SCA
time=1

[State 4001, fadeout]
type=allpalfx
trigger1= animelemtime(1)=10
time=30
sinadd=-255,-255,-255,120

[State 4001, black]
type=envcolor
trigger1= animelemtime(2)>=0
time=4
value=0,0,0

[State 4001, assert]
type=assertspecial
trigger1= animelemtime(2)>=0
flag=nobardisplay

[State 4001, bind]
type=targetbind
trigger1=1
pos=45,0

[State 4001, hitadd]
type=hitadd
trigger1= animelem=2 || animelem=3 || animelem=4 || animelem=5 || animelem=6 || animelem=7 || animelem=8 || animelem=9
trigger2= animelem=10 || animelem=11 || animelem=12 || animelem=13 || animelem=14 || animelem=15
trigger3= animelem=16 || animelem=17 || animelem=18 || animelem=19 || animelem=20 || animelem=21 || animelem=22 || animelem=23 || animelem=24 || animelem=25
trigger4= animelem=26 || animelem=27 || animelem=28 || animelem=29 || animelem=30 || animelem=31 || animelem=32 || animelem=33 || animelem=34
value=10+(random%10)

[State 4001, hitdamage]
type=targetlifeadd
trigger1= animelem=2 || animelem=3 || animelem=4 || animelem=5 || animelem=6 || animelem=7 || animelem=8 || animelem=9 || animelem=10
trigger2= animelem=10 || animelem=11 || animelem=12 || animelem=13 || animelem=14 || animelem=15 || animelem=16 || animelem=17
trigger3= animelem=18 || animelem=19 || animelem=20 || animelem=21 || animelem=22 || animelem=23 || animelem=24 || animelem=25 || animelem=26
trigger4= animelem=27 || animelem=28 || animelem=29 || animelem=30 || animelem=31 || animelem=32 || animelem=33 || animelem=34
value= -4
kill=0
absolute=1

[State 4001, hitsnd]
type=playsnd
trigger1= animelem=2 || animelem=3 || animelem=4 || animelem=5 || animelem=6 || animelem=7 || animelem=8 || animelem=9 || animelem=10
trigger2= animelem=10 || animelem=11 || animelem=12 || animelem=13 || animelem=14 || animelem=15 || animelem=16 || animelem=17
trigger3= animelem=18 || animelem=19 || animelem=20 || animelem=21 || animelem=22 || animelem=23 || animelem=24 || animelem=25 || animelem=26
trigger4= animelem=27 || animelem=28 || animelem=29 || animelem=30 || animelem=31 || animelem=32 || animelem=33 || animelem=34
value=2,3
channel=2
freqmul= .75 + (random/2000.0)
volume=-128

[State 4001, sparks]
type=explod
trigger1= animelem=2 || animelem=3 || animelem=4 || animelem=5 || animelem=6 || animelem=7 || animelem=8 || animelem=9
trigger2= animelem=10 || animelem=11 || animelem=12 || animelem=13 || animelem=14 || animelem=15
trigger3= animelem=16 || animelem=17 || animelem=18 || animelem=19 || animelem=20 || animelem=21 || animelem=22 || animelem=23 || animelem=24 || animelem=25
trigger4= animelem=26 || animelem=27 || animelem=28 || animelem=29 || animelem=30 || animelem=31 || animelem=32 || animelem=33 || animelem=34
anim=f(random%4)
sprpriority=5
postype=left
pos=160,120
random=240,160
facing=-1
ownpal=1
ontop=1
pausemovetime=300
supermovetime=300

[State 4001, shake]
type=envshake
trigger1= animelem=2 || animelem=3 || animelem=4 || animelem=5 || animelem=6 || animelem=7 || animelem=8 || animelem=9 || animelem=10
trigger2= animelem=10 || animelem=11 || animelem=12 || animelem=13 || animelem=14 || animelem=15 || animelem=16 || animelem=17
trigger3= animelem=18 || animelem=19 || animelem=20 || animelem=21 || animelem=22 || animelem=23 || animelem=24 || animelem=25 || animelem=26
trigger4= animelem=27 || animelem=28 || animelem=29 || animelem=30 || animelem=31 || animelem=32 || animelem=33 || animelem=34
time=2
freq=90
ampl=-3

[State 4001, kanji]
type=explod
trigger1= animelem=35
anim=6013
ID=6013
sprpriority=2
postype=p1
facing=ifelse(facing=1,1,-1)
pos=ifelse(facing=1,0,32)
bindtime=-1
removeongethit=1
ownpal=1

[State 4001, end]
type=changestate
trigger1= !animtime
value=4010


;---Finish---
[Statedef 4010]
type=S
physics=N
movetype=A
anim=4010
velset=0,0
ctrl=0

[State 4010, snd]
type=posset
trigger1=!time
x=0
y=0

[State 4010, bind]
type=targetbind
trigger1= !time
pos=0,0

[State 4010, throw]
type=targetstate
trigger1= !time
value=4003

[State 4010, throw]
type=targetstate
trigger1= animelem=3
value=4004

[State 4010, damage]
type=targetlifeadd
trigger1= animelem=3
value=-50;(target,lifemax)
kill=1
absolute=1

[State 4010]
type=angledraw
trigger1=time<20
scale= 1+(.15*time), 1+(.15*time)
[State 4010]
type=angledraw
trigger1=time>=20
scale=4,4

[State 4010]
type=bgpalfx
trigger1=time<20
time=2
mul= ceil(12.8*time), 0, 0

[State 4010]
type=bgpalfx
trigger1=time>=20
time=2
mul=256,0,0

[State 4010, assert]
type=assertspecial
trigger1=1
flag=nobardisplay


[State 4010, snd]
type=playsnd
trigger1= !time
value=5,17

[State 4010, snd]
type=playsnd
trigger1= animelem=2
value=4,ifelse(random<500,8,9)
channel=0

;[State Narrator]
;type=helper
;trigger1= time=90
;trigger1= !numhelper(7680) && random<250
;trigger1= var(48):=2
;helpertype=normal
;stateno=7680
;ID=7680
;name="Narrator"
;postype=left
;ownpal=1
;pausemovetime=999
;supermovetime=999

[State 4010, snd]
type=playsnd
trigger1= animelem=3
value=7,7

[State 4010, snd]
type=playsnd
trigger1= animelem=3
value=5,5

[State 4010, dust]
type=explod
trigger1= animelem=3
anim=7107
sprpriority=3
postype=p1
scale=1,1
ownpal=1

[State 4010, shake]
type=envshake
trigger1= animelem=3
time=30
freq=60
ampl=6

[State 4010, end]
type=changestate
trigger1=time>=120
value=4011


;---Finish---
[Statedef 4011]
type=A
physics=A
movetype=A
anim=4011
velset=0,0
ctrl=0

[State 4011, snd]
type=posset
trigger1=!time
x=0
y=ceil(pos y-screenpos y)-80

[State 4011]
type=angledraw
trigger1=1
scale=1,1

[State 4011, throw]
type=targetstate
trigger1= !time
value=4005

[State 4011]
type=screenbound
trigger1=1
value=1
movecamera=1,0


;---TARGET---
[Statedef 4002]
type=S
physics=N
movetype=H
velset=0,0
ctrl=0

[State 4002, anim]
type=changeanim2
trigger1= !time
value=4002

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

[Statedef 4003]
type=L
physics=C
movetype=H
velset=0,0
ctrl=0

[State 4003, anim]
type=changeanim2
trigger1= !time
value=4003

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

[Statedef 4004]
type=L
physics=C
movetype=H
velset=0,0
ctrl=0

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

[State 4004, anim]
type=changeanim
trigger1= !time
value=5080

[State 4004, end]
type=selfstate
trigger1=time>=300
value=5120

[Statedef 4005]
type=L
physics=C
movetype=H
velset=0,0
ctrl=0

[State 4005, end]
type=selfstate
trigger1=1
value=ifelse(alive, 5110, 5150)


;========================<MISOGI>=============================
[Statedef 4100]
type=A
physics=N
movetype=A
anim=4100
ctrl=0
velset=0,0
juggle=0
facep2=1

[State 4100, strengthvar]
type=varset
trigger1= var(10)!=7
var(10)=7

[State 4100, snd]
type=playsnd
trigger1= !time
value=4,3
channel=0

[State 4100, superchargehelper]
type=helper
trigger1= anim=4100 && !animelemtime(3)
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=-5,-45
ownpal=1
persistent=0
supermovetime=9999

[State 4100, superchargepause]
type=superpause
trigger1= anim=4100 && !animelemtime(3)
persistent=0
time=60
anim=-1
sound=s7,0
poweradd=-3000
p2defmul=1
darken=0
movetime=60

[State 4100, nhb]
type=nothitby
trigger1=1
time=1
value=SCA

[State 4100, push]
type=playerpush
trigger1=1
value=0
ignorehitpause=1

[State 4100, illusions]
type=helper
trigger1= time=61
helpertype=normal
stateno=4104
ID=4104
name="Misogi Illusion"
postype=p1
ownpal=1
persistent=0
pausemovetime=999
supermovetime=999

[State 4100, end]
type=changestate
trigger1= time>=63
value=4101


;---Firing---
[Statedef 4101]
type=A
physics=N
movetype=A
anim=9741
ctrl=0
velset=0,0

[State 4101, dist]
type=attackdist
trigger1=1
value=640

[State 4101, snd]
type=playsnd
trigger1= !time
value=5,9
[State 4101, snd]
type=playsnd
trigger1= time>=6 && random<100
value=4,11

[State 4101, end]
type=changestate
trigger1=time>=40
value=4120

[State 4101, comming down]
type=projectile
trigger1= !(time%2)
ProjID=4101
projanim=4101
projremanim=4102
projremove=0
projscale= 1,1
velocity= 0, 20
projsprpriority=-1
projedgebound=80
projheightbound=-9999,-19
postype=back
offset= ifelse(!(time%4), 320-8*(time%80), 8*(time%80)), ceil(pos y-screenpos y)-80
attr=S,HP
damage=32,7
animtype=Hard
guardflag=MH
hitflag=MAFD
priority=7,Hit
pausetime=0,12
sparkno=2
guard.sparkno=41 
sparkxy=-10,-52
hitsound=s2,3
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=0,0
air.velocity=0,-6
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=12
envshake.freq=60
envshake.ampl=4
fall=0
air.fall=1
fall.recover=0
p2stateno=100115


;---Finish---
[Statedef 4120]
type=A
physics=N
movetype=A
anim=4120
ctrl=0
velset=0,0
sprpriority=-1
juggle=0

[State 4120, nhb]
type=nothitby
trigger1=1
time=1
value=SCA

[State 4120, push]
type=playerpush
trigger1=1
value=0
ignorehitpause=1

[State 4120, pos]
type=posadd
trigger1=!time
x=p2dist x-10
y=p2dist y-240

[State 4120, vel]
type=velset
trigger1=1
y=20

[State 4120, snd]
type=playsnd
trigger1= animelem=3
value=4,11
channel=0
[State 4120, snd]
type=playsnd
trigger1=!time
value=5,9

[State 4120, particles]
type=explod
trigger1=1
vel=0,-4
anim=4111
sprpriority=3
postype=p1
pos=3,-60
random=40,40
facing=-1+(random<500)*2
scale=.5,.5
ownpal=1

[State 4120, hit]
type=hitdef
trigger1= animelem=2
attr=A,HA
damage=500,50
animtype=Hard 
guardflag=
hitflag=MAFD
priority=4,Hit
pausetime=0,0
guard.pausetime=0,30
sparkno=2
guard.sparkno=41
hitsound=s2,9 
guardsound=s2,0
ground.type=High
air.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-2,0
guard.velocity=-10
air.velocity=0,20
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=5
fall=1
fall.recover=0
sprpriority=-1
ID=4120
airguard.ctrltime= 16
airguard.velocity= ifelse(var(20),-4,-8), -1.5
p2stateno=100115

[State 4120, p2state]
type=targetstate
trigger1= movehit && numtarget(4120)
trigger1= (target(4120),stateno=5000) || (target(4120),stateno=5010)
value=1114100
ID=4120
ignorehitpause=1
[State 4120, p2state]
type=targetstate
trigger1= movehit && numtarget(4120)
trigger1= (target(4120),stateno=5020)
value=1114110
ID=4120
ignorehitpause=1

[State 4120, anim]
type=changestate
trigger1= pos y>=-5
value=4121


;---Land---
[Statedef 4121]
type=S
physics=S
movetype=A
anim=4121
ctrl=0
velset=0,0
sprpriority=-1
juggle=0

[State 4121, stop]
type=posset
trigger1=1
y=0

[State 4121, shake]
type=envshake
trigger1=!time
time=30
ampl=12

[State 4121, snd]
type=playsnd
trigger1=!time
value=5,7
[State 4121, fire]
type=explod
trigger1=!time
vel=0,0
anim=4105
sprpriority=4
postype=p1
pos=0,0
ownpal=1

[State 4121, dust]
type=explod
trigger1= !time
anim=7104
ID=7104
sprpriority=-2
postype=p1
pos=0,0
vel=0,0
ownpal=1
ignorehitpause=1
[State 4121, dust]
type=explod
trigger1= time=13
vel=0,0
anim=7107
ID=7107
sprpriority=4
postype=p1
pos=0,0
ownpal=1

[State 4121, particles]
type=explod
trigger1= animelemtime(1)>=5 && animelemtime(1)<17
vel=ceil(5+random/100),ceil(1+random/500)
accel=-.4,-.75
anim=4128
sprpriority=3
postype=p1
pos=2,-40
random=60,60
facing=-1+(random<500)*2
ownpal=1
scale=.5,.1
[State 4121, particles]
type=explod
trigger1= animelemtime(1)>=5 && animelemtime(1)<17
vel=-ceil(5+random/100),ceil(1+random/500)
accel=.4,-.75
anim=4128
sprpriority=3
postype=p1
pos=2,-40
random=60,60
facing=-1+(random<500)*2
ownpal=1
scale=.5,.1

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


;---TARGET STANDING---
[Statedef 1114100]
type=S
physics=S
movetype=H
ctrl=0
velset=gethitvar(xvel),0
sprpriority=1
[State 1114100, anim]
type=changeanim
trigger1= !time && selfanimexist(5950)
value=5950
[State 1114100, anim]
type=changeanim2
trigger1= !time && !selfanimexist(5950)
value=1114100

[State 1114100, stop]
type=posset
trigger1= 1
y=0
[State 1114100, stop]
type=velset
trigger1= 1
y=0
[State 1114100, dust]
type=gamemakeanim
trigger1= anim=1114100 && animelem=7
value=60
pos=0,0
under=sysvar(1)<=14
[State 1114100, snd]
type=playsnd
trigger1= anim=1114100 && animelem=7
value=f7,0

[State 1114100, anim]
type=changeanim
trigger1= time>=110 && selfanimexist(5111)
value=5111
[State 1114100, end]
type=selfstate
trigger1= time>=110
value=ifelse(alive,5120,5150)


;---TARGET MID-AIR---
[Statedef 1114110]
type=A
physics=N
movetype=H
ctrl=0
velset=gethitvar(xvel),gethitvar(yvel)
sprpriority=1
[State 1114110, anim]
type=changeanim2
trigger1= !time
value=1114110

[State 1114110, grav]
type=gravity
trigger1= animelemtime(5)<0
[State 1114110, stop]
type=posset
trigger1= pos y>=0
y=0
[State 1114110, stop]
type=velset
trigger1= pos y>=0
y=0
[State 1114110, sts]
type=statetypeset
trigger1= pos y>=0
type=L
physics=C

[State 1114110, anim]
type=changeanim2
trigger1= pos y>=0
value=1114110
elem=5
persistent=0
[State 1114110, dust]
type=gamemakeanim
trigger1= animelem=5
value=62
pos=0,0
under=sysvar(1)<=14
[State 1114110, snd]
type=playsnd
trigger1= animelem=5
value=f7,2

[State 1114110, end]
type=selfstate
trigger1= animelemtime(7)>=110
value=ifelse(alive,5120,5150)


;========================<KONGOU KOKURETSU ZAN>=============================
[Statedef 4200]
type=S
physics=S
movetype=A
anim=4200
ctrl=0
velset=0,0
sprpriority=-1
facep2=1

[State 4200, strengthvar]
type=varset
trigger1= var(10)!=6
var(10)=6

[State 4200, superchargehelper]
type=helper
trigger1=!time
helpertype=normal
stateno=7500
ID=7500
name="Super Charge"
postype=p1
pos=-18,-126
ownpal=1
persistent=0
supermovetime=9999

[State 4200, superchargepause]
type=superpause
trigger1=!time
time=53
anim=-1
sound=s7,0
poweradd=-2000
p2defmul=1
darken=0
movetime=53

[State 4200, nhb]
type=nothitby
trigger1=1
time=1
value=SCA

[State 4200, end]
type=changestate
trigger1=time>=53
value=4201


;---Firing---
[Statedef 4201]
type=S
physics=S
movetype=A
anim=4201
ctrl=0
velset=0,0
sprpriority=-1

[State 4201, nhb]
type=nothitby
trigger1=time<120
time=1
value=SCA

[State 4201, snd]
type=playsnd
trigger1=!time
value=3,2
channel=0
[State 4201, snd]
type=playsnd
trigger1=time<120 && !(time%8)
value=5,0
channel=1

[State 4201, going up]
type=explod
trigger1=time<120 && !(time%4)
anim=1005
sprpriority=3
postype=p1
pos=-18,-136
random=40,40
vel= -.5+(random/1000.0), -6-(random/250.0)
removetime=60
ownpal=1
scale=.5,.5
removeongethit=1

[State 4201, comming down]
type=projectile
trigger1= time>=60 && !(time%4)
ProjID=4205
projanim=1005
projhitanim=1006
projscale= .75, .75
velocity= -10+(random/50.0), 7.5+(random/200.0)
accel=0,.25
velmul=.9,1
projsprpriority=4
projedgebound=80
projheightbound=-9999,0
postype=p1
offset= ceil(p2dist x-100+(random/5.0)), ceil(pos y-screenpos y)-80
attr=S,HP
damage=30,6
animtype=Hard
guardflag=MH 
hitflag=MAFD
priority=7,Hit
pausetime=4,12
sparkno=2
guard.sparkno=41 
sparkxy=-10,0
hitsound=s5,1
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=0,-4
air.velocity=0,-4
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=12
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
p2stateno=100115

[State 4201, end]
type=changestate
trigger1=time>=180
value=4202


;---Over---
[Statedef 4202]
type=S
physics=S
movetype=I
anim=4202
ctrl=0
velset=0,0
sprpriority=-1

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