;#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="syun"
	command=~x,x,F,a,y
	time=36
[command]
	name="syun"
	command=~x,x,/$F,a,y
	time=36
;------
[command]
	name="max2"
	command=~D,F,D,F,a
	time=32
[command]
	name="max2"
	command=~D,F,D,F,b
	time=32
[command]
	name="max2"
	command=~D,F,a+b
[command]
	name="max2"
	command=~D,F,b+c
;------
[command]
	name="hp1_s"
	command=~D,F,D,F,y
	time=32
[command]
	name="hp1"
	command=~D,F,D,F,x
	time=32
[command]
	name="hp1_s"
	command=~D,F,y+z
[command]
	name="hp1"
	command=~D,F,x+y
;------
[command]
	name="hp2_s"
	command=~D,B,D,B,b
	time=32
[command]
	name="hp2"
	command=~D,B,D,B,a
	time=32
[command]
	name="hp2_s"
	command=~D,B,b+c
[command]
	name="hp2"
	command=~D,B,a+b
;------
[command]
	name="hp3_s"
	command=~D,B,D,B,y
	time=32
[command]
	name="hp3"
	command=~D,B,D,B,x
	time=32
[command]
	name="hp3_s"
	command=~D,B,y+z
[command]
	name="hp3"
	command=~D,B,x+y


;-----------------
[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,B,a
[command]
	name="sp4_s"
	command=~D,B,b
;------
[command]
	name="sp5"
	command=~D,F,a
[command]
	name="sp5_s"
	command=~D,F,b

;------
[command]
	name="asura-f1"
	command=~D,D,x
[command]
	name="asura-f2"
	command=~D,D,y
[command]
	name="asura-b1"
	command=~D,D,a
[command]
	name="asura-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]
;--------------------



;---
; sp-partner
;---
; double_super_ha_do
[state 0]
	type=selfstate
	triggerall=stateno=190192 && sysfvar(4)=1 ;;is-partner?
	triggerall=sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	triggerall=playerid(floor(sysfvar(0))),var(0)=90900 && playerid(floor(sysfvar(0))),var(49)=id
	triggerall=sysvar(0)>0 && playeridexist(sysvar(0))
	triggerall=playerid(sysvar(0)),sysfvar(4)<1 ;;is-main-player?
	;---
	trigger1=(playerid(sysvar(0)),name="ryu") || (playerid(sysvar(0)),name="evilryu")
	trigger1=(playerid(sysvar(0)),authorname="varo_hades")
	trigger1=(playerid(sysvar(0)),stateno=1900)
;;op;	trigger1=playerid(floor(sysfvar(0))),cond(0,0,var(53-sysvar(0)+var(49)):=1000)
	;---
	value=1900
;---
[state 0]
	type=changestate
	value=1900
	triggerall=command="a" && command="y" && command="holddown"
	triggerall=var(51)<1
	triggerall=power>=1000 && !numprojid(91000)
	triggerall=statetype!=a && (ctrl || var(41))
	;---
	triggerall=sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && playeridexist(playerid(floor(sysfvar(0))),var(49))
	triggerall=(playerid(playerid(floor(sysfvar(0))),var(49)),stateno=190192)
	trigger1=(playerid(playerid(floor(sysfvar(0))),var(49)),name="ryu") || (playerid(playerid(floor(sysfvar(0))),var(49)),name="evilryu")
	trigger1=(playerid(playerid(floor(sysfvar(0))),var(49)),authorname="varo_hades")



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



;---
;---
; combo
[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=230)) || ((stateno=250) && (anim=255))
	trigger2=stateno=400 || stateno=420 || stateno=430 || stateno=440 || (stateno=450 && moveguarded)
	trigger3=stateno=301 && (var(51)<1 || (var(51)>0 && (animelem=5,>0)))
	trigger4=stateno=310 && (var(51)<1 || (var(51)>0 && (animelem=7,>0)))
	trigger5=(stateno=1500) && (hitpausetime<1)
	var(41)=1



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

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

; mosogi (max2)
; S
[state 0]
	type=changestate
	value=3600
	triggerall=command="max2"
	triggerall=var(51)<1
	triggerall=power>=2000
	trigger1=statetype!=a && (ctrl || var(41))

; ra_sen_kyaku (max2)
; r
[state 0]
	type=changestate
	value=3700
	triggerall=command="hp2_s" || command="hp2"
	triggerall=var(51)<1
	triggerall=power>=2000
	trigger1=statetype!=a && (ctrl || var(41))

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

;; shin_ku_tatsu_maki
;; ^󗳊
;[state 0]
;	type=changestate
;	value=3200
;	triggerall=command="hp2_s" || command="hp2"
;	triggerall=var(51)<1
;	triggerall=power>=1000
;	trigger1=statetype!=a && (ctrl || var(41))

; shin_ku_ha_dou
; ^g
; messtsu_ha_dou
; ŎEg
[state 0]
	type=changestate
	value=3000
	triggerall=command="hp3_s" || command="hp3"
	triggerall=var(51)<1
	triggerall=power>=1000 && !numprojid(91000)
	trigger1=statetype!=a && (ctrl || var(41))

; messtsu_gou_syo_ryu
; ŎE
[state 0]
	type=changestate
	value=3100
	triggerall=command="hp1_s" || command="hp1"
	triggerall=var(51)<1
	triggerall=power>=1000 && !numprojid(91000)
	trigger1=statetype!=a && (ctrl || var(41))


;--------------------
; special
;--------------------
; syo_ryu
; 
[state 0]
	type=changestate
	value=1100
	triggerall=command="sp3_s" || command="sp3"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

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

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

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

; air_tatsu_maki
; 󒆗
[state 0]
	type=changestate
	value=1210
	triggerall=command="sp4_s" || command="sp4"
	triggerall=var(51)<1
	trigger1=statetype=a
	trigger1=ctrl || (movecontact && (stateno=320 || stateno=330 || (stateno=[600,699])))

;; soku_tou_keri
;; |R/R
;[state 0]
;	type=changestate
;	value=1300
;	triggerall=command="sp5_s" || command="sp5"
;	triggerall=var(51)<1
;	trigger1=statetype!=a && (ctrl || var(41))

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

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

; asura_sen_ku
; CM
[state 0]
	type=changestate
	value=1600
	triggerall=command="asura-f1" || command="asura-f2" || command="asura-b1" || command="asura-b2"
	triggerall=var(51)<1
	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

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

;--------------------
; leap-attack
[state 0]
	type=changestate
	value=620
	trigger1=stateno=58 && vel y>1

;--------------------
; throw ; 
[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=[-20,20])


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

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

;---
; sa_kotsu_wari
; 
[state 0]
	type=changestate
	value=300
	triggerall=command="x" && command="holdfwd"
	triggerall=var(51)<1
	trigger1=statetype=s && ctrl
; for_cancel
; Ap
[state 0]
	type=changestate
	value=301
	triggerall=command="x" && command="holdfwd"
	triggerall=var(51)<1
	trigger1=statetype!=a && var(41) && (stateno!=[300,301]) && (stateno!=310) && (stateno!=1500)

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

; sen_pu_kyaku
; r
[state 0]
	type=changestate
	value=330 ;; 320
	triggerall=command="a" && command="holdfwd"
	triggerall=var(51)<1
	trigger1=statetype=s && (ctrl || var(41)) && (stateno!=320) && (stateno!=330) && (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=c && 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=c && ctrl
;;---
;[state 0]
;	type=changestate
;	value=605
;	triggerall=command="x" && command="holdup"
;	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]
;--------------------


; jump small/mid_fwd
[state 0]
	type=changestate
	value=142021+(p2bodydist x>88)*10
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl
	triggerall=(sysfvar(0)>0) && playeridexist(floor(sysfvar(0)))
	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)!=2)
	trigger1=(p2bodydist x<128) && p2statetype=c && random<368
; leap
[state 0]
	type=changestate
	value=48
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl
	triggerall=(sysfvar(0)>0) && playeridexist(floor(sysfvar(0)))
	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)=2)
	trigger1=(p2bodydist x<88) && p2statetype=c && random<368
; roll
[state 0]
	type=changestate
	value=110
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && stateno!=110 && (prevstateno!=110)
	triggerall=(sysfvar(0)>0) && playeridexist(floor(sysfvar(0)))
	triggerall=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(22)!=[2,3])
	trigger1=(p2bodydist x<40) && p2movetype=a && random<400
;---
;---
; standing_attack
; SLP:200 / SLK:230 / SHP:220 / SHK:350
[state 0] ; stand attack***
	type=changestate
	value=ifelse(random<300, ifelse(random<850,200,230), ifelse(random<720,220,250))
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l && p2movetype!=a && numenemy
	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]) && (enemynear,statetype=s) && random<400
	trigger3=(stateno=[100,101]) && (p2bodydist x=[-26,26]) && (enemynear,numprojid(91000)=0) && random<400
	trigger4=(stateno=52) && (animtime=0) && (prevstateno=[600,699]) && (p2bodydist x=[0,42]) && random<650
;---
; crouching_attack
; CLP:400 / CLK:430 / CMK:440 / CHP:420 / CHK:450
[state 0]
	type=changestate
	value=ifelse(random<500, ifelse(random<600,430,400), ifelse(random<500,420,450) )
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l && p2movetype!=a && numenemy
	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<42) && (enemynear,movetype!=a) && (enemynear,statetype=s) && random<180
	trigger3=(stateno=[100,101]) && (p2bodydist x=[-26,26]) && (enemynear,numproj=0) && (enemynear,statetype!=a) && random<220
	trigger4=(prevstateno=52) && (p2bodydist x<42) && random<200
;---
; CLP / CLK
[state 0]
	type=changestate
	value=ifelse(random<650,430,400)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && p2statetype!=l && p2statetype!=a && p2movetype!=a
	trigger1=(stateno=400 || stateno=430) && movecontact && (p2bodydist x=[-32,32]) && random<350
	trigger2=ctrl && (p2bodydist x=[-32,32]) && p2movetype!=a && random<200
	trigger3=stateno=52 && (animtime=0) && (prevstateno=[600,699]) && (p2bodydist x=[-36,36]) && random<300

; CHP
[state 0]
	type=changestate
	value=420
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && p2statetype!=l && p2movetype!=a && numenemy
	trigger1=(stateno=400 || stateno=430) && movecontact && (p2bodydist x=[-16,16]) && random<250
	trigger2=ctrl && p2statetype=a && (p2bodydist x=[-30,30]) && (enemynear,vel y>0) && (enemynear,vel x>0) && random<150
	trigger3=stateno=52 && (animtime=0 || ctrl) && (prevstateno=[600,699]) && (p2bodydist x=[-32,32]) && p2statetype!=a && random<600

; CMK ; Ek
[state 0] ; crouching attack
	type=changestate
	value=440
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && p2statetype!=l
	trigger1=ctrl && (p2bodydist x=[35,75]) && p2statetype!=a && random<150 && (gametime%850=[350,650])
	trigger2=(stateno=200||stateno=205||stateno=400||stateno=403) && p2statetype!=a && movecontact && random<780

; CHK ; Ek
[state 0]
	type=changestate
	value=450
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && p2statetype!=l
	trigger1=(p2bodydist x=[5,55]) && p2movetype!=a && p2statetype!=a && random<125

;---
;---
; air_attack ; 󒆍U
; jump_attack
[state 0]
	type=changestate
	value=ifelse(random<200, ifelse(random<500,600,630), ifelse(random<500,620,650) )
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && ctrl && p2statetype!=l && p2movetype!=a
	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)

; jump_hard_attack
[state 0]
	type=changestate
	value=ifelse(random<200 && (p2bodydist x<35), 620, 650)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && ctrl && p2statetype!=l
	trigger1=(p2bodydist x=[-60,60]) && (p2bodydist y=[-35,60]) && random<760
	trigger2=(p2bodydist x=[-80,80]) && (pos y>-80) && (vel y>0) && random<820

;---
; Far_Retrain 
; 
[state 0]
	type=changestate
	value=ifelse(random<450,ifelse(random<500,230,200),ifelse(random<550,430,400))
	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)

;---
; wari - cancel
; AU
[state 0]
	type=changestate
	value=301
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && var(41) && (stateno!=[300,301]) && (stateno!=1500) && statetype!=a && p2statetype!=l && p2statetype!=a
	trigger1=(stateno=220||stateno=250) && (p2bodydist x=[0,50]) && random<500
	trigger2=(stateno=200) && (p2bodydist x=[16,40]) && random<150
	trigger3=(p2bodydist x=[30,45]) && random<10


;--------
;-------- special
; syo_ryu
[state 0]
	type=changestate
	value=1100
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && p2statetype!=l
	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=var(41) && (p2bodydist x=[-20,20]) && random<ifelse(movehit,620,230)
	trigger3=ctrl && prevstateno=5120 && p2movetype=a && (p2bodydist x=[-26,26]) && random<550
	trigger4=(stateno=[100,101]) && (p2movetype=a || p2statetype=a) && (p2bodydist x<25) && random<720
	trigger5=stateno=52 && (animtime=0 || ctrl) && (prevstateno=1205 || prevstateno=1210) && numtarget && p2statetype=a && (p2bodydist x=[-60,60]) && (p2bodydist y>-82) && random<900
	trigger6=ctrl && (p2bodydist x=[-30,30]) && (prevstateno=52||prevstateno=100||prevstateno=105) && random<760
	trigger7=ctrl && (p2bodydist x=[-32,50]) && (p2bodydist y=[-70,-30]) && p2statetype=a && random<820
	trigger8=ctrl && (p2bodydist x=[-38,38]) && (p2bodydist y>-85) && p2movetype=a && random<820

; ha_dou / fire_ha_dou
[state 0]
	type=changestate
	value=ifelse(random<700,1000,1010)
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && !numprojid(91000)
	trigger1=ctrl && (p2bodydist x>150) && p2statetype!=a && random<606 && (gametime%200>100)
	trigger2=var(41) && moveguarded && random<250
	trigger3=(stateno=301 || stateno=440 || stateno=450) && var(41) && moveguarded && random<750
	trigger4=(stateno=250 || stateno=420) && var(41) && moveguarded && (p2bodydist x>30)

; tatsu_maki
[state 0]
	type=changestate
	value=1200
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a
	triggerall=p2statetype!=l && p2statetype!=c && (p2stateno!=[5050,5110]) && numenemy
	trigger1=ctrl && (p2bodydist x=[40,60]) && (enemynear,hitdefattr!=sca,sa,ha,sp,hp) && random<200
	trigger2=(stateno=301 || stateno=1500) && var(41) && random<ifelse(movehit,750,100)
	trigger3=var(41) && random<ifelse(movehit,300,80)

; air_tatsu_maki
[state 0]
	type=changestate
	value=1210
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && p2statetype!=l
	trigger1=(stateno=[600,699]) && movecontact && (vel x>=0) && (p2bodydist x=[30,60]) && random<700

; ku_jin_kyaku (down + kick)
[state 0]
	type=changestate
	value=1400
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype=a && p2statetype!=l
	trigger1=(stateno=[600,699]) && movecontact && (vel x>0) && (vel y>=0) && random<850
	trigger2=ctrl && (vel y>=0) && (p2bodydist x=[30,80]) && random<800

; asura_sen_ku
; AVM
[state 0]
	type=changestate
	value=1600
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && movetype!=h && stateno!=1600
	trigger1=(ctrl || (var(41) && moveguarded)) && (backedgebodydist<38) && (gametime%200>100) && random<200

; ryu_sou_kyaku
; ܋r
[state 0]
	type=changestate
	value=1500
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && p2statetype!=l && (stateno!=1500)
	trigger1=ctrl && (p2bodydist x=[40,95]) && (gametime%180>125) && random<60
	trigger2=stateno=301 && var(41) && random<900
	trigger3=var(41) && random<100

;-------- super
; max2 - syun_goku_satsu
[state 0]
	type=changestate
	value=3500
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=2000 && statetype!=a && p2statetype!=a && numenemy
	trigger1=var(41) && (p2bodydist x<40) && (enemynear,backedgebodydist<10) && random<100
	trigger2=ctrl && p2statetype=a && (p2bodydist x=[-42,42]) && (p2bodydist y>=-20) && random<150
	trigger3=ctrl && (enemynear,stateno=190116) ;;dizzy

; max2 - misogi
[state 0]
	type=changestate
	value=3600
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=2000 && statetype!=a && ctrl && numenemy
	trigger1=stateno=52 && (animtime=0 || ctrl) && (prevstateno=1205 || prevstateno=1210) && p2statetype=a && random<250
	trigger2=p2statetype=a && (p2bodydist x=[0,30]) && (p2bodydist y>=-80) && random<250
	trigger3=(((p2movetype=a && backedgebodydist<10) || (enemynear,hitdefattr=sca,np,sp,hp)) && random<200) || (p2stateno=190116) ;;dizzy

; max2 - ra_sen_kyaku
[state 0]
	type=changestate
	value=3700
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=2000 && statetype!=a
	trigger1=ctrl && p2statetype=a && (p2bodydist x=[-33,33]) && (p2dist y>25) && random<260
	trigger2=stateno=52 && (animtime=0 || ctrl) && (prevstateno=1205 || prevstateno=1210) && p2statetype=a && (p2bodydist x=[-40,40]) && (p2bodydist y=[-80,0]) && random<280
	trigger3=var(41) && movehit && (p2bodydist x=[-26,26]) && random<400 && life<750

; super_syo_ryu
[state 0]
	type=changestate
	value=3100
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=1000 && statetype!=a
	trigger1=ctrl && p2statetype=a && (p2bodydist x=[-30,30]) && (p2bodydist y=[-80,0]) && random<650
	trigger2=stateno=52 && (animtime=0 || ctrl) && (prevstateno=1205 || prevstateno=1210) && numtarget && (p2bodydist x=[-45,50]) && (p2bodydist y=[-80,-20]) && random<720
	trigger3=var(41) && movehit && random<750

; super_hadou
[state 0]
	type=changestate
	value=3000
	triggerall=var(51)>0 && sysfvar(4)<1 && roundstate=2 && power>=1000 && statetype!=a && numenemy && !numprojid(91000)
	trigger1=var(41) && random<650 && (gametime%200>100)
	trigger2=ctrl && (p2bodydist x>200) && (enemynear,numprojid(91000)) && random<300

;--------
; h
; throw ; 
[state 0]
	type=changestate
	value=800
	trigger1=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl && (stateno!=[100,101]) && (p2bodydist x=[-12,12])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && random<(matchno+roundno+1)*88 && random<var(51)*98 ;*ntv

; iU
[state 0]
	type=changestate
	value=ifelse(random<600,300,330)
	trigger1=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl
	trigger1=p2statetype=c && (p2bodydist x=[-50,50]) && p2statetype!=l && p2movetype!=a && random<100 && random>life*2

;--------
; 
[state 0]
	type=changestate
	value=195
	trigger1=var(51)>0 && sysfvar(4)<1 && roundstate=2 && statetype!=a && ctrl
	trigger1=p2movetype=h && (p2bodydist x>200) && random<50


;---------------
;---------------
;=========
; 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]
