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

; これはKFMの定数と状態のファイルです。
; このファイルの中には注釈が散らされているので、CNSを習いたいお方は
; 読んでみたらいいです。

[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1500
;Amount of power stocks to have (divided by 1000). Defaults to 3000
power = 3000
;attack power (more is stronger)
;攻撃ダメージ
attack = 125
;defensive power (more is stronger)
;体力パワー
defence = 125
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
;Time which player lies down for, before getting up
liedown.time = 60
;Number of points for juggling
airjuggle = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 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 = 60
FloatPersistIndex = 40

[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,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 3.3      ;Walk forward
walk.back = -3     ;Walk backward
run.fwd  = 7.3    ;Run forward (x, y)
run.back = -6.6,-3.5 ;Hop backward (x, y)
jump.neu = 0,-11    ;Neutral jumping velocity (x, y)
jump.back = -3.25    ;Jump back Speed (x, y)
jump.fwd = 3.25       ;Jump forward Speed (x, y)
runjump.back = -4,-10 ;Running jump speeds (opt)
runjump.fwd = 4,-12      ;.
airjump.neu = 0,-9.1      ;.
airjump.back = -3.55      ;Air jump speeds (opt)
airjump.fwd = 3.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 = .58         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching

;---------------------------------------------------------------------------
; Variable usage:
; This is a record of the variables that KFM uses. Keeping a record of your
; variable usage helps you avoid careless mistakes later.
; var(1)  - Used in kfm.cmd for combo condition (updated every tick)
; var(2)  - Used in Kung Fu Throw (state 800) to remember if fwd was being
;           held (remembered from state 800 through state 810).

;---------------------------------------------------------------------------
;---------------------空中ダッシュ
[Statedef 110]
type = A
movetype = I;A
physics = A
anim = 110
velset = 0
ctrl = 0

[State 110, 1]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 115

[State 110, end]
type = ChangeState
trigger1 = AnimTime = 0
value = 111

;---------------------空中ダッシュ中
[Statedef 111]
type = A
movetype = I;A
physics = N
anim = 100
ctrl = 1

[State 111, 1]
type = Width
trigger1 = 1
value = 27,15

[State 111, 1]
type = VelSet
trigger1 = 1
x = 9;const(velocity.run.fwd.x)

[State 111, 0]
type = PlaySnd
trigger1 = time = 1
value = 100,0
channel = 1

[State 111, line1];スピードライン１
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4055  
postype = p1
pos = 0, -55
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2

[State 111, line2];スピードライン２
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4056  
postype = p1
pos = -5, -45
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2

[State 111, line3];スピードライン３
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4057  
postype = p1
pos = -35, -30
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2

[State 111, line4];スピードライン４
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4058
postype = p1
pos = 10, -68
velocity = 0, 0
accel = 0, 0
random = 40, 15
removetime = -2
ownpal = 1

[State 111, 5.1]
type = ChangeState
trigger1 = time > 7
trigger1 = command != "holdfwd" || time = 25
value = 950

[State 111, end]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 115

;---------------------------------着地

[Statedef 115]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1730

[State 115, 1]
type = VelSet
trigger1 = Time = 0
x = 15
y = 0

[State 115, 3]
type = VelAdd
trigger1 = Time > 0
x = .15

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

[State 115, landdust1]
type = explod
trigger1 = Time = 0
postype = p1
pos = 10,0
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5

[State 115, Landing Sound]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 2

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

;---------------------空中バックダッシュ
[Statedef 112]
type = A
movetype = I
physics = N
anim = 112
ctrl = 0

[State 112, 1]
type = Width
trigger1 = 1
value = 27,15

[State 112, 1]
type = VelSet
trigger1 = 1
x = -8;const(velocity.run.fwd.x)

[State 112, 0]
type = PlaySnd
trigger1 = time = 1
value = 100,0
channel = 1

[State 112, line1];スピードライン１
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4055  
postype = p1
pos = 0, -60
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2
facing = -1

[State 112, line2];スピードライン２
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4056  
postype = p1
pos = -5, -50
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2
facing = -1

[State 112, line3];スピードライン３
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4057  
postype = p1
pos = -5, -35
velocity = 0, 0
accel = 0, 0
random = 20, 20
removetime = -2
ownpal = 1
sprpriority = 2
facing = -1

[State 112, line4];スピードライン４
type = Explod
trigger1 = Time % 4 = 0 && Time < 30  
anim = 4058
postype = p1
pos = 10, -80
velocity = 0, 0
accel = 0, 0
random = 40, 15
removetime = -2
ownpal = 1
facing = -1

[State 112, 5.1]
type = ChangeState
triggerall = var(9) = 0
trigger1 = time > 7
trigger1 = command != "holdfwd" || time = 25
value = 113

[State 112, end]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= 0
value = 106

[Statedef 113]
type    = A
physics = A
anim = 113

[state 113, 1]
type = VelAdd
trigger1 = Time = 0
y = -0.08

; ----------------ハイジャンプ必殺技後 (降下)
[Statedef 950]
type    = A
physics = A
anim = 950

[state 950, 1]
type = VelAdd
trigger1 = Time = 0
y = -0.08

;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

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

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

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

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

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

;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

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

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

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

[State 191, 4]
type = PlaySnd
trigger1 = AnimElem = 3
value = s2200, 0

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

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

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

[State 195, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = s2200, 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  = 1                      ;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 p1's sprite 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 = Light                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 3, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
sparkno = s4100                      ;Spark anim no (Def: set above)
guard.sparkno = s4500
sparkxy = -10, -76               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s5, 0                  ;Sound to play on hit
guardsound = s6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -4             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -1.4,-3           ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 12                 ;Time before opponent regains control in air

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

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

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

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

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

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

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 4
trigger2 = AnimElem = 5
trigger3 = AnimElem = 6
trigger4 = AnimElem = 7
trigger5 = AnimElem = 8
trigger6 = AnimElem = 9
attr = S, NA
animtype  = Medium
damage    = 23
guardflag = MA
pausetime = 1,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,2
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

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

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

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

[State 210, 6]
type = PlaySnd
trigger1 = AnimElem = 5
value = 0, 1

[State 210, 7]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0, 1

[State 210, 8]
type = PlaySnd
trigger1 = AnimElem = 7
value = 0, 1

[State 210, 9]
type = PlaySnd
trigger1 = AnimElem = 8
value = 0, 1

[State 210, 10]
type = PlaySnd
trigger1 = AnimElem = 9
value = 0, 1

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 230, 1]
type = PlaySnd
trigger1 = Time = 2
value = 4, 1

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

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

[State 230, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 4

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

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

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


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


[State 240, 4]
type = PlaySnd
trigger1 = AnimElem = 7
value = 0, 2

;------------------------------------------------------------------------
;--------------------高速移動（緊急回避）--------------------------------
;------------------------------------------------------------------------
;--------高速移動（前方）
[Statedef 361]
type = S
physics = S
anim = 361
sprpriority = -1
poweradd = 0
velset = 0,0
ctrl = 0

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

[State 361, snd]
type = PlaySnd
trigger1 = AnimElem = 2
value = 8,1

[State 361, hit]
type = HitBy
trigger1 = 1
value =  , AT

[State 361, hit]
type = NotHitBy
trigger1 = 1
value = , AA, AP

[State 361, snd]
type = Poweradd
trigger1 = prevstateno = 150 || prevstateno = 151
trigger1 = AnimElem = 1
value = -1000

[State 361, 51]
type = EnvColor
trigger1 = animelem = 1
trigger1 = prevstateno = 150 || prevstateno = 151
value = 200,200,200
time = 3

[State 361, 1]
type = velset
trigger1 = Time = [10,25]
x = 5

[state 361, 1]
type = explod
trigger1 = animelem = 1
postype = p1
bindtime = 1
removetime = 8
removeongethit = 1
pos = 0,0
anim = 362
sprpriority = 3

[state 361, 1]
type = explod
trigger1 = time = 20
postype = p1
bindtime = 1
removetime = 8
removeongethit = 1
pos = 30,0
anim = 362
sprpriority = 3

[State 361, dust]
type = Explod
trigger1 = AnimElem = 1
anim = 4010
ID = 100
postype = p1
pos = -10,0
bindtime = 1
sprpriority = 2
ownpal = 1
scale = .7, .7

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

;--------高速移動（後方）
[Statedef 360]
type = S
physics = S
anim = 360
poweradd = 0
sprpriority = -1
velset = 0,0
ctrl = 0

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

[State 360, hit]
type = HitBy
trigger1 = 1
value =  , AT

[State 360, hit]
type = NotHitBy
trigger1 = 1
value = , AA, AP

[State 360, snd]
type = PlaySnd
trigger1 = AnimElem = 2
value = 8,1

[State 360, snd]
type = Poweradd
trigger1 = prevstateno = 150 || prevstateno = 151
trigger1 = AnimElem = 1
value = -1000

[State 360, 51]
type = EnvColor
trigger1 = animelem = 1
trigger1 = prevstateno = 150 || prevstateno = 151
value = 200,200,200
time = 3

[State 360, 1]
type = velset
trigger1 = Time = [10,25]
x = -5

[state 360, 1]
type = explod
trigger1 = animelem = 1
postype = p1
bindtime = 1
removetime = 8
removeongethit = 1
pos = 0,0
anim = 362
sprpriority = 3

[state 360, 1]
type = explod
trigger1 = time = 20
postype = p1
bindtime = 1
removetime = 8
removeongethit = 1
pos = -40,0
anim = 362
sprpriority = 3

[State 360, dust]
type = Explod
trigger1 = AnimElem = 1
anim = 4010
ID = 100
postype = p1
pos = 30,0
bindtime = 1
sprpriority = 2
ownpal = 1
facing = -1
scale = .7, .7

[State 360, 3]
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  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

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

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

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

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

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

;---------------------------------------------------------------------------
;Crouching strong punch
; 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 = C
juggle  = 6
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2

[State 410, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 4, 1

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 6
attr = C, NA
damage    = 37
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-55
hitsound   = s5,2
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4
air.velocity = -3,-4

;This is the second hit, triggered on the 4th element of animation.
[State 410, 3]
type = HitDef
trigger1 = AnimElem = 8
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-83
hitsound   = s5,2
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -3,-4

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

[State 410, 5]
type = PlaySnd
trigger1 = AnimElem = 4
value = 4, 1

[State 410, 6]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0, 3

[State 410, 7]
type = PlaySnd
trigger1 = AnimElem = 6
value = 0, 1

;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

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

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

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

[State 430, 1]
type = PlaySnd
trigger1 = AnimElem = 3
value = 4, 1

;---------------------------------------------------------------------------
;Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
; CNS レベル: 易
; 詳細:
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 70
ctrl = 0
anim = 440
sprpriority = 2

[State 440, 2]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 0

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

[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= 11
ctrl = 0
anim = 600
sprpriority = 2

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

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

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

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

;---------------------------------------------------------------------------
;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 = 2
value = 4, 1

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

[State 610, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 4

;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

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

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

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

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

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

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

[State 640, 1]
type = PlaySnd
trigger1 = time = 0
value = 0, 4

;---------------------------------------------------------------------------
;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
p1sprpriority = 1     ;Draw p1's sprite in front of p2
                      ;p2's sprite priority is set to 0 by default
p1facing = 1
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, 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 may 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

; Here a variable, var(2), is used to remember whether or not the
; player was holding forward at the start of the state. This variable
; is checked later on to turn KFM around if necessary.
[State 810, Holding fwd?]
type = VarSet
trigger1 = Time = 0
var(2) = command = "holdfwd"

[State 810, Grab Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1, 1

[State 810, Throw Sound]
type = PlaySnd
trigger1 = AnimElem = 7
value = 800, 0

[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, holdfwd - Turn 6] ;If was holding fwd before, turn now
type = Turn
trigger1 = var(2)
trigger1 = AnimElem = 6

[State 810, holdfwd - Pos 6] ;If was holding fwd before, move a little
type = PosAdd
trigger1 = var(2)
trigger1 = AnimElem = 6
x = -37

[State 810, holdfwd - Turn Target 6] ;If was holding fwd before, turn target too
type = TargetFacing
trigger1 = var(2)
trigger1 = AnimElem = 6
value = -1

[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

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

;In case attacker loses binding on player for any reason, this controller
;guarantees that the player will never get stuck in this thrown state.
[State 820, 2]
type = SelfState
trigger1 = !gethitvar(isbound)
value = 5050

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


;---------------------------------------------------------------------------
; CNS difficulty: medium
; Description: This is like a standard attack, but with some differences.
;   There are two HitDefs in this attack. One is triggered when the
;   opponent is near (using a p2bodydist trigger), and the other
;   when the opponent is farther away. The main differences between
;   the near and far versions of the HitDefs is that the near version
;   has a "fall" parameter set to 1, causing the opponent to be knocked
;   down. Other minor differences are the damage, and the velocity to
;   give the opponent.
;   The line "attr = S, SA" line means this is a Standing, Special Attack.
;   It is important you have the attr parameter set correctly for all
;   you HitDefs.
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2

[State 1000, 1]
type = PlaySnd
trigger1 = Time = 8
value = 0, 3

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 13
x = 10

[State 1000, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1000, 6] ;Opponent not near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 4
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

[State 1000, 6]
type = PosAdd
trigger1 = AnimElem = 9
x = -5

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

;---------------------------------------------------------------------------
; Strong Kung Fu Palm
; CNS difficulty: medium
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 120
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[State 1010, 1]
type = PlaySnd
trigger1 = Time = 9
value = 0, 3

[State 1010, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1010, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 13
x = 10

[State 1010, 4]
type = PosAdd
trigger1 = AnimElem = 5
x = 5

[State 1010, 5]
type = VelSet
trigger1 = AnimElem = 5
x = 4

[State 1010, 6] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-3.5
air.velocity = -4,-3
fall = 1

[State 1010, 7] ;Opponent not near
type = HitDef
trigger1 = AnimElem = 5
trigger1 = p2bodydist X >= 40
attr = S, SA
animtype  = Hard
damage    = 85, 4
priority  = 4
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -7
air.velocity = -4,-2.5

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

;---------------------------------------------------------------------------
; Fast Kung Fu Palm
; CNS difficulty: advanced
; Description: This is a complicated attack move. If you're a beginner,
;     you should skip looking at this for now and check it later when
;     you are more comfortable with the cns.
;     This move puts the other player in a custom get-hit state.
;     The line "p2stateno = 1025" in the HitDef does this. KFM has some
;     palette effects as well as after-image effects.
[Statedef 1020]
type    = S
movetype= A
physics = N
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2

[State 1020, Friction]
type = VelMul
trigger1 = 1
x = .85 * ifelse (AnimElemTime(6) < 0, 1, .8)

[State 1020, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1020, Afterimage]
type = AfterImageTime
trigger1 = AnimElemTime(8) < 0
time = 2

[State 1020, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

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

[State 1020, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 20

[State 1020, 3]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 12
x = 10

[State 1020, 4]
type = PosAdd
trigger1 = AnimElem = 4
x = 5

[State 1020, 5]
type = VelSet
trigger1 = AnimElem = 4
x = 13

[State 1020, 6]
type = HitDef
trigger1 = AnimElem = 4
attr = S, SA
animtype  = Hard
damage    = 95, 5
getpower  = 0
priority  = 4
guardflag = MA
pausetime = 8,7
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -8,-7
guard.velocity = -7
air.velocity = -8,-7
airguard.velocity = -5, -4
fall = 1
p2stateno = 1025    ;Make p2 go to state 1025 on hit
p2facing = 1        ;Force to face p1

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

;------------------
; Hit by Fast Kung Fu Palm - shaking from the hit
; (a custom gethit state)
; See State 1020 for details
[Statedef 1025]
type    = A
movetype= H
physics = N
velset = 0,0

[State 1025, Anim] ;Custom animation
type = ChangeAnim2
trigger1 = 1
value = 1025

[State 1025, State]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1026

;------------------
; Hit by Fast Kung Fu Palm - flying through the air
; (a custom gethit state)
[Statedef 1026]
type    = A
movetype= H
physics = N

[State 1026, Velocity]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 1026, Gravity]
type = VelAdd
trigger1 = 1
y = .45

[State 1026, No scroll]
type = ScreenBound
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist < 65
trigger2 = FrontEdgeBodyDist < 65
value = 1
movecamera = 0,1

[State 1026, Hit wall]
type = ChangeState
triggerall = Pos y < -15
trigger1 = BackEdgeBodyDist <= 20
trigger2 = FrontEdgeBodyDist <= 20
value = 1027

[State 1026, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;------------------
; Hit by Fast Kung Fu Palm - hit wall
; (a custom gethit state)
[Statedef 1027]
type    = A
movetype= H
physics = N

[State 1027, Turn]
type = Turn
trigger1 = (Time = 0) && (FrontEdgeBodyDist <= 30)

[State 1027, Pos]
type = PosAdd
trigger1 = Time = 0
x = 15 - BackEdgeBodyDist

[State 1027, Stop moving]
type = PosFreeze
trigger1 = 1
x = 1
y = 1

[State 1027, No scroll]
type = ScreenBound
trigger1 = 1
value = 1
movecamera = 0,1

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 50
postype = back
sprpriority = 3

[State 1027, Anim]
type = ChangeAnim2
trigger1 = Time = 0
value = 1027

[State 1027, Sound]
type = PlaySnd
trigger1 = Time = 0
value = F7,0

[State 1027, State]
type = ChangeState
trigger1 = AnimTime = 0
value = 1028

;------------------
; Hit by Fast Kung Fu Palm - bounce off wall
; (a custom gethit state)
[Statedef 1028]
type    = A
movetype= H
physics = N

[State 1028, 1]
type = NotHitBy
trigger1 = 1
value = , NA, NP

[State 1028, Vel Y]
type = VelSet
trigger1 = Time = 0
y = -6

[State 1028, Vel X]
type = VelSet
trigger1 = Time = 0
x = 1.6

[State 1028, Turn]
type = Turn
trigger1 = (Time = 0) && (BackEdgeDist < 30)

[State 1028, Gravity]
type = VelAdd
trigger1 = 1
y = .35

[State 1028, Anim 5050] ;Self falling animation
type = ChangeAnim
trigger1 = Time = 0
trigger1 = !SelfAnimExist(5052)
value = 5050

[State 1028, Anim 5052] ;Self falling animation (diagup type)
type = ChangeAnim
trigger1 = Time = 0
trigger1 = SelfAnimExist(5052)
value = 5052

[State 1028, Anim 5060] ;Coming down - normal
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5050
trigger1 = SelfAnimExist(5060)
persistent = 0
value = 5060

[State 1028, Anim 5062] ;Coming down - diagup type
type = ChangeAnim
trigger1 = Vel Y > -2
trigger1 = Anim = 5052
trigger1 = SelfAnimExist(5062)
persistent = 0
value = 5062

[State 1028, Hit ground]
type = SelfState
trigger1 = (Vel y > 0) && (Pos y >= 0)
value = 5100

;---------------------------------------------------------------------------
; Kung Fu Knee
; CNS difficulty: medium
; Description: Like the Kung Fu Palm, this is a special attack. This attack
;     begins on the ground, launches KFM into the air, then ends when KFM
;     lands on the ground. To achieve this, we use three states. The first
;     has KFM starting on the ground (note that type = S in the Statedef).
;     The ChangeState controller brings KFM into the second state (state
;     1051) when his ground animation ends. The second state controls KFM's
;     movement into the air and back towards the ground. The last state
;     (state 1052) stops KFM from moving when he touches the ground, and
;     brings him back to his stand state (state 0) when the animation is
;     over. More details are given in comments before each of the following
;     states.
[Statedef 1050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 110
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2

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

[State 1050, 2]
type = null;PosAdd
trigger1 = AnimElem = 2
x = 15

[State 1050, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 20

[State 1050, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 80, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3.5,-7
guard.velocity = -7
air.velocity = -3.5,-7
fall = 1

[State 1050, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1051

;------------------
; Light Kung Fu Knee - jump
; Description: This state uses a velset parameter in the Statedef to make
;     KFM move upwards. A value of 2,-6 means 2 pixels/tick forwards, and
;     6 pixels/tick upwards. Since this is an aerial state, the type is set
;     to A in the Statedef.
;     Notice that physics = N (N for None) here. This means we are not using
;     the built-in aerial physics model (physics = A), so we have complete
;     control over what KFM does in this state. Since we do not have
;     physics = A to take care of gravity for us, we need to put in our own
;     controller for that. Controller 1051,1 does the work of pulling KFM
;     down towards the ground. Controller 1051,2 checks if KFM has reached
;     the ground, and changes to state 1052 if so.
;     In this state's Statedef, we will use the hitdefpersist parameter to
;     retain the HitDef information from the last state. If we did not have
;     hitdefpersist, the HitDef will be turned off between state changes.
[Statedef 1051]
type    = A
movetype= A
physics = N
velset = 2,-6
anim = 1051
hitdefpersist = 1 ;Keep the HitDef from previous state active

[State 1051, 1] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1051, 2]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
value = 1055

[State 1051, 3] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;------------------
; Light Kung Fu Knee - land
; Description: This is KFM's landing state. There is a velset in the
;     Statedef to stop KFM from moving. Since KFM's y-position can be any
;     number greater than -10 upon entering this state (see the ChangeState
;     controller in State 1051), we need to reset it to 0, the ground
;     level. That is what controller 1052,1 is for.
[Statedef 1052]
type    = S
movetype= I
physics = S
anim = 1052
sprpriority = 1
velset = 0,0

[State 1052, 1] ;Reset y-position to ground level
type = PosSet
trigger1 = Time = 0
y = 0

[State 1052, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

[State 1052, 3] ;Give KFM back control early
type = CtrlSet
trigger1 = AnimElem = 3, -1
value = 1

[State 1052, 4] ;Move KFM back a little
type = PosAdd
trigger1 = AnimElem = 4
x = -15

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

;------------------
; Kung Fu Knee - kick
[Statedef 1055]
type    = A
movetype= A
physics = N
anim = 1055

[State 1055, 1]
type = PlaySnd
trigger1 = Time = 0
value = 100,0
channel = 0

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

[State 1055, 3]
type = PosAdd
trigger1 = Time = 0
x = 10
y = -10

[State 1055, 4] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1055, 5]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Med
damage    = 35 + (prevstateno = 1061)*5, 2
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-90
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 16
ground.velocity = -6
guard.velocity = -8
guard.ctrltime = 12
air.velocity = -4,-5
airguard.velocity = -4,-4.5
air.fall = 1

[State 1055, 6] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1056

;------------------
; Kung Fu Knee - land from kick
[Statedef 1056]
type    = S
movetype= I
physics = S
anim = 1056
sprpriority = 1
velset = 0,0

[State 1056, 1] ;Reset y-position to ground level
type = PosSet
trigger1 = Time = 0
y = 0

[State 1056, 2] ;Play a sound for landing
type = PlaySnd
trigger1 = Time = 0
value = 40, 0

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

;---------------------------------------------------------------------------
; Strong Kung Fu Knee
[Statedef 1060]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 120
velset = 0,0
anim = 1060
ctrl = 0
sprpriority = 2

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

[State 1060, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 6

[State 1060, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 21

[State 1060, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 90, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -3.5,-7.5
guard.velocity = -7
air.velocity = -3.5,-7.5
fall = 1

[State 1060, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1061

;------------------
; Strong Kung Fu Knee - jump
[Statedef 1061]
type    = A
movetype= A
physics = N
velset = 2.5,-7.5
anim = 1061
hitdefpersist = 1 ;Keep the HitDef from previous state active

[State 1061, 1]
type = VelAdd
trigger1 = 1
y = .45

[State 1061, 2]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
value = 1055

[State 1061, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;---------------------------------------------------------------------------
; Fast Kung Fu Knee
; Description: This version of the Kung Fu Knee hits up to 3 times (including
;     the kick).
[Statedef 1070]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1070
ctrl = 0
sprpriority = 2

[State 1070, Afterimage]
type = AfterImage
trigger1 = Time = 0
length = 13
PalBright   =  30, 30,  0
PalContrast =  70, 70, 20
PalAdd      = -10,-10,-10
PalMul      = .85,.85,.50
TimeGap  = 1
FrameGap = 2
Trans = Add
time = 2

[State 1070, Afterimage]
type = AfterImageTime
trigger1 = 1
time = 2

[State 1070, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

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

[State 1070, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 6

[State 1070, 3]
type = PosAdd
trigger1 = AnimElem = 4
x = 21

[State 1070, 4]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Medium
getpower  = 0
damage    = 35, 3
priority  = 5
hitflag   = MA
guardflag = MA
pausetime = 8,7
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -2,-6
guard.velocity = -7
air.velocity = -2,-6
fall = 1
fall.animtype = Med
fall.recovertime = 30

[State 1070, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 1071

;------------------
; Fast Kung Fu Knee - jump
[Statedef 1071]
type    = A
movetype= A
physics = N
velset = 2.5,-9
anim = 1071

[State 1071, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 18
add = 32,16,0
sinadd = 64,32,5,3

[State 1071, Afterimage]
type = AfterImageTime
trigger1 = Vel Y < 0
time = 2

[State 1071, 1]
type = VelAdd
trigger1 = 1
y = .5

[State 1071, 2]
type = VelAdd
trigger1 = Vel Y >= -1
y = .2

[State 1071, 3]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
getpower  = 0
damage    = 68, 4
priority  = 5
guardflag = MA
pausetime = 12,12
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3,-9.5
guard.velocity = -7
air.velocity = -3,-9.5
fall = 1
fall.recovertime = 30

[State 1071, 4]
type = ChangeState
trigger1 = Command = "a" || Command = "b"
trigger1 = Vel y < -1
trigger1 = Time > 0
value = 1075

[State 1071, 5]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -10
value = 1052

;------------------
; Fast Kung Fu Knee - kick
[Statedef 1075]
type    = A
movetype= A
physics = N
anim = 1055

[State 1075, Afterimage]
type = AfterImageTime
trigger1 = 1
time = 2

[State 1075, Blink Yellow]
type = PalFX
trigger1 = Time = 0
time = 20
add = 32,16,0
sinadd = 64,32,5,3

[State 1075, 1]
type = PlaySnd
trigger1 = Time = 0
value = 100,0
channel = 0

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

[State 1075, 3]
type = PosAdd
trigger1 = Time = 0
x = 10
y = -10

[State 1075, 4] ;Gravity
type = VelAdd
trigger1 = 1
y = .45

[State 1075, 5]
type = VelAdd
trigger1 = Vel Y >= -1
y = .2

[State 1075, 6]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Med
damage    = 42, 2
getpower  = 0
priority  = 4
guardflag = MA
pausetime = 12,12
sparkxy = 0,-90
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 15
ground.hittime  = 18
ground.velocity = -6
guard.velocity = -6
air.velocity = -4,-6
airguard.velocity = -4,-4.5
air.fall = 1

[State 1075, 7] ;Change state when KFM is close to ground
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1056


;---------------------------------------------------------------------------
;連続死ね死ねミサイル

[Statedef 1100]
type    = A
movetype= A
physics = S
juggle  = 4
poweradd= 1000
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2

            

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

;---------------------------------------------------------------------------
; ファイナルフラッシュ
[Statedef 1110]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
velset = 0,0
anim = 1110
ctrl = 0
sprpriority = 2

[State 1110,1]
type = Helper
trigger1 = time = 0
id = 1111
name = "Vegeta"
sprpriority = 4
pos = 0,-200
postype = p1
stateno = 1111
helpertype = normal
keyctrl = 0 
ownpal = 0


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

;---------------------------------------------------------------------------
;ベジータ
[Statedef 1111]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1111
ctrl = 0
sprpriority = 2

[State 1111, 1]
type = PlaySnd
trigger1 = time = 0
value = 8, 1

[State 1111, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 6000, 1

[State 1111, 3]
type = PlaySnd
trigger1 = AnimElem = 4
value = 20, 0

[State 1111, 4]
type = PlaySnd
trigger1 = AnimElem = 15
value = 2200, 4

[State 1111, 5]
type = PlaySnd
trigger1 = AnimElem = 18
value = 3000, 2





;---------------------------------------------------------------------------
; スーパー必殺技フルコース
[Statedef 2000]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -2000
velset = 0,0
anim = 2000
ctrl = 0
sprpriority = 3

[state 2000, 1]
type = superpause
trigger1 = time = 0
time = 33
movetime = 33
anim = -1

[State 3200, ]
type = EnvShake
trigger1 = time = 0
time = 33
freq = 120
ampl = 3

[State 2000, 2]
type = Explod
trigger1 = time = 0
anim = 4000
sprpriority = 2
postype = p1
pos = 4,0
bindtime = -1
removetime = 33
removeongethit = 1
supermove = 1

[State 2000, 3]
type = Explod
trigger1 = time = 34
anim = 4001
sprpriority = 2
postype = p1
pos = 5,0
bindtime = 1
removetime = 6
removeongethit = 1
supermove = 1
ownpal = 1

[State 2000, 3]
type = Explod
trigger1 = time = 0
anim = 4040
sprpriority = 4
postype = p1
pos = 5,0
bindtime = 1
removetime = 33
removeongethit = 1
supermove = 1
ownpal = 1

[State 2000, 4]
type = PlaySnd
trigger1 = time = 0
value = 3000,1

[State 2000, 5]
type = PlaySnd
trigger1 = time = 0
value = s2200, 0

[State 2000, 6]
type = PlaySnd
trigger1 = AnimElem = 6
trigger2 = AnimElem = 10
value = s4, 0

[State 2000, 6]
type = PlaySnd
trigger1 = AnimElem = 13
trigger2 = AnimElem = 19
trigger3 = AnimElem = 23
trigger4 = AnimElem = 37
trigger5 = AnimElem = 38
trigger6 = AnimElem = 39
trigger7 = AnimElem = 40
trigger8 = AnimElem = 41
trigger9 = AnimElem = 42
trigger10 = AnimElem = 43
trigger11 = AnimElem = 44
trigger12 = AnimElem = 45
trigger13 = AnimElem = 46
trigger14 = AnimElem = 47
value = s0, 1

[State 2000, 7]
type = velset
trigger1 = AnimElem = 6
trigger2 = AnimElem = 13
trigger3 = AnimElem = 19
trigger4 = AnimElem = 23
trigger5 = AnimElem = 27
x = 8

[State 2000, 8]
type = PlaySnd
trigger1 = AnimElem = 27
trigger2 = AnimElem = 32
value = s4, 1

[State 2000, 8]
type = HitDef
trigger1 = AnimElem = 4
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,12
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,0
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 9]
type = HitDef
trigger1 = AnimElem = 13
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,2
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 10]
type = HitDef
trigger1 = AnimElem = 19
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,2
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 11]
type = HitDef
trigger1 = AnimElem = 23
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,2
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 12]
type = HitDef
trigger1 = AnimElem = 23
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,2
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 13]
type = HitDef
trigger1 = AnimElem = 27
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,0
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 14]
type = HitDef
trigger1 = AnimElem = 32
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,1
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 15]
type = HitDef
trigger1 = AnimElem = 37
trigger2 = AnimElem = 38
trigger3 = AnimElem = 39
trigger4 = AnimElem = 40
trigger5 = AnimElem = 41
trigger6 = AnimElem = 42
trigger7 = AnimElem = 43
trigger8 = AnimElem = 44
trigger9 = AnimElem = 45
trigger10 = AnimElem = 46
attr = S, HA
animtype  = Hard
damage    = 23
guardflag = MA
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,3
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 2000, 14]
type = HitDef
trigger1 = AnimElem = 47
attr = S, HA
animtype  = diagup
damage    = 23
guardflag = MA
priority = 7, Hit
pausetime = 0,15
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,3
guardsound = s6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -9,-4
air.velocity = -9,-4
fall = 1


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

;---------------------------------------------------------------------------
;---------------------かめはめ波 (弱)
[Statedef 1200]
type = S
movetype = A
physics = S
anim = 1200
poweradd = -100
velset = 0
ctrl = 0
juggle = 1

[State 1200, ki]
type = Explod
trigger1 = animelem = 1
anim = 1223
sprpriority = 2
postype = p1
pos = 0,0
bindtime = -1
removetime = 5
removeongethit = 1
ownpal = 1

[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1100,1

[State 1200, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1100,0

[State 1200, 3]
type = Projectile
triggerall = var(10) = 0
trigger1 = AnimElem = 2
projanim = 1210
projhitanim = 1221
projID = 1000
velocity = 3.5
;projshadow = 150,150,150
projpriority = 1
postype = p1
offset = 108,-36
attr = S, SP
damage = 90,10
animtype = medium
hitflag = MAFP
guardflag = MA
sparkno = -1
guard.sparkno = s4500
sparkxy = 0,0
hitsound = S5,4
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -4,-4
air.fall = 1
fall.recover = 0
air.juggle = 10
yaccel = .5

[State 1200, KAIOKEN]
type = Projectile
triggerall = var(10) != 0
trigger1 = AnimElem = 2
projanim = 1210
projhitanim = 1221
projID = 1200
velocity = 4
;projshadow = 150,150,150
projpriority = 3
postype = p1
offset = 108,-36
attr = S, SP
damage = 80,10
animtype = hard
hitflag = MAFP
guardflag = MA
sparkno = -1
guard.sparkno = s4500
sparkxy = 0,0
hitsound = S5,4
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -4,-4
air.fall = 1
fall.recover = 0
air.juggle = 10
yaccel = .5
ownpal = 1

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

;---------------------------------------------------------------------------
;--------------------------------空中かめはめ波 (弱)
[Statedef 1400]
type = A
movetype = A
physics = N
anim = 1450
juggle = 1
ctrl = 0
velset = 0,0
poweradd = -100

[State 1400, ki]
type = Explod
trigger1 = time = 0
anim = 1223
sprpriority = 2
postype = p1
pos = 0,0
bindtime = -1
removetime = 5
removeongethit = 1

[State 1400, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1100,1

[State 1400, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1100,0

[State 1400, 3]
type = Projectile
triggerall = var(10) = 0
trigger1 = AnimElem = 2
projanim = 1210
projhitanim = 1221
projID = 1400
velocity = 3.5
;projshadow = 150,150,150
projpriority = 1
postype = p1
offset = 108,-36
attr = A, SP
damage = 90,10
animtype = medium
hitflag = MAFP
guardflag = MA
sparkno = -1
guard.sparkno = s4500
sparkxy = 0,0
hitsound = S5,4
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -4,-4
air.fall = 1
fall.recover = 0
air.juggle = 10
yaccel = .5

[State 1400, KAIOKEN]
type = Projectile
triggerall = var(10) != 0
trigger1 = AnimElem = 2
projanim = 1210
projhitanim = 1221
projID = 1400
ID = 1400
velocity = 4
;projshadow = 150,150,150
projpriority = 3
postype = p1
offset = 108,-36
attr = A, SP
damage = 80,10
animtype = hard
hitflag = MAFP
guardflag = MA
sparkno = -1
guard.sparkno = s4500
sparkxy = 0,0
hitsound = S5,4
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -4,-4
air.fall = 1
fall.recover = 0
air.juggle = 10
yaccel = .5
ownpal = 1

[state 1400, 3]
type = changestate
trigger1 = animtime = 0
value = 950
ctrl = 1

;---------------------------------------------------------------------------
; ギャラクティカドーナツ
; CNS difficulty: easy
[Statedef 1210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -120
velset = 0,0
anim = 1211
ctrl = 0
sprpriority = 2

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

[State 1210, 2]
type = PlaySnd
trigger1 = AnimElem = 9
value = 1100,0

[State 1210, 3]
type = Explod
trigger1 = AnimElem = 1
persistent = 0
anim = 1222
postype = p1
pos = 0, 0
velocity = 0
accel = 0, .0
removetime = 22

[State 1210, 4]
type = Projectile
trigger1 = AnimElem = 9
ProjID = 1224
projanim = 1224
Projhitanim = 1225
Projremanim = 1225
Projcancelanim = 1225
Projremove = 1
Projremovetime = 165
velocity = 10, 0
attr = S, SP
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 1,165
sparkno = -1
guard.sparkno = s4500
sparkxy = 0, 0
hitsound = S5,4
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

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

;------------------------------------------------------------------------
;----------------------------------気力溜め------------------------------
;------------------------------------------------------------------------
;パワー溜め
[Statedef 1900]
type = S
physics = S
ctrl = 0
anim = 1900
velset = 0,0
sprpriority = 2

[State 1900, 1];気の音1
type = PlaySnd
trigger1 = time = 0
value = 2100, 2
volume = 255

[State 1900, 2];気の音2
type = PlaySnd
trigger1 = time = 10
value = 2100, 3
channel = 3
loop = 1
pan = 1
volume = 25

[State 1900, 3];『はぁ〜』
type = PlaySnd
trigger1 = time = 0
value = 2200, 0
channel = 2

[State 1900, 4]
type = poweradd
trigger1 = Time >= 0
value = 3

[State 1900, 5]
type = poweradd
trigger1 = Time >= 25
value = 4

[State 1900, 6]
type = poweradd
trigger1 = Time >= 75
value = 5

[State 1900, 7]
type = poweradd
trigger1 = Time >= 120
value = 6

[State 1900, charge]
type = Helper
triggerall = var(10) = 0
trigger1 = Time = 0
id = 1902
name = "Charge"
pos = 4,-2
postype = P1
stateno = 1902
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
size.xscale = 1
size.yscale = 1

[State 1900, charge kaiohken]
type = Helper
triggerall = var(10) != 0
trigger1 = Time = 0
id = 1903
name = "Charge"
pos = 4,-2
postype = P1
stateno = 1903
helpertype = normal
keyctrl = 0
ownpal = 1
ignorehitpause = 1
size.xscale = 1
size.yscale = 1

[State 1900, dust]
type = explod
removetime = -1
trigger1 = time = 0
trigger1 = stateno = 1900
anim = 4040
pos = 17,5
sprpriority = 4
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1
id = 4040
facing = -1

[state 1900, shake]
type = envshake
trigger1 = time%5 = 0
time = 5
freq = 60
ampl = -2

[State 1900, flash]
type = PalFX
triggerall = Time >= 5
trigger1 = TimeMod = 4,0
trigger1 = Time > 0
time = 1
add = 100,100,100

[State 1900, 9];MAX気の音
type = PlaySnd
trigger1 = power >= 3000
value = 2100, 2
pan = 1

[State 1900, 10]
type = ChangeState
trigger1 = power >= 3000
trigger2 = command != "hold_b" || command != "hold_y"
trigger2 = command != "hold_c"
value = 1901
ctrl = 1

;--------------------------気溜めやめる

[Statedef 1901]
type = S
physics = N
ctrl = 0
anim = 1901
sprpriority = 2

[State 1901, StopSnd]
type = StopSnd
trigger1 = Time = 0
channel = 3

[State 19011, StopSnd]
type = StopSnd
trigger1 = Time = 0
channel = 2

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

;----------------------------------へるぱー
[Statedef 1902]
type = A
movetype = I
physics = N
ctrl = 0
anim = 1950
velset = 0,0
sprpriority = 1

[State 1902, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 1902, BindToParent]
type = BindToParent
trigger1 = anim = 1950
pos = 4,-2

[State 1902, Anim]
type = ChangeAnim
triggerall = anim = 1950
trigger1 = root,anim = 1901
trigger2 = root,movetype = H
value = 1951

[State 1902, DestroySelf]
type = DestroySelf
trigger1 = anim = 1950 && Root,StateNo != 1900
trigger2 = anim = 1951 && animtime = 0
trigger3 = Root,stateno = [5000,5090]


;----------------------------------へるぱー（赤）
[Statedef 1903]
type = A
movetype = I
physics = N
ctrl = 0
anim = 3300
velset = 0,0
sprpriority = 3

[State 1903, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = NoShadow

[State 1903, BindToParent]
type = BindToParent
trigger1 = anim = 3300
pos = 0,0

[State 1903, Anim]
type = ChangeAnim
triggerall = anim = 3300
trigger1 = root,anim = 1901
trigger2 = root,movetype = H
value = 3301

[State 1903, DestroySelf]
type = DestroySelf
trigger1 = anim = 3300 && Root,StateNo != 1900
trigger2 = anim = 3301 && animtime = 0
trigger3 = Root,stateno = [5000,5090]


;---------------------------------------------------------------------------
;---------------------完全に怒ったビーム
[Statedef 2300]
type = S
movetype = A
physics = S
anim = 2300
poweradd = -1000
velset = 0
ctrl = 0
juggle = 1
sprpriority = 2

[state 2300, super a]
type = superpause
trigger1 = animelem = 2
time = 40
anim = -1


[State 2300, Aura1]
type = Explod
trigger1 = animelem = 2
anim = 1226
sprpriority = 5
postype = p1
pos = 0,0
bindtime = -1
removetime = 52
removeongethit = 1
supermove = 1
ownpal = 1

[State 2300, Aura2]
type = Explod
trigger1 = animelem = 2
anim = 2700
sprpriority = 5
postype = p1
pos = 0,0
bindtime = 1
removetime = 40
removeongethit = 1
supermove = 1
ownpal = 1

[State 2300, dust]
type = Explod
trigger1 = AnimElem = 2
anim = 4025
ID = 4025
postype = p1
pos = -25,0
bindtime = -1
sprpriority = 5
supermovetime = 26
ownpal = 1
removeongethit = 1
facing = -1

[State 2300, 1];『溜める音』
type = PlaySnd
trigger1 = AnimElem = 2
value = 20,0

[State 2300, 1];『撃つ音』
type = PlaySnd
trigger1 = AnimElem = 3
value = 2200,4

[State 2300, 1];『かめはめ波〜！』
type = PlaySnd
trigger1 = animelem = 1
value = 2200, 0
channel = 4

[State 2300, StopSnd]
type = StopSnd
trigger1 = animelem = 3
channel = 4

[State 2200, 1];『波ぁ〜！！』
type = PlaySnd
trigger1 = AnimElem = 3
value = 2200,5

[State 2300, proj]
type = Explod
trigger1 = animelem = 4
anim = 2600
sprpriority = 3
postype = p1
pos = 0,0
bindtime = -1
removetime = 70
removeongethit = 1
;supermove = 1
ownpal = 1

[State 2300, proj]
type = Projectile
trigger1 = AnimElem = 4
projanim = 2400
projhitanim = -1
projID = 2300
projremove = 0
projremovetime = 50
attr = S, HP
velocity = 0
projshadow = 150,150,150
projpriority = 5
postype = p1
offset = 0,0
attr = S, SP
damage = 50, 20
projhits = 45
projmisstime = 11
animtype = heavy
attr = s, sp
guardflag = MA
sparkno = s1221
guard.sparkno = s4500
sparkxy = ceil (p2dist x) + -10, -70
hitsound = S5,5
getpower = 0
guardsound = S6,0
pausetime = 0,15
ground.hittime = 35
ground.type = high
ground.slidetime = 20
ground.velocity = -12.5
air.velocity = -4,-4
air.juggle = 10
envshake.time = 10
envshake.ampl = 4
yaccel = .5
guard.kill = 0

[State 2300, proj2]
type = Projectile
trigger1 = time = 52
projanim = 2400
projhitanim = -1
projID = 2200
projremove = 0
projremovetime = 12
velocity = 0
attr = S, HP
projshadow = 150,150,150
projpriority = 5
postype = p1
offset = 0,0
damage = 100, 20
projhits = 45
projmisstime = 15
animtype = heavy
attr = s, sp
guardflag = MA
sparkno = s4300
guard.sparkno = s4500
sparkxy = ceil (p2dist x) + -10, -70
hitsound = S5,5
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -12,-4
air.fall = 1
fall=1
fall.recover = 0
air.juggle = 10
envshake.time = 10
envshake.ampl = 4
yaccel = .5
removeongethit = 1

[State 2200, nojuggle]
type = AssertSpecial
trigger1 = projhit(2200) = 0
flag = nojugglecheck

[State 2200, dust]
type = explod
trigger1 = animelem = 4
anim = 4040
pos = 17,5
sprpriority = 5
bindtime = 1
ownpal = 1
removeongethit = 1
facing = -1
removetime = 66

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

;---------------------------------------------------------------------------
;---------------------空中完全に怒ったビーム
[Statedef 2350]
type = A
movetype = A
physics = S
anim = 2350
poweradd = -1000
velset = 0,0
ctrl = 0
juggle = 1
sprpriority = 2

[state 2350, super a]
type = superpause
trigger1 = animelem = 2
time = 40
anim = -1

[State 2300, Aura1]
type = Explod
trigger1 = animelem = 2
anim = 1226
sprpriority = 5
postype = p1
pos = 0,0
bindtime = -1
removetime = 52
removeongethit = 1
supermove = 1
ownpal = 1

[State 2300, Aura2]
type = Explod
trigger1 = animelem = 2
anim = 2700
sprpriority = 5
postype = p1
pos = 0,0
bindtime = 1
removetime = 40
removeongethit = 1
supermove = 1
ownpal = 1

[State 2300, 1];『溜める音』
type = PlaySnd
trigger1 = AnimElem = 2
value = 20,0

[State 2300, 1];『撃つ音』
type = PlaySnd
trigger1 = AnimElem = 3
value = 2200,4

[State 2300, 1];『かめはめ波〜！』
type = PlaySnd
trigger1 = animelem = 1
value = 2200, 0
channel = 4

[State 2350, StopSnd]
type = StopSnd
trigger1 = animelem = 3
channel = 4

[State 2250, 1];『波ぁ〜！！』
type = PlaySnd
trigger1 = AnimElem = 3
value = 2200,5

[State 2300, proj]
type = Explod
trigger1 = animelem = 4
anim = 2600
sprpriority = 3
postype = p1
pos = 0,0
bindtime = -1
removetime = 70
removeongethit = 1
;supermove = 1
ownpal = 1

[State 2350, proj]
type = Projectile
trigger1 = AnimElem = 4
projanim = 2400
projhitanim = -1;1221
projID = 2300
projremove = 0
projremovetime = 50
velocity = 0
projshadow = 150,150,150
projpriority = 5
postype = p1
offset = 0,0
attr = A, HP
damage = 50, 20
projhits = 45
projmisstime = 11
animtype = heavy
attr = s, sp
hitflag = mafd
guardflag = MA
sparkno = s1221
guard.sparkno = s4500
sparkxy = ceil (p2dist x) + -10, -70
hitsound = S5,5
getpower = 0
guardsound = S6,0
pausetime = 0,15
ground.hittime = 35
ground.type = high
ground.slidetime = 20
ground.velocity = -12.5
air.velocity = -4,-4
;air.fall = 1
;fall=1
;fall.recover = 0
air.juggle = 10
envshake.time = 10
envshake.ampl = 4
yaccel = .5
guard.kill = 0

[State 2350, proj2]
type = Projectile
trigger1 = time = 52
projanim = 2400
projhitanim = -1;1221
projID = 2200
projremove = 0
projremovetime = 12
velocity = 0
projshadow = 150,150,150
projpriority = 5
postype = p1
offset = 0,0
attr = A, HP
damage = 100, 20
projhits = 45
projmisstime = 15
animtype = heavy
guardflag = MA
sparkno = s4300
guard.sparkno = s4500
sparkxy = ceil (p2dist x) + -10, -70
hitsound = S5,5
getpower = 0
guardsound = S6,0
pausetime = 0,13
ground.hittime = 15
ground.type = high
ground.slidetime = 15
ground.velocity = -12.5
air.velocity = -12,-4
air.fall = 1
fall=1
fall.recover = 0
air.juggle = 10
envshake.time = 10
envshake.ampl = 4
yaccel = .5
removeongethit = 1

[State 2350, nojuggle]
type = AssertSpecial
trigger1 = projhit(2200) = 0
flag = nojugglecheck

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

;---------------------------------------------------------------------------
;============================================================
;---------------------スーパーゴーストカミカゼアタック
;============================================================

[Statedef 3100]
type = S
movetype = A
physics = S
anim = 3100
poweradd = -2000
velset = 0,0
ctrl = 0
juggle = 1
sprpriority = 3

[state 3100, super a]
type = superpause
trigger1 = time = 0
time = 182
movetime = 182
anim = -1
;darken = 0

[State 3200, ]
type = EnvShake
trigger1 = time = 4
time = 80
freq = 120
ampl = 3

[State 3100, Aura1]
type = Explod
trigger1 = time = 0
anim = 4000
sprpriority = 2
postype = p1
pos = 4,0
bindtime = -1
removetime = 74
removeongethit = 1
supermove = 1

[State 3100, Aura2]
type = Explod
trigger1 = time = 80
anim = 4001
sprpriority = 2
postype = p1
pos = 5,0
bindtime = 1
removetime = 6
removeongethit = 1
supermove = 1
ownpal = 1

[State 3100, dust]
type = explod
removetime = 74;26
trigger1 = time = 4
anim = 8103
pos = -10,5
sprpriority = 5
bindtime = -1
ownpal = 1
removeongethit = 1
ignorehitpause = 1
supermove = 1
facing = -1

[State 3100, !];『！』
type = Explod
trigger1 = time = 105
anim = 8800
sprpriority = 5
postype = p2
pos = 45,-95
bindtime = -1
removetime = 75
removeongethit = 1
supermove = 1
ontop = 1

[State 3100, aura]
type = PlaySnd
trigger1 = time = 0
value = 3000,1

[State 3100, voice];『はーー』
type = PlaySnd
trigger1 = time = 0
value = 4000,0
volume = 255

[State 3100, sound];『オバケの飛ぶ音』
type = PlaySnd
trigger1 = time = 66
trigger2 = time = 68
trigger3 = time = 71
trigger4 = time = 73
value = 100,0

[State 3100, sound];『！』
type = PlaySnd
trigger1 = time = 100
value = 3000,2

[State 3100, sound];『くらえ！』
type = PlaySnd
trigger1 = animelem = 8
value = 1000,0

[State 3100, flash]
type = PalFX
trigger1 = TimeMod = 4,0
triggerall = animelem = 2, >= 1 && animelem = 3, <= 1
time = 1
add = 100,100,100

[State 3100, palfx]
type = PalFX
trigger1 = animelem = 6
time = 10
add = 100,100,100
mul = 256,256,256
sinadd = -100,-100,-100,40
invertall = 0
color = 256

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

;--------------------オバケ
[State 3101, 1];後ろ
type = Helper
trigger1 = time = 68;AnimElem = 3 
pos = -50, -47
postype = p1
stateno = 3103
helpertype = normal
name = "ghost"
id = 3101
ownpal = 0;1
supermovetime = 114
pausemovetime = 114

[State 3101, 2];左下
type = Helper
trigger1 = time = 69;AnimElem = 3 
pos = -35, -20
postype = p1
stateno = 3103;4
helpertype = normal
name = "ghost"
id = 3102
ownpal = 0;1
supermovetime = 113
pausemovetime = 113

[State 3101, 3];右下
type = Helper
trigger1 = time = 70;AnimElem = 3 
pos = 13, -10
postype = p1
stateno = 3104;3
helpertype = normal
name = "ghost"
id = 3103
ownpal = 0;1
supermovetime = 112
pausemovetime = 112

[State 3101, 4];先頭
type = Helper
trigger1 = time = 71;AnimElem = 3 
pos = 35, -45
postype = p1
stateno = 3101
helpertype = normal
name = "ghost"
id = 3104
ownpal = 0;1
supermovetime = 111
pausemovetime = 111

[State 3101, 5];右上
type = Helper
trigger1 = time = 72;AnimElem = 3 
pos = 15, -70
postype = p1
stateno = 3101
helpertype = normal
name = "ghost"
id = 3105
ownpal = 0;1
supermovetime = 110
pausemovetime = 110

[State 3101, 6];中央
type = Helper
trigger1 = time = 73;AnimElem = 3 
pos = -10, -40
postype = p1
stateno = 3104
helpertype = normal
name = "ghost"
id = 3106
ownpal = 0;1
supermovetime = 109
pausemovetime = 109

[State 3101, 7];左上
type = Helper
trigger1 = time = 74;AnimElem = 3 
pos = -35, -70
postype = p1
stateno = 3102
helpertype = normal
name = "ghost"
id = 3107
ownpal = 0;1
supermovetime = 108
pausemovetime = 108

;------------------------------へるぱー
[Statedef 3101]
type = A
movetype = A
physics = N
anim = 3101
velset = 0

[State 3101, 0]
type = Turn
trigger1 = p2Dist X < 0

[State 3101, Seek 1]
type = VelAdd
trigger1 = P2Dist X < 0
trigger1 = time >= 120
x = -.5

[State 3101, Seek 2]
type = VelAdd
trigger1 = P2Dist X > 0
trigger1 = time >= 120
x = .5

[State 3101, Seek 3]
type = VelAdd
trigger1 = P2Dist Y < 50
trigger1 = time >= 120
y = -.5

[State 3101, Seek 4]
type = VelAdd
trigger1 = P2Dist Y > 50
trigger1 = time >= 120
y = .5

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(1) = parent,fvar(1)

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(2) = ifelse((root,P2dist x=[0,1]),1,ifelse((root,P2dist x=[-1,0]),-1,root,P2dist x))

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(3) = ifelse((root,P2dist y=[0,1]),1,ifelse((root,P2dist y=[-1,0]),-1,root,P2dist y))+20

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ceil((atan(fvar(2)/fvar(3))*180)/pi)-(90*ifelse(root,P2dist Y<0,-1,1))

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ifelse(var(0)>60,60,ifelse(var(0)<-60,-60,var(0)))

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = atan(fvar(2)/fvar(3))-(.5*pi*ifelse(root,P2dist Y <0,-1,1))

[State 3101, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = ifelse(fvar(0)>(.33*pi),.33*pi,ifelse(fvar(0)<(-.33*pi),-.33*pi,fvar(0)))

[State 3101, 1]
type = angleset
trigger1 = animelem = 54
value = var(0)

[State 3101, 1]
type = angledraw
trigger1 = animelem = 54

[State 3101, 1]
type = VelSet
trigger1 = animelem = 54
x = abs(20*cos(fvar(0)))
y = -10*sin(fvar(0))


[State 3101, 2]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3101, sound];『ウッキャー』
type = PlaySnd
trigger1 = animelem = 44
value = 1000,5

[State 3101, HitDef]
type = HitDef
trigger1 = !time
attr = S, HP
animtype = Medium
damage = 60,7
hitflag = MAFD
guardflag = MA
pausetime = 0, 10
sparkno = s4300
guard.sparkno = s4500
sparkxy = 10,-10
hitsound = s1000,6
guardsound = s1000,6
ground.type = High
ground.slidetime = 13
ground.hittime = 26
ground.velocity = -3,-6
guard.velocity = -6
air.velocity = -3,-6
airguard.velocity = -6,-1
down.velocity = -12,0
down.hittime = 26
palfx.color = 0
fall = 1
fall.recover = 0
envshake.time = 30
envshake.freq = 55
envshake.ampl = 6
getpower = 0
projID = 3100

[State 3101, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NT, ST, HT
ignorehitpause = 1

[State 3101, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3150
attr = SCA, NP, SP, HP, NA, SA, HA
ignorehitpause = 1

[State 3101, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP, NA, SA, HA
time = 1
ignorehitpause = 1

[State 3101, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
trigger2 = parent, lose
value = 3150

[State 3101, 1]
type = DestroySelf
trigger1 = MoveContact = 1

;----------------へるぱー2
[Statedef 3102]
type = A
movetype = A
physics = N
anim = 3102
velset = 0

[State 3202, 0]
type = Turn
trigger1 = p2Dist X < 0

[State 3202, Seek 1]
type = VelAdd
trigger1 = P2Dist X < 0
trigger1 = time >= 120
x = -.5

[State 3202, Seek 2]
type = VelAdd
trigger1 = P2Dist X > 0
trigger1 = time >= 120
x = .5

[State 3202, Seek 3]
type = VelAdd
trigger1 = P2Dist Y < 50
trigger1 = time >= 120
y = -.5

[State 3202, Seek 4]
type = VelAdd
trigger1 = P2Dist Y > 50
trigger1 = time >= 120
y = .5

[State 3202, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(1) = parent,fvar(1)

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(2) = ifelse((root,P2dist x=[0,1]),1,ifelse((root,P2dist x=[-1,0]),-1,root,P2dist x))

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(3) = ifelse((root,P2dist y=[0,1]),1,ifelse((root,P2dist y=[-1,0]),-1,root,P2dist y))+20

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ceil((atan(fvar(2)/fvar(3))*180)/pi)-(90*ifelse(root,P2dist Y<0,-1,1))

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ifelse(var(0)>60,60,ifelse(var(0)<-60,-60,var(0)))

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = atan(fvar(2)/fvar(3))-(.5*pi*ifelse(root,P2dist Y <0,-1,1))

[State 3102, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = ifelse(fvar(0)>(.33*pi),.33*pi,ifelse(fvar(0)<(-.33*pi),-.33*pi,fvar(0)))

[State 3102, 1]
type = angleset
trigger1 = animelem = 54
value = var(0)

[State 3102, 1]
type = angledraw
trigger1 = animelem = 54

[State 3102, 1]
type = VelSet
trigger1 = animelem = 54
x = abs(18*cos(fvar(0)))
y = -10*sin(fvar(0))

[State 3102, 2]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3102, sound];『ウッキャー』
type = PlaySnd
trigger1 = animelem = 46
value = 1000,5

[State 3102, HitDef]
type = HitDef
trigger1 = !time
attr = S, HP
animtype = Medium
damage = 60,7
hitflag = MAFD
guardflag = MA
pausetime = 0, 10
sparkno = s4300
guard.sparkno = s4500
sparkxy = 10,-10
hitsound = s1000,6
guardsound = s1000,6
ground.type = High
ground.slidetime = 13
ground.hittime = 26
ground.velocity = -3,-6
guard.velocity = -6
air.velocity = -3,-6
airguard.velocity = -6,-1
down.velocity = -12,0
down.hittime = 26
palfx.color = 0
fall = 1
fall.recover = 0
envshake.time = 30
envshake.freq = 55
envshake.ampl = 6
getpower = 0
projID = 3100

[State 3102, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NT, ST, HT
ignorehitpause = 1

[State 3102, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3150
attr = SCA, NP, SP, HP, NA, SA, HA
ignorehitpause = 1

[State 3102, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP, NA, SA, HA
time = 1
ignorehitpause = 1

[State 3102, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
trigger2 = parent, lose
value = 3151

[State 3102, 2]
type = DestroySelf
trigger1 = MoveContact = 1

;----------------へるぱー3
[Statedef 3103]
type = A
movetype = A
physics = N
anim = 3101
velset = 0
sprpriority = 5

[State 3103, 0]
type = Turn
trigger1 = p2Dist X < 0

[State 3103, Seek 1]
type = VelAdd
trigger1 = P2Dist X < 0
trigger1 = time >= 120
x = -.5

[State 3103, Seek 2]
type = VelAdd
trigger1 = P2Dist X > 0
trigger1 = time >= 120
x = .5

[State 3103, Seek 3]
type = VelAdd
trigger1 = P2Dist Y < 50
trigger1 = time >= 120
y = -.5

[State 3103, Seek 4]
type = VelAdd
trigger1 = P2Dist Y > 50
trigger1 = time >= 120
y = .5

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(1) = parent,fvar(1)

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(2) = ifelse((root,P2dist x=[0,1]),1,ifelse((root,P2dist x=[-1,0]),-1,root,P2dist x))

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(3) = ifelse((root,P2dist y=[0,1]),1,ifelse((root,P2dist y=[-1,0]),-1,root,P2dist y))+20

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ceil((atan(fvar(2)/fvar(3))*180)/pi)-(90*ifelse(root,P2dist Y<0,-1,1))

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ifelse(var(0)>60,60,ifelse(var(0)<-60,-60,var(0)))

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = atan(fvar(2)/fvar(3))-(.5*pi*ifelse(root,P2dist Y <0,-1,1))

[State 3103, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = ifelse(fvar(0)>(.33*pi),.33*pi,ifelse(fvar(0)<(-.33*pi),-.33*pi,fvar(0)))

[State 3103, 1]
type = angleset
trigger1 = animelem = 54
value = var(0)

[State 3103, 1]
type = angledraw
trigger1 = animelem = 54

[State 3103, 1]
type = VelSet
trigger1 = animelem = 54
x = abs(16*cos(fvar(0)))
y = -10*sin(fvar(0))

[State 3103, 2]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3103, sound];『ウッキャー』
type = PlaySnd
trigger1 = animelem = 48
value = 1000,5

[State 3103, HitDef]
type = HitDef
trigger1 = !time
attr = S, HP
animtype = Medium
damage = 60,7
hitflag = MAFD
guardflag = MA
pausetime = 0, 10
sparkno = s4300
guard.sparkno = s4500
sparkxy = 10,-10
hitsound = s1000,6
guardsound = s1000,6
ground.type = High
ground.slidetime = 13
ground.hittime = 26
ground.velocity = -3,-6
guard.velocity = -6
air.velocity = -3,-6
airguard.velocity = -6,-1
down.velocity = -12,0
down.hittime = 26
palfx.color = 0
fall = 1
fall.recover = 0
envshake.time = 30
envshake.freq = 55
envshake.ampl = 6
getpower = 0
projID = 3100

[State 3103, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NT, ST, HT
ignorehitpause = 1

[State 3103, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3150
attr = SCA, NP, SP, HP, NA, SA, HA
ignorehitpause = 1

[State 3103, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP, NA, SA, HA
time = 1
ignorehitpause = 1

[State 3103, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
trigger2 = parent, lose
value = 3152

[State 3103, 3]
type = DestroySelf
trigger1 = MoveContact = 1

;----------------へるぱー4
[Statedef 3104]
type = A
movetype = A
physics = N
anim = 3102
velset = 0
sprpriority = 5

[State 3104, 0]
type = Turn
trigger1 = p2Dist X < 0

[State 3104, Seek 1]
type = VelAdd
trigger1 = P2Dist X < 0
trigger1 = time >= 120
x = -.5

[State 3104, Seek 2]
type = VelAdd
trigger1 = P2Dist X > 0
trigger1 = time >= 120
x = .5

[State 3104, Seek 3]
type = VelAdd
trigger1 = P2Dist Y < 50
trigger1 = time >= 120
y = -.5

[State 3104, Seek 4]
type = VelAdd
trigger1 = P2Dist Y > 50
trigger1 = time >= 120
y = .5

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(1) = parent,fvar(1)

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(2) = ifelse((root,P2dist x=[0,1]),1,ifelse((root,P2dist x=[-1,0]),-1,root,P2dist x))

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
fvar(3) = ifelse((root,P2dist y=[0,1]),1,ifelse((root,P2dist y=[-1,0]),-1,root,P2dist y))+20

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ceil((atan(fvar(2)/fvar(3))*180)/pi)-(90*ifelse(root,P2dist Y<0,-1,1))

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
var(0) = ifelse(var(0)>60,60,ifelse(var(0)<-60,-60,var(0)))

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = atan(fvar(2)/fvar(3))-(.5*pi*ifelse(root,P2dist Y <0,-1,1))

[State 3104, VarSet]
type = VarSet
trigger1 = animelem = 54
ignorehitpause = 1
fvar(0) = ifelse(fvar(0)>(.33*pi),.33*pi,ifelse(fvar(0)<(-.33*pi),-.33*pi,fvar(0)))

[State 3104, 1]
type = angleset
trigger1 = animelem = 54
value = var(0)

[State 3104, 1]
type = angledraw
trigger1 = animelem = 54

[State 3104, 1]
type = VelSet
trigger1 = animelem = 54
x = abs(14*cos(fvar(0)))
y = -10*sin(fvar(0))

[State 3104, 2]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3104, sound];『ウッキャー』
type = PlaySnd
trigger1 = animelem = 50
value = 1000,5

[State 3104, HitDef]
type = HitDef
trigger1 = !time
attr = S, HP
animtype = Medium
damage = 60,7
hitflag = MAFD
guardflag = MA
pausetime = 0, 10
sparkno = s4300
guard.sparkno = s4500
sparkxy = 10,-10
hitsound = s1000,6
guardsound = s1000,6
ground.type = High
ground.slidetime = 13
ground.hittime = 26
ground.velocity = -3,-6
guard.velocity = -6
air.velocity = -3,-6
airguard.velocity = -6,-1
down.velocity = -12,0
down.hittime = 26
palfx.color = 0
fall = 1
fall.recover = 0
envshake.time = 30
envshake.freq = 55
envshake.ampl = 6
getpower = 0
projID = 3100

[State 3104, NotHitBy]
type = NotHitBy
trigger1 = Time >= 0
time = 1
value = SCA, NT, ST, HT
ignorehitpause = 1

[State 3104, HitOverride]
type = HitOverride
trigger1 = Time >= 0
slot = 1
time = 1
stateno = 3150
attr = SCA, NP, SP, HP, NA, SA, HA
ignorehitpause = 1

[State 3104, HitBy]
type = HitBy
trigger1 = Time >= 0
value = SCA, NP, SP, HP, NA, SA, HA
time = 1
ignorehitpause = 1

[State 3104, ChangeState]
type = ChangeState
trigger1 = MoveContact = 1
trigger2 = parent, lose
value = 3153

[State 3104, 4]
type = DestroySelf
trigger1 = MoveContact = 1

;------------------爆発・頭部
[Statedef 3150]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3104
sprpriority = 4
ctrl = 0

[State 3150, vel1]
type = Velset
trigger1 = animelem = 1
x = -4
y = -4

[State 3150, vel2]
type = Velset
trigger1 = animelem = 2
x = -3
y = 0

[State 3150, vel3]
type = Velset
trigger1 = animelem = 3
x = -2
y = 4

[State 3150, vel4]
type = Velset
trigger1 = animelem = 4
x = -1
y = 6

[State 3150, explo]
type = Explod
trigger1 = time = 0
anim = 8900
sprpriority = 5
postype = p1
pos = 20,-10
bindtime = -1
removetime = 19
supermove = 1
facing = -1

[State 3150, 0]
type = AssertSpecial
trigger1 = Time >= 0
flag = NoShadow

[State 3150, 1]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3150, 2]
type = DestroySelf
trigger1 = AnimTime = 0

;------------------爆発・腕
[Statedef 3151]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3105
sprpriority = 4
ctrl = 0

[State 3151, vel1]
type = Velset
trigger1 = animelem = 1
x = 4
y = -4

[State 3151, vel2]
type = Velset
trigger1 = animelem = 2
x = 3
y = 0

[State 3151, vel3]
type = Velset
trigger1 = animelem = 3
x = 2
y = 4

[State 3151, vel4]
type = Velset
trigger1 = animelem = 4
x = 1
y = 6

[State 3151, explo]
type = Explod
trigger1 = time = 0
anim = 8900
sprpriority = 5
postype = p1
pos = 20,-10
bindtime = -1
removetime = 19
supermove = 1
facing = -1

[State 3151, 0]
type = AssertSpecial
trigger1 = Time >= 0
flag = NoShadow

[State 3151, 1]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3151, 2]
type = DestroySelf
trigger1 = AnimTime = 0

;------------------爆発・胴体
[Statedef 3152]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3106
sprpriority = 4
ctrl = 0

[State 3152, vel1]
type = Velset
trigger1 = animelem = 1
x = 3
y = -4

[State 3152, vel2]
type = Velset
trigger1 = animelem = 2
x = 2
y = 0

[State 3152, vel3]
type = Velset
trigger1 = animelem = 3
x = 1
y = 4

[State 3152, vel4]
type = Velset
trigger1 = animelem = 4
x = 1
y = 6

[State 3152, explo]
type = Explod
trigger1 = time = 0
anim = 8900
sprpriority = 5
postype = p1
pos = 20,-10
bindtime = -1
removetime = 19
supermove = 1
facing = -1

[State 3152, 0]
type = AssertSpecial
trigger1 = Time >= 0
flag = NoShadow

[State 3152, 1]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3152, 2]
type = DestroySelf
trigger1 = AnimTime = 0

;------------------爆発・脚
[Statedef 3153]
type = S
movetype = A
physics = N
velset = 0,0
anim = 3107
sprpriority = 4
ctrl = 0

[State 3153, vel1]
type = Velset
trigger1 = animelem = 1
x = -3
y = -4

[State 3153, vel2]
type = Velset
trigger1 = animelem = 2
x = -2
y = 0

[State 3153, vel3]
type = Velset
trigger1 = animelem = 3
x = -1
y = 4

[State 3153, vel4]
type = Velset
trigger1 = animelem = 4
x = -1
y = 6

[State 3153, explo]
type = Explod
trigger1 = time = 0
anim = 8900
sprpriority = 5
postype = p1
pos = 20,-10
bindtime = -1
removetime = 19
supermove = 1
facing = -1

[State 3153, 0]
type = AssertSpecial
trigger1 = Time >= 0
flag = NoShadow

[State 3153, 1]
type = PlayerPush
trigger1 = Time >= 0
value = 0

[State 3153, 2]
type = DestroySelf
trigger1 = AnimTime = 0


;------------------
; Smash Kung Fu Upper (success)
; Description: This is the state that KFM changes to if he successfully hits
;     with Smash Kung Fu Upper. KFM holds his arm high for a short while
;     longer, then changes back to his idle stand state.
[Statedef 3051]
type    = S
movetype= A
physics = S
anim = 3051

[State 3051, 1]
type = AfterImageTime
trigger1 = AnimTime < -2
time = 2

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


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

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

[State -2, DEBUG]
trigger1 = 1
type = DisplayToClipboard
ignorehitpause = 1
text = "choujin world\n http://choujin.50webs.com"

[State 1800, remove slashdown1]
type = Removeexplod
trigger1 = stateno != 1800
ID = 1800

[State 1800, remove slashdown2]
type = Removeexplod
trigger1 = stateno != 1850
ID = 1850

[state -2, remove charge dust]
type = removeexplod
trigger1 = stateno != 1900
id = 4040

[state -2, stop charge voice]
type = stopsnd
trigger1 = stateno != 1900
channel = 2

[state -2, stop charge sound]
type = stopsnd
trigger1 = stateno != 1900
channel = 3

;--------------------------界王拳モード
[State -2, var]
type = Varadd
trigger1 = var(10) != 0
trigger1 = (gametime%2) = 0
var(10) = -1

[State -2, offenseup]
type = AttackMulSet
trigger1 = var(10) != 0
value = 1.5*(1-fvar(8))

[State -2, defenseup]
type = DefenceMulSet
trigger1 = var(10) != 0
value = 1.5

[State -2, red]
type = PalFX
triggerall = alive
triggerall = stateno != 181 && stateno != 182
triggerall = stateno != 3150 && stateno != 3155
triggerall = stateno != 3055
trigger1 = (GameTime%2)=0
trigger1 = var(10) != 0
time = 1
add = 255,0,0
ignorehitpause = 1

[State -2, offensedown]
type = AttackMulSet
trigger1 = var(10) = 0
value = 1*(1-fvar(8))

;[State -2, defensedown]
;type = DefenceMulSet
;trigger1 = var(10) = 0
;value = 1

;[State -2, 1];fall.defence_up
;type = DefenceMulSet
;trigger1 = var(10) = 0
;value = (.894)+(ifelse((GetHitVar(HitCount)/10 < 1.0), GetHitVar(HitCount)/10, 0))
;IgnoreHitPause = 1

;----------------------------------------------
;--------------------ダメージ補正----------
;----------------------------------------------

[State -2, リセット]
type = varset
trigger1 = enemy,movetype != H
trigger2 = enemy,ctrl
triggerall = time > 0
fvar(8) = 0

[State -2, 補正対象];浮かせ技
type = varadd
triggerall = movehit = 1
triggerall = hitdefattr = SCA,NA
triggerall = fvar(8) < 0.7
trigger1 = stateno = 252
trigger2 = stateno = 525
fvar(8) = 0.15+(fvar(8)*0.57);　←ここの数字をいじると補正が強くなる

[State -2, 限界値]
type = varset
trigger1 = fvar(8) > 0.7
fvar(8) = 0.8


; ;--------------------------Finish Hit Explod
[Statedef 9000]
type = S
movetype = I
physics = N
anim = 3110

[State 9000, 1]
type = Explod
triggerall = (NumExplod(9000) < 1)
trigger1 = Time = 0
persistent = 0
anim = 8000
ID = 9000
postype = left
pos = 0, 0
velocity = 0, 0
accel = 0, 0
removetime = 24
sprpriority = -4
bindtime = -1
ontop = 1
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

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

[Statedef -3]

[State -3, - Helper]
type = Helper
triggerall = (WinKO) && (NumHelper(9000) = 0)
trigger1 = StateNo = 3100 && (Time >= 0) && AnimElem = 16, >= 1 && AnimElem = 33, <= 1
trigger2 = StateNo = 3150 && (Time >= 0) && AnimElem = 33, >= 1 && AnimElem = 49, <= 1
;trigger2 = projhittime(2200) = 1
;trigger3 = projhittime(2300) = 1
helpertype = Normal
name = "Finish Effect"
id = 9000
pos = 0, 0
postype = p1
facing = 0
stateno = 9000
keyctrl = 0
ownpal = 1
supermovetime = 1000
pausemovetime = 1000
ignorehitpause = 1

[State -3, Corner]
type = Velset
trigger1 = FrontEdgeDist < 10 && vel x > 0.1
x = 0.1

[State 52, bounce Sound]
type = PlaySnd
trigger1 = Time = 1
trigger1 = stateno = 5100
value = 7, 2

[State 52, fall Sound]
type = PlaySnd
trigger1 = Time = 1
trigger1 = stateno = 5110
value = 7, 0

[State 52, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 106
trigger2 = stateno = 52
value = 0, 2

[State 350, recover]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 5210
trigger2 = stateno = 5201
value = 2100,6
volume = -20

[State -3, Jumping Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 40
value = 2100,1

[State -3, Double Jump Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 45
value = 3000,8

[State -3, Backstep Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 105
value = 3000,8

[State -2, backstep afterimage]
type = AfterImage
triggerall = Time = 1
trigger1 = stateno = 105
time = 10
trans = add1
timegap = 1
framegap = 2
length = 8
palbright = 12,12,12
palcontrast = 225,225,225
palpostbright = 0,0,0
paladd = 0,0,0
palmul = 1,1,1

[State -2, sethitvoice]
type = VarRandom
triggerall = Time = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
v = 4
range = 0,14

[State -2, hitvoice1]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [0,2]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,0

[State -2, hitvoice2]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [3,5]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,1

[State -2, hitvoice3]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [6,8]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,2

[State -2, hitvoice4]
type = PlaySnd
triggerall = Time = 1
triggerall = Var(4) = [9,11]
triggerall = alive = 1
trigger1 = stateno = 5000
trigger2 = stateno = 5010
trigger3 = stateno = 5020
value = 5000,3


[State -3, jumpdust1];ジャンプホコリ1
type = explod
trigger1 = StateNo = 40 && Time = 1
postype = p1
pos = -4,0
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

[State -3, jumpdust2];ジャンプホコリ2
type = explod
trigger1 = StateNo = 40 && Time = 1
postype = p1
pos = 4,0
facing = -1
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

[State -3, landdust1];着地ホコリ1
type = explod
trigger1 = StateNo = 52 && Time = 1
postype = p1
pos = -17,0
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

[State -3, landdust];着地ホコリ2
type = explod
trigger1 = StateNo = 52 && Time = 1
postype = p1
pos = 20,0
facing = -1
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

[State -3, landdust1];バックステップ着地1
type = explod
trigger1 = StateNo = 106 && Time = 1
trigger2 = StateNo = 2210 && Time = 1
postype = p1
pos = -35,0
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

[State -3, landdust];バックステップ着地2
type = explod
trigger1 = StateNo = 106 && Time = 1
trigger2 = StateNo = 2210 && Time = 1
postype = p1
pos = 8,0
facing = -1
spacing = 1
anim = 4010
ownpal = 1
scale = .5, .5
supermove = 1

;----------------------------------------------
;かめはめ波フィニッシュ----------

[State -2,KO]
type = Varadd
trigger1 = roundstate = 3
ignorehitpause = 1
var(32) = 1

[State -2,KO]
type = Varset
trigger1 = roundstate != 3
ignorehitpause = 1
var(32) = 0

;[state -2, finish]
;type = explod
;triggerall = WinKo && var(32) = 1
;trigger1 = projhittime(2200) = 1
;anim = 4000
;pos = 0,0
;postype = left
;bindtime = -1
;supermove = 1 ;0
;removetime = 12
;ontop = 1
;ownpal = 1

[state -2, finish]
type = explod
triggerall = WinKo && var(32) = 1
trigger1 = projhittime(2200) = 1
trigger2 = projhittime(2300) = 1
anim = 8000
pos = 0,0
postype = left
bindtime = -1
supermove = 1 ;0
removetime = 24
ontop = 1
ownpal = 1


;----------------------------------------------
;--------------------ダメージ補正----------
;----------------------------------------------

[State -2, リセット]
type = varset
trigger1 = enemy,movetype != H
trigger2 = enemy,ctrl
triggerall = time > 0
fvar(8) = 0

[State -2, 補正対象];浮かせ技
type = varadd
trigger1 = movehit = 1
trigger1 = hitdefattr = SCA,NA
trigger1 = stateno = 252 || stateno = 525; ←補正かけたい技の番号 
trigger1 = fvar(8) < 0.7
fvar(8) = 0.15+(fvar(8)*0.57);　←ここの数字をいじると補正が強くなる

[State -2, 攻撃力]
type = AttackMulSet
trigger1 = 1
value = 1-fvar(8);value = fvar(8)

[State -2, 限界値]
type = varset
trigger1 = fvar(8) > 0.7
fvar(8) = 0.8

