; _____________________________________
;| Rare Akuma by Phantom.of.the.Server |
; ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
;==============================================================================================
;=======================================<SPECIAL STATES>=======================================
;==============================================================================================

;========================<GOU HADOU KEN>=============================
[Statedef 1000]
type=S
physics=S
movetype=A
anim=1000
ctrl=0
velset=0,0
poweradd=72
sprpriority=1
facep2=1

[State 1000, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse(command="qcfz",3,ifelse(command="qcfy",2,1))

[State 1000, strengthvarAI]
type=varset
trigger1= !time && var(59)>=1
var(10)=ifelse(random<500,3,ifelse(random<500,2,1))

[State 1000, width]
type=width
trigger1= animelemtime(5)>=0 && animelemtime(10)<0
value=30,0

[State 1000, Hadouken]
type=helper
trigger1= !animelemtime(5)
helpertype=normal
stateno=1005
name="Hadouken"
postype=p1
pos=78,-68
ownpal=1
size.xscale=1
size.yscale=1

[State 1000, snd]
type=playsnd
trigger1= !animelemtime(4)
value=3,3
channel=0
freqmul=ifelse(ishelper, 1.5, 1)

[State 1000, snd]
type=playsnd
trigger1= !animelemtime(5)
value=5,0

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


;========================<ZANKUU HADOU KEN>=============================
[Statedef 1050]
type=A
physics=A
movetype=A
anim=1050
ctrl=0
poweradd=72
sprpriority=1

[State 1050, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse(command="qcfz",3,ifelse(command="qcfy",2,1))

[State 1050, strengthvarAI]
type=varset
trigger1= !time && var(59)>=1
var(10)=ifelse(random<500,3,ifelse(random<500,2,1))

[State 1050, width]
type=width
trigger1= (animelemtime(2)>=0 && animelemtime(4)<0) || (animelemtime(5)>=0 && animelemtime(6)<0)
value=27,0

[State 1050, Hadouken]
type=helper
trigger1= !animelemtime(2) || !animelemtime(5)
helpertype=normal
stateno=1055
name="Hadouken"
postype=p1
pos=ifelse((animelem=2),54,67),ifelse((animelem=2),-48,-48)
ownpal=1
size.xscale=1
size.yscale=1

[State 1050, snd]
type=playsnd
trigger1= animelem=2 || animelem=5
value=3,10
channel=0
freqmul=ifelse(ishelper, 1.5, 1)

[State 1050, snd]
type=playsnd
trigger1= !animelemtime(2) || !animelemtime(5)
value=5,0
channel=1


;========================<GOU SHORYUU KEN>=============================
[Statedef 1100]
type=A
physics=N
movetype=A
anim=1100
ctrl=0
velset=0,0
poweradd=72
juggle=0
facep2=1

[State 1100, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse(command="dfz",3,ifelse(command="dfy",2,1))

[State 1100, strengthvarAI]
type=varset
trigger1= !time && var(59)>=1
var(10)=ifelse(p2movetype=H,3,ifelse(random<333,2,1))

[State 1100, nothitby]
type=nothitby
trigger1= anim=1100
value=SCA
time=1
ignorehitpause=1

[State 1100, statetype]
type=statetypeset
trigger1= anim=1100 && animelemtime(4)<0
trigger1= !pos y
statetype=S
physics=N

[State 1100, statetype]
type=statetypeset
trigger1= anim=1100 && animelemtime(4)<0
trigger1= pos y
statetype=A
physics=N

[State 1100, vel]
type=velset
trigger1= anim=1100 && !animelemtime(4)
x=ifelse(var(10)=3,20,ifelse(var(10)=2,15,10))
y=ifelse(var(10)=3,-20,ifelse(var(10)=2,-15,-10))

[State 1100, vel]
type=velmul
trigger1= 1
x=.9

[State 1100, vel]
type=velmul
trigger1= vel y>0
x=0

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

[State 1100, snd]
type=playsnd
trigger1= anim=1100 && !animelemtime(4)
value=3,9
channel=0
freqmul=ifelse(ishelper, 1.5, 1)

ignorehitpause=1
persistent=0

[State 1100, width]
type=width
trigger1= vel y<0
edge=const(size.air.front)

[State 1100,envcolor]
type=envcolor
triggerall=movehit
trigger1=AnimElem=2
trigger2=AnimElem=3
trigger3=AnimElem=4
time=1
under=1
value=500,0,0

[State 1100, hit]
type=hitdef
trigger1= (animelem=2) && anim=1100
trigger2= (animelem=3) && anim=1100
attr=S,SA
damage= ifelse(var(10)=3, 73, ifelse(var(10)=2, 66, 56)), 7
animtype=Hard
fall.animtype=Hard
guardflag=M
hitflag=MAFD
priority=4,Hit
pausetime=12,12
guard.sparkno=41
sparkno=S(ifelse(Random<=500,5990,5991))
sparkxy=8,ifelse(AnimElemTime(3)<0,-52,ifelse (AnimElemTime(3)>=0&&AnimElemTime(4)<0,-80,-125))
hitsound=s2,3
guardsound=s2,0
ground.type=Low
ground.slidetime=16
ground.hittime=16
ground.velocity=.5,-6
air.type=Low
air.velocity=.5,-6
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
fall.animtype=Medium
p2stateno=100115

[State 1100, hit2]
type=hitdef
trigger1= (animelem=4) && anim=1100
attr=A,SA
damage=28,7
animtype=Back
guardflag=MA
hitflag=MAFD
priority=4,Hit
pausetime=16,16
guard.sparkno=41
sparkno=S(ifelse(Random<=500,5990,5991))
sparkxy=8,ifelse(AnimElemTime(3)< 0,-52,ifelse(AnimElemTime(3)>=0&&AnimElemTime(4)<0,-80,-125))
hitsound=s2,3
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-2-(var(10)/2),-8-var(10)
air.type=Low
air.velocity=-2-(var(10)/2),-8-var(10)
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 1100, statetype]
type=statetypeset
trigger1= anim=1100 && animelemtime(4)>=0
statetype=A
physics=A

[State 1100, anim]
type=changeanim
trigger1= anim=1100 && animelemtime(4)>0 && vel y>(ifelse(var(10)=3,-5.3,ifelse(var(10)=2,-4,-2.7)))
value=1101


;========================<TATSUMAKI ZANKUU KYAKU>=============================
[Statedef 1200]
type=A
physics=N
movetype=A
anim=1200
ctrl=0
velset=0,0
poweradd=72
juggle=0
facep2=1

[State 1200, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse((command="qcbc"),3,ifelse(command="qcbb",2,1))

[State 1200, strengthvarAI]
type=varset
trigger1= !time && var(59)>=1
var(10)=ifelse(p2movetype=H,3,1)

[State 1200, nothitby]
type=nothitby
trigger1= anim=1200
value=SCA
time=1
ignorehitpause=1

[State 1200, snd]
type=playsnd
trigger1= anim=1200 && !animelemtime(1)
value=3,11
channel=0
freqmul=ifelse(ishelper, 1.5, 1)

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

[State 1200, anim]
type=changeanim
trigger1= anim=1200 && !animtime
value=1201

[State 1200, statetype]
type=statetypeset
trigger1= anim=1200 || anim=1205
statetype=A
physics=A

[State 1200, statetype]
type=statetypeset
trigger1= anim=1201
statetype=A
physics=N

[State 1200, vel]
type=velset
trigger1= anim=1200 && !animelemtime(1)
x=7
y=-7

[State 1200, vel]
type=velset
trigger1= anim=1201
x=7
y=0

[State 1200, spin]
type=playsnd
trigger1= anim=1201 && !(animelemtime(1)%9)
value=1,6
channel=1

[State 1200, anim]
type=changeanim
trigger1= anim=1201 && ifelse(var(10)=3,!animtime,ifelse(var(10)=2,animelemtime(18)>=0,animelemtime(6)>=0))
value=1205
persistent=0

[State 1100,envcolor]
type=envcolor
triggerall=movehit
trigger1=AnimElem=2
trigger2=AnimElem=5
trigger3=AnimElem=8
trigger4=AnimElem=11
trigger5=AnimElem=14
trigger6=AnimElem=17
trigger7=AnimElem=20
trigger8=AnimElem=23
time=1
under=1
value=500,500,500

[State 1200, hit]
type=hitdef
trigger1= anim=1200 && animelemtime(2)=-1
trigger2= anim=1201 && (animelem=2 || animelem=8 || animelem=14 || animelem=20)
attr=S,SA
damage= ifelse(var(10)=1, 45, 37), 7
animtype=Hard
guardflag=MA
hitflag=MAFD
priority=4,Hit
pausetime=14,14
guard.sparkno=41
sparkno=S(ifelse(Random<=500,5993,5993))
sparkxy=8,ifelse(AnimElemTime(3)<0,-52,ifelse (AnimElemTime(3)>=0&&AnimElemTime(4)<0,-80,-125))
hitsound=s2,6
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=-2.5,-8
air.type=Low
air.velocity=-2.5,-6.5
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115

[State 1200, hitb]
type=hitdef
trigger1= anim=1201 && (animelem=5 || animelem=11 || animelem=17 || animelem=23)
attr=S,SA
damage= ifelse(var(10)=1, 45, 37), 7
animtype=Hard
guardflag=MA
hitflag=MAFD
priority=4,Hit
pausetime=14,14
guard.sparkno=41
sparkno=S(ifelse(Random<=500,5992,5993))
sparkxy=8,ifelse(AnimElemTime(3)<0,-52,ifelse (AnimElemTime(3)>=0&&AnimElemTime(4)<0,-80,-125))
hitsound=s2,6
guardsound=s2,0
ground.type=High
ground.slidetime=16
ground.hittime=16
ground.velocity=3,-8
air.type=Low
air.velocity=3,-6.5
getpower= ifelse(p2movetype=H,72,144), 36
envshake.time=16
envshake.freq=60
envshake.ampl=4
fall=1
fall.recover=0
airguard.ctrltime= 16
airguard.velocity= -8, -1.5
p2stateno=100115


;========================<ASHURA SENKUU>=============================
[Statedef 1400]
type=S
physics=N
movetype=I
anim=1400
velset=0,0
ctrl=0
sprpriority=-1
facep2=1

[State 1400, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse(command="df2p",3,ifelse(command="df2k",2,ifelse(command="db2p",-3,-2)))

[State 1400, anim]
type=changeanim
trigger1= !time && (prevstateno=195 || prevstateno=1020 || prevstateno=1500)
value=1400
elem=3

[State 1400, afterimage]
type=afterimage
trigger1= animelem=3
time=2
timegap=1
framegap=6
length=ifelse((var(10)=3 || var(10)=-3),24,18)
palbright=0,0,0
paladd=0,0,0
palmul=.9,.9,.9
palcontrast=160,160,160
palpostbright=0,0,0
trans=add1

[State 1400, aura]
type=helper
trigger1= !animelemtime(3) && !ishelper(1)
helpertype=normal
stateno=6000
ID=6000
postype=p1
ownpal=1
persistent=0

[State 1400, vel]
type=velset
trigger1= animelemtime(2)>0 && animelemtime(6)<0
x=ifelse(var(10)=3,-12,ifelse(var(10)=2,-6,ifelse(var(10)=-3,12,6)))*sin((time-2)/2)

[State 1400, vel]
type=velset
trigger1= animelem=6
x=ifelse(var(10)=3,28,ifelse(var(10)=2,18,ifelse(var(10)=-3,-28,-18)))
[State 1400, vel]
type=velmul
trigger1= animelemtime(6)>ifelse((var(10)=3 || var(10)=-3),8,5)
x=.9

[State 1400, snd]
type=playsnd
trigger1= animelem=6
value=5,6
persistent=0

[State 1400, push]
type=playerpush
trigger1= animelemtime(3)>=0
value=0
[State 1400, nothitby]
type=nothitby
trigger1=1
value=SCA
time=1
ignorehitpause=1
[State 1400, turn]
type=turn
trigger1= animelemtime(6)>0 && p2dist x<0

[State 1400, end]
type=changestate
trigger1= animelemtime(6)=ifelse((var(10)=3 || var(10)=-3),20,12)
trigger2= animelemtime(6)>0 && vel x<0 && backedgebodydist<=const(size.ground.back)
trigger3= animelemtime(6)>0 && vel x>0 && frontedgebodydist<=const(size.ground.front)
value=0
ctrl=1


;========================<ZENPOU TENSHIN>=============================
[Statedef 1450]
type=S
physics=N
movetype=I
anim=1450
ctrl=0
velset=0,0
sprpriority=-1
facep2=1

[State 1450, strengthvar]
type=varset
trigger1= !time && var(59)<=0
var(10)=ifelse(command="qcbz",3,ifelse(command="qcby",2,1))
[State 1450, strengthvarAI]
type=varset
trigger1= !time && var(59)>=1
var(10)=ifelse(random<500,1,ifelse(random<500,2,3))

[State 1450, sts]
type=statetypeset
trigger1= anim=1450 && animelemtime(3)>=0
statetype=C
[State 1450, sts]
type=statetypeset
trigger1= anim=1451 && animelemtime(3)>=0
statetype=S
physics=S

[State 1450, vel]
type=velset
trigger1= anim=1450 && animelemtime(2)>=0
x=6

[State 1400, snd]
type=playsnd
trigger1= anim=1450 && animelem=2
value=0,105
persistent=0

[State 1450, dust]
type=explod
trigger1= anim=1450 && animelemtime(4)>=0 && !(animelemtime(4)%5)
anim=7103
ID=7103
sprpriority=3
postype=p1
vel=-1,0
removetime=-2
ownpal=1

[State 1450, push]
type=playerpush
trigger1= anim=1450
trigger2= anim=1451 && animelemtime(3)<0
value=0
[State 1450, nothitby]
type=nothitby
trigger1= 1
value=SCA,AA,AP,AT
time=1

[State Hadouken]
type=helper
trigger1= numhelper(1025)<5 && !(time%4)
trigger1= anim=1450 && !ishelper
helpertype=normal
stateno=1025
ID=1025
name="Hadouken"
postype=p1
pos=0,-20
ownpal=1
size.xscale=.5
size.yscale=.5

[State 1450, anim]
type=changeanim
trigger1= anim=1450
trigger1= ifelse(var(10)=3,!animtime,ifelse(var(10)=2,animelemtime(8)>=0,animelemtime(4)>=0))
value=1451

[State 1400, dust]
type=explod
trigger1= anim=1451 && animelem=3
anim=7102
ID=7102
sprpriority=-2
postype=p1
pos=25,0
vel=0,0
removetime=-2
ownpal=1
scale=.5,.5
[State 1400, snd]
type=playsnd
trigger1= anim=1451 && animelem=3
value=0,100
persistent=0

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


;========================<TENMA SHURETTOU>=============================
;---POSE---
[Statedef 1500]
type=S
physics=S
movetype=I
anim=1500
ctrl=0
velset=0,0
facep2=1

[State 1500, reversal]
type=reversaldef
trigger1= animelem=3
reversal.attr=SCA,AA,AP
p1stateno=1505
pausetime=0,12
hitsound=s2,0
sparkno=41
sparkxy=0,0
numhits=0

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


;---wow---
[Statedef 1505]
type=S
movetype=I
physics=N
juggle=0
anim=1505
velset=0,0
sprpriority=1
ctrl=0

[State 1505]
type=pause
trigger1=1
time=1
movetime=1

[State 1505]
type=helper
trigger1= !time
helpertype=normal
stateno=1510
name="Log"
postype=p1
pos=0,-32
ownpal=1
size.xscale=1
size.yscale=1
pausemovetime=999

[State 1505]
type=posadd
trigger1=!time
x= ceil(p2dist x+48)
[State 1505]
type=posset
trigger1=!time
y=0
[State 1505]
type=turn
trigger1=!time
trigger1=p2dist x<0

[State 1505, snd]
type=playsnd
trigger1=!time
value=4,13
channel=0
[State 1505, snd]
type=playsnd
trigger1=!time
value=5,16
[State 1505, snd]
type=playsnd
trigger1=animelem=3||animelem=8
value=1,6
channel=1

[State 1505, snd]
type=bgpalfx
trigger1=1
time=2
mul=128,128,128

[State 1505, snd]
type=playsnd
trigger1=animelem=11
value=0,52
[State 1505, dust]
type=explod
trigger1=animelem=11
anim=7102
ID=7102
sprpriority=-2
postype=p1
scale=.5,.5
ownpal=1

;[State Narrator]
;type=helper
;trigger1= !animtime
;trigger1= !numhelper(7680) && random<125
;trigger1= var(48):=ifelse(random<500,7,4)
;helpertype=normal
;stateno=7680
;ID=7680
;name="Narrator"
;postype=left
;ownpal=1
;pausemovetime=999
;supermovetime=999

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


;========================<AKUMA JUNIORS>=============================
[Statedef 1900]
type=S
physics=S
movetype=I
anim=1900
ctrl=0
velset=0,0
poweradd=72
sprpriority=1
poweradd=-500
facep2=1

[State 1900, fx]
type=helper
trigger1= animelem=5
trigger1= numhelper(1)<3 && !ishelper(1)
helpertype=normal
ID=1
name="Akuma Juniors"
postype=p1
pos=-20,-48
keyctrl=1
size.xscale=.5
size.yscale=.5
ownpal=1

[State 1900, snd]
type=playsnd
trigger1= animelem=4
value=5000,2
channel=0
[State 1900, snd]
type=playsnd
trigger1= animelem=5
value=5,18

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