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

[Data]
life = 1000			;Amount of life to start with
power = 3000		;Amount of maximum power
attack = 50		;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 60		;Time which player lies down for, before getting up
airjuggle = 15		;Number of points for juggling
sparkno = 2			;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0			;1 to enable echo on KO
volume = 0			;Volume offset (negative for softer)
IntPersistIndex = 60	;Variables with this index and above will not have their values
FloatPersistIndex = 40  ;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.


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

[Velocity]
walk.fwd  = 2.4		;Walk forward
walk.back = -2.2		;Walk backward
run.fwd  = 6.6, 0		;Run forward (x, y)
run.back = -4.5,-3.8	;Hop backward (x, y)
jump.neu = 0,-10		;Neutral jumping velocity (x, y)
jump.back = -2.55		;Jump back Speed (x, y)
jump.fwd = 2.6		;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 = 0		;Number of air jumps allowed (opt)
airjump.height = 25	;Minimum distance from ground before you can air jump (opt)
yaccel = .47		;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
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = var(0) = 75
trigger1 = Anim != 171
value = 171

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 8
value = S140,1
volume = 255
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 65
value = S140,0
volume = 255
channel = 1

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

;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; Win pose 1
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 180
velset = 0,0

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = var(0) = 75
trigger1 = Anim != 19005
value = 19005

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 1
value = S3,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) = 75
trigger1 = animelem = 2
value = S3,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) = 75
trigger1 = animelem = 1
value = S3,4
volume = 30

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) = 75
trigger1 = animelem = 5
value = S140,6
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) = 75
trigger1 = animelem = 4
value = S3,9
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 3
value = S3,4
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 4
value = S3,5
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 6
value = S3,9
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = var(0) != 90
trigger1 = animelem = 7
value = S140,38
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = var(0) = 90
trigger1 = animelem = 7
value = S140,10
volume = 255

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

;---------------------------------------------------------------------------
; Pre Intro

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

;---------------------------------------------------------------------------
; Pre Intro -  Variable

[State 190, 1]
type = VarRandom
trigger1 = Time = 0
v = 2
range = 0,2

;---------------------------------------------------------------------------
; Pre Intro - Normal style

[State 190, 2.0]
type = ChangeState
trigger1 = palno != 10
trigger1 = Var(2) = 0
value = 19000

;---------------------------------------------------------------------------
; Pre Intro - DS 4th Style

[State 190, 2.1]
type = ChangeState
trigger1 = palno != 10
trigger1 = Var(2) = 1
value = 19100

;---------------------------------------------------------------------------
; Pre Intro - DS 4th Style

[State 190, 2.1]
type = ChangeState
trigger1 = palno != 10
trigger1 = Var(2) = 2
value = 19100


;---------------------------------------------------------------------------
; Pre Intro - DS 4th Style

[State 190, 2.1]
type = ChangeState
trigger1 = palno >= 10
trigger1 = Var(2) = 0
value = 19105

;---------------------------------------------------------------------------
; Pre Intro - DS 4th Style

[State 190, 2.1]
type = ChangeState
trigger1 = palno >= 10
trigger1 = Var(2) = 1
value = 19105

;---------------------------------------------------------------------------
; Pre Intro - DS 4th Style

[State 190, 2.1]
type = ChangeState
trigger1 = palno >= 10
trigger1 = Var(2) = 2
value = 19105

;----------------------------________________-------------------------------
;---------------------------|                |------------------------------
;---------------------------|   Intro Pose   |------------------------------
;---------------------------|________________|------------------------------

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 19000]
type = S
ctrl = 0
anim = 19000
velset = 0,0

[State 190,01]
type = ChangeState
trigger1 = p2name = "Gin Ichimaru"
value = 19110

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S3,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S3,4
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S3,5
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8
value = S7000,3
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = S7000,2
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S140,7
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S140,8
volume = 255

[State 200, Explod]
type = Explod
trigger1 = animelem = 8
anim = 8150
pos = -2, -61
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 8
anim = 8150
pos = -19, -64
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 9
anim = 8150
pos = 2, -88
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 9
anim = 8150
pos = 15, -73
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 9
anim = 8150
pos = 20, -62
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 8150
pos = 48, -48
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 8150
pos = 46, -83
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 11
anim = 8150
pos = 80, -50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 19000

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

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
; Introduction - 2
; CNS difficulty: basic
[Statedef 19100]
type = S
ctrl = 0
anim = 19100
velset = 0,0,0

[State 190,01]
type = ChangeState
trigger1 = p2name = "Gin Ichimaru"
value = 19110

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S3,0
volume = 255

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = S140,5
volume = 255

[State 19100, 3]
type = AssertSpecial
trigger1 = Time >= 0
flag = Intro

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

;---------------------------------------------------------------------------
; Introduction 3 - Bankai trans Intro
[Statedef 19105]
type = S
ctrl = 0
anim = 19105
velset = 0,0

[State 190,01]
type = ChangeState
trigger1 = p2name = "Gin Ichimaru"
value = 19110

[State 181, a]
type = AssertSpecial
triggerall = var(0) = 75
trigger1 = time >= 0
trigger1 = time <=180
flag = RoundNotOver

[State 0, VarSet]
type = VarSet
trigger1 = !time
v = 0
value = 75

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 28
value = S140,40
volume = 255
channel = 1

[State 700, Helper]
type                           = Helper
trigger1                       = time = 140
helpertype                     = normal
name                           = "Blue FX"
ID                             = 6010
stateno                        = 6010
pos                            = 5,0
postype                        = p1
sprpriority                    = 4
pausemovetime                  = 9999999

[State 0, SSJ3]
type = ChangeAnim
triggerall = palno = 10
trigger1 = time = 9999
value = 19105

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 19110]
type = S
ctrl = 0
anim = 19110
velset = 0,0
sprpriority = 0

[State 3000,SuperBG00]
type                            = Explod
trigger1                        = AnimElem = 1
anim                            = 8332
pos                             = 0,0
postype                         = p1
supermove                       = 1
facing                          = 1
sprpriority                     = -1
bindtime                        = 700
removetime                      = 410
removeongethit                  = 1
pausemovetime                   = 9999999
scale                           = .6,.6

[State 200, Explod]
type = Explod
trigger1 = animelem = 1
anim = 1191
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1
pausemovetime = 9999999

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !Time
value = S7000,5
volume = 20

[State 0, AfterImage]
Type = AfterImage
Trigger1 = Time = 0
Time = 418
PalContrast = 128,128,128
PalAdd = 0,0,0
PalMul = .5,.5,.5
length = 20
trans = add
TimeGap  = 1
FrameGap = 2

[State 200, Explod]
type = Explod
trigger1 = !Time
anim = 19111
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 0, Orihime]
type           = Explod
trigger1       = Time = 364
anim           = 1191
ID             = 1191
pos            = 0,0
postype        = p1
facing         = 1
vfacing        = 1
bindtime       = 1
vel            = 0,0
accel          = 0,0
random         = 0,0
removetime     = -2
scale          = 1.5,0.7
sprpriority    = 6
ontop          = 1
shadow         = 0,0,0
ownpal         = 1
ignorehitpause = 1

[State 0, Orihime]
type           = Explod
trigger1       = Time = 364
anim           = 1191
ID             = 1191
pos            = 0,0
postype        = p1
facing         = 1
vfacing        = 1
bindtime       = 1
vel            = 0,0
accel          = 0,0
random         = 0,0
removetime     = -2
scale          = 1.5,0.7
sprpriority    = 6
ontop          = 1
shadow         = 0,0,0
ownpal         = 1
ignorehitpause = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 8150
pos = -2, -61
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 10
anim = 8150
pos = -19, -64
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 11
anim = 8150
pos = 2, -88
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 11
anim = 8150
pos = 15, -73
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 11
anim = 8150
pos = 20, -62
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 12
anim = 8150
pos = 48, -48
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 12
anim = 8150
pos = 46, -83
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 13
anim = 8150
pos = 80, -50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 364
value = S7000,2
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = Time = 364
value = S7000,4
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
value = S3,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8
value = S3,5
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 10
value = S7000,3
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 10
value = S7000,2
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 1
value = S140,51
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 90
value = S140,50
volume = 255
channel = 1

[State 190, 1] ;Freeze animation until PreIntro is over
type = ChangeAnim
trigger1 = RoundState = 0
value = 19110

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

[State 190, 4] ;Change to stand state
type = ChangeState
trigger1 = Time = 448
value = 0
;---------------------------------------------------------------------------
; Taunt
; CNS difficulty: easy
[Statedef 195]
type = S
ctrl = 0
anim = 195
velset = 0,0
movetype = I
physics = S
sprpriority = 2

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = var(0) = 75
trigger1 = Anim != 19005
value = 19005

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 1
value = S3,0
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 3
value = S3,4
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 4
value = S3,5
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 4
value = S3,9
volume = 255

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) != 75
trigger1 = animelem = 4
value = S140,4
volume = 255
channel = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 3
anim = 8150
pos = -14,-49
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 3
anim = 8150
pos = -29,-29
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 200, Explod]
type = Explod
trigger1 = animelem = 3
anim = 8150
pos = -40,-10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
sprpriority = 4
removeongethit = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S7000,3
volume = 255
channel = 5


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

;---------------------------------------------------------------------------
; 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

; Notes: The '-' symbol in the hitflag field means that it only affects
;   players who are not in a hit state. This prevents the player 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
p1facing = ifelse (command = "holdfwd", -1, 1) ;Turn if holding forwards
p2facing = 1          ;Force p2 to face player
p1stateno = 810       ;On success, player changes to state 810
p2stateno = 820       ;If hit, p2 changes to state 820 in player's cns
fall = 1              ;Force p2 into falling down

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

;---------------------------------------------------------------------------
; Throwing the opponent
; Description: In this state, the player 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 the player. That puts him around where the 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 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 28, 0

[State 810, Width 2-11]
type = Width
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(12) < 0
edge = 60,0

[State 810, Bind 2-4]
type = TargetBind
trigger1 = AnimElemTime(2) >= 0 && AnimElemTime(5) < 0
pos = 58, 0

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = 47, 0

[State 810, Bind 6]
type = TargetBind
trigger1 = AnimElemTime(6) >= 0 && AnimElemTime(7) < 0
pos = 41, -60

[State 810, Bind 7]
type = TargetBind
trigger1 = AnimElemTime(7) >= 0 && AnimElemTime(8) < 0
pos = 25, -75

[State 810, Bind 8]
type = TargetBind
trigger1 = AnimElemTime(8) >= 0 && AnimElemTime(9) < 0
pos = 15, -90

[State 810, Bind 9]
type = TargetBind
trigger1 = AnimElemTime(9) >= 0 && AnimElemTime(10) < 0
pos = -5, -96

[State 810, Bind 10]
type = TargetBind
trigger1 = AnimElemTime(10) >= 0 && AnimElemTime(11) < 0
pos = -14, -90

[State 810, Bind 11]
type = TargetBind
trigger1 = AnimElem = 11
pos = -50, -50

[State 810, Hurt 11]
type = TargetLifeAdd
trigger1 = AnimElem = 11
value = -78

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

[State 810, Turn 12]
type = Turn
trigger1 = AnimElem = 12

[State 810, Pos 15]
type = PosAdd
trigger1 = AnimElem = 15
x = -10

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

;---------------------------------------------------------------------------
; Opponent Thrown
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by the 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

;---------------------------------------------------------------------------
; Opponent 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 = 2.8,-7
poweradd = 40

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

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

[State 821, 3] ; Recover in mid air (use SelfState)
type = SelfState
triggerall = Vel Y > 0
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5210 ;HITFALL_AIRRECOVER

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



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

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

[Statedef -2]

[State -2, Helper] ; ICHIGO
type = Helper
triggerall = statetype != A
triggerall = var(20) != 1
triggerall = palno != 10
triggerall = palno != 1
triggerall = palno != 2
triggerall = palno != 3
triggerall = palno != 4
triggerall = palno != 5
triggerall = palno != 6
triggerall=roundstate=2
trigger1 =  power >= 500
triggerall = VAR(0) != 75
trigger1 = command = "c" && NumHelper(2000) = 0 && NumHelper(2160) = 0
helpertype = normal
name = "c"
ownpal = 1
ID = 2000; the same from NumHelper
stateno = 1000
pos = -20,0
postype = p1
facing = 1
ignorehitpause = 1

[State -2, Helper] ; RENJI
type = Helper
triggerall = statetype != A
triggerall = var(20) != 1
triggerall = palno != 10
triggerall = palno != 1
triggerall = palno != 2
triggerall = palno != 3
triggerall = palno != 4
triggerall = palno != 5
triggerall = palno != 6
triggerall=roundstate=2
trigger1 =  power >= 500
triggerall = VAR(0) = 75
triggerall =  stateno != [32545,32540]
triggerall =  stateno != [32545,32540]
trigger1 = command = "c" && NumHelper(2160) = 0 && NumHelper(2000) = 0
helpertype = normal
name = "c"
ownpal = 1
ID = 2160
stateno = 2160
pos = -20,0
postype = p1
facing = 1
ignorehitpause = 1

[State -2, Helper] ; RANGIKU
type = Helper
triggerall = statetype != A
triggerall = var(20) != 1
triggerall = palno != 10
triggerall = palno != 7
triggerall = palno != 8
triggerall = palno != 9
triggerall = palno != 11
triggerall = palno != 12
triggerall= roundstate=2
triggerall = VAR(0) != 75
trigger1 =  power >= 500
trigger1 = command = "c" && NumHelper(2100) = 0 && NumHelper(2150) = 0
helpertype = normal
name = "c"
ownpal = 1
ID = 2100
stateno = 2100
pos = 0,0
postype = P1
facing = 1
ignorehitpause = 1

[State -2, Helper] ; MOMO
type = Helper
triggerall = statetype != A
triggerall = var(20) != 1
triggerall = palno != 10
triggerall = palno != 7
triggerall = palno != 8
triggerall = palno != 9
triggerall = palno != 11
triggerall = palno != 12
triggerall= roundstate=2
triggerall = VAR(0) = 75
triggerall =  stateno != [32545,32540]
triggerall =  stateno != [32545,32540]
trigger1 =  power >= 500
trigger1 = command = "c" && NumHelper(2150) = 0 && NumHelper(2100) = 0
helpertype = normal

name = "c"
ownpal = 1
ID = 2150
stateno = 2150
pos = 0,0
postype = P1
facing = 1
ignorehitpause = 1

[State -2, Helper] ; Kusaka
type = Helper
trigger1 = power >= 500
triggerall = statetype != A
triggerall = var(20) != 1
triggerall = palno = 10
triggerall = palno != 1
triggerall = palno != 2
triggerall = palno != 3
triggerall = palno != 4
triggerall = palno != 5
triggerall = palno != 6
triggerall = palno != 7
triggerall = palno != 8
triggerall = palno != 9
triggerall = palno != 11
triggerall = palno != 12
triggerall= roundstate=2
trigger1 = StateNo != [2300,2351]
triggerall =  stateno != [32545,32540]
triggerall =  stateno != [32545,32540]
trigger1 = command = "c" && NumHelper(2190) = 0
helpertype = normal
name = "c"
ID = 2190
stateno = 2190
ownpal = 1
pos = 50,0
postype = p1
facing = 1
ignorehitpause = 1

; PERFECT VICTORY
[State -2]
Type = Helper
TriggerAll = NumHelper(30000) = 0 && NumHelper(30001) = 0 && NumHelper(30002) = 0
TriggerAll = WinPerfect && WinKO
TriggerAll = RoundState = 4
Trigger1 = NumPartner = 0
Trigger2 = NumPartner > 0
Trigger2 = Partner,ID > ID
StateNo = 30000
PosType = Left
Pos = 0, 0
Ownpal = 1
IgnoreHitPause = 1
SuperMoveTime = 99999
PauseMoveTime = 99999
SprPriority = 0
ID = 30000
Persistent = 0

[State 0, AfterImage]
Type = AfterImage
triggerall = var(0) = 75
triggerall = var(0) = 90
Trigger1 = Time = 0
Time = 99999
PalContrast = 128,128,128
PalAdd = 0,0,0
PalMul = .5,.5,.5
length = 10
trans = add
TimeGap  = 1
FrameGap = 2

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

[Statedef -3]

;[State -1]      ; To use later
;Type = Helper
;Trigger1 = MoveHit
;StateNo = 30003
;ID = 30003
;PosType = P2
;Pos = 0,-50
;Ownpal = 1
;SprPriority = 5
;IgnoreHitPause = 1
;Persistent = 0
;SuperMoveTime = 9999
;PauseMoveTime = 9999

[State -3, GetHit Snd]
type=playsnd
triggerall=alive&&time=1
triggerall=stateno=5000||stateno=5010
trigger1=gethitvar(animtype)>=2&&random<500
trigger2=gethitvar(animtype)=1&&random<375
trigger3=gethitvar(animtype)=0&&random<250
value=s140,(13+(random%2)) ;*10,ceil(random/200)
channel=1
ignorehitpause=1

;This controller plays a sound everytime the player lands from a jump, or
;from a 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

;[State 3000, Super]  Not uses yet
;type = Helper
;trigger1 = Time = 0
;id = 8515
;pos = 40,-50
;postype = P1
;name = "Spining circle"
;stateno = 8515
;helpertype = normal
;supermove = 1
;keyctrl = 0
;ownpal = 1
;supermovetime = 99999999
;pausemovetime = 99999999
