;#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="max2"
	command=~D,B,F,x
	time=32
[command]
	name="max2"
	command=~D,B,F,y
	time=32
[command]
	name="max2"
	command=~D,B,x+y
[command]
	name="max2"
	command=~D,B,y+z
;------
[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="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="sp3"
	command=~F,D,F,x
	time=20
[command]
	name="sp3_s"
	command=~F,D,F,y
	time=20
[command]
	name="sp3"
	command=~F,D,DF,x
	time=20
[command]
	name="sp3_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="sp4"
	command=~D,F,a
[command]
	name="sp4_s"
	command=~D,F,b
;------
[command]
	name="sp5"
	command=~D,B,a
[command]
	name="sp5_s"
	command=~D,B,b
;------
[command]
	name="sp6"
	command=~D,D,a
[command]
	name="sp6_s"
	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]
;---------------



;---
;--- get_hit_voice ; ꉹ
[state 0]
	type=playsnd
	trigger1=stateno=5000 || stateno=5010 || stateno=5020 || stateno=5070 || stateno=5100
	trigger1=time=1 && alive && random<500
	value=5000,(random%3)
	channel=0
;---
[state 0] ; blocking/just defence
	type=playsnd
	trigger1=stateno=195500 && time=1
	value=0,(random%4)
	channel=0



;---
;---
; combo-cancel flag
[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)) || (stateno=250 && (anim=255))
	trigger2=stateno=400 || stateno=420 || stateno=430
	var(41)=1



;---------------
; super / hyper
;---------------

; (max2)
; ra-sho-mon / super-nage
; 
[state 0]
	type=changestate
	value=3400
	triggerall=command="hp3" || command="hp3_s"
	triggerall=var(51)<1
	triggerall=power>=2000
	trigger1=statetype!=a && (ctrl || var(41))

; (max2)
; deadly / ranbu
; fbh[Cu
[state 0]
	type=changestate
	value=3300
	triggerall=command="max2"
	triggerall=var(51)<1
	triggerall=power>=2000
	trigger1=statetype!=a && (ctrl || var(41))

;---
; super-atemi
; |g
[state 0]
	type=changestate
	value=3200
	triggerall=var(51)<1
	triggerall=command="hp4" || command="hp4_s"
	triggerall=power>=1000
	trigger1=statetype!=a && (ctrl || var(41))

; razing storm
; CWOXg[
[state 0]
	type=changestate
	value=3000
	triggerall=command="hp1" || command="hp1_s"
	triggerall=var(51)<1
	triggerall=power>=1000
	trigger1=statetype!=a && (ctrl || var(41))


;---------------
; special
;---------------

; ja-ei
; ׉e
[state 0]
	type=changestate
	value=1700
	triggerall=command="sp4_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

; ex-reppu
; ex-󕗌
[state 0]
	type=changestate
	value=1600
	triggerall=command="sp4"
	triggerall=var(51)<1
	triggerall=!numprojid(91000)
	trigger1=statetype!=a && (ctrl || var(41))

; rai-mei-go / down-nage
; j (E)
[state 0]
	type=changestate
	value=1500
	triggerall=command="sp6" || command="sp6_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl

; ex-hisyo
; ex-ē֎a
[state 0]
	type=changestate
	value=1300
	triggerall=command="sp3" || command="sp3_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

; atemi-up
; Đg (i)
[state 0]
	type=changestate
	value=1200
	triggerall=command="sp2"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))
; atemi-mid
; Đg (i)
[state 0]
	type=changestate
	value=1210
	triggerall=command="sp5"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))
; atemi-low
; Đg (i)
[state 0]
	type=changestate
	value=1220
	triggerall=command="sp5_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

; shippu / air-hado
; 
[state 0]
	type=changestate
	value=1100
	triggerall=command="sp2" || command="sp2_s"
	triggerall=var(51)<1
	triggerall=!numprojid(91000)
	trigger1=statetype=a && ctrl
	trigger2=(stateno=[600,699]) && movecontact

; reppu / hado
; 󕗌
[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))


;---------------
; normal
;---------------


;;--- leap
;[state 0]
;	type=changestate
;	value=48
;	triggerall=(sysvar(4)=0) && roundstate=2
;	triggerall=statetype!=a && (ctrl || var(41))
;	triggerall=(sysfvar(0)>id) && playeridexist(floor(sysfvar(0)))
;	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)=2)
;	trigger1=(command="x" && command="a") && (command!="holdup") && var(51)<1
;	trigger2=var(51)>0 && sysfvar(4)<1 && (p2bodydist x<82) && random<80

;;--- guard-break
;[state 0]
;	type=changestate
;	value=8210
;	triggerall=(sysvar(4)=0) && power>=1000 && roundstate=2
;	triggerall=statetype!=a && (ctrl || var(41))
;	triggerall=(sysfvar(0)>id) && playeridexist(floor(sysfvar(0)))
;	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)=2)
;	trigger1=(command="y" && command="b") && var(51)<1
;	trigger2=var(51)>0 && sysfvar(4)<1 && (p2bodydist x<60) && random<85

;;--- guard-cancel / zero-counter
;[state 0]
;	type=changestate
;	value=8200
;	triggerall=(sysvar(4)=0) && power>=1000 && roundstate=2
;	triggerall=(stateno=150 || stateno=152) && time>1 && alive
;	trigger1=(command="ab") && var(51)<1
;	trigger2=var(51)>0 && sysfvar(4)<1 && (p2bodydist x<82)
;	trigger2=(sysfvar(0)>id) && playeridexist(floor(sysfvar(0)))
;	trigger2=(playerid(floor(sysfvar(0))),var(0)=90900) && random<(roundno+matchno+var(51)+var(51)+var(51))*28
;	trigger2=(random>life*3) || (playerid(floor(sysfvar(0))),var(36)>40) ;;{0,50}

;;--- guard-cancel-escape
;[state 0]
;	type=changestate
;	value=ifelse(command="holdback",115,110)
;	triggerall=(sysvar(4)=0) && power>=500 && roundstate=2
;	triggerall=(stateno=150 || stateno=152) && time>1 && alive
;	trigger1=(command="recovery") && var(51)<1
;	trigger2=var(51)>0 && sysfvar(4)<1 && random<50
;[state 0]
;	type=poweradd
;	triggerall=(sysvar(4)=0)
;	trigger1=(stateno=110 || stateno=115) && time=1
;	trigger1=(prevstateno=150 || prevstateno=152)
;	value=-500

;--- roll
[state 0]
	type=changestate
	value=ifelse(command="holdback",115,110)
	triggerall=command="recovery"
	triggerall=statetype!=a && ctrl
	triggerall=var(51)<1 && !var(4)
	trigger1=(sysfvar(0)>id) && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)!=[2,3])
	trigger2=(sysfvar(0)<=0)

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

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

;---------------
; throw
;  (P:^󓊂 / K:Ew蓊)
[state 0]
	type=changestate
	value=800
	triggerall=(command="y" || command="b") && (command="holdfwd" || command="holdback")
	trigger1=statetype=s && ctrl && (stateno!=[100,101])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && (p2bodydist x=[-12,12])


;---------------
; basic
;---------------

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

;---
[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=c && ctrl

[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=c && 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]
;---------------

; roll
[state 0]
	type=changestate
	value=110
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && prevstateno!=110
	trigger1=(sysfvar(0)>0) && playeridexist(floor(sysfvar(0)))
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)!=[2,3])
	trigger1=(p2bodydist x=[-40,40]) && p2movetype=a && random<250

;---
[state 0]
	type=changestate
	value=ifelse(random<500,200,230) +(random<650)*200
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l && numenemy
	trigger1=(p2bodydist x=[-30,30]) && p2movetype!=a && p2statetype!=a && random<250
	trigger2=(stateno=[100,101]) && (p2bodydist x=[-25,25]) && enemynear,numprojid(91000)=0 && p2statetype!=a && random<450
	trigger3=(prevstateno=[600,699]) && (p2bodydist x=[-35,35]) && p2statetype!=a && random<650

[state 0]
	type=changestate
	value=ifelse(random<650,220,250)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l && numenemy
	trigger1=(p2bodydist x=[-30,30]) && p2movetype!=a && p2statetype!=a && random<300
	trigger2=(stateno=[100,101]) && (p2bodydist x=[-26,26]) && enemynear,numprojid(91000)=0 && p2statetype!=a && random<500
	trigger3=(prevstateno=[600,699]) && (p2bodydist x=[-36,36]) && p2statetype!=a && random<800

[state 0]
	type=changestate
	value=ifelse(random<500,430,450)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l
	trigger1=(p2bodydist x=[-40,40]) && p2movetype!=a && p2statetype=s && random<150

[state 0]
	type=changestate
	value=ifelse(random<350,620,650)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && ctrl && p2statetype!=l
	trigger1=(p2bodydist x=[-42,42]) && (p2bodydist y=[-60,60]) && random<800

;----
; Far_Retrain ; 
[state 0]
	type=changestate
	value=ifelse(random<500,200,230) +(random<550)*200
	trigger1=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger1=playerid(floor(sysfvar(0))),var(0)=90900 && playerid(floor(sysfvar(0))),var(18)%10=2

;----
; ex-hisyo
[state 0]
	type=changestate
	value=1300
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l
	trigger1=(prevstateno=[100,105]) && (p2bodydist x=[10,60]) && random<450
	trigger2=stateno=0 && prevstateno=5120 && p2movetype=a && (p2bodydist x=[10,50]) && random<550
	trigger3=(stateno=[100,101]) && p2movetype=a && (p2bodydist x=[-20,50]) && random<300
	trigger4=p2statetype=a && (p2bodydist x=[-25,50]) && (p2bodydist y=[-60,-20]) && prevstateno!=1300 && random<400
	trigger5=prevstateno=1305 && (p2bodydist x=[-50,50]) && (p2bodydist y>=-150) && random<360

; hado
[state 0]
	type=changestate
	value=1000
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && !numprojid(91000)
	trigger1=(p2bodydist x>=150) && p2statetype!=a && (p2stateno!=[3000,4999]) && random<380

; shippu (air-hado)
[state 0]
	type=changestate
	value=1100
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && numenemy && !numprojid(91000)
	trigger1=(stateno=[600,699]) && movecontact && random<420
	trigger2=(ctrl || stateno=120 || stateno=142) && (pos y<-20) && random<350

; random (jaei: 1700 / ex-reppu: 1600 / hisyo: 1300)
[state 0]
	type=changestate
	value=ifelse(random<350,1700,ifelse(random<500,1600,1300))
	trigger1=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && var(41) && random<200

; hiroi-nage
[state 0]
	type=changestate
	value=1500
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype=l
	trigger1=(p2stateno=[5110,5111]) && (p2bodydist x=[-40,40]) && random<400

;---
; super-atemi
[state 0]
	type=changestate
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=1000 && statetype!=a && ctrl && numenemy
	trigger1=p2movetype=a && (p2bodydist x=[-60,60]) && (enemynear,hitdefattr!=sca,nt,st,ht) && (enemynear,numprojid(91000)=0) && random<600
	value=3200

; atemi
[state 0]
	type=changestate
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && numenemy
	trigger1=p2movetype=a && (p2bodydist x=[-50,50]) && (enemynear,hitdefattr!=sca,nt,st,ht) && (enemynear,numprojid(91000)=0) && random<760
	value=ifelse((enemynear,statetype!=a)&&(enemynear,hitdefattr=c,aa), 1220, ifelse((enemynear,statetype=a)&&(enemynear,hitdefattr=a,aa), 1200, 1210))

;---
; upper (storm)
[state 0]
	type=changestate
	value=3000
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=1000 && statetype!=a && ctrl && p2statetype!=l
	trigger1=p2movetype=a && (p2bodydist x=[-60,60]) && (p2bodydist y=[-60,40]) && random<350
	trigger2=p2statetype=a && (p2bodydist x=[-40,40]) && (p2bodydist y=[-130,40]) && random<450
	trigger3=prevstateno=1305 && (p2bodydist x=[-40,40]) && (p2bodydist y=[-130,40]) && random<750
	trigger4=prevstateno=5120 && p2movetype=a && (p2bodydist x=[-60,60]) && random<400

; deadly
[state 0]
	type=changestate
	value=3300
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=2000 && statetype!=a && numenemy
	trigger1=ctrl && (p2bodydist x=[-120,120]) && (((enemynear,hitdefattr=c,na,sa,ha) && random<250) || (enemynear,stateno=190116)) ;;dizzy
	trigger2=var(41) && movehit && (stateno=220||stateno=250||stateno=420) && (random>life || random<250)
;---
; super-throw
[state 0]
	type=changestate
	value=3400
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && power>=2000 && p2statetype!=a && p2statetype!=l
	trigger1=ctrl && p2movetype!=h && (p2bodydist x=[-23,23]) && random<500
	trigger2=var(41) && (p2bodydist x=[-20,20]) && random<200
; normal-throw
[state 0]
	type=changestate
	value=800
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && (stateno!=[100,101])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && (p2bodydist x=[-12,12]) && random<500


;---------------
;---------------
;=========
; AI switch
[state 0]
	type=varset
	trigger1=(sysfvar(0)>0) && 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)
;---
[state 0]
	type=varset
	trigger1=(sysvar(4)=0) && (matchno=1)
	var(51)=ailevel

;=========
;[EOF]
