;---------------------------------------------------------------------------
; PUSH PUSH require:
;
; Variable usage
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(13)  - Used in kfm.cmd for combo condition (updated every tick)
; var(14)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;            held (remembered from state 800 through state 810).
; var(19)  - variabile identificativa dei char che usano il codice push push
;
; Anim e States usage
; 210		  - strong punch
; 920         - move anim
; 921		  - win fist anim
; 105		  - draw/escape move
; 5000	  - loose anim
; 922-923-924 - lighting effects



;---------------------------------------------------------------------------
; Standing strong punch

[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 210
sprpriority = -1

[State 210, Width]
type = Width
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (7) < 0)
value = 15,0

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

[State 210]
type = PlaySnd
trigger1 = animelem = 1
trigger1 = random > 500
value = 1000, 3

[State 210, 2]
type = HitDef
triggerall = enemy,AnimExist(920) = 0
trigger1 = time = 0
attr = S, NA
animtype  = Medium
damage    = 60,10
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-85
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4
priority = 4, hit

[State 210, VarRan]
type = VarRandom
trigger1 = time = 1
v = 4
range = 1,10

[State 210, 2]
type = HitDef
triggerall = enemy,AnimExist(920) = 1 && var(4) >= 5
trigger1 = P2StateNo = 210
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4
priority = 7, hit
p1stateno = 920
p2stateno = 925

[State 210, 2]
type = HitDef
triggerall = enemy,AnimExist(920) = 1 ;&& var(4) <= 4
triggerall = P2StateNo != 210
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4
priority = 6, hit

;[State 210, 4a]
;type = ChangeAnim
;trigger1 = AnimElemTime(5) > 0 && AnimElemTime(6) <= 0
;trigger1 = movecontact
;ignorehitpause = 1
;persistent = 0
;value = 210
;elem = 3

[State 210, 4b]
type = SprPriority
trigger1 = AnimElem = 5
value = 2

[State 210, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 990
ctrl = 1

[Statedef 920]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 65
ctrl = 0
velset = 0,0
anim = 920
sprpriority = -1

[State 920, Super A]
type = SuperPause
triggerall = var(0) = 0
trigger1 = time = 0
anim = -1
sound = 20, 0

[State 920, Super D]
type = EnvColor
trigger1 = time = 0
value = 0,0,0
under = 1
time = 180

[State 920, Super B]
type = Explod
triggerall = var(0) = 0
trigger1 = time > 0
anim = F170 
postype = back
pos = 0,0
bindtime = 1
supermove = 1
sprpriority = -1
ontop = 0
ownpal = 1

[State 920, effetto lampi 1]
type = Explod
pos = -13,-93
trigger1 = Animelem = 2
trigger2 = Animelem = 12
trigger3 = Animelem = 16
trigger4 = Animelem = 26
trigger5 = Animelem = 30
trigger6 = Animelem = 39
anim = 922
sprpriority = -1
ontop = 1

[State 920, effetto lampi 2]
type = Explod
pos = -22,-105
trigger1 = Animelem = 5
trigger2 = Animelem = 9
trigger3 = Animelem = 21
trigger3 = Animelem = 31
trigger5 = Animelem = 47
anim = 923
sprpriority = -1
ontop = 1

[State 920, effetto lampi 3]
type = Explod
pos = -17,-83
trigger1 = Animelem = 2
trigger2 = Animelem = 18
trigger3 = Animelem = 22
trigger4 = Animelem = 33
trigger5 = Animelem = 41
anim = 924
sprpriority = -1
ontop = 1

[State 920, vs]
type = varset
trigger1 = 1
var(19) = 0

[state 920, vs1]
type = varset
trigger1 = time = 0
var(13) = 0

[state 920, vs2]
type = varset
trigger1 = time = 0
var(14) = 0

[State 920, 1a]
type = SprPriority
triggerall = IsHomeTeam
trigger1 = AnimElem = 1
value = 10

[State 920, 1b]
type = SprPriority
triggerall = !IsHomeTeam
trigger1 = AnimElem = 1
value = 9

[State 920, sound]
type = PlaySnd
trigger1 = Time = 1
value = 4000,11
channel = 11

[state 920, 2]
type = posset
trigger1 = time = 1
y = 0

[state 920, 3a]
type = varadd
triggerall = IsHomeTeam
trigger1 = command = "y"
var(13) = 1

[state 920, AI activation1]
type = VarRandom
trigger1 = var(0) = 1
v = 13
range = 10, 15

[state 920, 3b]
type = varadd
triggerall = !IsHomeTeam
trigger1 = command = "y"
var(14) = 1

[state 920, AI activation2]
type = VarRandom
trigger1 = var(0) = 1
v = 14
range = 10, 17

[State 920, stop-sound]
type = Stopsnd
trigger1 = AnimElem = 46
channel = 11

[State 210, 4vince]  
type = ChangeState
triggerall = IsHomeTeam
triggerall = time >= 142
trigger1 = var(13) > enemy,var(14)
value = 921
ctrl = 0

[State 210, 4perde]
type = ChangeState
triggerall = IsHomeTeam
triggerall = time >= 142
trigger1 = var(13) < enemy,var(14)
value = 195;5000
ctrl = 0

[State 210, 4pareggia]
type = ChangeState
triggerall = IsHomeTeam
triggerall = time >= 142
trigger1 = var(13) = enemy,var(14)
value = 105
ctrl = 1

[State 210, 4vince]
type = ChangeState
triggerall = !IsHomeTeam
triggerall = time >= 142
trigger1 = var(14) > enemy,var(13)
value = 921
ctrl = 0

[State 210, 4perde]
type = ChangeState
triggerall = !IsHomeTeam
triggerall = time >= 142
trigger1 = var(14) < enemy,var(13)
value = 195;5000
ctrl = 0

[State 210, 4pareggia]
type = ChangeState
triggerall = !IsHomeTeam
triggerall = time >= 142
trigger1 = var(14) = enemy,var(13)
value = 105
ctrl = 1

;finale
[Statedef 921]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
velset = 0
anim = 921

[State 921, sounds]
type = PlaySnd
trigger1 = AnimElem = 4 
trigger2 = AnimElem = 7 && movehit
trigger3 = AnimElem = 11 && movehit
trigger4 = AnimElem = 17 && movehit
value = 301,4

[State 921, movefwd]
type = VelSet
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
trigger3 = AnimElem = 3 
trigger4 = AnimElem = 4
trigger5 = AnimElem = 5
x = 3.0

[State 921, 2]
type = HitDef
trigger1 = animelem = 4
trigger2 = animelem = 7
trigger3 = animelem = 11
attr = S, SA
damage    = 65,6
animtype  = hard
getpower  = 10
givepower = 8
hitflag = MA
guardflag = MA
pausetime = 6,56
sparkno = 10
sparkxy = -7,-80
hitsound   = S0,6
guardsound = 6,0
ground.type = high
ground.slidetime = 14
ground.hittime  = 25
ground.velocity = 0,-0.5
air.velocity = 0,-0.5
guard.velocity = -1

[State 921, 2]
type = HitDef
triggerall = movehit 
trigger1 = Animelem = 17
attr = S, SA
damage    = 100,25
animtype  = Diagup
getpower  = 10
givepower = 8
hitflag = MA
guardflag = MA
pausetime = 2,19
sparkxy = -7,-90
sparkno = 12
hitsound   = S0,3
guardsound = 192, 1
ground.type = high
ground.slidetime = 2
ground.hittime  = 5
air.velocity = -2,-9
ground.velocity = -3,-9
fall = 1
yaccel = 0.4
fall.recover = 0

[State 921,hit nero]
type = Envcolor
triggerall = movehit = 1
trigger1 = animelem = 3
trigger1 = animelem = 5
trigger2 = animelem = 6
trigger3 = animelem = 7
trigger4 = animelem = 8
trigger5 = animelem = 9
trigger6 = animelem = 10
trigger7 = animelem = 11
trigger10 = animelem = 14
ignorehitpause = 1
value = 0, 0, 0
time = 1
under = 1
supermove = 1

[State 921,hit bianco]
type = Envcolor
triggerall = movehit = 1
trigger1 = animelem = 3
trigger1 = animelem = 5
trigger2 = animelem = 6
trigger3 = animelem = 7
trigger4 = animelem = 8
trigger5 = animelem = 9
trigger6 = animelem = 10
trigger7 = animelem = 11
trigger10 = animelem = 14
ignorehitpause = 1
value = 255, 255, 255
time = 1
under = 1
supermove = 1

[State 921, exit1]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = power < 3000
value = 992
ctrl = 1

[State 921, exit2]
type = ChangeState
trigger1 = AnimElem = 18
;trigger1 = AnimTime = 0
trigger1 = power >= 3000
value = 1000
ctrl = 1

;P2 tmp
[Statedef 925]
type    = S
movetype= H
physics = N
velset = 0,0

[State 925, 2]
type = SelfState
trigger1 = time = 1
value = 920


