;===========================================================================
; <<<<< TOMOE NAGE A LA GOKU >>>>>
; Grab state : 800
; Goku throws : 801
; P2 thrown state : 802
; P2 hits ground : 803
; P2 hits ground from dash collision : 804
;===========================================================================

[Statedef 800]
type = S
movetype = A
physics = S
juggle = 15
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 1
facep2 = 1
poweradd = 20

[State 800, Don't Guard]
type = attackdist
trigger1 = 1
value = 0

[State 800, hit]
type = hitdef
trigger1 = animelem=4 && enemy,stateno!=5300
attr = S,NT
hitflag = M- 
priority = 1,Miss 
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 801
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1

[State 800, hit]
type = hitdef
trigger1 = animelem=4 && enemy,stateno=5300
attr = S,NT
hitflag = MAF
priority = 1,Miss 
sparkno = -1
p1facing = 1
p2facing = 1
p1stateno = 801
guard.dist = 0
fall = 1
fall.recover = 0
hitsound = s800,1

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 0, 1
[State 200, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 5000,0
channel = 0

[State Idle]
type = statetypeset
trigger1 = animelemtime(5)>=0
movetype = I

[State 800, end]
type = changestate
trigger1 = !animtime
value = 0
ctrl = 1

;----------------------------
;Goku's State
[Statedef 801]
type = S
movetype = A
physics = S
anim = 803
ctrl = 0
sprpriority = 1

[State 200, Haria voice]
type = PlaySnd
trigger1 = !time
value = 3,10

[State 1000]
type = width
trigger1 = anim = 803
value = 45,30

[State Throw]
type = PosAdd
trigger1 = animelemtime(3)=0
X = -20
[State Throw]
type = PosAdd
trigger1 = animelemtime(7)=0
X = -30

[State Throw]
type = targetstate
trigger1 = !time
value = 802

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 1,0
value = 1

[State 810, bind 1]
type=targetbind
trigger1= animelemtime(1)>=0 && animelemtime(2)<0
pos=35,0
[State 810, bind 2]
type=targetbind
trigger1= animelemtime(2)>=0 && animelemtime(3)<0
pos=15,-60
[State 810, bind 3]
type=targetbind
trigger1= animelemtime(3)>=0 && animelemtime(4)<0
pos=0,-55
[State 810, bind 4]
type=targetbind
trigger1= animelemtime(4)>=0 && animelemtime(5)<0
pos=-45,-55
[State 810, bind 4]
type=targetbind
trigger1= animelem = 5
pos=-80,-90

[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 5
trigger1 = prevstateno = 800
value = 803
[State 810, Throw 11]
type = TargetState
trigger1 = AnimElem = 5
trigger1 = prevstateno = 951
value = 804

[State 200, throw sound]
type = PlaySnd
trigger1 = animelem = 5
value = 20,2
volume = 150

[State 810, hurt]
type = poweradd
trigger1 = animelem = 5
value = 180

[State 810, Throw 11]
type = VelSet
trigger1 = AnimElemtime(8)=0
x = -7
y = -6

[State 810, Throw 11]
type = StateTypeSet
trigger1 = AnimElemtime(8)=0
statetype = A

[State 4001, Fall]
type = VelAdd
trigger1 = Animelemtime(8)>0 && (vel Y < 0)
Y = .55

[State 4001, Fall]
type = VelAdd
trigger1 = (Vel Y > 0)
Y = .4

[State 4001, Fall]
type = VelSet
trigger1 = (Vel Y > 0) && AnimElemtime(8)>0
X = -4

[State 4001, Stop]
type = VelSet
trigger1 = Vel Y > abs(Pos Y)
trigger1 = animelemtime(9)>0
Y = 0

[State 4001, Replace]
type = PosSet
trigger1 = Vel Y = 0
trigger1 = animelemtime(9)>0
Y = 0

[State 1400, EndState]
type = ChangeState
trigger1 = Vel Y = 0 && pos Y = 0
trigger1 = animelemtime(10)>0
value = 52
ctrl = 0

;----------------------------
;Enemy Thrown State
[Statedef 802]
type = S
movetype = H
physics = N
velset = 0,0
sprpriority = 0

[State 182, 1]
type = screenbound
trigger1 = 1
movecamera = 1,0
value = 1

[State 802, anim]
type = changeanim2
trigger1 = !time
value = 804

[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

[State 801, end]
type = selfstate
trigger1 = !animtime
value = 5100
ctrl = 0

;----------------------------
;Enemy Thrown State 2 - in air
[Statedef 803]
type    = A
movetype= H
physics = N
velset = 6,-5
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 810, Hurt 11]
type = LifeAdd
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -20
value = -58
[State 810, Hurt 11]
type = PowerAdd
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -20
value = 35

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -20
value = 5100 ;Hit ground

;----------------------------
;Enemy Thrown State 2 - in air (from Dash Collision)
[Statedef 804]
type    = A
movetype= H
physics = N
velset = 6,-5
poweradd = 40

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = 1
y = .4

[State 810, Hurt 11]
type = LifeAdd
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -20
value = -86

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -20
value = 5100 ;Hit ground