;#ADD004BASIC#

[remap]
	x=x
	y=y
	z=z
	a=a
	b=b
	c=c
	s=s
[defaults]
	command.time=15
	command.buffer.time=1


;------------------
[command]
	name="hp5"
	command=~x,x,F,a,y
	time=36
[command]
	name="hp5"
	command=~x,x,/$F,a,y
	time=36
[command]
	name="hp5"
	command=~D,F,a+b
[command]
	name="hp5"
	command=~D,F,b+c
;---
[command]
	name="hp1"
	command=~D,F,D,F,x
	time=32
[command]
	name="hp1_s"
	command=~D,F,D,F,y
	time=32
[command]
	name="hp1"
	command=~D,F,x+y
[command]
	name="hp1_s"
	command=~D,F,y+z
;---
[command]
	name="hp2"
	command=~D,B,D,B,x
	time=32
[command]
	name="hp2_s"
	command=~D,B,D,B,y
	time=32
[command]
	name="hp2"
	command=~D,B,x+y
[command]
	name="hp2_s"
	command=~D,B,y+z
;---
[command]
	name="hp3"
	command=~D,F,D,F,a
	time=32
[command]
	name="hp3_s"
	command=~D,F,D,F,b
	time=32
[command]
	name="hp3"
	command=~D,F,a+b
[command]
	name="hp3_s"
	command=~D,F,b+c
;;---
;[command]
;	name="hp4"
;	command=~D,B,D,B,a
;	time=32
;[command]
;	name="hp4_s"
;	command=~D,B,D,B,b
;	time=32
;[command]
;	name="hp4"
;	command=~D,B,a+b
;[command]
;	name="hp4_s"
;	command=~D,B,b+c

;-----------------
[command]
	name="sp5"
	command=~F,D,F,x
	time=20
[command]
	name="sp5_s"
	command=~F,D,F,y
	time=20
[command]
	name="sp5"
	command=~F,D,DF,x
	time=20
[command]
	name="sp5_s"
	command=~F,D,DF,y
	time=20
;--
[command]
	name="sp1"
	command=~D,F,x
[command]
	name="sp1_s"
	command=~D,F,y
;---
[command]
	name="sp2"
	command=~D,B,x
[command]
	name="sp2_s"
	command=~D,B,y
;---
[command]
	name="sp3"
	command=~D,F,a
[command]
	name="sp3_s"
	command=~D,F,b
;---
[command]
	name="sp4"
	command=~D,B,a
[command]
	name="sp4_s"
	command=~D,B,b
;---
[command]
	name="sp7_f1"
	command=~D,D,x
[command]
	name="sp7_f2"
	command=~D,D,y
[command]
	name="sp7_b1"
	command=~D,D,a
[command]
	name="sp7_b2"
	command=~D,D,b

;--------
[command]
	name="ff"
	command=F,F
	time=10
[command]
	name="bb"
	command=B,B
	time=10
;--------
[command]
	name="recovery"
	command=x+y
	time=1
[command]
	name="recovery"
	command=z
	time=1
[command]
	name="ab"
	command=a+b
	time=1
[command]
	name="ab"
	command=c
	time=1
;--------
[command]
	name="a"
	command=a
	time=1
[command]
	name="b"
	command=b
	time=1
[command]
	name="c"
	command=c
	time=1
[command]
	name="x"
	command=x
	time=1
[command]
	name="y"
	command=y
	time=1
[command]
	name="z"
	command=z
	time=1
[command]
	name="start"
	command=s
	time=1
;--------
[command]
	name="holdfwd"
	command=/$F
	time=1
[command]
	name="holdback"
	command=/$B
	time=1
[command]
	name="holdup"
	command=/$U
	time=1
[command]
	name="holddown"
	command=/$D
	time=1




;------------------
[statedef -1]
;------------------


;---
;---
; hit_spark / guard_spark (v30-32)
;--- set
[state 0]
	type=varset
	trigger1=(movecontact=1) && (var(32)=-1) && (sysfvar(0)<=0)
	var(32)=hitpausetime ;;<- memo hitpausetime to var
	ignorehitpause=1
;--- hit_spark_def
[state 0]
	type=explod
	trigger1=(movecontact=1) && (var(32)=hitpausetime) && (sysfvar(0)<=0)
	trigger1=var(31)>=0 ;; sparkno
	anim=f0+ifelse(movehit,ifelse(var(31)%10<3, var(31)%10, 3), 40)
	ownpal=0
	postype=p2
	pos=((var(30)/1000)%1000)-500, floor( (500-(var(30)%1000)) *const(size.yscale) -p2dist y)
	sprpriority=5
	facing=-1
	ignorehitpause=1
[state 0]
	type=playsnd
	trigger1=(movecontact=1) && (var(32)=hitpausetime) && (sysfvar(0)<=0)
	trigger1=var(31)>=0 ;; sparkno
	value=f5+(movehit=0), ifelse(var(31)%10>4,4,var(31)%10)*(movehit>0)
	ignorehitpause=1
;--- reset
[state 0]
	type=varset
	trigger1=(var(32)>-1)
	var(32)=-1



;---
;---
[state 0]
	type=varset
	trigger1=var(41)
	var(41)=0
[state 0]
	type=varset
	triggerall=movecontact
	triggerall=!var(41)
	triggerall=roundstate=2
	trigger1=stateno=200||(stateno=220 &&(anim=225))||(stateno=230 &&(anim=235))
	trigger2=stateno=400||stateno=420||stateno=430||stateno=440
	trigger3=stateno=701 && (var(51)<1 || (var(51)>0 && (animelem=7,>0)))
	trigger4=stateno=710 && (var(51)<1 || (var(51)>0 && (animelem=4,>0)))
	trigger5=(stateno=1500) && (hitpausetime<1)
	var(41)=1


;------------------
; hyper / super
;------------------
; uE(max2)
[state 0]
	type=changestate
	value=3500
	triggerall=command="hp5"
	triggerall=var(51)<1
	triggerall=power>=2000 && var(2)
	trigger1=statetype!=a && (ctrl || var(41))
	trigger2=(stateno=200 || stateno=220 || stateno=230) && !movecontact

;---
; ŁE
[state 0]
	type=changestate
	value=3400
	triggerall=command="hp1" || command="hp1_s"
	triggerall=var(51)<1
	triggerall=power>=1000 && var(2)
	trigger1=statetype!=a && (ctrl || var(41))

;---
; ϐg/o
[state 0]
	type=changestate
	value=3300
	triggerall=command="hp2" || command="hp2_s"
	triggerall=var(51)<1
	triggerall=power>=1000 && !var(2)
	trigger1=statetype!=a && (ctrl || var(41))

;---
; ^E(max2)
[state 0]
	type=changestate
	value=3200
	triggerall=command="hp3" || command="hp3_s"
	triggerall=var(51)<1
	triggerall=power>=2000 && !var(2)
	trigger1=statetype!=a && (ctrl || var(41))

;---
; ^g
[state 0]
	type=changestate
	value=3000
	triggerall=command="hp1" || command="hp1_s"
	triggerall=var(51)<1
	triggerall=power>=1000 && !numprojid(91000) && !var(2)
	trigger1=statetype!=a && (ctrl || var(41))

;---------
;---------
; 
[state 0]
	type=changestate
	value=ifelse(var(2),1110,1100)
	triggerall=command="sp5" || command="sp5_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

; g
[state 0]
	type=changestate
	value=1000
	triggerall=command="sp1" || command="sp1_s"
	triggerall=var(51)<1
	triggerall=!numprojid(91000)
	trigger1=statetype!=a && (ctrl || var(41))

; ܔMg
[state 0]
	type=changestate
	value=1010
	triggerall=command="sp2" || command="sp2_s"
	triggerall=var(51)<1
	triggerall=!numprojid(91000)
	trigger1=statetype!=a && (ctrl || var(41))

; a()g
[state 0]
	type=changestate
	value=1050
	triggerall=command="sp1" || command="sp1_s"
	triggerall=var(2) && var(51)<1
	triggerall=!numprojid(91000)
	trigger1=statetype=a && ctrl

; r
[state 0]
	type=changestate
	value=1200
	triggerall=command="sp4" || command="sp4_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

; 󒆗r
[state 0]
	type=changestate
	value=1210
	triggerall=command="sp4" || command="sp4_s"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
	trigger2=(stateno=600||stateno=620||stateno=630||stateno=650||stateno=720||stateno=750) && movecontact

; |R
[state 0]
	type=changestate
	value=1300
	triggerall=command="sp3_s" || command="sp3"
	triggerall=!var(2) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41)) && (stateno!=1500)

; nr
[state 0]
	type=changestate
	value=1400
	triggerall=command="holddown" && (command="a" || command="b")
	triggerall=var(2) && var(51)<1
	trigger1=statetype=a && ctrl
	trigger2=(stateno=[600,699]) && movecontact

; ܋r
[state 0]
	type=changestate
	value=1500
	triggerall=command="sp3" || command="sp3_s"
	triggerall=var(2) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41)) && (stateno!=1500)

; CM
[state 0]
	type=changestate
	value=1600
	triggerall=command="sp7_f1" || command="sp7_f2" || command="sp7_b1" || command="sp7_b2"
	triggerall=var(2) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

;---------
;---------
; 킵ړ
[state 0]
	type=changestate
	value=ifelse(command="holdback",115,110)
	triggerall=command="recovery"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl && (sysvar(4)!=[2,3])

; WvU
[state 0]
	type=changestate
	value=620
	trigger1=stateno=58 && (vel y>0)

; run
[state 0]
	type=changestate
	value=100
	trigger1=command="ff"
	trigger1=var(51)<1
	trigger1=statetype=s && ctrl && stateno!=100
; backstep
[state 0]
	type=changestate
	value=105
	trigger1=command="bb"
	trigger1=var(51)<1
	trigger1=statetype=s && ctrl && stateno!=105

;---
; 
[state 0]
	type=changestate
	value=800
	triggerall=(command="y" || command="b") && (command="holdfwd" || command="holdback")
	triggerall=statetype=s && ctrl && (stateno!=[100,101])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && (p2bodydist x=[-15,15])

;---
; 
[state 0]
	type=changestate
	value=195
	triggerall=command="start"
	triggerall=var(51)<1
	trigger1=statetype=s && ctrl

;---------
;---------
; i()
[state 0]
	type=changestate
	value=700
	triggerall=command="x" && command!="holddown" && command="holdfwd"
	triggerall=var(51)<1
	trigger1=statetype=s && ctrl
; i()LZp
[state 0]
	type=changestate
	value=701
	triggerall=command="x" && command!="holddown" && command="holdfwd"
	triggerall=var(51)<1
	trigger1=statetype!=a && var(41) && (stateno!=[700,710]) && (stateno!=1500)

; ӂ
[state 0]
	type=changestate
	value=710
	triggerall=command="y" && command!="holddown" && command="holdfwd"
	triggerall=!var(2) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41)) && (stateno!=710) && (stateno!=1500)

[state 0]
	type=changestate
	value=720
	triggerall=command="x" && command="holdup"
	triggerall=!var(2) && var(51)<1
	trigger1=statetype=a && ctrl

; r
[state 0]
	type=changestate
	value=750
	triggerall=command="a" && command="holdfwd"
	triggerall=!var(2) && var(51)<1
	trigger1=statetype=s && (ctrl || var(41)) && (stateno!=750) && (stateno!=1500)

;---------
;---------
[state 0]
	type=changestate
	value=200
	triggerall=command="x" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=230 || stateno=400 || stateno=430) && (time>4 || movecontact)
[state 0]
	type=changestate
	value=220
	triggerall=command="y" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype=s && ctrl
[state 0]
	type=changestate
	value=230
	triggerall=command="a" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=230 || stateno=400 || stateno=430) && (time>4 || movecontact)
[state 0]
	type=changestate
	value=250
	triggerall=command="b" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype=s && ctrl
;---
[state 0]
	type=changestate
	value=400
	triggerall=command="x" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=230 || stateno=400 || stateno=430) && (time>4 || movecontact)
[state 0]
	type=changestate
	value=420
	triggerall=command="y" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=400 || stateno=430) && movecontact
[state 0]
	type=changestate
	value=440
	triggerall=command="a" && command="holddown" && (command="holdfwd" || command="holdback")
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=230 || stateno=400 || stateno=430) && (time>4 || movecontact)
[state 0]
	type=changestate
	value=430
	triggerall=command="a" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=230 || stateno=400 || stateno=430) && (time>4 || movecontact)
[state 0]
	type=changestate
	value=450
	triggerall=command="b" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
;---
[state 0]
	type=changestate
	value=600
	triggerall=command="x"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
[state 0]
	type=changestate
	value=620
	triggerall=command="y"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
[state 0]
	type=changestate
	value=630
	triggerall=command="a"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
[state 0]
	type=changestate
	value=650
	triggerall=command="b"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
;---



;-----------------
; [ai]
;-----------------

; ai trigger
[state 0]
	type=varset
	trigger1=1
	var(50)=(var(51)>0 && sysfvar(4)<1 && roundstate=2 && p2statetype!=l && numenemy)

;---
;---
;   p200 k230  p220 k250
[state 0]
	type=changestate
	value=ifelse(random<350, ifelse(random<500,230,200), ifelse(random<350,220,250))
	triggerall=var(50) && statetype!=a && ctrl
	;---
	trigger1=sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && playerid(floor(sysfvar(0))),var(18)%10=1
	;---
	trigger2=(p2bodydist x=[0,32]) && p2statetype!=a && random<360
;---
;   p400 k430  p420 k450
[state 0]
	type=changestate
	value=ifelse(random<500, ifelse(random<600,430,400), ifelse(random<250,420,450))
	triggerall=var(50) && statetype!=a && ctrl
	;---
	trigger1=sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(18)/10)%10=1
	;---
	trigger2=(p2bodydist x=[0,42]) && p2movetype!=a && p2statetype!=a && random<360

;   p400 k430
[state 0]
	type=changestate
	value=ifelse(random<650,430,400)
	triggerall=var(50) && (p2bodydist x=[-38,38]) && random<250
	trigger1=(stateno=200||stateno=230||stateno=400||stateno=430) && (time>4 || movecontact)

;  k
[state 0]
	type=changestate
	value=440
	triggerall=var(50) && statetype!=a
	trigger1=ctrl && (p2bodydist x=[35,75]) && p2statetype!=a && random<150
	trigger2=(stateno=200||stateno=230||stateno=400||stateno=430) && var(41) && (p2bodydist x=[30,75]) && random<450

;  k
[state 0]
	type=changestate
	value=450
	triggerall=var(50) && statetype!=a && ctrl
	trigger1=(p2bodydist x=[10,60]) && p2movetype!=a && p2statetype=s && random<125
;---
;   p600 k630  p620 k650
[state 0]
	type=changestate
	value=ifelse(random<200, ifelse(random<500,600,630), ifelse(random<350,620,650) )
	triggerall=var(50) && statetype=a && ctrl
	;---
	trigger1=sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(18)/100)%10=1
	;---
;op;	trigger2=(pos y>-65) && (vel y>0) && (p2bodydist x=[-35,85]) && random<800
;---
;---
; Far_Retrain ; 
[state 0]
	type=changestate
	value=ifelse(random<450,230,200) +(random<600)*200
	triggerall=var(50) && statetype!=a && ctrl
	trigger1=(sysfvar(0)>0) && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && playerid(floor(sysfvar(0))),var(18)%10=2
;---
;--- AU
; i 701
[state 0]
	type=changestate
	value=701
	triggerall=var(50) && statetype!=a && var(41) && (stateno!=[700,710]) && (stateno!=1500) && p2statetype!=a
	trigger1=(stateno=220 && anim=225) && (p2bodydist x=[-32,32]) && random<200
	trigger2=(p2bodydist x=[-32,32]) && random<25

;  Op710
[state 0]
	type=changestate
	value=710
	triggerall=var(50) && !var(2) && statetype!=a && (stateno!=710) && (stateno!=1500)
	trigger1=ctrl && (p2bodydist x=[30,65]) && (p2statetype!=a) && (gametime%600<200) && random<250
	trigger2=(stateno=701) && var(41) && (p2bodydist x=[-15,60]) && random<450

; r 720
[state 0]
	type=changestate
	value=720
	triggerall=var(50) && !var(2) && statetype!=a && (stateno!=720) && (stateno!=1500)
	trigger1=ctrl && p2statetype=c && p2movetype!=a && (p2bodydist x=[30,56]) && random<80
	trigger2=(stateno=701||stateno=710) && var(41) && random<100
	trigger3=var(41) && (p2bodydist x=[0,32]) && random<26

;--- Special
;--- ΋}
[state 0] ; ΋ - 
	type=changestate
	value=ifelse(var(2),1110,1100)
	triggerall=var(50) && statetype!=a
	;---
	trigger1=ctrl && sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(18)/1000)%10=1
	;---
	trigger2=ctrl && p2statetype=a && (p2bodydist x=[-30,30]) && (p2bodydist y=[-80,0]) && random<500
	trigger3=(stateno=8200) && (animtime=0) && movehit && random<500
	trigger4=var(41) && movehit && (p2bodydist x=[-36,36]) && random<80

; ѓ
[state 0]
	type=changestate
	value=1000
	triggerall=var(50) && statetype!=a && !numprojid(91000) && (gametime%600>300)
	trigger1=ctrl && (p2bodydist x>150) && p2statetype!=a && random<200
	trigger2=var(41) && random<ifelse(moveguarded,150,75)
	trigger3=(stateno=701||stateno=710) && var(41) && moveguarded && random<350
	trigger4=(stateno=420||stateno=440) && var(41) && random<500

; r
[state 0]
	type=changestate
	value=1200
	triggerall=var(50) && statetype!=a && p2statetype!=c && random<500
	trigger1=ctrl && (p2bodydist x=[50,90]) && p2movetype=i && random<60
	trigger2=(stateno=701||stateno=710) && var(41) && random<250

; 󒆗r
[state 0]
	type=changestate
	value=1210
	triggerall=var(50) && statetype=a && random<80 && (gametime%400=[100,300])
	trigger1=ctrl && (pos y<-75)
	trigger2=(stateno=600||stateno=620||stateno=630||stateno=650||stateno=720||stateno=750) && movecontact
;---
;--- 
; ^g 3000
[state 0]
	type=changestate
	value=3000
	triggerall=var(50) && power>=1000 && !var(2) && statetype!=a && !numprojid(91000)
	trigger1=ctrl && (p2bodydist x>200) && random<80
	trigger2=var(41) && random<50
	trigger3=(stateno=220||stateno=420||stateno=701||stateno=710) && var(41) && (p2bodydist x=[-15,60]) && random<200

; ^ 3200
[state 0]
	type=changestate
	value=3200
	triggerall=var(50) && power>=2000 && !var(2) && statetype!=a
	trigger1=ctrl && (p2bodydist x<75) && (p2movetype=a || enemy,numprojid(91000)) && random<80
	trigger2=(stateno=701||stateno=710) && var(41) && movehit && random<150
	trigger3=var(41) && movehit && random<20
;---
;---
; 
[state 0]
	type=changestate
	value=800
	triggerall=var(50) && statetype!=a && ctrl && (stateno!=[100,101]) && (p2bodydist x=[-15,15])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && random<var(51)*98 && random<(matchno+roundno+1)*88
; i
[state 0]
	type=changestate
	value=700
	triggerall=var(50) && statetype!=a && ctrl && (stateno!=[700,710])
	trigger1=(p2bodydist x=[10,32]) && p2statetype=c && p2movetype!=a && random<250 && random>life*2
;---------
;=========
; AI switch
[state 0]
	type=varset
	trigger1=playeridexist(floor(sysfvar(0)))
	trigger1=playerid(floor(sysfvar(0))),stateno=90900 && var(51)!=playerid(floor(sysfvar(0))),var(51)
	var(51)=playerid(floor(sysfvar(0))),var(51)
;=========
;[EOF]
