;================================================================================
;                   DSS TODOH 'S CODINGS FILE - part5
;================================================================================
;---------------------Throw A
[Statedef 800]
type = S
movetype = A
physics = S
anim = 800
poweradd = 50
velset = 0
ctrl = 0
juggle = 15

[State 200, 2]
type = HitDef
trigger1 = AnimElem = 1
trigger1 = var(30) = 0
attr = S, NT
damage = 0
animtype = hard
hitflag = M-
guardflag = M
priority = 3,miss
sparkno = -1
guard.sparkno = -1
sparkxy = 0,-60
hitsound = -1
guardsound = -1
pausetime = 0,0
p1stateno = 810
p2stateno = 815

[State 200, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 225

[Statedef 810]
type = S
physics = S
anim = 810
poweradd = 0
velset = 0
ctrl = 0
sprpriority = 3

[State 810, turn]
type = turn
trigger1 = animelem = 7

[State 810, bind1]
type = Targetbind
trigger1 = animelem = 1
pos = 50,0

[State 810, bind2]
type = targetbind
trigger1 = animelem = 2
pos = 25,-100

[State 810, bind3]
type = targetbind
trigger1 = animelem = 3
pos = 5,-95

[State 810, bind4]
type = targetbind
trigger1 = animelem = 4
pos = -60,-80

[State 810, width]
type = width
trigger1 = animelem = 1
edge = 50,50

[State 810, width]
type = width
trigger1 = animelem = 3
edge = 70,70

[State 810, width]
type = width
trigger1 = animelem = 4
edge = 90,90

[State 810, snd]
type = playsnd
trigger1 = animelem = 3
value = 200,0

[State 810, snd]
type = playsnd
trigger1 = animelem = 1
value = 8,0

[State 810, snd]
type = playsnd
trigger1 = animelem = 3
value = 7,3

[State 1100, 1]
type = Explod
trigger1 = AnimElem = 1
anim = F0
ID = 800
postype = p1
pos = 48,-86
bindtime = 1
sprpriority = 1
ownpal = 1

[State 810, state]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

[Statedef 815]
type = A
movetype = H
physics = N
poweradd = 0
velset = 0
ctrl = 0
facep2 = 1
sprpriority = 0

[State 825, screen]
type = Screenbound
trigger1 = 1
value = 0

[State 815, anim]
type = changeanim2
trigger1 = time = 0
value = 815

[State 1515, life]
type = lifeadd
trigger1 = animelem = 4
value = -100

[State 855, 39]
type = ChangeState
trigger1 = AnimTime = 0
value = 816

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

[State 865, 2]
type = Velset
trigger1 = 1
x = 4

[State 865, 2]
type = Velset
trigger1 = time < 2
y = -4

[State 865, 2]
type = VelAdd
trigger1 = time > 1
y = .5

[State 865, 4]
type = ChangeAnim2
trigger1 = Time = 0
value = 816

[State 865, 5]
type = SelfState
trigger1 = pos Y >= 0
trigger1 = vel Y >= 0
value = 5100

;=============================================================
;
;			Charge Power
;
;=============================================================

[Statedef 310]
type = S
movetype = I
physics = S
anim = 310
velset = 0
ctrl = 0

[State 301, snd]
type = PlaySnd
trigger1 = AnimElem = 1
value = 310,0
channel = 3

[State 735, 2]
type = PowerAdd
trigger1 = 1
value = 10

[State 735, 1]
type = ChangeState
trigger1 = command != "hold_a"
trigger1 = command != "hold_y"
trigger1 = command != "hold_c"
value = 312

[State 730, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 311

; Power up
[Statedef 311]
type = S
movetype = I
physics = S
anim = 311

[State 705, 2]
type = Explod
trigger1 = ((Time + 12) % 12) = 0
anim = 319
ID = 311
sprpriority = -1
postype = p1
pos = -1,0
bindtime = -1
removeongethit = 1
scale = 0.70,0.70

[State 735, 1]
type = ChangeState
trigger1 = command != "hold_a"
trigger1 = command != "hold_y"
trigger1 = command != "hold_c"
value = 312

[State 735, 2]
type = PowerAdd
trigger1 = Time = [0,12]
value = 10

[State 735, 2]
type = ChangeState
trigger1 = Power >= 3000
value = 313

[State 735, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 311

; Power up (end)
[Statedef 312]
type = S
movetype = I
physics = S
anim = 312

[State 1100, 1]
type = RemoveExplod
trigger1 = AnimElem = 1
ID = 311

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

; Power up (maxed out)
[Statedef 313]
type = S
movetype = I
physics = S
anim = 312

[State 1100, 1]
type = RemoveExplod
trigger1 = AnimElem = 1
ID = 311

[State 741, 2]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;=============================================================
;
;			Standing KO
;
;=============================================================

[Statedef 4996]
type = L
movetype = H
physics = N
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0
facep2 = 1

[State 1310, anim]
type = Changeanim
;trigger1 = time = 0
trigger1 = var(50) = 69
trigger1 = selfanimexist(4996) = 1
trigger1 = anim != 4996
value = 4996

[State 6010, air]
type = Selfstate
trigger1 = pos Y != 0
trigger2 = var(50) != 69
trigger3 = var(50) = 69
trigger3 = selfanimexist(4996) = 0
trigger4 = alive && time > 0
value = 5000

[State 4996, no ko snd]
type = AssertSpecial
trigger1 = 1;anim = 4996
flag = nokosnd

[State 200, 1]
type = PlaySnd
trigger1 =  time = 12 ;&& anim = 4996
value = 5000,3

[State 220, 3]
type = ChangeState
trigger1 = anim = 4996 && AnimTime = 0
value = 5150

; HIT_LIEDEAD
[Statedef 5150]
type    = L
movetype= H
physics = N
sprpriority = -3

[State 5150, 1]
type = ChangeAnim
triggerall = 1
triggerall = Prevstateno = 4996
trigger1 = var(50) = 69
trigger1 = selfanimexist(4997) = 1
value = 4997

[State 5150, 1]
type = ChangeAnim
triggerall = 1
triggerall = Prevstateno = 4994
trigger1 = var(50) = 69
trigger1 = selfanimexist(4995) = 1
value = 4995

[State 5150, 1] ;Normal anim
type = ChangeAnim
triggerall = Prevstateno != 4996 && Prevstateno != 4994
triggerall = Time = 0
triggerall = SelfAnimExist(5140)
trigger1 = (anim != [5111,5119]) && (anim != [5171,5179])
trigger2 = !SelfAnimExist(5140 + (anim % 10))
value = 5140

[State 5150, 3] ;Hit up type anim
type = ChangeAnim
triggerall = Prevstateno != 4996 && Prevstateno != 4994
trigger1 = Time = 0
trigger1 = (anim = [5111,5119]) || (anim = [5171,5179])
trigger1 = SelfAnimExist(5140 + (anim % 10))
value = 5140 + (anim % 10)

[State 5150, 4] ;Match over anim
type = ChangeAnim
triggerall = Prevstateno != 4996 && Prevstateno != 4994
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [5140,5149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 5] ;Switch to 5110 if liedead anim does not exist
type = ChangeAnim
triggerall = Prevstateno != 4996 && Prevstateno != 4994
trigger1 = Time = 0
trigger1 = Anim != [5140,5159]
trigger1 = Anim != [5110,5119]
value = 5110

[State 5150, 4] ;Match over anim
type = ChangeAnim
triggerall = Prevstateno != 4996 && Prevstateno != 4994
persistent = 0
;trigger1 = Time = 0
trigger1 = MatchOver = 1
trigger1 = Anim = [15140,15149]
trigger1 = SelfAnimExist(anim+10)
value = anim+10

[State 5150, 6] ;Friction
type = VelMul
trigger1 = 1
x = 0.85

[State 5150, 7] ;Friction
type = VelSet
trigger1 = Vel x < .05
persistent = 0
x = 0

[State 5150, 8]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

;=============================================================
;
;			Ultimate KO
;
;=============================================================

[Statedef 4993]
type = L
movetype = H
physics = N
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0

[State 6010, air]
type = Selfstate
trigger1 = pos Y != 0
trigger2 = var(50) != 69
trigger3 = var(50) = 69
trigger3 = selfanimexist(4995) = 0
trigger4 = life != 0
value = 5000

[State 1310, anim]
type = Selfstate
trigger1 = time = 0
trigger1 = var(50) = 69
trigger1 = selfanimexist(4995) = 1
value = 4994

[Statedef 4994]
type = L
movetype = H
physics = N
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0
facep2 = 1

[State 1000, wodth]
type = Width
trigger1 = 1
value = 30,30

[State 4994, snd]
type = PlaySnd
trigger1 = AnimElem = 17
value = 7,2

[State 1800, Shake Screen]
type = EnvShake
trigger1 = Animelem = 17
time = 12     ;Time to shake screen
ampl = 8     ;Amount to shake
freq = 90   ;A frequency of 180 shakes the screen rapidly

[State 1100, 1]
type = Explod
trigger1 = animelem = 17, = 1
anim = f61
ID = 800
postype = p1
pos = -36,0
bindtime = 1
sprpriority = -1
ownpal = 1

[State 1310, anim]
type = Changeanim
trigger1 = time = 0
trigger1 = var(50) = 69
trigger1 = selfanimexist(4994) = 1
value = 4994

[State 6010, air]
type = Selfstate
trigger1 = pos Y != 0 && time < 1
trigger2 = var(50) != 69
trigger3 = var(50) = 69
trigger3 = selfanimexist(4994) = 0
value = 5000

[State 4996, no ko snd]
type = null;AssertSpecial
trigger1 = 1;anim = 4996
flag = nokosnd

[State 220, 3]
type = ChangeState
trigger1 = anim = 4994 && AnimTime = 0
value = 5150

;=============================================================
;
;		Overwrite for roll
;
;=============================================================

; HITA_FALL (knocked up, falling)
[Statedef 5050]
type    = A
movetype= H
physics = N

[State 5050, 1] ;Change anim when done with transition
type = ChangeAnim
trigger1 = AnimTime = 0
trigger1 = Anim = 5035
trigger2 = Time = 0     ;If no transition anim
trigger2 = Anim != 5035
trigger2 = (Anim != [5051, 5059]) && (Anim != [5061, 5069])
trigger2 = Anim != 5090 ;Not if hit off ground anim
value = 5050

[State 5050, 2] ;Coming down anim
type = ChangeAnim
trigger1 = anim = [5050,5059]
trigger1 = Vel Y >= ifelse(anim = 5050, 1, -2)
trigger1 = SelfAnimExist(anim+10)
value = anim+10
persistent = 0

[State 5050, 3] ;Gravity
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 5050, 4] ;Recover near ground
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 5050, 6]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= ifelse((anim = [5051,5059]) || (anim = [5061,5069]), 0, 25)
value = 5100 ;HIT_BOUNCE

; HIT_FALLRECOVER (on the ground)
[Statedef 5201]
type    = S
movetype= H
physics = S
anim = 5200
velset = 0,0

[State 5201, 1] ;Turn if not facing opponent
type = Turn
trigger1 = Time = 0
trigger1 = p2dist X < -5

[State 5201, 3]
type = PosSet
trigger1 = Time = 0
y = 0

[State 5201, 4]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1

[State 360, push]
type = PlayerPush
trigger1 = 1
value = 0

[State 705, 1]
type = velset
trigger1 = Time = [1,16]
x = -4

[State 5201, 6]
type = GameMakeAnim
trigger1 = Time = 1
value = 60
pos = 0, 0
under = 1

[State 705, 1]
type = SelfState
trigger1 = Animtime = 0
value = 0
ctrl = 1
