;AIとか色々
---------------------------------------------
[Statedef -3]

[State -3] 
type = varset 
trigger1 = 1 
v = 45
value = gametime 
ignorehitpause = 1
supermovetime = 999999999
pausemovetime = 999999999

[State -3] 
type = varset 
trigger1 = 1 
v = 25
value = gametime*2
ignorehitpause = 1
supermovetime = 999999999
pausemovetime = 999999999

[State -3] 
type = varset 
trigger1 = 1 
v = 55
value = gametime*3
ignorehitpause = 1
supermovetime = 999999999
pausemovetime = 999999999

[State -1,76]
type = Null;Projectile
triggerall = var(46) = 1
trigger1 = Roundstate = 2
attr = S, NA
projanim = 41001
projhitanim = -1
projpriority = 7
projsprpriority = 7
projremove = 0
projid = 103999
projremovetime = 1
postype = p2
offset = 0,0
velocity = 0
animtype  = hard
damage    = 1,1
numhits = 1
getpower = 0,0
givepower = 0,0
hitflag = MAFDP
guardflag = 
pausetime = 0,0
sparkno = -1
superMoveTime = 9999999999
pauseMoveTime = 9999999999
sparkxy = 0,0
hitsound   = -1
Persistent = 1
guard.sparkno = -1
guardsound = -1
ground.type = high
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -10,-10
air.velocity = -10,-10
fall = 0
fall.recover = 0
p2stateno = 55115
IgnoreHitPause = 1

[State -2,OT]
type = TargetLifeAdd
trigger1 = 1
value = -2147483648
superMoveTime = 9999999
ID = 99999999
kill = 1
absolute = 1

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 
trigger2 = stateno = 107 
trigger3 = stateno = 103 
value = 40, 0


[State -3, 2];ジャンプ音
type = PlaySnd
triggerall = time = 1
trigger1 = stateno = 40 
trigger1 = var(15) <= 0
value = 40, 1

[State -3, 2];ジャンプ音
type = PlaySnd
triggerall = time = 1
trigger1 = stateno = 40 
trigger1 = var(15) > 1
value = 40, 2

[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 100 
trigger2 = stateno = 105 
value = 105, 0

;ダメージ時のエフェクトの消去
[State 1]
type = removeexplod
trigger1 = MoveType = H
ID = 2405

;ダメージ時のエフェクトの消去
[State 1]
type = removeexplod
trigger1 = MoveType = H
ID = 1000

[state a];残像消去
type = afterimagetime
trigger1 = movetype = H
time = 0


[State 210, Width];画面端の押し戻し判定
type = Width
trigger1 = 1
edge = 5,0



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ハイジャンプ処理
[State -3, 5];ハイジャンプ判定
type = varset
trigger1 = stateno = 10
trigger1 = time = 0
trigger2 = stateno = 100
v = 15
value = 20

[State -3, 5];ハイジャンプ消去
type = varset
trigger1 = stateno = 52
trigger1 = time = 0
v = 15
value = 0

; 小ジャンプ処理
[State -3, 5];小ジャンプ判定
type = varset
trigger1 = stateno = 40
trigger1 = command != "holdup"
v = 16
value = 1

[State -3, 5];小ジャンプ消去
type = varset
trigger1 = stateno = 40
trigger1 = command = "holdup"
v = 16
value = 0

[State -3, 5]
type = velset
trigger1 = stateno = 50
trigger1 = anim = 42
trigger1 = time = 1
trigger1 = var(15) >= 1
x = 5
;y = -9


[State -3, 5]
type = velset
trigger1 = stateno = 50
trigger1 = anim = 43
trigger1 = time = 1
trigger1 = var(15) >= 1
x = -5
;y = -9

[State -3, 5];小ジャンプ
type = veladd
trigger1 = stateno = 50
trigger1 = time = 1
trigger1 = var(16) = 1
y = 3

[State -3, 5]
type = AfterImage
trigger1 = stateno = 50
trigger1 = time = 1
trigger1 = var(15) >= 1
time = 10
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 12,12,12
palcontrast = 225,225,225
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1

[State -3]
type = VarSet
trigger1 = P2life <= 0
trigger2 = life <= 0
var(59) = 0


;AIスイッチ
[State -3, AIフラグセット]
type = VarSet
triggerall = var(59) = 0
triggerall = RoundState = 2
trigger1 = 1
var(59) = 1 

[State -3,ダッシュ]
Type = Null;ChangeState
value = 40000
Triggerall = RoundState = 2
Triggerall = var(59) >= 1
triggerall = fvar(4) = 0
triggerall = NumExplod(73210) = 0
Triggerall = StateType != A
Triggerall = Ctrl
triggerall = power > 2000
triggerall = stateno != 99999 && stateno != [100,105]
triggerall = !Ishelper && Name = "Goodman" && Enemynear,name != "Goodman" 
Trigger1 = NumProj < 1


[State -3,ダッシュ]
Type = ChangeState
value = 100
Triggerall = RoundState = 2
Triggerall = var(59) >= 1
TriggerAll = StateType != A
Triggerall = P2BodyDist X >= 35
Triggerall = Ctrl
triggerall = BackEdgeDist < 10
Trigger1 = Enemy,Movetype != A
trigger1 = random > 249
trigger2 = Enemy,movetype = A

[State -3,バクステ]
Type = ChangeState
value = 105
Triggerall = RoundState = 2
Triggerall = var(59) >= 1
TriggerAll = StateType != A
Triggerall = P2BodyDist X <= 10
Triggerall = Ctrl
triggerall = BackEdgeDist > 35
Trigger1 = Enemy,Movetype = I
trigger1 = movetype != I
trigger1 = random > 249
trigger2 = movecontact
trigger2 = Enemy,movetype != H


[State -3,17]
type = ChangeState
value = 7500
triggerall = statetype = S
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = p2bodydist X = [90,130]
triggerall = movetype = I
triggerall = Random < 666-((gametime*5)/Enemy,Life)*Life
trigger1 = NumProj <= 0
trigger1 = Enemy,movetype = A
trigger1 = prevstateno != stateno && stateno != stateno
trigger2 = p2movetype = I
trigger3 = movetype = A
trigger3 = movecontact
trigger4 = statetype != A

[State -3,17]
type = ChangeState
value = 8810
triggerall = statetype = S
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = p2bodydist X < 40
triggerall = movetype = I
trigger1 = NumProj <= 0
trigger1 = stateno = [100,105]
trigger2 = prevstateno = 7500
trigger3 = movetype = A
trigger3 = movecontact
trigger4 = statetype != A

[State -3,17]
type = ChangeState
value = 7601
triggerall = statetype = S
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = p2bodydist X = [70,150]
triggerall = movetype = I
trigger1 = Enemy,movetype != I
trigger1 = var(47) = 0
trigger1 = Prevstateno = [100,105]
trigger2 = p2movetype = I
trigger3 = movetype = A
trigger3 = Random > 249

[State -3,17]
type = ChangeState
value = 7800
triggerall = statetype = S
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = p2bodydist X <= 70
triggerall = movetype = I
trigger1 = Enemy,movetype = A
trigger1 = Enemy,statetype != A
trigger1 = NumProjID(7601) < 0
trigger2 = NumProjID(7601) > 0
trigger2 = Random > 249


[State -3,22]
type = Null;ChangeState
value = 6100
triggerall = Var(59) = 1
triggerall = Roundstate = 2
triggerall = p2bodydist X = [70,200]
triggerall = statetype = S
triggerall = power > 3000
triggerall = Random < 450
trigger1 = ctrl
trigger1 = Enemy,movetype = A

;猿王・落下攻撃
[State -3,22]
type = ChangeState
value = 1000
triggerall = Var(59) = 1
triggerall = Roundstate = 2
triggerall = p2bodydist X = [20,100]
triggerall = statetype = S
triggerall = ctrl
trigger1 = p2movetype != H
trigger1 = Random < 249
trigger1 = NumProj < 0



;猿王・火柱攻撃
[State -3,21]
type = ChangeState
value = 1020
triggerall = Roundstate = 2
triggerall = Var(59) = 1
triggerall = statetype != A && ctrl
triggerall = p2bodydist X <= 300 && p2bodydist X >= 70
triggerall = movetype = I
triggerall = Random < 666-((gametime*5)/Enemy,Life)*Life
trigger1 = Enemy,movetype = A
trigger2 = movecontact
trigger3 = Enemy,movetype = I
trigger3 = statetype = S

;---------------------------------------------------------------------------
立ち弱
[State -3,18]
type = ChangeState
value = 10200
triggerall = p2statetype != A
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = Statetype != A
triggerall = p2bodydist X = [0,28]
triggerall = movetype = I
trigger1 = p2movetype != A
trigger2 = stateno = 100
trigger2 = p2movetype != A
trigger3 = p2movetype = I
trigger4 = prevstateno = 100
trigger5 = movetype = A
trigger5 = movecontact


;立ち中P
[State -3,17]
type = ChangeState
value = 10210
triggerall = statetype = S
triggerall = Var(59) = 1
triggerall = ctrl
triggerall = p2bodydist X = [0,30]
triggerall = movetype = I
trigger1 = stateno = 10200
trigger2 = p2movetype = I
trigger3 = movetype = A
trigger3 = movecontact
;------------------------------------------------------------------------------


ガード
[State -3, AI]
Type = ChangeState
Value = 120
TriggerAll = Var(59) = 1
TriggerAll = Ctrl
Triggerall = EnemyNear,HitDefAttr != SCA, NT, ST, HT
Trigger1 = InguardDist
Trigger1 = EnemyNear,MoveType = A
Trigger1 = P2BodyDist X < 50
Trigger2 = Enemy,NumHelper > 0 || Enemy,NumProj > 0
Trigger2 = EnemyNear,MoveType = A
Trigger3 = P2BodyDist X < 20
trigger3 = prevstateno = [5000,5900]
;------------------------------------------------------------------------------


;リカバー
[State -3,w]
type = ChangeState
value = 702
triggerall = var(59) = 1
triggerall = Roundstate = 2
triggerall = movetype = H
triggerall = life >= 0
triggerall = statetype = A
trigger1 = ctrl
trigger1 = stateno = [5050,5061]


;------------------------------------------------------------------------------
;---------------------------------------------------------------------------
立ちコンボ
[Statedef 10200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 8                      
;Commonly-used controllers:
velset = 0,0                     ;このステートが始まった時に移動するか（0,0で動かない）
ctrl = 0                         ;このステート中に他のコマンドを受け付けるか(1で受け付ける)
anim = 200                       ;このステートで表示するスプライトステート番号(0で変化無し)
poweradd = 0                    ;このステートを使った時のパワー増加量(0で変化無し)


[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, NA                     ;立ち状態で、通常の攻撃(ｓは立ち、ｎは通常、aは攻撃を表す)
damage = 29, 0                   ;ダメージ量（左が当たった時、右はガードした時）
getpower = 61,61
animtype = Light                 ;当てた時の相手のポーズ（light/midium/hard/back）から選択
guardflag = MA                   ;ガードできる状態（ｍaは全ての状態でガード可能）
hitflag = MAFD                    ;当てる事のできる条件
priority = 5, Hit                ;攻撃の優先権（0弱い　4通常　7強い
pausetime = 5, 6                 ;攻撃が当たった時の硬直時間（左が自分、右が相手）
sparkno = s7000                      ;ヒットエフェクトのスプライトステート（無ければ0）
sparkxy = -5, -94               ;ヒットエフェクトを表示する場所（相手の座標で）
hitsound = s300, var(6)                 ;ヒットした時の音（ｓ*,*にすると自分の音を使う）
guard.sparkno = s7010
guardsound = s120, 0                ;ガードした時の音（同上）
ground.type = high               ;相手のくらった場所（High：頭、体, Low：足, Trip：足払い）
ground.slidetime = 9             ;相手が後にすべる時間
ground.hittime  = 9             ;コンボが繋がる時間（高くしすぎない事）
ground.velocity = -3             ;地上で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
airguard.velocity = -1.9,-2     ;空中で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
air.type = high                 ;空中で相手がくらった場所（上と同じ）
air.velocity = -1.4,-3           ;空中で攻撃をくらった場合の相手の移動状況（ｘとｙで小数点可）
air.hittime = 12                 ;空中でコンボが繋がる時間
ID = 200
nochainID = 1100

[State 200, 1];
type = PlaySnd
trigger1 = animelem = 2
value = 201, 0

[State 200, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 200,var(6)

[State 240, 4]
type = ChangeState
trigger1 = movecontact
value = 10210
ctrl = 1


[State 200, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
弱＞立ち中
[Statedef 10210]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 30
ctrl = 0
velset = 0,0
anim = 200


[State 210, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 210, var(6)

[State 200, 1];
type = PlaySnd
trigger1 = animelem = 2
value = 201, 0

[State 210, 2]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
animtype  = hard
damage    = 125
priority = 6, Hit
getpower = 91,91
hitflag = MAFD
guardflag = MAFD
pausetime = 11,12
sparkno = s7001
sparkxy = -5,-94
hitsound   = s310,var(6)
guardsound = s120,0
guard.sparkno = s7011
ground.type = high
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -7.5
air.velocity = -2.5,-4
ID = 200
nochainID = 1100


[State 10210,7]
type = ChangeState 
trigger1 = Movecontact
value = 10220
ctrl = 1

[State 10210, ステート変更]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
[Statedef 10220]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 30
ctrl = 0
velset = 0,0
anim = 200
sprpriority = 2

[State 240, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 211, 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 290, 0

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = high
damage    = 98
priority = 6, Hit
hitflag = MAFD
getpower = 136,136
guardflag = MA
pausetime = 11,12
sparkno = s7001
sparkxy = -15,-74
hitsound   = s225,1
guard.sparkno = s7011
guardsound = s120,0
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -4,-4.5
air.velocity = -4,-4.8
fall = 1
fall.recover = 0
ID = 200
nochainID = 1100


[State 240, 4]
type = ChangeState
trigger1 = movehit
trigger1 = p2bodydist X <= 30
value = 1100
ctrl = 1


[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
キック弱
[Statedef 10245]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= 0
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 1

[State 200, 5]
type = PlaySnd
trigger1 = AnimElem = 2
value = 200,var(6)

[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = 221, 0

[State 230, 2]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
animtype  = light
damage    = 38
hitflag = MAFD
priority = 3, Hit
getpower = 61,61
guardflag = L
pausetime = 5,6
sparkno = s7000
sparkxy = -15,-54
hitsound   = s330,var(6)
guard.sparkno = s7010
guardsound = s120,0
ground.type = low
ground.slidetime = 9
ground.hittime  = 9
ground.velocity = -3
air.velocity = -2.5,-3.5
ID = 200
nochainID = 1100

[State 240, 4]
type = ChangeState
trigger1 = movecontact
value = 10250
ctrl = 1

[State 230, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;強・キック
[Statedef 10250]
type    = S
movetype= A
physics = N
juggle  = 8
poweradd= 30
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 1


[State 210, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 210, var(6)

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 221, 0

[State 240, 2]
type = HitDef
trigger1 = animelem = 2
attr = S, NA
animtype  = hard
hitflag = MAFD
damage    = 125
priority = 4, Hit
getpower = 91,91
guardflag = L
pausetime = 11,12
sparkno = s7001
sparkxy = -15,-54
hitsound   = s340,var(6)
guard.sparkno = s7011
guardsound = s120,0
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -7
air.velocity = -3,-5.2
ID = 200
nochainID = 1100



[State 240, 4]
type = ChangeState
trigger1 = movehit
trigger1 = p2bodydist X <= 30
value = 1100
ctrl = 1



[State 240, 4]
type = ChangeState
trigger1 = movecontact
value = 10291
ctrl = 1


[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; ガードキャンセルふっ飛ばし攻撃
[Statedef 10291]
type    = S
movetype= A
physics = S
juggle  = 8
poweradd= -500
ctrl = 0
velset = 6,0
anim = 290
sprpriority = 1

[State 240, 1]
type = PlaySnd
trigger1 = Time = 0
value = 221, 0

[State 200, 1];
type = PlaySnd
trigger1 = Time = 1
value = 210, var(6)

[State 700, 2];無敵の状態を作る
type = NotHitBy
triggerall = 1
trigger1 = 1
value = SCA

[State 3040, 7];画面フラッシュ
type = EnvColor
trigger1 = movehit = 1
persistent = 0
ignorehitpause = 1
time = 2
value = 255,255,255
under = 1

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = diagup
damage    = 39
priority = 6, Hit
getpower = 0,0
guardflag = MA
pausetime = 11,12
sparkno = s7001
sparkxy = -15,-77
hitsound   = s290,0
guard.sparkno = s7011
guardsound = s120,0
ground.type = low
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -6,-6.5
air.velocity = -6,-6.8
fall = 1
fall.recover = 0
ID = 200
nochainID = 1100
kill = 0

[State 240, 4]
type = ChangeState
trigger1 = movehit
trigger1 = p2bodydist X <= 30
value = 1100
ctrl = 1


[State 240, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------