[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1000
;attack power (more is stronger)
;攻撃ダメージ
attack = 96
;defensive power (more is stronger)
;体力パワー
defence = 90
;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 = 24
;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 = 255
;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 = 59
FloatPersistIndex = 40

[Size]
xscale = .5           ;Horizontal scaling factor.
yscale = .5           ;Vertical scaling factor.
ground.back = 20     ;Player width (back, ground)
ground.front = 22    ;Player width (front, ground)
air.back = 7        ;Player width (back, air)
air.front = 7       ;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  = 2.4      ;Walk forward
walk.back = -2.2     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-3.8 ;Hop backward (x, y)
jump.neu = 0,-8.7    ;Neutral jumping velocity (x, y)
jump.back = -2.88    ;Jump back Speed (x, y)
jump.fwd = 2.8       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.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 = .45         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

;---------------------------------------------------------------------------
; 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 = 0
velset = 0,0

[State 0, ]
type = Helper
trigger1 = Time = 1
helpertype = normal
name = "Bus"
ID = 2000
pos = -200,0
postype = back
facing = 1
stateno = 1831
ownpal = 1
size.xscale = 1
size.yscale = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = matchover = 0
trigger1 = roundstate >= 2
value = ifelse(random<500,181,ifelse(random<500,187,183))

[State 180, 1]
type = ChangeState
triggerall = matchover = 1
trigger1 = var(46) = 1
value = ifelse(random<500,185,186)

[State 180, 1]
type = ChangeState
trigger1 = matchover = 1
trigger2 = roundstate < 2
value = ifelse(random<500,182,184)

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 181]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
trigger1 = random < 300
name = "fade from white"
stateno = 740
facing = ifelse(random<500,-1,1)
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 182]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time = 0
trigger2 = time = 30
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
trigger2 = time = 30
name = "fade from white"
ID = 665
stateno = ifelse(time=0,666,667)
ownpal = 1
ontop = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

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

;[State 0, ]
;type = EnvColor
;trigger1 = time = 30
;value = 255,255,255
;time = 10

[State 0, ]
type = EnvColor
trigger1 = time >= 31
value = 0,0,0
time = 1

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 160,120
postype = left
bindtime = -1
removetime = -1
ontop = 1
sprpriority = -2
ownpal = 1
ignorehitpause = 1

;---------------------------------------------------------------------------
; Win pose 3 - bus
[Statedef 183]
type = S
ctrl = 0
anim = 0
velset = 0,0

[State 0, ]
type = HitBy
trigger1 = 1
value = SCA,AA,AP,AT
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,15

[State 0, ]
type = Explod
trigger1 = timemod = 10,2
anim = 9991
pos = -60,ceil(screenpos y)
postype = back
vel = 6,0
removetime = 150
scale = .5,.5
sprpriority = 6
removetime = 140

;---------------------------------------------------------------------------
; The bus of doom
[Statedef 1831]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 13,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 2000                       ;Change animation (Def: no change)
sprpriority = 10                  ;Set layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, HP                     ;Attribute: Standing, Normal Attack
damage = 350, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag =                    ;Flags on how move is to be guarded against
hitflag = MAFPD                    ;Flags of conditions that move can hit
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = 0,0
hitsound = S666, 0                  ;Sound to play on hit
guardsound = -1                ;Sound to play on guard
ground.type = Low               ;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 = -1,-30             ;Velocity at which opponent is pushed
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1,-30           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0
fall.damage = 30
affectteam = F
p2stateno = 1832

[State 0, ]
type = DestroySelf
trigger1 = time >= 300
ignorehitpause = 1

;---------------------------------------------------------------------------
; Ouch!
[Statedef 1832]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= H                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 4,-7                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 5070                       ;Change animation (Def: no change)
sprpriority = 10                  ;Set layering priority to 2 (in front)

[State 0, ]
type = ScreenBound
trigger1 = 1
value = 0

;---------------------------------------------------------------------------
; Win pose 4
[Statedef 184]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
trigger2 = time = 30
name = "fade from white"
ID = 665
stateno = ifelse(time=0,666,667)
ownpal = 1
ontop = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

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

[State 0, ]
type = EnvColor
trigger1 = time >= 31
value = 0,0,0
time = 1

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 50,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 100,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 150,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 200,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 250,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 50,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 100,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 150,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 200,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 250,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 50,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 100,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 150,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 200,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 250,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 50,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 100,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 150,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 200,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

[State 0, ]
type = Explod
trigger1 = time = 31
anim = 9990
pos = 250,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5
sprpriority = -2

;---------------------------------------------------------------------------
; Win pose 1 - SMACK!
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 185]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 5

[State 0, ]
type = PlaySnd
trigger1 = Time = 20
value = S0,17

[State 0, ]
type = PlaySnd
trigger1 = Time = 30
value = S0,14

[State 0, ]
type = EnvColor
trigger1 = time = 30
value = 255,255,255
time = 10

[State 0, ]
type = EnvColor
trigger1 = time >= 40
value = 0,0,0
time = 1

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 160,120
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = Time = 50
value = S0,15

;---------------------------------------------------------------------------
; Win pose AAAAAAARGHH!!!!!!!!!
[Statedef 186]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 5

[State 0, ]
type = PlaySnd
trigger1 = Time = 30
value = S0,14

[State 0, ]
type = EnvColor
trigger1 = time = 30
value = 255,255,255
time = 10

[State 0, ]
type = PlaySnd
trigger1 = Time >= 40
trigger1 = random < 500
value = S0,ifelse(random<500,16,17)

[State 0, ]
type = EnvColor
trigger1 = time >= 40
value = 0,0,0
time = 1

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 50,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 100,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 150,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 200,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 250,50
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 50,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 100,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 150,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 200,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 250,100
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 50,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 100,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 150,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 200,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 250,150
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 50,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 100,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 150,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 200,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

[State 0, ]
type = Explod
trigger1 = time = 40
anim = 185
pos = 250,200
postype = left
bindtime = -1
removetime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
scale = .5,.5

;---------------------------------------------------------------------------
; Moonwalking shoes
[Statedef 187]
type = S
ctrl = 0
anim = 21
velset = -2,0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = pos x

[State 0, PlaySnd]
type = PlaySnd
trigger1 = timemod = 55,2
value = S0,23
[State 0, PosSet]
type = PosSet
trigger1 = timemod = 55,2
x = var(0)


;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "What The Fuck" || p4name = "What The Fuck"
anim = 8000
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "Developer Fags You Imbecile" || p4name = "Developer Fags You Imbecile"
trigger1 = teamside = 1
anim = 8001
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "Clark Steel" || p4name = "Clark Steel"
anim = 8003
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "Evil Ken" || p4name = "Evil Ken"
trigger2 = p2name = "Thanos" || p4name = "Thanos"
trigger3 = p2name = "Gill by Cad" || p4name = "Gill by Cad"
trigger4 = p2name = "Perfect Weapon MB-02" || p4name = "Perfect Weapon MB-02"
anim = 8004
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "Another Ken" || p4name = "Another Ken"
trigger2 = p2name = "RH-00 test type" || p4name = "RH-00 test type"
anim = 8005
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 0, ]
type = Explod
triggerall = numexplod(1999) = 0
trigger1 = p2name = "EVIL BALROG!!!11" || p4name = "EVIL BALROG!!!11"
trigger2 = p2name = "Evil Balrog" || p4name = "Evil Balrog"
anim = 8006
ID = 1999
pos = 0,0
postype = left
bindtime = -1
scale = .5, .5
ontop = 1
ownpal = 1
ignorehitpause = 1

[State 190, 2] ;Special intro vs porings
type = ChangeState
triggerall = Time = 0
trigger1 = p2name = "Ex-Inferis" || p4name = "Ex-Inferis"
trigger2 = p2name = "Radish ssj4 by THE VICIOUS" || p4name = "Radish ssj4 by THE VICIOUS"
trigger3 = p2name = "Somos" || p4name = "Somos"
trigger4 = p2name = "oni chizuru" || p4name = "oni chizuru"
trigger5 = p2name = "KuroNeko" || p4name = "KuroNeko"
trigger6 = p2name = "Isabeau" || p4name = "Isabeau"
trigger7 = p2name = "Galactic Monkey" || p4name = "Galactic Monkey"
trigger8 = p2name = "Elque" || p4name = "Elque"
trigger9 = p2name = "Obeese Cheese Boy" || p4name = "Obeese Cheese Boy"
trigger10 = p2name = "Zero Hotaru" || p4name = "Zero Hotaru"
trigger11 = p2name = "Syous" || p4name = "Syous"
trigger12 = p2name = "Death13" || p4name = "Death13"
trigger13 = p2name = "Justice" || p4name = "Justice"
trigger14 = p2name = "Ogre" || p4name = "Ogre"
trigger15 = p2name = "  Dyan Weinert Kirichenko da Silva" ||p4name = "  Dyan Weinert Kirichenko da Silva"
trigger16 = p2name = "Dooby Dummy" || p4name = "Dooby Dummy"
trigger17 = enemy, Name = "Zero_Col"
trigger18 = enemy, Name = "Mizuchi"
trigger19 = enemy, Name = "Psycho Shredder[S]"
trigger20 = enemy, Name = "Go Hibiki"
trigger21 = enemy, AuthorName = "supermystery"
trigger22 = enemy, AuthorName = "Snowwolf"
trigger23 = enemy, AuthorName = "Smoke"
trigger24 = enemy, Name = "Sonso"
trigger25 = enemy, Name = "Blue"
trigger26 = enemy, Name = "mechhisuiex"
trigger27 = enemy, Name = "Super Mario 64"
trigger28 = enemy, Name = "Broly mode soft"
trigger29 = enemy, Name = "seph"
trigger30 = enemy, Name = "Himan version beta"
trigger31 = enemy, Name = "naruto-kun"
trigger32 = enemy, Name = "sasuke-kun"
trigger33 = enemy, Name = "Super Sailor Chibi Moon"
trigger34 = enemy, Name = "Eternal SailorMoon"
trigger35 = enemy, Name = "[KoYotae]'s Zangief"
trigger36 = enemy, Name = "Athena Asamiya"
trigger37 = enemy, Name = "Evil Ken"
trigger38 = enemy, Name = "Gouken"
trigger39 = enemy, Name = "Mega_Weapon"
trigger40 = enemy, Name = "Super Dizzy"
value = 198

[State 0, ]
type = VarRandom
trigger1 = Time = 0
v = 0
range = 0,6

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = 191 + var(0)

;---------------------------------------------------------------------------
; Intro 1
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Intro 2
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Intro 3
[Statedef 193]
type = S
ctrl = 0
anim = 9999
velset = 0,0

[State 0, ]
type = Explod
trigger1 = Time = 0
anim = 193
ID = 193
removetime = 140
scale = .5, .5
sprpriority = 0
shadow = 255,255,255
removeongethit = 1
ignorehitpause = 1

[State 0, ]
type = Explod
trigger1 = time = 110
anim = 0
pos = 0,-270
postype = p1
vel = 0,8
removetime = 30
scale = .5, .5
sprpriority = -1
shadow = 255,255,255

[State 0, ]
type = EnvColor
trigger1 = time >= 140
value = 0,0,0

[State 0, ]
type = VarRandom
trigger1 = 1
v = 0
range = 0,3

[State 0, ]
type = VarRandom
trigger1 = 1
v = 1
range = -20,20

[State 0, ]
type = VarRandom
trigger1 = 1
v = 2
range = -70,-10

[State 810, Grab Sound]
type = PlaySnd
trigger1 = Time = 142
trigger2 = Time = 145
trigger3 = Time = 146
trigger4 = Time = 150
trigger5 = Time = 151
trigger6 = Time = 152
trigger7 = Time = 155
trigger8 = Time = 157
trigger9 = Time = 159
trigger10 = Time = 161
trigger11 = Time = 167
trigger12 = Time = 169
trigger13 = Time = 170
trigger14 = Time = 175
value = F5,3

[State 0, ]
type = HitAdd
trigger1 = Time = 142
trigger2 = Time = 145
trigger3 = Time = 146
trigger4 = Time = 150
trigger5 = Time = 151
trigger6 = Time = 152
trigger7 = Time = 155
trigger8 = Time = 157
trigger9 = Time = 159
trigger10 = Time = 161
trigger11 = Time = 167
trigger12 = Time = 169
trigger13 = Time = 170
trigger14 = Time = 175
value = 1

[State 0, ]
type = Explod
trigger1 = Time = 142
trigger2 = Time = 145
trigger3 = Time = 146
trigger4 = Time = 150
trigger5 = Time = 151
trigger6 = Time = 152
trigger7 = Time = 155
trigger8 = Time = 157
trigger9 = Time = 159
trigger10 = Time = 161
trigger11 = Time = 167
trigger12 = Time = 169
trigger13 = Time = 170
trigger14 = Time = 175
anim = F var(0)
pos = var(1),var(2)
postype = p1
facing = 1
vfacing = 1
bindtime = -1
ontop = 1
ownpal = 1
ignorehitpause = 1
persistent = 1

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = Time = 70
value = S0,10

[State 0, ]
type = Explod
trigger1 = Time = 199
anim = 1935
ID = 1935
scale = 1, 1
sprpriority = 0
shadow = 255,255,255
removeongethit = 1
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = time = 201
value = S666,1

[State 0, ]
type = ChangeState
trigger1 = time = 201
value = 0
ctrl = 0

;---------------------------------------------------------------------------
; Intro 4
[Statedef 194]
type = S
ctrl = 0
anim = 194
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,11

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Intro 5
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;--------------------------------------------------------------------------
; Intro 6
[Statedef 196]
type = S
ctrl = 0
anim = 196
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,12

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = time >= 120
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = time >= 120
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = time >= 120
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = time >= 120
trigger1 = AnimTime = 0
value = 0

;--------------------------------------------------------------------------
; Intro 7
[Statedef 197]
type = S
ctrl = 0
anim = 197
velset = 0,0

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = PlaySnd
trigger1 = AnimTime = 0
value = S1,4

[State 0, ]
type = EnvColor
trigger1 = Animtime = 0
value = 255,255,255
time = 1

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "fade from white"
ID = 665
stateno = 666
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;--------------------------------------------------------------------------
; Intro 8
[Statedef 198]
type = S
movetype = A
ctrl = 0
anim = 9998
velset = 0,0

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,13

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,13

[State 191, 2] ;Assert this until you want "round 1, fight" to begin
type = AssertSpecial
trigger1 = 1
flag = Intro

[State 0, ]
type = Explod
trigger1 = Time = 185
anim = 198
ID = 198
pos = 0,-40
postype = p2
scale = 1, 1
sprpriority = -10
shadow = 255,255,255
removeongethit = 1
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = Time = 206
attr = S, HA                     ;Attribute: Standing, Normal Attack
damage = 200, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
hitflag = MAFD                    ;Flags of conditions that move can hit
guardflag = 
pausetime = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
hitsound = S0,14                  ;Sound to play on hit
guardsound = S0,14                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0             ;Time that the opponent slides back
ground.hittime  = 12             ;Time opponent is in hit state
ground.velocity = 0             ;Velocity at which opponent is pushed
airguard.velocity = 0,-.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 = 0,-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
fall = 1
fall.recover = 0

[State 0, ]
type = EnvColor
trigger1 = Time = 206
value = 255,0,0
time = 1

[State 0, Helper]
type = Helper
trigger1 = time = 206
name = "fade from red"
ID = 665
stateno = 665
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 191, 3] ;Change to stand state when done
type = ChangeState
trigger1 = Time = 207
value = 0


;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[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  = 2                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 200                       ;Change animation (Def: no change)
poweradd = 20                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 23, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;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
pausetime = 8, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 0                      ;Spark anim no (Def: set above)
sparkxy = -10, ceil(-65*const(size.yscale))               ;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 = Low               ;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 = -3.5             ;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 = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-5           ;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 you can just block]
type = StateTypeSet
trigger1 = animelem = 4
movetype = I

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

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

;---------------------------------------------------------------------------
; Stand Medium Punch
; CNS difficulty: easy
[Statedef 210]
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  = 5                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 210                       ;Change animation (Def: no change)
poweradd = 20                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 0, VelAdd]
type = VelAdd
trigger1 = animelem = 6
x = 7
[State 200, 1]
type = HitDef
trigger1 = AnimElem = 8
priority = 4
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 70, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;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
pausetime = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 1                      ;Spark anim no (Def: set above)
sparkxy = 0, ceil(-90*const(size.yscale))               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S5, 1                  ;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  = 18             ;Time opponent is in hit state
ground.velocity = -8             ;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 = -3,-6           ;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 you can just block]
type = StateTypeSet
trigger1 = animelem = 9
movetype = I

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

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

;---------------------------------------------------------------------------
; Stand High Punch
[Statedef 220]
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  = 5                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 220                       ;Change animation (Def: no change)
poweradd = 100                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 0, VarSet]
type = VarSet
trigger1 = var(57) = 0
trigger1 = time = 0
var(0) = ifelse(command="x",0,(ifelse(command="y",1,2)) )
ignorehitpause = 1
[State 0, VarSet]
type = VarRandom
trigger1 = var(57) > 0
trigger1 = time = 0
v = 0
range = 0,2
ignorehitpause = 1

[State 0, ]
type = VarSet
trigger1 = var(0) = 0
fv = 10
value = cos(gametime*.05)*2
ignorehitpause = 1
[State 0, ]
type = VarSet
trigger1 = var(0) = 1
fv = 10
value = (random / 125) - 4
ignorehitpause = 1
[State 0, ]
type = VarSet
trigger1 = var(0) = 1
fv = 11
value = (random / 2000)
ignorehitpause = 1
[State 0, ]
type = VarSet
trigger1 = var(0) = 2
fv = 10
value = 47
ignorehitpause = 1

[State 0, ]
type = null;Helper
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
trigger4 = AnimElem = 5
trigger5 = AnimElem = 6
trigger6 = AnimElem = 7
trigger7 = AnimElem = 8
trigger8 = AnimElem = 9
trigger9 = AnimElem = 10
trigger10 = AnimElem = 11
helpertype = normal
name = "Head"
ID = 220
pos = -16,-32
postype = p1
facing = 1
stateno = 225
ownpal = 1
ignorehitpause = 1
persistent = 1

[State 0, Projectile]
type = Projectile
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
trigger4 = AnimElem = 5
trigger5 = AnimElem = 6
trigger6 = AnimElem = 7
trigger7 = AnimElem = 8
trigger8 = AnimElem = 9
trigger9 = AnimElem = 10
trigger10 = AnimElem = 11
ProjID = 220
projanim = 225
;projhitanim = 225
;projremanim =
;projcancelanim =
projscale = 0.5,0.5
projremove = 1
projremovetime = 10
velocity = ifelse(fvar(10)!=47,11 ,10),ifelse(fvar(10)!=47,fvar(10),0)
;remvelocity = 0,0
accel = ifelse(var(10)!=1,0,fvar(11)),ifelse(fvar(10)!=47,0,-1.7)
velmul = 1
projhits = 1
projpriority = 1
projsprpriority = 3
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = -16,-32
postype = p1         ;p2,front,back,left,right
attr = S,SP
hitflag = MAF
guardflag = MA
animtype = hard
priority = 3,Hit   ;Hit,Miss,Dodge
damage = 10,0
sparkno = 2
sparkxy = 0,0
hitsound = S5,0
guardsound = S6,0
ground.type = Low
air.type = Low
ground.slide = 5
ground.hittime = 13
air.hittime = 20
ground.velocity = -3.7
air.velocity = -3,-3
air.juggle = 1
sprpriority = 2

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

;---------------------------------------------------------------------------
; Flying Head
[Statedef 225]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 11,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 225                       ;Change animation (Def: no change)
sprpriority = 5                  ;Set layering priority to 2 (in front)

[State 0, ]
type = VelSet
trigger1 = time = 0
trigger1 = root, fvar(10) != 47
y = root, fvar(10)
ignorehitpause = 1
[State 0, ]
type = VelAdd
trigger1 = root, fvar(10) = 47
y = -0.88
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, NP                     ;Attribute: Standing, Normal Attack
damage = 12, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;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
pausetime = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = 2                      ;Spark anim no (Def: set above)
sparkxy = 0, 0               ;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 = Low               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 14             ;Time opponent is in hit state
ground.velocity = -1             ;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 = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-1           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
getpower = 1,0

[State 200, 7]
type = DestroySelf
trigger1 = movecontact
trigger2 = pos y >= 0
trigger3 = time >= 10

;---------------------------------------------------------------------------
; True Stand High Punch
[Statedef 222]
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  = 3                      ;Number of air juggle points move takes
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 222                       ;Change animation (Def: no change)
poweradd = 60                    ;Power to add (Def: 0)
sprpriority = 0                  ;Set layering priority to 2 (in front)

[State 0, ]
type = Explod
trigger1 = animelem = 3
anim = 221
pos = 0,0
postype = p1
facing = 1
bindtime = -1
scale = .5, .5
sprpriority = 6
ownpal = 1
removeongethit = 1
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = animelem = 4
value = 0,2

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
priority = 5
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 95, 0                   ;Damage that move inflicts, guard damage
animtype = diagup                 ;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
pausetime = 0, 8                 ;Time attacker pauses, time opponent shakes
sparkno = 2                      ;Spark anim no (Def: set above)
sparkxy = 0, ceil(-67*const(size.yscale))
;Y-offset for the spark rel. to p1
hitsound = S5, 3                  ;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  = 18             ;Time opponent is in hit state
ground.velocity = -12,-3             ;Velocity at which opponent is pushed
air.velocity = -12,-3
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1

[State you can just block]
type = StateTypeSet
trigger1 = animelem = 8
movetype = I

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

;---------------------------------------------------------------------------
;Crouching light punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning
;     KFM will get hit instead of trading hits with his opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
animtype  = Light
hitflag = MAFPD
guardflag = L
pausetime = 8,0
sparkno = 0
sparkxy = -10,ceil(-15*const(size.yscale))
hitsound   = S5,0
guardsound = S6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 12
ground.velocity = -2
air.velocity = -1.5,-3

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

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
; CNS レベル: 易
; 詳細: これは殴打が二発ある攻撃です。
; 殴打できるアニメーションの枚は一々HitDefを登録しています。
; 一発目の攻撃のHitDefにはguardflagが「M」（middle＝中段ガード）
; にセットされているので、相手は空中でガードできません。二発目
; の攻撃のguardflagは「MA」（middle+air＝中段＋空中ガード）で、
; 地上、空中でもガードすることができます。
[Statedef 410]
type    = C
movetype= A
physics = N
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2
velset = 6,-4

[State 0, ]
type = Gravity
trigger1 = 1

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

[State 410, 2]
type = HitDef
trigger1 = Time = 1
attr = C, NA
priority = 4
damage    = 68
animtype  = Medium
hitflag = MAFPD
guardflag = L
pausetime = 0,0
sparkno = 1
sparkxy = 0,0
hitsound   = S5,1
guardsound = S6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -2,-4
air.type = trip
air.fall = 1

[State 0, ]
type = VelSet
trigger1 = time >= 5
trigger1 = pos y >= 0
y = 0
ignorehitpause = 1

[State 410, 1]
type = PlaySnd
trigger1 = time >= 5
trigger1 = pos y >= 0
value = 1, 5

[State 410, 4]
type = ChangeState
trigger1 = time >= 5
trigger1 = pos y >= 0
value = 11
ctrl = 1

; Crouch Strong Kick
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = 8
poweradd= 70
ctrl = 0
anim = 420
sprpriority = 2

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

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

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

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 3
ctrl = 0
sprpriority = 2

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

[State 0, ]
type = null;Helper
trigger1 = Time = 1
helpertype = normal
name = "Star Platinum"
pos = 0,-52
postype = p1
facing = 1
stateno = 601
ownpal = 1
size.xscale = .5
size.yscale = .5

[State 0, Projectile]
type = Projectile
trigger1 = time = 1
ProjID = 600
projanim = 600
;projhitanim = 225
;projremanim =
;projcancelanim =
projscale = 0.5,0.5
projremove = 1
velocity = 6,(P2Dist Y * 4) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y))))
projhits = 1
projpriority = 1
projsprpriority = 3
projedgebound = 40
projstagebound = 40
projheightbound = -240
offset = 0,-52
postype = p1
attr = S,NP
hitflag = MAF
guardflag = MA
animtype = light
priority = 2,Hit
damage = 9,0
sparkno = 0
sparkxy = 0,0
hitsound = S5,0
guardsound = S6,0
ground.type = High
air.type = Low
ground.slide = 2
ground.hittime = 4
ground.velocity = -4
air.velocity = -2,-3
air.juggle = 1
sprpriority = 2
getpower = 3
givepower = 6

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

;---------------------------------------------------------------------------
; Star Platinum
[Statedef 601]
type    = A
movetype= A
physics = N
ctrl = 0
velset = 4,0
anim = 600
sprpriority = 3

[State 210, 5]
type = Varset
trigger1 = time = 0
fv = 0
value = (P2Dist Y * 6) / (Exp(0.5*ln((P2Dist X * P2Dist X) + (P2Dist Y * P2Dist Y))))

[State 210, 5]
type = VelSet
trigger1 = time = 0
y = fvar(0)

[State 210, 2]
type = HitDef
trigger1 = time = 0
attr = A, NP
animtype  = Hard
damage    = 9,0
guardflag = MA
pausetime = 0,0
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = 0,0
hitsound   = S5,0
guardsound = S6,0
ground.type = High
ground.slidetime = 2
ground.hittime  = 4
ground.velocity = -2
air.velocity = -2,-3
guard.kill = 0
getpower = 3
givepower = 6

[State 210, 5]
type = DestroySelf
trigger1 = movecontact
trigger2 = screenpos x != [0,320]
trigger3 = pos y >= 0

;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 65
ctrl = 0
anim = 610
sprpriority = 2

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

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

;---------------------------------------------------------------------------
;Jump UltraStrong Punch
; CNS difficulty: easy
[Statedef 620]
type    = A
movetype= A
physics = N
juggle  = 4
poweradd= 100
ctrl = 0
anim = 620
sprpriority = 2
velset = 0,0

[State 0, ]
type = EnvShake
trigger1 = time = 0
time = 20
freq = 120
ignorehitpause = 1

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

[State 0, ]
type = StateTypeSet
trigger1 = animelem = 12
movetype = I
physics = A
ignorehitpause = 1

[State 610, 3]
type = HitDef
trigger1 = Time = 0
animtype = Hard
attr = A, NA
damage = 100
guardflag = HA
priority = 7
pausetime = 0,0
sparkno = 1
sparkxy = -10,-55
hitsound   = S5,3
guardsound = S6,0
animtype = High
ground.type = High
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = -30,10
air.velocity = -7,30
fall = 1

;---------------------------------------------------------------------------
; Scary fade from white
[Statedef 666]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 666
sprpriority = 65535
velset = 0,0
ontop = 1

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 666,666
[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(time*12), (time*12)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = (time*12) >= 256

;---------------------------------------------------------------------------
; Scary fade from white (winpose version)
[Statedef 667]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 9999
sprpriority = 65535
velset = 0,0

[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 666,666
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 666
ID = 666
pos = 160,120
postype = left
bindtime = -1
supermovetime = 65535
pausemovetime = 65535
scale = 666,666
sprpriority = 65535
ontop = 1
ownpal = 0
[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
add = 0-(time*12),0-(time*12),0-(time*12)

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = numexplod(666) = 1
trigger1 = (time*12) >= 256
id = 666
[State 0, DestroySelf]
type = DestroySelf
trigger1 = numexplod(666) = 0
trigger1 = (time*12) >= 256


;---------------------------------------------------------------------------
; Scary fade from red
[Statedef 665]
type    = S
movetype= I
physics = N
ctrl = 0
anim = 666
sprpriority = 65535
velset = 0,0

[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
mul = 365,0,0
[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 666,666
[State 0, Trans]
type = Trans
trigger1 = 1
trans = addalpha
alpha = 256-(time*10), (time*10)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = (time*10) >= 256


;---------------------------------------------------------------------------
; Weird Event Crosshair
[Statedef 700]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 4,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 700                       ;Change animation (Def: no change)
sprpriority = -10                  ;Set layering priority to 2 (in front)

[State 0, ]
type = VelSet
trigger1 = frontedgedist < 10
x = -4

[State 0, ]
type = VelSet
trigger1 = backedgedist < 10
x = 4

[State You want a bomb?]
type = Helper
trigger1 = numhelper(710) = 0
trigger1 = root, alive
trigger1 = root, command = "a"
trigger1 = parent,var(47)
helpertype = normal
name = "Bomb"
ID = 710
pos = 0,-1500
postype = p1
facing = 1
stateno = 710
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State Or maybe you want a mine?]
type = Helper
trigger1 = numhelper(710) = 0
trigger1 = root, alive
trigger1 = root, command = "b"
trigger1 = parent,var(47)
helpertype = normal
name = "Bomb"
ID = 710
pos = 0,-1500
postype = p1
facing = 1
stateno = 720
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State Or even a grapple?]
type = Helper
trigger1 = numhelper(730) = 0
trigger1 = root, alive
trigger1 = root, command = "c"
trigger1 = parent,var(47)
helpertype = normal
name = "Grapple"
ID = 730
pos = 0,-400
postype = p1
facing = 1
stateno = 730
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

;---------------------------------------------------------------------------
; The bomb
[Statedef 710]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(random<100,742,710)
sprpriority = 0                  ;Set layering priority to 2 (in front)

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,6

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,6

[State 0, ]
type = Gravity
trigger1 = 1

[State 0, ]
type = ChangeState
trigger1 = pos y >= 0
value = 711

; BOOM!
[Statedef 711]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 421
sprpriority = 10
velset = 0,0

[State 0, ]
type = EnvShake
trigger1 = Time = 0
time = 20
freq = 140
ignorehitpause = 1

[State 0, ]
type = PosSet
trigger1 = Time = 0
y = 0
ignorehitpause = 1

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

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, SA
priority = 7
damage    = 100
hitflag = MAFD
guardflag = 
pausetime = 0,12
sparkno = 1
sparkxy = -5,-10
hitsound   = S5,2
guardsound = S6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -3,-30
air.velocity = -3,-30
guard.velocity = -5
fall = 1
yaccel = 2
;affectteam = B

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

;---------------------------------------------------------------------------
; The mine-bomb
[Statedef 720]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(random<100,742,710)
sprpriority = 0                  ;Set layering priority to 2 (in front)

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,6

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,6

[State 0, ]
type = Gravity
trigger1 = 1

[State 0, ]
type = ChangeState
trigger1 = pos y >= 0
value = ifelse(anim=742,740,721)

;---------------------------------------------------------------------------
; The mine
[Statedef 721]
type    = C                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = C                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 11                       ;Change animation (Def: no change)
sprpriority = 0                  ;Set layering priority to 2 (in front)

[State 0, ]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA, AP, AT
stateno = 711
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,7

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

[State 0, ]
type = ChangeState
trigger1 = time >= 200
trigger2 = p2dist x = [-60,60]
trigger2 = p2dist y >= -10
value = 711

;---------------------------------------------------------------------------
; The grapple
[Statedef 730]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,4                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 730                       ;Change animation (Def: no change)
sprpriority = 20                  ;Set layering priority to 2 (in front)

[State 0, ]
type = ChangeState
trigger1 = screenpos y = [-5,5]
value = 731

[State 0, ]
type = ChangeState
trigger1 = time >= 250
value = 733

[Statedef 731]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 730                       ;Change animation (Def: no change)
sprpriority = 20                  ;Set layering priority to 2 (in front)

[State 0, ]
type = VelSet
trigger1 = p2dist x > 10
x = 4

[State 0, ]
type = VelSet
trigger1 = p2dist x < -10
x = -4

[State 0, ]
type = ChangeState
trigger1 = time >= 120
value = 732

; GRAB!
[Statedef 732]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 732                       ;Change animation (Def: no change)
sprpriority = 20                  ;Set layering priority to 2 (in front)

[State 200, 1]
type = HitDef
trigger1 = time = 0
priority = 7
attr = A, ST                     ;Attribute: Standing, Normal Attack
damage = 10, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag =                    ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
pausetime = 0, 0                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = 0, 0               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = S0, 8                  ;Sound to play on hit
guardsound = -1                ;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  = 18             ;Time opponent is in hit state
ground.velocity = -6             ;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
kill = 0
p1stateno = 733
p2stateno = 739
fall = 1
fall.recover = 0
fall.damage = 160

[State 0, ]
type = ChangeState
trigger1 = AnimTime = 0
value = 733

; Ok, good job
[Statedef 733]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 731                       ;Change animation (Def: no change)
sprpriority = 20                  ;Set layering priority to 2 (in front)

[State 0, ]
type = TargetBind
trigger1 = 1
pos = 0,319*const(size.yscale)
ignorehitpause = 1

[State 0, ]
type = VelSet
trigger1 = time >= 30
trigger1 = vel y = 0
y = -6
ignorehitpause = 1

[State 0, ]
type = ChangeState
trigger1 = screenpos y < -170
value = 734

; Drop It!
[Statedef 734]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 730                       ;Change animation (Def: no change)
sprpriority = 20                  ;Set layering priority to 2 (in front)

[State 0, ]
type = TargetState
trigger1 = Time = 0
value = 738

[State 0, ]
type = ChangeState
trigger1 = time >= 100
value = 799

; p2
[Statedef 738]
type    = A
movetype= H
physics = N

[State 0, ]
type = NotHitBy
trigger1 = 1
value = SCA

[State 0, ]
type = ChangeAnim
trigger1 = time = 0
value = 5070

[State 0, ]
type = Gravity
trigger1 = 1

[State 0, ]
type = SelfState
trigger1 = pos y >= 0
value = 5100

; p2
[Statedef 739]
type    = A
movetype= H
physics = N

[State 0, ]
type = ChangeAnim2
trigger1 = time = 0
value = 739


; wAIT!
[Statedef 799]
type    = S
movetype= I
physics = N
anim = 9999

[State 0, ]
type = DestroySelf
trigger1 = time >= 150

;---------------------------------------------------------------------------
; Gman? WTF?!
[Statedef 740]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 740
sprpriority = 0

[State 0, ]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA, AP, AT
stateno = 711
ignorehitpause = 1

[State 0, ]
type = PlaySnd
triggerall = anim = 741
trigger1 = animelem = 2
trigger2 = animelem = 7
value = S0,ifelse( animelemno(0) = 2, 21, 22)

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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 740
trigger1 = animtime = 0
value = 741
[State 0, VelSet]
type = VelSet
trigger1 = anim = 741
x = 2
[State 0, ]
type = ChangeState
trigger1 = roundstate = 2
trigger1 = p2dist x = [-40,40]
value = 711
[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 741
trigger1 = frontedgedist < -50


;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents KFM from combo-ing
;   into the throw. The priority should be set to a low number, such as
;   1 or 2, so that the throw does not take precedence over normal attacks.
;   The type of priority must always be set to "Miss" or "Dodge" for throws,
;   otherwise strange behavior can result.
[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT          ;Attributes: Standing, Normal Throw
hitflag = M-          ;Affect only ground people who are not being hit
priority = 1, Miss    ;Throw has low priority, must be miss or dodge type.
sparkno = -1          ;No spark
sprpriority = -1       ;Draw in front of p2
p2facing = 1          ;Force p2 to face KFM
p1stateno = 810       ;On success, KFM changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in KFM's cns
guard.dist = 0        ;This prevents p2 from going into a guard state if close
fall = 1              ;Force p2 into falling down

[State 800, 1]
type = HitDef
Trigger1 = animelem = 3
attr = S, NT
hitflag = M
guardflag = M
priority = 1, Miss
sparkno = -1
guard.sparkno = -1
sprpriority = -1
guardsound = S6,0
guard.pausetime = 8,8
p2facing = 1
p1stateno = 810
p2stateno = 820
fall = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Kung Fu Throw - Throwing the opponent
; Description: In this state, KFM throws the opponent by binding him to
;     various offsets based on his current frame of animation. For
;     example, [State 810, Bind 1] binds the opponent to an offset of
;     28 pixels in front of KFM. That puts him around where KFM's hand
;     is at. Is is important to keep the opponent bound using a
;     TargetBind controller at all times, until you let him go. This
;     is especially important if your player has a Clsn2 box that
;     allows him to get hit while throwing someone. Each time a player
;     gets hit, all his bound targets will be set to a fall state. If
;     the opponent is not bound, then he might get stuck in his thrown
;     state when his attacker is knocked out of the throw halfway.
; Notes: There is a TargetLifeAdd controller to decrease the opponent's
;     life, and a TargetState controller to change his state to a
;     falling state when KFM lets go of him.
[Statedef 810]
type    = S
movetype= A
physics = N
anim = 810
poweradd = 60

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,15

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,15

[State 0, ]
type = AssertSpecial
trigger1 = 1
flag = timerfreeze
flag2 = nomusic
flag3 = globalnoshadow

[State 810, Bind 1]
type = TargetBind
trigger1 = 1
pos = 107*const(size.xscale), 0

[State 0, ]
type = BgPalFX
trigger1 = time < 158
time = 2
mul = ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7)),ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7)),ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7))
color = 256 - ceil(time*1.7)
sinadd = 256,256,256,64
ignorehitpause = 1

[State 0, ]
type = PalFX
trigger1 = time < 158
time = 2
mul = ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7)),ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7)),ifelse(ceil(time*1.7)>=256,0,256 - ceil(time*1.7))
color = 256 - ceil(time*1.7)
sinadd = 256,256,256,64
ignorehitpause = 1

[State 0, ]
type = PalFX
trigger1 = time = [128,158]
time = 2
add = time*9 - 1408,time*9 - 1408,time*9 - 1408
;mul = time*8 - 1024,time*8 - 1024,time*8 - 1024
sinadd = 256,256,256,64
ignorehitpause = 1

[State 0, ]
type = Explod
trigger1 = time = 128
anim = ifelse(random<=90,812,ifelse(random<500,811,813))
pos = 0,-70
postype = p2
facing = -1
vel = 0,2
sprpriority = -10
;ownpal = 0
scale = .75,.75
removeongethit = 1
ignorehitpause = 1

[State 0, ]
type = AssertSpecial
trigger1 = time >= 128
flag = invisible

[State 0, ]
type = PlaySnd
trigger1 = time = 158
value = 0,ifelse(random<80,20,14)

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = time = 158
value = -160

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = p2name = "Evil Ken"
trigger1 = time = 158
value = -99999

[State 810, Throw 11]
type = TargetState
trigger1 = time = 158
value = 821

[State 0, ]
type = EnvColor
trigger1 = time = 158
value = 255,0,0
time = 1
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 158
name = "fade from red"
ID = 665
stateno = 665
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 810, State End]
type = ChangeState
trigger1 = time >= 160
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = N
velset = 0,0

[State 820, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 820

[State 0, ]
type = SelfState
trigger1 = Time >= 200
value = 5070

;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 0,0
poweradd = 40

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = 1
value = 5110 ;Hit ground


;---------------------------------------------------------------------------
; Scarpin Strights
[Statedef 1000]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 3,-8                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 1000                       ;Change animation (Def: no change)
poweradd = 60                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 0, VarSet]
type = VarSet
trigger1 = var(57) = 0
trigger1 = time = 0
var(0) = ifelse(command="x",0,(ifelse(command="y",1,2)) )
ignorehitpause = 1
[State 0, VarSet]
type = VarRandom
trigger1 = var(57) > 0
trigger1 = time = 0
v = 0
range = 0,2
ignorehitpause = 1
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = ifelse(var(0)=0,1000,ifelse(var(0)=1,1001,1002))
[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = ifelse(var(0)=0,1,ifelse(var(0)=1,3,6))
y = ifelse(var(0)=0,-5,ifelse(var(0)=1,-8,-7.5))

[State 0, ]
type = Gravity
trigger1 = 1
[State 0, ]
type = VelMul
trigger1 = anim != 1002
x = ifelse(anim=1000,0.96,0.92)

[State 200, 1]
type = HitDef
trigger1 = !movecontact
attr = A, SA                     ;Attribute: Standing, Normal Attack
damage = ifelse(anim=1002,100,88), 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = M                   ;Flags on how move is to be guarded against
hitflag = MAFPD                    ;Flags of conditions that move can hit
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
guard.sparkno = -1
sparkxy = 0,0
hitsound = S666, 0                  ;Sound to play on hit
guardsound = 6,0                ;Sound to play on guard
ground.type = Low               ;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 = ifelse(anim=1002&&animelemtime(5)<0,-5,-1),ifelse(anim=1002&&animelemtime(5)<0,-6,30)
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1,30           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0
fall.yvelocity = ifelse(anim=1002,-4.5,0)
priority = 3,Hit

[State 0, ]
type = ChangeState
trigger1 = pos y >= 0
trigger1 = vel y >= 0
value = 1001

;---------------------------------------------------------------------------
; Scarpin Strights
[Statedef 1001]
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
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 1010                       ;Change animation (Def: no change)
sprpriority = 2                  ;Set layering priority to 2 (in front)
juggle = 5

[State 0, VarSet]
type = VarSet
trigger1 = time = [0,10]
fvar(0) = time
[State 0, AngleDraw]
type = AngleDraw
trigger1 = time = [0,10]
scale = 1,0.9 + (fvar(0)/100)
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = time = 0
value = 0,19
ignorehitpause = 1

[State 0, ]
type = EnvShake
trigger1 = time = 0
time = 10
freq = 160
ampl = -4
ignorehitpause = 1

[State 0, ]
type = Explod
trigger1 = time = 0
anim = F62
supermovetime = 65535
pausemovetime = 65535
ownpal = 1
ignorehitpause = 1
ignorehitpause = 1

[State 0, ]
type = PosSet
trigger1 = 1
y = 0

[State 200, 1]
type = HitDef
trigger1 = time = 0
attr = S, SP                     ;Attribute: Standing, Normal Attack
damage = 40, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = L                   ;Flags on how move is to be guarded against
hitflag = MFPD                    ;Flags of conditions that move can hit
pausetime = 0, 12                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
guard.sparkno = -1
sparkxy = 0,0
hitsound = S5, 4                  ;Sound to play on hit
guardsound = -1                ;Sound to play on guard
ground.type = Low               ;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 = -1,-8.5             ;Velocity at which opponent is pushed
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1,-8.5           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0
fall.damage = 40

[State you can just block]
type = StateTypeSet
trigger1 = animelem = 2
movetype = I

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

;---------------------------------------------------------------------------
; The bus of doom
[Statedef 2000]
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
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 0                       ;Change animation (Def: no change)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 0, ]
type = SuperPause
trigger1 = Time = 0
time = 30
anim = F100
sound = S666,1
poweradd = -1500
pos = ceil(54*const(size.xscale)),ceil(-230*const(size.yscale))
ignorehitpause = 1

[State 0, ]
type = Helper
trigger1 = Time = 1
helpertype = normal
name = "Bus"
ID = 2000
pos = -200,0
postype = back
facing = 1
stateno = 2001
ownpal = 1
size.xscale = 1
size.yscale = 1
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; The bus of doom
[Statedef 2001]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 13,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(random<80,2002,ifelse(random<400,2001,2000))
sprpriority = 10                  ;Set layering priority to 2 (in front)

[State 0, AngleDraw]
type = AngleDraw
trigger1 = anim != 2000
scale = .5,.5
;ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = anim = 2002
trigger1 = vel x != 24
x = 24

[State 200, 1]
type = HitDef
trigger1 = anim = 2000
trigger1 = !movecontact
attr = S, HP                     ;Attribute: Standing, Normal Attack
damage = 340, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag =                    ;Flags on how move is to be guarded against
hitflag = MAFPD                    ;Flags of conditions that move can hit
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = 0,0
hitsound = S666, ifelse(random<100,2,0)
guardsound = -1                ;Sound to play on guard
ground.type = Low               ;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 = -1,-30             ;Velocity at which opponent is pushed
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1,-30           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0
fall.damage = 30

[State 200, 1]
type = HitDef
trigger1 = anim = 2001
trigger1 = !movecontact
attr = S, HP                     ;Attribute: Standing, Normal Attack
damage = 296, 0                   ;Damage that move inflicts, guard damage
animtype = Hard                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag =                    ;Flags on how move is to be guarded against
hitflag = MAFPD                    ;Flags of conditions that move can hit
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
sparkno = -1                      ;Spark anim no (Def: set above)
sparkxy = 0,0
hitsound = S666, ifelse(random<400,3,0)
guardsound = -1                ;Sound to play on guard
ground.type = Low               ;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 = -3,-30             ;Velocity at which opponent is pushed
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3,-30           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0
fall.damage = 30

[State 200, 1]
type = HitDef
trigger1 = anim = 2002
trigger1 = !movecontact
attr = S, HP                     ;Attribute: Standing, Normal Attack
damage = 380, 0                   ;Damage that move inflicts, guard damage
animtype = diagup
guardflag = M                   ;Flags on how move is to be guarded against
hitflag = MAFPD                    ;Flags of conditions that move can hit
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
guard.pausetime = 0,0
sparkno = -1                      ;Spark anim no (Def: set above)
guard.sparkno = -1
sparkxy = 0,0
hitsound = S666, ifelse(random<100,4,5)
guardsound = S666,6
ground.type = Low               ;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 = -30,-3
air.type = Low                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -30,-4
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air
fall = 1
fall.recover = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 2002
ignorehitpause = 1

[State 0, ]
type = DestroySelf
trigger1 = time >= 300
ignorehitpause = 1

;---------------------------------------------------------------------------
; EAT MY SHORTS!!!!
[Statedef 2002]
type    = A
movetype= H
physics = N
velset = -4,-10
ctrl = 0
sprpriority = 10

[State 0, AngleDraw]
type = AngleDraw
trigger1 = anim != 2000
scale = .5,.5
;ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 0, Gravity]
type = Gravity
trigger1 = 1

[State 0, ]
type = DestroySelf
trigger1 = screenpos y >= 300
ignorehitpause = 1

;---------------------------------------------------------------------------
; Armageddon
[Statedef 2100]
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
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 0                       ;Change animation (Def: no change)
sprpriority = 2                  ;Set layering priority to 2 (in front)

[State 0, ]
type = SuperPause
trigger1 = Time = 0
time = 30
anim = F100
sound = S666,1
poweradd = -1500
pos = ceil(54*const(size.xscale)),ceil(-230*const(size.yscale))
ignorehitpause = 1

[State 0, ]
type = Helper
trigger1 = Time = 1
helpertype = normal
name = "Bus"
ID = 2000
pos = 00,0
postype = p1
facing = 1
stateno = 2101
ownpal = 1
size.xscale = 1
size.yscale = 1
ignorehitpause = 1

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

;---------------------------------------------------------------------------
; Armageddon
[Statedef 2101]
type    = S                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= I                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
;Commonly-used controllers:
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = 9999                       ;Change animation (Def: no change)

[State 0, ]
type = VarRandom
trigger1 = 1
v = 0
range = 0,320
ignorehitpause = 1

[State You want a bomb?]
type = Helper
trigger1 = timemod = 18,2
helpertype = normal
name = "Bomb"
ID = 710
pos = var(0),-700
postype = left
facing = 1
stateno = 2102
ownpal = 1
size.xscale = .5
size.yscale = .5
ignorehitpause = 1

[State 0, ]
type = DestroySelf
trigger1 = time >= 300
ignorehitpause = 1

;---------------------------------------------------------------------------
; The bomb
[Statedef 2102]
type    = A                      ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = N                      ;Physics: S-stand, C-crouch, A-air
velset = 0,0                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(random<100,742,710)
sprpriority = 0                  ;Set layering priority to 2 (in front)

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,9

[State 0, ]
type = PlaySnd
trigger1 = Time = 0
value = S0,9

[State 0, ]
type = Gravity
trigger1 = 1

[State 610, 3]
type = HitDef
trigger1 = !movecontact
animtype = Hard
attr = A, HP
damage = 130
hitflag = A
guardflag = 
pausetime = 0,0
sparkno = -1
hitsound = -1
guardsound = S6,0
animtype = High
ground.type = Trip
ground.slidetime = 17
ground.hittime  = 17
ground.velocity = ifelse(random<500,3,-3),-30
air.type = Trip
air.velocity = -7,30
fall = 1
yaccel = 2

[State 0, ]
type = ChangeState
trigger1 = movecontact
value = 2104

[State 0, ]
type = ChangeState
trigger1 = pos y >= 0
value = 2103

; BOOM!
[Statedef 2103]
type    = C
movetype= A
physics = C
ctrl = 0
anim = 421
sprpriority = 10
velset = 0,0

[State 0, ]
type = EnvShake
trigger1 = Time = 0
time = 20
freq = 140
ignorehitpause = 1

[State 0, ]
type = PosSet
trigger1 = Time = 0
y = 0
ignorehitpause = 1

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

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, SA
priority = 7
damage    = 100
hitflag = MAFD
guardflag = 
pausetime = 0,12
sparkno = 1
sparkxy = -5,-10
hitsound   = S5,2
guardsound = S6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = ifelse(random<500,3,-3),-30
air.velocity = ifelse(random<500,3,-3),-30
guard.velocity = -5
fall = 1
yaccel = 2
;affectteam = B

[State 440, 4]
type = DestroySelf
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; Air Boom
[Statedef 2104]
type    = A
movetype= I
physics = N
juggle  = 4
poweradd= 100
ctrl = 0
anim = 621
sprpriority = 2
velset = 0,0

[State 0, ]
type = EnvShake
trigger1 = time = 0
time = 20
freq = 120
ignorehitpause = 1

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

[State 0, ]
type = DestroySelf
trigger1 = animtime = 0

; Enter the stage doing an aerial attack
;---------------------------------------

[Statedef 4500]
type = A
movetype = A
physics = N
anim = 12	;<- You must include this attack in the AIR
sprpriority = 2
ctrl = 0

[State 4500, position]
type = posset
trigger1 = time = 0
x = (partner, pos x) - 360*facing
y = 0

[State 4500, screen bound] ; Prevents the camera from following the char
type = ScreenBound
trigger1 = 1
value = 0

[State 4500, end state]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1

; Land on the stage
;------------------

[Statedef 4501]
type = S
movetype = I
physics = S
anim = 47	;<- standard landing animation
sprpriority = 1
ctrl = 0

[State 4501, stop velocity]
type = VelSet
trigger1 = time = 0
x = 0
y = 0

[State 4501, position]
type = PosSet
trigger1 = time = 0
y = 0

[State 4501, end state]
type = ChangeState
trigger1 = AnimTime = 0
value = 4502

; Arriving Taunt - to adapt to each char
;---------------------------------------

[Statedef 4502]
type = S
movetype = I
physics = S
sprpriority = 1
anim = 195

; <- Put anything here (animations, sounds, etc...)

[State 4502, end state]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1



; Leaving Taunt - to adapt to each char
;--------------------------------------

[Statedef 4510]
type = S
movetype = I
physics = S
sprpriority = 1
velset = 0,0
ctrl = 0
anim = 180

[State 4510, invincibility]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4510, ghost]
type = PlayerPush
trigger1 = 1
value = 0

; <- Put anything here (animations, sounds, etc...)

[State 4510, end state]
type = ChangeState
trigger1 = AnimTime = 0
value = 4511


; Leave the stage
;----------------

[Statedef 4511]
type = A
movetype = I
physics = N
anim = 43
sprpriority = 2
ctrl = 0

[State 4511, velocity]
type = VelSet
trigger1 = 1
x = -12
y = -5

[State 4511, invincibility]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4511, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4511, screen bound] ; Prevents the camera from following the char
type = ScreenBound
trigger1 = 1
value = 0

[State 4511, end state]
type = ChangeState
trigger1 = backedgedist < -30
value = 4512

; Wait out of the screen
;-----------------------

[Statedef 4512]
type = A
movetype = I
physics = N
anim = 9999
velset = 0,0
ctrl = 0

[State 4512, invincibility]
type = NotHitBy
trigger1 = 1
value = SCA

[State 4512, ghost]
type = PlayerPush
trigger1 = 1
value = 0

[State 4512, screen bound] ; Prevents the camera from following the char
type = ScreenBound
trigger1 = 1
value = 0

[State 4512, life add] ; Gains life
type = LifeAdd
trigger1 = (gametime%10) = 0
value = 1

[State 4512, turn] ; allways face the same direction as partner
type = turn
trigger1 = facing != partner,facing

[State 4512, position] ; allways stay behind and at the same distance of the char on the stage
type = posset
trigger1 = 1
x = (partner, pos x) - 1000*facing
y = -150



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

; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
;
;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Persistent direction command detection enabler (due to 2002.04.14).
; var(9) - AutoTurn bug fixer.
; parent's var(58) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9741, PauseCheck]
type = VarSet
trigger1 = (GameTime>(Parent,var(58)))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = !var(9)
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = !(var(4):=1)
var(59) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = (var(4):=0)

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = var(1)
triggerall = !var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
var(59) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(2) = 2)
trigger8 = (var(2):=0)
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = (var(1):=1)
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

[State 9741, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "var(2) = %d, parentvar(58) = %d, GameTime = %d, var(3) = %d"
params = var(2), (parent,var(58)), GameTime, var(3)

;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick dir activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; parent's var(58) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 0

[State 9742, PauseCheck]
type = VarSet
trigger1 = (GameTime>Parent,var(58))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
trigger5 = (var(3):=0)
var(2) = (var(3):=1)

[State 9742, Facing]
type = Turn
trigger1 = (var(9):=(Facing != Parent,Facing))

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = (Parent,command = "holdfwd")
trigger2 = (Parent,command = "holdback")
trigger3 = (Parent,command = "holdup")
trigger4 = (Parent,command = "holddown")
trigger5 = (var(6):=0)
var(6) = 1

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = (Parent,command = "a")
trigger2 = (Parent,command = "b")
trigger3 = (Parent,command = "c")
trigger4 = (Parent,command = "x")
trigger5 = (Parent,command = "y")
trigger6 = (Parent,command = "z")
trigger7 = (Parent,command = "start")
trigger8 = (var(7):=0)
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
trigger1 = (Parent,command = "a")
trigger1 = (Partner,command = "a")
trigger2 = (Parent,command = "b")
trigger2 = (Partner,command = "b")
trigger3 = (Parent,command = "c")
trigger3 = (Partner,command = "c")
trigger4 = (Parent,command = "x")
trigger4 = (Partner,command = "x")
trigger5 = (Parent,command = "y")
trigger5 = (Partner,command = "y")
trigger6 = (Parent,command = "z")
trigger6 = (Partner,command = "z")
trigger7 = (Parent,command = "start")
trigger7 = (Partner,command = "start")
trigger8 = (var(8):=0)
var(8) = 1;Partner,AnimExist(9741)

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(9)
var(59) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(59)
trigger1 = (command = "holdfwd")
trigger1 = (Parent,command = "holdfwd")
trigger2 = (command = "holdback")
trigger2 = (Parent,command = "holdback")
trigger3 = (command = "holdup")
trigger3 = (Parent,command = "holdup")
trigger4 = (command = "holddown")
trigger4 = (Parent,command = "holddown")
var(59) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(8)
var(59) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = !var(8)
trigger1 = (command = "a")
trigger1 = (Parent,command = "a")
trigger2 = (command = "b")
trigger2 = (Parent,command = "b")
trigger3 = (command = "c")
trigger3 = (Parent,command = "c")
trigger4 = (command = "x")
trigger4 = (Parent,command = "x")
trigger5 = (command = "y")
trigger5 = (Parent,command = "y")
trigger6 = (command = "z")
trigger6 = (Parent,command = "z")
trigger7 = (command = "start")
trigger7 = (Parent,command = "start")
var(59) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = (var(2) = 2)
trigger2 = (var(2):=0)
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6)
trigger2 = var(7)
trigger3 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = (var(1):=1)
var(5) = !var(7)

[State 9742, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "var(2) = %d, parentvar(58) = %d, GameTime = %d, var(3) = %d"
params = var(2), (parent,var(58)), GameTime, var(3)


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

[Statedef -2]

[State Special Winpose]
type = VarSet
trigger1 = p2name = "Evil Kung Fu Man" || p4name = "Evil Kung Fu Man"
trigger2 = p2name = "  Dyan Weinert Kirichenko da Silva" || p4name = "  Dyan Weinert Kirichenko da Silva"
trigger3 = p2name = "Kanna" || p4name = "Kanna"
trigger4 = p2name = "Shadow Dio" || p4name = "Shadow Dio"
trigger5 = p2name = "Evil Dan" || p4name = "Evil Dan"
trigger6 = p2name = "Bridget" || p4name = "Bridget"
trigger7 = p2name = "Warakia" || p4name = "Warakia"
trigger8 = p2name = "Wory" || p4name = "Wory"
trigger9 = p2name = "Kim Kaphwan" || p4name = "Kim Kaphwan"
trigger10 = p2name = "Ryu" || p4name = "Ryu"
v = 46
value = 1

[State Egible for an attack?]
type = VarSet
trigger1 = !var(47)
trigger1 = roundstate = 2
trigger1 = ctrl
var(47) = 1
ignorehitpause = 1
[State No Longer?]
type = VarSet
trigger1 = var(47)
trigger1 = roundstate != 2
trigger1 = !ctrl
var(47) = 0
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = numenemy = 0 || (enemynear,gethitvar(hitcount)=0)
fvar(13) = 0
[State 0, VarSet]
type = VarSet
trigger1 = numenemy > 0 && (enemynear,gethitvar(hitcount))
fvar(13) = enemynear,gethitvar(hitcount)

[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
value = 1 - ifelse( (fvar(13)/25) > 0.5 , (fvar(13)/25) , 0.5 )
ignorehitpause = 1

[State 9742, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "bodydist x = %d dampender = %f"
params = floor(p2bodydist x),(fvar(13)/25)

; Within StateDef -2, none of your own AI-related code should be placed
; above these next two controllers.

[State -2, StopAI]
type = VarSet
triggerall = (var(59) > 0)
trigger1 = (RoundState != 2)
trigger2 = !Alive
var(59) = -2
IgnoreHitPause = 1

; This controller is optional.  It lets you slightly simplify the triggers
; in your AI code: var(0) and !var(0) instead of var(59)>0 and var(59)<1.
; Another benefit is that it makes it easier for users to disable your AI,
; if they so choose.
[State -2, Simplifier]
type = VarSet
trigger1 = (var(59) = 1)
trigger2 = (var(57):=0)
var(57) = 1	; Another option is to replace 1 with something like MatchNo, if
		; you want to design your AI to have varying levels of difficulty.
IgnoreHitPause = 1


[State 0, ]
type = AssertSpecial
trigger1 = roundstate != 2
flag = nobardisplay
ignorehitpause = 1

[State 0, ]
type = AssertSpecial
trigger1 = numexplod(1999) = 1
flag = intro
ignorehitpause = 1

[State 0, ]
type = AssertSpecial
trigger1 = alive
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard
ignorehitpause = 1

[State 0, ]
type = PlaySnd
trigger1 = gethitvar(damage) > 0
trigger1 = stateno != [120,169]
value = 5000,ifelse(random<500,0,1)
channel = 0

;Weird Event
[State -2: Helper]
type = Helper
trigger1 = roundstate = 2
trigger1 = NumHelper(700) = 0
helpertype = Normal
name = "Weird Event"
id = 700
pos = 0,0
postype = p1
facing = 0
stateno = 700
keyctrl = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535

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

[Statedef -3]

; It is very important that this controller NOT be moved to State -2, as putting
; it there would defeat the entire purpose of the controller, allowing the
; helper method to erroneously set the AI variable.
; And within State -3, don't put any ChangeState controllers before this
; controller, lest you unnecessarily delay your character's AI activation.
[State -3, GameTimeVar]
type = VarSet
trigger1 = 1
var(58) = GameTime
IgnoreHitPause = 1

; Kamek and Luchini appear to have been the first ones to use the IsHomeTeam AI activation concept.
; Feel free to move this controller to your character's intro state for slightly better efficiency.
[State -3, SetAI]
type = VarSet
triggerall = !RoundState
triggerall = IsHomeTeam
trigger1 = (TeamSide = 2)
trigger2 = (MatchNo > 1)
var(59) = 1

; Feel free to move this controller to your character's intro state for slightly better efficiency.
; Note that it may give P2 a slight unfair advantage in simul team vs mode, so you
; may want to disable it.  But then, since when has Mugen been about fairness? =P
[State -3, Unfair]; Is this reliable?
type = VarSet
trigger1 = !RoundState
trigger1 = (var(59) != 1)
trigger1 = NumPartner
trigger1 = (ID > Partner,ID)
trigger1 = (TeamSide = 2)
var(59) = 1

[State -3, AI Helper (Compatibly Partnered Version)]
type = Helper
trigger1 = !var(59)
trigger1 = !NumHelper(9742)
trigger1 = (RoundState = 2)
trigger1 = Alive
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 999999999
SuperMoveTime = 999999999

; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy control
; options in Training mode without activating the dummy's AI while working on your
; character, then all you need to do is temporarily disable this controller.
[State -3, AI Helper]
type = Helper
triggerall = !var(59)
triggerall = !NumHelper(9741)
triggerall = (RoundState = 2)
triggerall = Alive
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 999999999
SuperMoveTime = 999999999

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = (var(59) = -2)
trigger1 = (RoundState = 2)
trigger1 = Alive
var(59) = 1

; According to Roque, this method works in Mugen version 2002.04.14,
; whereas the old humanly-impossible commands method does not.
; It is very important that this controller NOT be moved to State -2.
; Note that this part won't work if AI.Cheat is turned off in mugen.cfg.
[State -3, XOR]
type = VarSet
triggerall = var(59)!=1
trigger1 = (command = "a") ^^ (command = "a2")
trigger2 = (command = "b") ^^ (command = "b2")
trigger3 = (command = "c") ^^ (command = "c2")
trigger4 = (command = "x") ^^ (command = "x2")
trigger5 = (command = "y") ^^ (command = "y2")
trigger6 = (command = "z") ^^ (command = "z2")
trigger7 = (command = "start") ^^ (command = "start2")
trigger8 = (command = "holda") ^^ (command = "holda2")
trigger9 = (command = "holdb") ^^ (command = "holdb2")
trigger10 = (command = "holdc") ^^ (command = "holdc2")
trigger11 = (command = "holdx") ^^ (command = "holdx2")
trigger12 = (command = "holdy") ^^ (command = "holdy2")
trigger13 = (command = "holdz") ^^ (command = "holdz2")
trigger14 = (command = "holdstart") ^^ (command = "holdstart2")
trigger15 = (command = "recovery") ^^ (command = "recovery2")
trigger16 = (command = "holdfwd") ^^ (command = "holdfwd2")
trigger17 = (command = "holdback") ^^ (command = "holdback2")
trigger18 = (command = "holdup") ^^ (command = "holdup2")
trigger19 = (command = "holddown") ^^ (command = "holddown2")
;Add more as desired. (See my notes in the CMD.)
var(59) = 1

[State 0, ]
type = PlaySnd
triggerall = time = 0
trigger1 = stateno = 10
trigger2 = stateno = 12
value = S1,3

[State 0, ]
type = PlaySnd
triggerall = time = 0
trigger1 = stateno = 40
trigger2 = stateno = 52
value = S1,2

;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
