;#ADD004BASIC#

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


;---------------
;---------------
[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="sp6"
	command=~D,D,a
	time=20
[command]
	name="sp6_s"
	command=~D,D,b
	time=20

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



;---
;--- mamahaha
[state 0]
	type=helper
	trigger1=!numhelper(8000) && roundstate=2 && alive
	trigger1=movetype!=h
	id=8000
	stateno=8000
	postype=p1
	pos=-50,floor(-screenpos y-36)
	helpertype=normal
	keyctrl=0
	ownpal=1
;op;	name="mamahaha"
	;---
;op;	size.xscale=const(size.xscale)
;op;	size.yscale=const(size.yscale)



;---
;--- 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
;--- blocking/just defence
[state 0]
	type=playsnd
	trigger1=stateno=195500 && time=1
	value=0,(random%2)
	channel=0



;---
;--- combo 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=210 && anim=215) || (stateno=220 && anim=225) || (stateno=235 && (animelem=4,<0))
	trigger2=stateno=400 || stateno=410 || stateno=420
	var(41)=1



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

;--- Healing (max2)
; VR-JCm~ (X̐_ւ̋F)
[state 0]
	type=changestate
	value=3200
	triggerall=command="hp2" || command="hp2_s"
	triggerall=power>=2000 && var(51)<1
	trigger1=statetype!=a && ctrl

;---
; V`Jv-JC-CVJ (-_-{)
[state 0]
	type=changestate
	value=3300
	triggerall=command="hp3" || command="hp3_s" || command="hp4" || command="hp4_s"
	triggerall=power>=1000 && var(20) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))
	trigger2=(stateno=1250 || stateno=3530) && (animelem=7,>0) && movecontact

;---
; GV-JC-Z (P-_-֕)
[state 0]
	type=changestate
	value=3510
	triggerall=command="hp1" || command="hp1_s"
	triggerall=power>=1000 && var(51)<1
	trigger1=stateno=1503 || (stateno=1510 && movecontact)
[state 0]
	type=changestate
	value=3500
	triggerall=command="hp1" || command="hp1_s"
	triggerall=power>=1000 && var(20) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))






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

;--- catch mamahaha
; }}nnɒ͂܂
[state 0]
	type=changestate
	value=1500
	triggerall=command="sp6" || command="sp6_s"
	triggerall=var(20) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

;---
; JC-cx (_-n)
[state 0]
	type=changestate
	value=1400
	triggerall=command="sp1" || command="sp1_s"
	triggerall=var(51)<1
	trigger1=stateno=1503
	trigger2=stateno=1510 && movecontact

; V`Jv-AC (-)
[state 0]
	type=changestate
	value=1450
	triggerall=command="sp2" || command="sp2_s"
	triggerall=var(51)<1
	trigger1=stateno=1503
	trigger2=stateno=1510 && movecontact

;--- mamahaha - assist
; Ax-g (-) / V`Jv-GgD (-΂)
[state 0]
	type=changestate
	value=1300
	triggerall=command="sp3" || command="sp3_s" || command="sp4" || command="sp4_s"
	triggerall=var(20) && var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

;---
; JC-Z (_-֕)
[state 0]
	type=changestate
	value=1200
	triggerall=command="sp2" || command="sp2_s"
	triggerall=var(51)<1
	trigger1=statetype!=a && (ctrl || var(41))

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

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





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


;;--- 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>0)

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

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


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

[state 0]
	type=changestate
	value=200
	triggerall=command="x" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=210 || stateno=400 || stateno=410) && (time>4 || movecontact)

[state 0]
	type=changestate
	value=210
	triggerall=command="a" && command!="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=210 || stateno=400 || stateno=410) && (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="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=210 || stateno=400 || stateno=410) && (time>4 || movecontact)

[state 0]
	type=changestate
	value=410
	triggerall=command="a" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl
	trigger2=(stateno=200 || stateno=210 || stateno=400 || stateno=410) && (time>4 || movecontact)

[state 0]
	type=changestate
	value=440
	triggerall=command="y" && command="holddown" && (command="holdfwd" || command="holdback")
	triggerall=var(51)<1
	trigger1=statetype!=a && ctrl

[state 0]
	type=changestate
	value=420
	triggerall=command="y" && command="holddown"
	triggerall=var(51)<1
	trigger1=statetype=c && ctrl
	trigger2=(stateno=400 || stateno=410) && movecontact

[state 0]
	type=changestate
	value=430
	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=610
	triggerall=command="a"
	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="b"
	triggerall=var(51)<1
	trigger1=statetype=a && ctrl
;---







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

; v42: flag
[state 0]
	type=varset
	trigger1=!ishelper
	var(42)=var(51)>0 && sysfvar(4)<1 && roundstate=2

;---
; S- LP200 LK210 HP220 HK230
[state 0]
	type=changestate
	value=ifelse(random<300, ifelse(random<650,200,210), ifelse(random<800,220,230))
	triggerall=var(42) && 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)%10=1
	trigger2=(p2bodydist x=[0,32]) && (p2statetype=s) && random<400
	trigger3=stateno=52 && (animtime=0) && (prevstateno=[600,699]) && (p2bodydist x=[0,42]) && random<650
;---
; C- LP400 LK410 HK430
[state 0] ; crouching attack
	type=changestate
	value=ifelse(random<360, ifelse(random<100,400,410), 430)
	triggerall=var(42) && statetype!=a && ctrl && p2statetype!=l
	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) && p2statetype=s && p2movetype!=a && random<180

;--- CHP
[state 0]
	type=changestate
	value=420
	triggerall=var(42) && statetype!=a && p2statetype!=l
	trigger1=stateno=52 && (animtime=0) && (prevstateno=[600,699]) && (p2bodydist x=[-32,32]) && random<500
	;;--- ΋
	trigger2=ctrl && sysfvar(0)>0 && playeridexist(floor(sysfvar(0)))
	trigger2=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(18)/1000)%10=1
	trigger2=(p2bodydist x=[-32,32]) && (p2bodydist y=[-80,80]) && random<500

;--- CLP/CLK
[state 0]
	type=changestate
	value=ifelse(random<650,410,400)
	triggerall=var(42) && statetype!=a && p2statetype!=l && (p2bodydist x=[-30,30])
	trigger1=(stateno=200||stateno=210||stateno=400||stateno=410) && var(41) && random<300

;--- CHK / CHP-c
[state 0] ; crouching attack
	type=changestate
	value=ifelse(random<600,430,440)
	triggerall=var(42) && statetype!=a && p2statetype!=l
	trigger1=ctrl && (p2bodydist x=[35,75]) && p2statetype!=a && (gametime%850=[350,650]) && random<150

;--- Jumpping-Attack
[state 0]
	type=changestate
	value=ifelse(random<200, 600, 620) +(random<600)*10
	triggerall=var(42) && statetype=a && ctrl && (p2movetype!=h || random<200 || p2statetype!=a)
	trigger1=sysfvar(0)>0 && playeridexist(floor(sysfvar(0))) && (prevstateno!=8200) && (prevstateno!=712) && (prevstateno!=720)
	trigger1=(playerid(floor(sysfvar(0))),var(0)=90900) && (playerid(floor(sysfvar(0))),var(18)/100)%10=1
	trigger2=(p2bodydist x=[-62,62]) && (p2bodydist y<68) && (vel y>0) && random<500
	trigger3=(p2bodydist x=[-26,26]) && (p2bodydist y=[-26,26]) && random<700

;--- Far_Retrain ; 
[state 0]
	type=changestate
	value=ifelse(random<400,400,200) +(random<400)*10
	trigger1=var(42) && 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

;--- ѓ˕Ԃ
[state 0]
	type=changestate
	value=1200
	triggerall=var(42) && statetype!=a && ctrl && numenemy
	triggerall=enemynear,numprojid(91000)
	trigger1=(enemynear,numprojid(91010) && random<66) || (enemynear,numprojid(91020) && random<928)
	trigger2=(enemynear,numprojid(91030) && random<82) || (enemynear,numprojid(91040) && random<38)
;---
[state 0]
	type=changestate
	value=1200
	triggerall=var(42) && statetype!=a && p2statetype!=l
	trigger1=ctrl && (p2bodydist x=[-80,80]) && random<80 && (gametime%300>120)
	trigger2=stateno=220 && var(41) && random<380
	trigger3=var(41) && random<150
;---
[state 0]
	type=changestate
	value=1000 +(random%2)*100
	triggerall=var(42) && statetype!=a && (gametime%600>300)
	trigger1=ctrl && (p2bodydist x!=[-52,52]) && p2statetype!=a && random<180 && random<(p2bodydist x*2)
	trigger2=var(41) && random<100
;---
[state 0]
	type=changestate
	value=ifelse(random<650,1300,1500)
	triggerall=var(42) && statetype!=a && var(20)
	trigger1=ctrl && (p2bodydist x!=[-100,100]) && p2statetype!=a && random<160 && (gametime%250<120)
	trigger2=var(41) && (p2bodydist x!=[-28,28]) && random<250

;--- JC-cx (_-n)
[state 0]
	type=changestate
	value=1400
	triggerall=var(42) && (stateno=1503 || (stateno=1510 && movecontact))
	trigger1=(p2bodydist x=[-100,100]) && random<250
	trigger2=(p2bodydist x!=[-100,100]) && random<80
;--- V`Jv-AC (-)
[state 0]
	type=changestate
	value=1450
	triggerall=var(42) && (stateno=1503 || (stateno=1510 && movecontact))
	trigger1=(p2bodydist x=[-100,100]) && random<80
	trigger2=(p2bodydist x!=[-100,100]) && random<250

;---
;--- Super - Combos
;--- () GV-JC-Z (P-_-֕)
[state 0]
	type=changestate
	value=3510
	triggerall=var(42) && power>=1000 && (stateno=1503 || (stateno=1510 && movecontact))
	trigger1=(p2bodydist x=[-100,100]) && random<200
	trigger2=(p2bodydist x!=[-100,100]) && random<100

;--- GV-JC-Z (P-_-֕)
[state 0]
	type=changestate
	value=3500
	triggerall=var(42) && statetype!=a && power>=1000
	trigger1=ctrl && p2statetype=a && (p2bodydist x=[-32,32]) && (p2bodydist y=[-32,0]) && random<100
	trigger2=var(41) && random<20 && (gametime%80>60)
	trigger3=var(41) && movehit && random<260
;---V`Jv-JC-CVJ (-_-{)
[state 0]
	type=changestate
	value=3300
	triggerall=var(42) && statetype!=a && power>=1000 && var(20)
	trigger1=(ctrl || var(41)) && random<80 && (gametime%120=[60,65])
	trigger2=(stateno=1250 || stateno=3530) && (animelem=7,>0) && (animelem=9,<0) && movehit && random<150
;--- (Max2)
[state 0]
	type=changestate
	value=3200
	trigger1=var(42) && statetype!=a && ctrl && power>=2000
	trigger1=statetype!=a && ctrl && (p2bodydist x!=[-80,80]) && life<250 && random<80
;---
;--- Throw - Normal
[state 0]
	type=changestate
	value=800
	trigger1=var(42) && statetype!=a && ctrl && (stateno!=[100,101])
	trigger1=p2statetype!=a && p2movetype!=h && p2statetype!=l && (p2bodydist x=[-12,12])
	trigger1=random<(matchno+roundno+1)*88 && random<var(51)*98 ;*ntv

;--- Taunt ; 
[state 0]
	type=changestate
	value=195
	trigger1=var(42) && statetype!=a && ctrl && 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]
