; KFM's constants and state file.
; There are comments scattered through this file, so you may like to
; take a look if would like to learn more about the cns.

[Data]
  ;Amount of life to start with
life = 1000
  ;attack power (more is stronger)
attack = 100
  ;defensive power (more is stronger)
defence = 100
  ;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
  ;Time which player lies down for, before getting up
liedown.time = 60
  ;Number of points for juggling
airjuggle = 15
  ;Default hit spark number for HitDefs
sparkno = 2
  ;Default guard spark number
guard.sparkno = 40
  ;1 to enable echo on KO
KO.echo = 0
  ;Volume offset (negative for softer)
volume = 0
  ;Variables with this index and above will not have their values
  ;reset to 0 between rounds or matches. There are 60 int variables,
  ;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
  ;If omitted, then it defaults to 60 and 40 for integer and float
  ;variables repectively, meaning that none are persistent, i.e. all
  ;are reset. If you want your variables to persist between matches,
  ;you need to override state 5900 from common1.cns.
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 13    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 60	     ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too   
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 1.8      ;Walk forward
walk.back = -1.4     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-9.4    ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5       ;Jump forward Speed (x, y)
runjump.back = -2.55,-9.1 ;Running jump speeds (opt)
runjump.fwd = 4,-9.1      ;.
airjump.neu = 0,-9.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

[Movement]
airjump.num = 1      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .57         ;Vertical acceleration
stand.friction = .8  ;Friction coefficient when standing
crouch.friction = .8 ;Friction coefficient when crouching


;---------------------------------------------------------------------------
 RUN_FWD
[Statedef 100]
type    = S
physics = S
anim = 100

[State 100, 1]
type = VelSet
trigger1 = 1
x = 5
y = 0

[State 100,assert]
type = AssertSpecial
trigger1 = command = "holdfwd"
flag = nowalk


[State 100, 2]
type = ChangeState
trigger1 = command != "holdfwd"
value = 0

;---------------------------------------------------------------------------
 RUN_BACK
[Statedef 105]
type    = S
physics = S
anim = 105

[State 100, 1]
type = VelSet
trigger1 = 1
x = -5
y = 0

[State 100,assert]
type = AssertSpecial
trigger1 = command = "holdback"
flag = nowalk


[State 100, 2]
type = ChangeState
trigger1 = command != "holdback"
value = 0



;---------------------------------------------------------------------------
; Format:
; [Statedef STATENO]
; type = ?      S/C/A/L  stand/crouch/air/liedown
; movetype = ?  I/A/H    idle/attack/gethit
; physics = ?   S/C/A/N  stand/crouch/air/none
; juggle = ?             air juggle points move requires
;
; [State STATENO, ?]     ? - any number you choose
; type = ?
; ...

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS 儗儀儖: 婎杮
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 170, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

; WIN
[Statedef 180]
type = S

[State 180, 1] ;Vitoria Normal
type = ChangeState
trigger1 = Time = 0
trigger1 = Win = 1
value = 189

[State 180, 1] ; Final
type = ChangeState
trigger1 = Time = 0
trigger1 = Win = 0
value = 9797

; Final 
;Anima玢o do Final

[Statedef 9797]
type = S
ctrl = 0
velset = 0,0,0

[State 3000,MBS]
type = explod
trigger1 = AnimElem = 1
anim = 9797
facing = 1
pos = 0,0
postype = left
sprpriority = 1;-2
bindtime = -1
ownpal = 1
supermove = 1
removetime = 99999999999999999999999999

;---------------------------------------------------------------------------
; Win state decider
[Statedef 189]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181

;---------------------------------------------------------------------------
; Win pose 1 - Bow
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

[State 181, 1]
type = NotHitBy
trigger1 = Time >= 0
value = SCA
time = 1

;---------------------------------------------------------------------------
; Introduction
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[State 190, begin]
type = AssertSpecial
trigger1 = time = [0,400]
flag = intro

[State 190, 1] ;If opponent 
type = ChangeState
triggerall = Time = 0
trigger1 = P2Name = "Goku-n-hd by EmuBoarding"
trigger2 = P2Name = "N-Trunks by EmuBoarding"
trigger3 = P2Name = "Recoom by Lucifer"
trigger4 = P2Name = "Goku Super Sayajin 2 by ribeiro"
trigger5 = P2Name = "Mr.Satan"
trigger6 = P2Name = "Goku SSJ4 by _Vision and MRP"
trigger7 = P2Name = "Androide 18 by _Vision"
trigger8 = P2Name = "Broli Remix ver1.2"
trigger9 = P2Name = "Cell por Ssonic"
trigger10= P2Name = "Cell Junior by _Vision"
trigger11= P2Name = "C-Trunks by EmuBoarding"
trigger12= P2Name = "Freeza by OverMind";
trigger13= P2Name = "Goten by Alunfl@"
trigger14= P2Name = "Kaio Shin by Alunfl@"
trigger15= P2Name = "Kame by EmuBoarding"
trigger16= P2Name = "Kuririn by EmuBoarding"
trigger17= P2Name = "Mystic Gohan by Zero_X"
trigger18= P2Name = "Mr.Boo by OverMind"
value = 159999

[State 3000,MBS]
type = explod
trigger1 = AnimElem = 1
anim = 159999
facing = 1
pos = 10,67
postype = left
sprpriority = 1;-2
bindtime = 600
ownpal = 1
supermove = 1
removetime = 600

; INTRO Especial

;Intro pad鉶
[Statedef 159999]
type = S
ctrl = 0
anim = 190
velset = 0,0,0

[State 190, begin]
type = AssertSpecial
trigger1 = time = [0,700]
flag = intro

[State 3000,MBS]
type = explod
trigger1 = AnimElem = 1
anim = 159998
facing = 1
pos = 10,67
postype = left
sprpriority = 1;-2
bindtime = 600
ownpal = 1
supermove = 1
removetime = 900

[State 190, 3]
type = changestate
trigger1 = animtime = 800
value = 0
ctrl = 0


;---------------------------------------------------------------------------
; Taunt
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 195, 1]
type = CtrlSet
trigger1 = Time = 40
value = 1

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

;---------------------------------------------------------------------------
; Stand Light Punch
[Statedef 200]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = S                      ;Physics: S-stand, C-crouch, A-air
juggle  = 1                      ;Number of air juggle points move takes
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)

[State 200, 1]
type = HitDef
trigger1 = Time = 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
                                 ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, -40               ;X-offset for the "hit spark" rel. to p2,
                                 ;Y-offset for the spark rel. to p1
hitsound = S5, 0                  ;Sound to play on hit
guardsound = S6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 12             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
                                 ;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

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

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

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
velset = 0,0
anim = 210

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

[State 210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = S5,1
guardsound = S6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4

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

;---------------------------------------------------------------------------
; Standing light kick
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
velset = 0,0
anim = 230

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

[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-37
hitsound   = S5,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5

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

;---------------------------------------------------------------------------
; Standing strong kick
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 5
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2

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

[State 240, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 63
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = S5,1
guardsound = S6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2

[State 240, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 12

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

;---------------------------------------------------------------------------
;Crouching light punch
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 1
ctrl = 0
anim = 400

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
priority  = 3
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = 0
sparkxy = -10,-30
hitsound   = S5,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 12
ground.velocity = -4
air.velocity = -1.5,-3

[State 400, 3]
type = CtrlSet
trigger1 = Time = 5
value = 1

[State 400, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11

;---------------------------------------------------------------------------
;Crouching strong punch
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 6
ctrl = 0
anim = 410

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

[State 410, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -10,-30
hitsound   = S5,1
guardsound = S6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -3,-4

[State 410, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouching light kick
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 6
ctrl = 0
anim = 430

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

[State 430, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 28
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = 0
sparkxy = -10,-8
hitsound   = S5,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2,-3
down.velocity = -5,0
down.hittime = 20

[State 430, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Crouch Strong Kick
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 0
ctrl = 0
anim = 440

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

[State 440, 2]
type = Velset
trigger1 = AnimElem = 2
x = 4

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 72
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = 1
sparkxy = -5,-10
hitsound   = S5,1
guardsound = S6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -1.5,-2
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Punch
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 1
ctrl = 0
anim = 600

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

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 7,8
sparkno = 0
sparkxy = -10,-35
hitsound   = S5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -4
air.velocity = -1.3,-3

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;Jump Strong Punch
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
ctrl = 0
anim = 610

[State 610, 2]
type = PlaySnd
trigger1 = Time = 1
value = 200, 1

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 72
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-35
hitsound   = S5,1
guardsound = S6,0
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;Jump Light Kick
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
ctrl = 0
anim = 630

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

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 26
guardflag = HA
priority = 3
pausetime = 8,8
sparkno = 1
sparkxy = -5,-35
hitsound   = S5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 6
ground.velocity = -4
air.velocity = -2,-3

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;---------------------------------------------------------------------------
;Jump Strong Kick
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
ctrl = 0
anim = 640

[State 640, 2]
type = PlaySnd
trigger1 = Time = 1
value = 200, 1

[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
guardflag = HA
priority = 4
pausetime = 12,12
sparkno = 1
sparkxy = -10,-40
hitsound   = S5,1
guardsound = S6,0
animtype = Med
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -5
air.velocity = -3,-4

[State 440, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50
ctrl = 1

;-------------------------------------------------------------------------
; KI power up
[Statedef 700]
type = S
physics = S
anim = 700
ctrl = 0

[State 954, 1]
type = Explod
triggerall = IsHelper != 1
trigger1 = NumExplod(9000) = 0
id = 9000
anim = 9000
pos = 0,0
sprpriority = -3
removetime = -1
bindtime = -1
ownpal = 1

[State 954, 1] 
type = EnvShake
trigger1 = TimeMod = 4,0
time = 3
ampl = 2
freq = 127

[State 954, 1]
type = PlaySnd
trigger1 = TimeMod = 20,0
value = 700,0

[State 954, 2]
type = PowerAdd
trigger1 = AnimElem = 1
trigger2 = AnimElem = 2
value = 30

[State 954, 4]
type = ChangeState
trigger1 = command != "hold_s"
value = 701
ctrl = 0

;-------------------------------------------------------------------------
; KI power up (final)
[Statedef 701]
type = S
physics = S
anim = 701
ctrl = 0

[State 954, 4]
type = RemoveExplod
trigger1 = animtime = 0
ID = 9000

[State 954, 4]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Energy Dan ( esquerdo )
[Statedef 1000]
type    = S
movetype= A
physics = S
velset = 0,0
juggle = 0
ctrl = 0
anim = 1000

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

[State 1000, 4]
type = Projectile
trigger1 = AnimElem = 2
projanim = 6000
projhitanim = 7000
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 47,-41
velocity = 5
attr = S, SP
damage   = 60,10
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

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

;---------------------------------------------------------------------------
; Energy Dan ( direito )
[Statedef 1001]
type    = S
movetype= A
physics = S
velset = 0,0
juggle = 0
ctrl = 0
anim = 1001

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

[State 1000, 4]
type = Projectile
trigger1 = AnimElem = 2
projanim = 6000
projhitanim = 7000
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 47,-41
velocity = 5
attr = S, SP
damage   = 60,10
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -6
air.animtype = Back
air.velocity = -4,-6
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0

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

;---------------------------------------------------------------------------
; Zanzoken ( aleat髍io )
[statedef 1002]
type = S
Movetype = I
Physics = S
Anim = 1002
ctrl = 0

[state 700, 0]
type = playsnd
trigger1 = animelem = 3
value = 1002,0

[State 700, 1]
type = velset
trigger1 = time >= 0
trigger1 = time <= 48
x = 0
y = 0

[state 700, 2]
triggerall = p2bodydist X < 30
type = posadd
trigger1 = animelem = 4
x = -500

[state 700, 3]
triggerall = p2bodydist X < 500
type = posadd
trigger1 = animelem = 4
x = 300

[state 700, 3]
triggerall = p2bodydist X < 60
type = posadd
trigger1 = animelem = 4
x = -100

[state 700 ,5]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; Multiple Energy Dan ( inicio )
[Statedef 3000]
type    = S
movetype= A
physics = S
velset = 0,0
poweradd = -1000
juggle = 0
ctrl = 0
anim = 3000

[State 3000, 1]
type = explod
trigger1 = animelem = 1
anim = 9000
ID = 9000
pos = 0,0
postype = p1
sprpriority = -2
removetime = -1
bindtime = 1
supermove = 1
ownpal = 1

[State 3000, 1]
type = SuperPause
trigger1 = animelem = 1
pos = 12, -41
anim = 100
Time = 55

[State 3000, 1]
type = SuperPause
trigger1 = animelem = 1
pos = -7, -38
anim = 100
Time = 55

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

[State 1000, 8]
type = ChangeState
trigger1 = AnimTime = 0
value = 3001
ctrl = 0

;---------------------------------------------------------------------------
; Multiple Energy Dan ( o bombardeio )
[Statedef 3001]
type    = S
movetype= A
physics = S
velset = 0,0
juggle = 0
ctrl = 0
anim = 3001

[State 954, 4]
type = RemoveExplod
trigger1 = animelem = 1
ID = 9000

[State 210, 1] 
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 4
trigger3 = AnimElem = 6
trigger4 = AnimElem = 8
trigger5 = AnimElem = 10
trigger6 = AnimElem = 12
trigger7 = AnimElem = 14
trigger8 = AnimElem = 16
trigger9 = AnimElem = 18
trigger10 = AnimElem = 20
trigger11 = AnimElem = 22
trigger12 = AnimElem = 24
trigger13 = AnimElem = 26
trigger14 = AnimElem = 28
trigger15 = AnimElem = 30
trigger16 = AnimElem = 32
trigger17 = AnimElem = 34
trigger18 = AnimElem = 36
trigger19 = AnimElem = 38
trigger20 = AnimElem = 40
value = 300, 0

[State 1000, 4]
type = Projectile
trigger1 = AnimElem = 2
trigger2 = AnimElem = 4
trigger3 = AnimElem = 6
trigger4 = AnimElem = 8
trigger5 = AnimElem = 10
trigger6 = AnimElem = 12
trigger7 = AnimElem = 14
trigger8 = AnimElem = 16
trigger9 = AnimElem = 18
trigger10 = AnimElem = 20
trigger11 = AnimElem = 22
trigger12 = AnimElem = 24
trigger13 = AnimElem = 26
trigger14 = AnimElem = 28
trigger15 = AnimElem = 30
trigger16 = AnimElem = 32
trigger17 = AnimElem = 34
trigger18 = AnimElem = 36
trigger19 = AnimElem = 38
trigger20 = AnimElem = 40
projanim = 6000
projhitanim = 7000
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projshadow = -1
offset = 47,-41
velocity = 9
attr = S, HP
damage   = 16,10
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 10,10
hitsound   = 5,2
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -2
air.animtype = light
air.velocity = 0

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

;---------------------------------------------------------------------------
; KamheHame Ha
[Statedef 3002]
type    = S
movetype= A
physics = S
juggle  = 0
PowerAdd = -1000
velset = 0,0
anim = 3002
ctrl = 0

[State 3000, 1]
type = SuperPause
trigger1 = Time = 0
pos = -7, -35
anim = 100
Time = 55

[State 3000, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = F20, 0 

[State 3000, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 3003
ctrl = 0

;---------------------------------------------------------------------------
; KameHame Ha
[Statedef 3003]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3003
ctrl = 0

[State 3000, 4]
type = Projectile
trigger1 = AnimElem = 1
projanim = 6001
projhitanim = 6001
projhits = 20
projshadow = -1
projmisstime = 4
projpriority = 30
projremovetime = 150
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projid = 6004
velocity = 0.001,0.001
offset = 21,-42
attr = S, HP
damage   = 18,2
animtype = heavy
guardflag = MA
hitflag = MAFDP
pausetime = 1,5
hitsound   = S5,1
sparkxy = 500,500
guardsound = S6,0
ground.type = High
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -10,-2
air.animtype = Back
air.velocity = -10,-2
air.juggle = 3
air.fall = 1
down.velocity = -10
down.hittime = 30
down.bounce = 1
fall = 1
fall.recover = 0

[State 3000] 
type = explod
trigger1 = projcontact(6004) = 1
anim = 7001
pos = 0,-60
postype = p2
sprpriority = 999
bindtime = 1

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

;---------------------------------------------------------------------------
; Double Energy Dan Shot ( inicio )
[Statedef 3004]
type    = S
movetype= A
physics = S
juggle  = 0
PowerAdd = -1000
velset = 0,0
anim = 3004
ctrl = 0

[State 3000, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = F20, 0 

[State 3000, 1]
type = SuperPause
trigger1 = AnimElem = 1
pos = 15, -31
anim = 100
Time = 55

[State 3000, 1]
type = SuperPause
trigger1 = AnimElem = 1
pos = -15, -31
anim = 100
Time = 55

[State 3000, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 3005
ctrl = 0

;---------------------------------------------------------------------------
; Double Energy Dan Shot ( inicio )
[Statedef 3005]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3005
ctrl = 0

[State 954, 1]
type = Explod
trigger1 = AnimElem = 1
id = 7003
anim = 7003
pos = 15,-31
sprpriority = 2
removetime = -1
bindtime = -1
ownpal = 1

[State 954, 1]
type = Explod
trigger1 = AnimElem = 1
id = 7003
anim = 7003
pos = -15,-31
sprpriority = 2
removetime = -1
bindtime = -1
ownpal = 1

[State 3011, 1]
type = ChangeState
trigger1 = command != "hold_y"
trigger1 = command != "hold_x"
trigger1 = time > 30
value = 3006
ctrl = 0

;---------------------------------------------------------------------------
; Double Energy Dan Shot ( o tiro ) 
[Statedef 3006]
type    = S
movetype= A
physics = N
juggle  = 0
anim = 3006
ctrl = 0

[State 3011, 1]
type = RemoveExplod
trigger1 = AnimElem = 1
ID = 7003

[State 3011, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 201, 0 

[State 3000, 4]
type = Projectile
trigger1 = AnimElem = 1
projanim = 6002
projhitanim = 7002
projpriority = 1
projheightbound = -240
projstagebound = 500
projedgebound = 500
projshadow = -1
offset = 35,-42
velocity = 15
attr = S, SP
damage   = 360,30
animtype = light
guardflag = MA
pausetime = 10,10
hitsound   = S3000,0
sparkxy = 500,500
guardsound = S3000,0
ground.type = High
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -4,-5
air.animtype = light
air.velocity = -4,-5
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0
fall = 1
fall.recover = 0

[State 3000, 4]
type = Projectile
trigger1 = AnimElem = 1
projanim = 6003
projhitanim = 6003
projpriority = 4
projheightbound = -240
projstagebound = 500
projedgebound = 500
projshadow = -1
offset = 35,-42
velocity = 15
attr = S, SP
damage   = 360,30
animtype = light
guardflag = MA
pausetime = 10,10
hitsound   = S3000,0
sparkxy = 500,500
guardsound = S3000,0
ground.type = High
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -4,-5
air.animtype = light
air.velocity = -4,-5
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 0
fall = 1
fall.recover = 0

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

;---------------------------------------------------------------------------
; Override common states (use same number to override) :
;---------------------------------------------------------------------------

;---------------------------------------------------------------------------
; States that are always executed (use statedef -2)
;---------------------------------------------------------------------------

[Statedef -2]

; Power bar sobe sozinha
[State -2,1]
type = poweradd
trigger1 = time >= 0
trigger1 = palno = 1
trigger2 = palno = 2
trigger3 = palno = 3
trigger4 = palno = 4
trigger5 = palno = 5
trigger6 = palno = 6
trigger7 = palno = 7
trigger8 = palno = 8
trigger9 = palno = 9
trigger10 = palno = 10
trigger11 = palno = 11
trigger12 = palno = 12
value = 1

[State -2,1]
type = VarSet
trigger1 = palno = 1
trigger2 = palno = 2
trigger3 = palno = 3
trigger4 = palno = 4
trigger5 = palno = 5
trigger6 = palno = 6
trigger7 = palno = 7
trigger8 = palno = 8
trigger9 = palno = 9
trigger10 = palno = 10
trigger11 = palno = 11
trigger12 = palno = 12
v = 1
value = 1

; Remover KI
[State -2, 1]
type = RemoveExplod
trigger1 = Movetype = H
ID = 9000

; Remover energy dan
[State -2, 1]
type = RemoveExplod
trigger1 = Movetype = H
ID = 7003

; Toca sons de grito aleat髍io ao ser atingido
[State -2, 2]
type = VarRandom
triggerall = Time = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
v = 3
range = 0,24

; Toca "ouch" hit fraco e medio
[State -2, 3]
type = PlaySnd
triggerall = Var(3) = [0,4]
triggerall = time = 1
triggerall = stateno = 5000
triggerall = Alive = 1
trigger1 = anim = 5000
trigger2 = anim = 5001
trigger3 = anim = 5010
trigger4 = anim = 5011
value = 5000,0

; Fala de Pan aleat髍ia
[State -2, 4]
type = VarRandom
trigger1 = Time = 1
v = 4
range = 0,8

; A fala de Pan
[State -2, 5]
type = PlaySnd
triggerall = Var(4) = [0,4]
triggerall = time = 1
triggerall = Alive = 1
trigger1 = stateno = 210
trigger2 = stateno = 240
trigger3 = stateno = 410
trigger4 = stateno = 440
trigger5 = stateno = 610
trigger6 = stateno = 640
value = 300,0

;---------------------------------------------------------------------------
; States that are executed when in self's state file (use statedef -3)
;---------------------------------------------------------------------------

[Statedef -3]

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

