
;---------------------------------------------------------------------------
; カンフー突き手・空中弱
[Statedef 1000]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 110
velset = 3,0
anim = 1000
ctrl = 0
sprpriority = 2


[State 1010]
type = PlaySnd
trigger1 = Time = 3
value = 3, 3

[State 1000]
type = PlaySnd
trigger1 = Time = 3
value = 0, 2

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1000, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1000, 5] ;相手が近い時
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s6001                     
guard.sparkno = s6002 
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6] ;相手が遠い時
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 80, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkno = s6001                    
guard.sparkno = s6002
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

[State 1000, 6]
type = PosAdd
trigger1 = AnimElem = 8
x = -5

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; カンフー突き手・空中強
[Statedef 1005]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 110
velset = 5,0
anim = 1000
ctrl = 0
sprpriority = 2


[State 1010]
type = PlaySnd
trigger1 = Time = 3
value = 3, 3

[State 1000]
type = PlaySnd
trigger1 = Time = 3
value = 0, 2

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1000, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1000, 5] ;相手が近い時
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s6001                      
guard.sparkno = s6002 

sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6] ;相手が遠い時
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 80, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkno = s6001                     
guard.sparkno = s6002  
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

[State 1000, 6]
type = PosAdd
trigger1 = AnimElem = 8
x = -5

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; カンフー突き手・地上弱
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 120
velset = 3,0
anim = 1010
ctrl = 0
sprpriority = 2


[State 1010]
type = PlaySnd
trigger1 = Time = 3
value = 3, 3

[State 1010, 1]
type = PlaySnd
trigger1 = Time = 9
value = 0, 2

[State 1010, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1010, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1010, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1010, 5]
type = VelSet
trigger1 = AnimElem = 5
x = 4

[State 1010, 6] 
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 94, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s6001                     
guard.sparkno = s6002
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1010, 7] 
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 89, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkno = s6001                      
guard.sparkno = s6002 
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; カンフー突き手・地上強
[Statedef 1015]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 120
velset = 6,0
anim = 1010
ctrl = 0
sprpriority = 2


[State 1010]
type = PlaySnd
trigger1 = Time = 3
value = 3, 3

[State 1010, 1]
type = PlaySnd
trigger1 = Time = 9
value = 0, 2

[State 1010, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1010, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1010, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1010, 5]
type = VelSet
trigger1 = AnimElem = 5
x = 4

[State 1010, 6] 
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 94, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s6001                     
guard.sparkno = s6002
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1010, 7] 
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 89, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkno = s6001                    
guard.sparkno = s6002
sparkxy = -10,-60
hitsound   = s6,2
guardsound = s7,2
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

[State 1010, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; カンフー突き手・ＥＸ
; 
;     これは少し難しい物を使っています。
;     攻撃が当たった時に相手をp2stateno = 1025で移動しています。
;     あとの移動などは応用なのでそう難しくないですね。

[Statedef 1020]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -1000
velset = 12,0
anim = 1020
ctrl = 0
sprpriority = 2



[State 195]
type = PlaySnd
trigger1 = Time = 3
value = 3, 2

[State 1010, 1]
type = PlaySnd
trigger1 = Time = 5
value = 0, 3
channel = 2

[State 1020, Friction]
type = VelMul
trigger1 = 1
x = .85 * ifelse (AnimElemTime(6) < 0, 1, .8)

[State 1020, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1020, Afterimage]
type = AfterImageTime
trigger1 = AnimElemTime(8) < 0
time = 2

[State 1020, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1020, 1]
type = PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 1020, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1020, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 11
x = 10

[State 1020, 4]
type = PosAdd
trigger1 = AnimElem = 4
x = 5

[State 1020, 5]
type = VelSet
trigger1 = AnimElem = 4
x = 13

[State 1020, 6]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Hard
damage    = 102, 5
getpower  = 0
priority  = 5
guardflag = MA
pausetime = 8,7
sparkno = s6001                   
guard.sparkno = s6002
sparkxy = -10,-60
hitsound   = s6,3
guardsound = s7,3
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -8,-7
guard.velocity = -7
air.velocity = -8,-7
airguard.velocity = -5, -4
fall = 1
p2stateno = 1025


[State 1020, 7]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;------------------
; 攻撃をくらった相手の状態

[Statedef 1025]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;２Ｐのスプライトステートを変更しています
type = ChangeAnim2
trigger1 = 1
value = 1025

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1026

;------------------
; 飛んでいく相手のステート

[Statedef 1026]
type    = A
movetype= H
physics = N

[State 1026, Velocity]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1027

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; 飛んでいった相手の壁に当たる状態のステート

[Statedef 1027]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 1028

;------------------
; 壁に当たった相手が落ちるステート

[Statedef 1028]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = , NA, NP

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 1.6

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] 
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] 
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] 
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] 
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100
