; 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 = 1750
;Amount of power stocks to have (divided by 1000). Defaults to 3000
power = 3000
;attack power (more is stronger)
;攻撃ダメージ
attack = 115
;defensive power (more is stronger)
;体力パワー
defence = 115
;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  = 6      ;Walk forward
walk.back = -6     ;Walk backward
run.fwd  = 11.2, -5    ;Run forward (x, y)
run.back = -11.2,-5 ;Hop backward (x, y)
jump.neu = 0,-13    ;Neutral jumping velocity (x, y)
jump.back = -4.-13    ;Jump back Speed (x, y)
jump.fwd = 4.-13       ;Jump forward Speed (x, y)
runjump.back = -8.-13 ;Running jump speeds (opt)
runjump.fwd = 4,-13      ;.
airjump.neu = 0,-11      ;.
airjump.back = -4.55,-11      ;Air jump speeds (opt)
airjump.fwd = 4.5,-11         ;.

[Movement]
airjump.num = 0      ;Number of air jumps allowed (opt)
airjump.height = 35  ;Minimum distance from ground before you can air jump (opt)
yaccel = .57         ;Vertical acceleration
stand.friction = .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).


;---------------------------------------------------------------------------
; 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 = AnimElem = 1
value = s5,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

[State 181, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = s7000,25
volume = 255

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

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

;---------------------------------------------------------------------------

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

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

[State 181, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = s5,2
volume = 255

;---------------------------------------------------------------------------
;対ブルー将軍 又はドクターマシリトと闘う時
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0


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

[State 192, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 8000,0
volume = 255

[State 192, 4]
type = Explod
trigger1 = AnimElem = 2
persistent = 0
anim = 193
sprpriority = 2
postype = p1
pos = 0, 0
velocity = 0
accel = 0, .0
removetime = 350

[State 195, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = s7000,26

[State 195, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 0


;---------------------------------------------------------------------------
;わくわく
[Statedef 195]
type = S
ctrl = 0
anim = 195
poweradd = -200
velset = 0,0
movetype = I
physics = S
sprpriority = 2


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

[State 195, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = s8000,34
volume = 255

[State 195, 4]
type = lifeadd
trigger1 = AnimElem = 3
value = 200


;---------------------------------------------------------------------------
; 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 = 4
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 = 7, 8                 ;Time attacker pauses, time opponent shakes
sparkno = s4100                      ;Spark anim no (Def: set above)
guard.sparkno = s4500
sparkxy = 26, -19               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = s5, 3                  ;Sound to play on hit
guardsound = s6, 0                ;Sound to play on guard
ground.type = Low               ;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 = Low                  ;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 = AnimElem = 3
value = 0, 0
volume = 255

[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 = Time = 2
value = 0, 2
volume = 255

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 8,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,5
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

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

[State 230, 2]
type = HitDef
trigger1 = AnimElem = 3
trigger2 = AnimElem = 5
attr = S, NA
animtype  = Medium
damage    = 26
guardflag = MA
pausetime = 8,12
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-37
hitsound   = s5,4
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

;---------------------------------------------------------------------------
; 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 = Time = 2
value = 0, 3

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

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

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

;---------------------------------------------------------------------------
;Crouching light punch

[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
priority  = 3
animtype  = Medium
hitflag = MAF
guardflag = L
pausetime = 7,10
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-42
hitsound   = s5,3
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

[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 = 3
trigger2 = AnimElem = 10
value = 0, 0

;This is the first hit, triggered on the 3rd element of animation.
[State 410, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 37
animtype  = Light
hitflag = MAF
guardflag = M
pausetime = 8,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-55
hitsound   = s5,3
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 = 10
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 9,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-83
hitsound   = s5,4
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

;---------------------------------------------------------------------------
;Crouching light kick

[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2

[State 430, 1]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 10
trigger3 = AnimElem = 17
value = 0, 0

[State 430, 2]
type = HitDef
trigger1 = AnimElem = 3
trigger2 = AnimElem = 10
trigger3 = AnimElem = 17
attr = C, NA
damage    = 28
animtype  = Medium
hitflag = MAFD
guardflag = L
pausetime = 10,12
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-8
hitsound   = s5,3
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

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

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

[State 440, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage    = 80
animtype  = Light
pausetime = 9,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -5,-10
hitsound   = s5,4
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 = 0, 0

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 20
guardflag = HA
priority = 3
pausetime = 1,7
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-58
hitsound   = s5,3
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

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

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

[State 610, 4]
type = velset
trigger1 = AnimElem = 2
x = 7

[State 610, 5]
type = velset
trigger1 = AnimElem = 2
y = -7


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

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

[State 630, 3]
type = velset
trigger1 = AnimElem = 3
x = 7

[State 630, 4]
type = velset
trigger1 = AnimElem = 3
y = -7


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

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

;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt

[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
[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 = 2, 0

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

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


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

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

[State 1001, voice]
type = PlaySnd
trigger1 = time = 0
value = 8000,3

[State 1001, snd2]
type = PlaySnd
trigger1 = time = 0
value = 105,0

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

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

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

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

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



[State 1001, dust]
type = Explod
trigger1 = AnimElem = 1
anim = 8100
postype = p1
pos = -10,5
bindtime = 1
sprpriority = 2
ownpal = 1
scale = .7, .7

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

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

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

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

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

[State 1000, voice]
type = PlaySnd
trigger1 = time = 0
value = 8000,30

[State 1000, snd2]
type = PlaySnd
trigger1 = time = 0
value = 105,0

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

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

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



[State 1000, dust]
type = Explod
trigger1 = AnimElem = 1
anim = 8100
postype = p1
pos = 30,5
bindtime = 1
sprpriority = 2
ownpal = 1
facing = -1
scale = .7, .7

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

;---------------------------------------------------------------------------
; ガッちゃんズの挟み撃ちビーム
; CNS difficulty: medium
[Statedef 1010]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -110
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2

[State 1010,1]
type = Helper
trigger1 = time = 0
id = 501
name = "Gattyan1"
sprpriority = 4
pos = 0, 0
postype = p2
stateno = 501
helpertype = normal
keyctrl = 0 
ownpal = 1

[State 1010,2]
type = Helper
trigger1 = time = 0
id = 502
name = "Gattyan2"
sprpriority = 4
pos = 0, 0
postype = p2
stateno = 502
helpertype = normal
keyctrl = 0 
ownpal = 1

[State 1010, 3]
type = HitDef
trigger1 = AnimElem = 5
trigger2 = AnimElem = 7
trigger3 = AnimElem = 9
trigger4 = AnimElem = 11
trigger5 = AnimElem = 13
trigger6 = AnimElem = 15
attr = S, SA
animtype  = diagup
damage    = 7
guardflag = MA
pausetime = 1,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

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

[State 1010, 5]
type = PlaySnd
trigger1 = Time = 0
value = 2000, 1

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

;---------------------------------------------------------------------------
;ガッちゃん１
[Statedef 501]
type = S
ctrl = 0
anim = 501
velset = 0,0
movetype = A
physics = S
sprpriority = 2

[State 501, 2]
type = HitDef
trigger1 = AnimElem = 5
trigger2 = AnimElem = 9
trigger3 = AnimElem = 13
attr = S, SA
animtype  = hard
damage    = 35
;guardflag = MA
priority = 7, Hit
pausetime = 1,12
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0.0
air.velocity = -5,-5

[state 501, 3]
type = velset
trigger1 = AnimElem = 19
y= -7

[state 501, 4]
type = destroyself 
trigger1 = time = 100

[State 501, ヘルパーやられ時消滅フラグ]
type  = HitOverRide     
trigger1  = time  = 0  ;ﾀｲﾑが0の時  
attr  = SCA, AA, AT, AP    ;すべてやられ状態で  
time  = 0    ;有効時間 上書きされるまで  
stateno  = 507 

;---------------------------------------------------------------------------
;ガッちゃん１攻撃を受けて消える
[Statedef 507]
anim = 507


[state 507, 2]
type = destroyself 
trigger1 = time = 20


;---------------------------------------------------------------------------
;ガッちゃん２
[Statedef 502]
type = S
ctrl = 0
anim = 502
velset = 0,0
movetype = A
physics = S
sprpriority = 2

[State 502, 2]
type = HitDef
trigger1 = AnimElem = 7
trigger2 = AnimElem = 11
trigger3 = AnimElem = 15
attr = S, SA
animtype  = hard
damage    = 35
;guardflag = MA
priority = 7, Hit
pausetime = 1,12
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0.0
air.velocity = -5,5

[state 502, 3]
type = velset
trigger1 = AnimElem = 19
y= -7

[state 502, 4]
type = destroyself 
trigger1 = time = 100

[State 502, ヘルパーやられ時消滅フラグ]
type  = HitOverRide     
trigger1  = time  = 0  ;ﾀｲﾑが0の時  
attr  = SCA, AA, AT, AP    ;すべてやられ状態で  
time  = 0    ;有効時間 上書きされるまで  
stateno  = 507 

;---------------------------------------------------------------------------
;ガッちゃん２攻撃を受けて消える
[Statedef 508]
anim = 508


[state 508, 2]
type = destroyself 
trigger1 = time = 20


;---------------------------------------------------------------------------
; オボッチャマン君の体当たり
[Statedef 1020]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -110
velset = 0,0
anim = 1020
ctrl = 0
sprpriority = 2



[State 1020, 2]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2000, 2
volume = 255

[State 1020, 3]
type = PlaySnd
trigger1 = AnimElem = 1
value = 2000, 3
volume = 255

[State 1020, 4]
type = Explod
trigger1 = Time = 0
persistent = 0
anim = 511
sprpriority = 2
postype = p1
pos = 0, 0
velocity = 10
accel = 0, .0
removetime = 100
ownpal = 1


[State 1020, 5]
type = Projectile
trigger1 = AnimElem = 1
ProjID = 512
projanim = 512
Projremove = 1
Projremovetime = 100
velocity = 10, 0
attr = S, SP
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 12,12
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = Trip
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -7.7
air.velocity = -5.7,-6



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



;---------------------------------------------------------------------------
; なにしてんの？ガハハ！

[Statedef 1050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -110
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 0

[State 1050, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8000, 6
volume = 255

[State 1050,2]
type = Helper
trigger1 = time = 0
id = 1051
name = "nikochan"
sprpriority = 4
pos = 50, 0
postype = p1
stateno = 1051
helpertype = normal
keyctrl = 0 
ownpal = 1
size.xscale = 0.8
size.yscale = 0.8
facing = 1


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

;------------------
;ニコチャン大王と家来
[Statedef 1051]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1051
ctrl = 0
sprpriority = 1


[State 1051, 4]
type = PlaySnd
trigger1 = AnimElem = 5
value = 8000, 26

[State 1051,5]
type = Projectile
trigger1 = AnimElem = 5
projanim = 1052
projhits = 10
Projemisstime = 30
projID = 1052
Projshadow = 100,10,100
offset = 0,0
sparkxy = 120,0
hitsound = s5, 7
sparkno = s4200 
guard.sparkno = s4500 
guardsound = s6, 0
guardflag = HA
velocity = 1, 0
attr = S, SP        
damage = 6,4          
animtype = Hard   
pausetime = 0,20 
hitflag = MAF         
priority = 7, dodge  
palfx.time = 10
palfx.add = 100,0,255
invertall = 1
fall = 0

[State 1051,5]
type = Projectile
trigger1 = Time = 70
projanim = 1052
projhits = 10
Projemisstime = 30
projID = 1053
Projshadow = 100,10,100
offset = 0,0
sparkxy = 120,0
hitsound = s5, 7
sparkno = s4200
guard.sparkno = s4500
guardsound = s6, 0
guardflag = HA
velocity = 1, 0
attr = S, SP        
damage = 6,4          
animtype = Hard   
pausetime = 0,20 
hitflag = MAF         
priority = 7, dodge  
palfx.time = 10
palfx.add = 100,0,255
invertall = 1
fall = 0

[state 1051, 4]
type = destroyself 
trigger1 = AnimTime = 0

;---------------------------------------------------------------------------
; 巨大ウンチ投げ
[Statedef 1060]
type    = S
movetype= A
physics = S
poweradd= -1000
juggle  = 2
ctrl = 0
velset = 0,0
anim = 1060

[State 1060, 0]
type = PlaySnd
trigger1 = AnimElem = 7
value = s0, 5
volume = 255

[State 1060, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = s1, 7
volume = 255

[state 1060, 2]
type = helper
trigger1 = AnimElem = 7
helpertype = normal
name = "Unchi"
ID = 1062
pos = 18,-62
stateno = 1062
ownpal = 1

[State 1060, 4]
type = Explod
trigger1 = AnimElem = 2
persistent = 0
anim = 1061
sprpriority = 2
postype = p1
pos = 0, 0
velocity = 0
accel = 0, .0
removetime = 31

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

;ウンチ
[statedef 1062]
type = A
movetype = A
physics = N
ctrl = 0
velset = 6,-5
anim = 1062

[state 1062]
type = playerpush
trigger1 = 1
value = 0

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

[State 1062, Assert]
type = assertspecial
trigger1 = Animtime != 0
flag = noshadow

[State 1062, 2]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage    = 90
animtype  = Hard
hitflag = MAF
guardflag = MA
priority = 7, Hit
pausetime = 0,12
guard.sparkno = s4500
sparkxy = 0,-15
sparkno = s4200
hitsound   = s5,7
guardsound = s6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 0,0
air.velocity = 0,0
getpower = 160
fall = 1

[state 1062, 2]
type = helper
trigger1 = pos Y>= -6
helpertype = normal
name = "Unchi2"
ID = 1063
pos = 0,0
stateno = 1063
ownpal = 1

[state 1062]
type = Destroyself
trigger1 = pos Y>= -6


;---------------------
;ウンチ着地
[statedef 1063]
type = S
movetype = A
physics = N
anim = 1063
velset = 0,0
ctrl = 0


[state 1063, 1]
type = playerpush
trigger1 = 1
value = 0

[State 1063, 2]
type = HitDef
trigger1 = time = 0
attr = S, SP
damage    = 90
animtype  = Hard
hitflag = MAF
guardflag = MA
priority = 5, Hit
pausetime = 0,12
sparkxy = 0,-15
sparkno = s4200
guard.sparkno = s4500
hitsound   = s5,7
guardsound = s6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 0,0
air.velocity = 0,0
getpower = 160
fall = 1

[state 1063, 3]
type = destroyself 
trigger1 = Animtime = 0



;---------------------------------------------------------------------------
; がんばれ悟空君
[Statedef 1070]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -110
velset = 0,0
anim = 1070
ctrl = 0
sprpriority = 2

[State 1070, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = s8000, 27
volume = 255

[State 1070,2]
type = Helper
trigger1 = time = 0
id = 1071
name = "Son Goku"
sprpriority = 4
pos = 40, 0
postype = p1
stateno = 1071
helpertype = normal
keyctrl = 0 
ownpal = 1


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

;------------------
;孫悟空
[Statedef 1071]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 1071
ctrl = 0
sprpriority = 1

[State 1071, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = s8000, 28
volume = 255

[State 1071, 2]
type = PlaySnd
trigger1 = AnimElem = 22
value = s4, 0
volume = 255

[State 1071, 3]
type = velset
trigger1 = AnimElem = 22
trigger2 = AnimElem = 26
trigger1 = AnimElem = 32
x = 8


[State 1071, 4]
type = HitDef
trigger1 = AnimElem = 22
attr = S, SA                     
damage = 23, 0                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                
pausetime = 7, 8                 
sparkno = s4100                      
guard.sparkno = s4500
sparkxy = 26, -19               
;Y-offset for the spark rel. to p1
hitsound = s5, 3                 
guardsound = s6, 0               
ground.type = Low               
ground.slidetime = 5            
ground.hittime  = 10             
ground.velocity = -4             
airguard.velocity = -1.9,-.8     
air.type = Low                  
air.velocity = -1.4,-3           
air.hittime = 12   


[State 1071, 5]
type = PlaySnd
trigger1 = AnimElem = 26
value = s4, 1
volume = 255         

[State 1071, 6]
type = HitDef
trigger1 = AnimElem = 26
attr = S, SA
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 8,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,5
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[State 1071, 7]
type = PlaySnd
trigger1 = AnimElem = 32
value = s4, 2
volume = 255 


[State 1071, 8]
type = HitDef
trigger1 = AnimElem = 33
attr = S, SA
animtype  = Hard
damage    = 63
guardflag = MA
pausetime = 9,12
sparkno = s4100
guard.sparkno = s4500
sparkxy = -10,-60
hitsound   = s5,6
guardsound = s6,0
ground.type = Trip
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -10,15
air.velocity = -2.2,-3.2

[state 1071, 9]
type = destroyself 
trigger1 = Animtime = 0


;------------------------------------------------------------------------
;----------------------------------気力溜め------------------------------
;------------------------------------------------------------------------
;パワー溜め
[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_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 1110]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -330
velset = 0,0
anim = 1110
ctrl = 0
sprpriority = 2

[State 1110, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = s8000, 27
volume = 255

[State 1110,2]
type = Helper
trigger1 = time = 0
id = 1111
name = "Son Goku"
sprpriority = 4
pos = 40, 0
postype = p1
stateno = 1111
helpertype = normal
keyctrl = 0 
ownpal = 1

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

;---------------------------------------------------------------------------
;孫悟空
[Statedef 1111]
type = S
movetype = A
physics = S
anim = 1111
velset = 0
ctrl = 0
juggle = 1
sprpriority = 2

[state 2200, super a]
type = superpause
trigger1 = time = 0
time = 40
anim = -1


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


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

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

[State 1111, 1];『撃つ音』
type = PlaySnd
trigger1 = AnimElem = 2
value = 20,1

[State 1111, 1];『かめはめ波〜！』
type = PlaySnd
trigger1 = AnimElem = 1
value = 1400,0

[State 1111, proj]
type = Explod
trigger1 = animelem = 3
anim = 2410
sprpriority = 3
postype = p1
pos = -1,0
bindtime = -1
removetime = 50
removeongethit = 1
;supermove = 1
ownpal = 1


[State 1111, 3]
type = Projectile
triggerall = var(10) = 0
trigger1 = AnimElem = 3
projanim = 2400
projhitanim = -1;1221
projID = 2200
projremove = 0
projremovetime = 50
velocity = 0
projshadow = 150,150,150
attr = S, HP
projpriority = 5
postype = p1
offset = 0,0
attr = S, SP
damage = 250, 20
animtype = heavy
hitflag = MAF
guardflag = MA
sparkno = s1221
guard.sparkno = s4500
sparkxy = ceil (p2dist x) + -10, -70
hitsound = S5,8
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 1111, dust]
type = explod
trigger1 = animelem = 3
anim = 4040
pos = 17,5
sprpriority = 5
bindtime = 1
ownpal = 1
removeongethit = 1
facing = -1
removetime = 33


[state 1111, 8]
type = destroyself 
trigger1 = Animtime = 0

;---------------------------------------------------------------------------
;ガッちゃんズとウンチ飛ばし
[Statedef 1120]
type    = S
movetype= A
physics = S
juggle  = 6
poweradd= -330
velset = 0,0
anim = 1120
ctrl = 0
sprpriority = 2

[State 1120,1]
type = Helper
trigger1 = time = 0
id = 1121
name = "Gattyan1"
sprpriority = 4
pos = 0, 0
postype = p1
stateno = 1121
helpertype = normal
keyctrl = 0 
ownpal = 1

[State 1120,2]
type = Helper
trigger1 = time = 0
id = 1122
name = "Gattyan2"
sprpriority = 4
pos = 0, 0
postype = p1
stateno = 1122
helpertype = normal
keyctrl = 0 
ownpal = 1

[State 1120, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = 0, 2
volume = 255

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

[State 1120, 4]
type = Projectile
trigger1 = AnimElem = 7
ProjID = 1123
Projanim = 1123
Projremove = 1
Velocity = 8,0
Projehits = 10
attr = S, SP
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 0,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4


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

;---------------------------------------------------------------------------
;ガッちゃん１
[Statedef 1121]
type = S
ctrl = 0
anim = 1121
velset = 0,0
movetype = A
physics = S
sprpriority = 2

[State 1121, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 8000, 31
volume = 255

[State 1121, 4]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 0,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,6
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0,0
air.velocity = 0,0

[State 1121, 4]
type = Projectile
trigger1 = AnimElem = 7
ProjID = 1124
Projanim = 1124
Projremove = 1
Velocity = 8,0
Projehits = 10
attr = S, SP
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 0,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[state 1121, 4]
type = destroyself 
trigger1 = Animtime = 0

;---------------------------------------------------------------------------
;ガッちゃん２
[Statedef 1122]
type = S
ctrl = 0
anim = 1122
velset = 0,0
movetype = A
physics = S
sprpriority = 2

[State 1122, 4]
type = HitDef
trigger1 = AnimElem = 7
attr = S, SA
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 0,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,6
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0,0
air.velocity = 0,0

[State 1122, 4]
type = Projectile
trigger1 = AnimElem = 7
ProjID = 1125
Projanim = 1125
Projremove = 1
Velocity = 8,0
Projehits = 10
attr = S, SP
animtype  = Hard
damage    = 57
guardflag = MA
pausetime = 0,12
sparkno = s4150
guard.sparkno = s4500
sparkxy = -10,-70
hitsound   = s5,7
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

[state 1122, 4]
type = destroyself 
trigger1 = Animtime = 0

;---------------------------------------------------------------------------
; 合体んちゃ砲
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -2000
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = -1

[State 1200, e1]
type = Explod
trigger1 = Time = 0
anim = 10302
ID = 10302
postype = p1
pos = 20, 0
removetime = 60
ownpal = 1
sprpriority = -1
vel = 0, 0


[State 1200, e2]
type = Explod
trigger1 = AnimElem = 1
persistent = 0
anim = 10300
sprpriority = 2
postype = p1
pos = 0, 0
accel = 0, .0
removetime = 70
ownpal = 1

[State 1200, e3]
type = Explod
trigger1 = AnimElem = 1
persistent = 0
anim = 10304
sprpriority = 2
postype = p1
pos = 0, 0
accel = 0, .0
removetime = 70
ownpal = 1

[State 1200, e4]
type = Explod
trigger1 = AnimElem = 1
persistent = 0
anim = 10305
sprpriority = 2
postype = p1
pos = 0, 0
accel = 0, .0
removetime = 70
ownpal = 1

;-----------------------

[State 1200, s]
type = PlaySnd
trigger1 = AnimElem = 1
persistent = 0
value = 8000, 25

[State 1200, s]
type = PlaySnd
trigger1 = AnimElem = 2
persistent = 0
value = 2200, 16


[State 1200, s]
type = PlaySnd
trigger1 = AnimElem = 1
persistent = 0
value = 8000, 8

[State 1200, 6] 
type = HitDef
trigger1 = Time = 0
attr = S, HA
animtype  = diagup
damage    = 300
priority  = 6
;guardflag = MA
pausetime = 1,15
sparkno = s4300
guard.sparkno = s4500
sparkxy = -10,-60
hitsound   = s5,8
guardsound = s6,0
ground.type = Trip
ground.slidetime = 12
ground.hittime  = 15
;ground.velocity = -10,-10
air.velocity = -12,-12
fall = 0

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


[State 1200 , 2]
type = Helper
trigger1 = AnimElem = 2
trigger1 = NumHelper(1200) < 1
id = 19600
name = "beem"
pos = 6, -40
postype = p1
stateno = 10301
helpertype = normal
keyctrl = 0
ownpal = 0
sprpriority = 2
facing = 1



;--------------------------------

[Statedef 10301]
type = S
movetype = A
velset = 0,0
anim = 10301
juggle = 1

[State 10301, 4]
type = PlaySnd
trigger1 = AnimElem = 3
value = 500, 36

[State 10301,9]
type = DestroySelf
trigger1 = Animtime = 0

[State 10301, 6] 
type = HitDef
trigger1 = Time = 0
attr = S, HA
animtype  = Hard
damage    = 260
priority  = 6
;guardflag = MA
pausetime = 0,35
sparkno = s4300
guard.sparkno = s4500
sparkxy = -10,-10
hitsound   = s5,8
guardsound = s6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = 0,0
air.velocity = -12,-12
palfx.time = 100
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.color = 0
palfx.invertall = 1
fall = 0

;---------------------
;地球割り
[Statedef 3000]
type = S
movetype = A
physics = S
juggle  = 0
ctrl = 0
anim = 3000
poweradd = -1000

[State 3000, 超必殺技暗転時間停止]
type = SuperPause
trigger1 = time = 1
anim = s10000 
pos = 0, -70 
sound = s3, 0

[State 210, 4]
type = Explod
trigger1 = time = 1
anim = 10001
postype = p1
sprpriority = 2
bindtime = -1
ID = 10001
removetime = 20
pos = 0, 0
ownpal = 1
removeongethit = 1
supermovetime = 999999

[State 3000, 0]
type = PlaySnd
trigger1 = time = 2
value = s8000, 33

[State 3000, NotHitby]
type = NotHitBy
trigger1 = time = [1,30]
value = SCA

[State 3000, 1]
type = HitDef
trigger1 = time = 0
attr = S, HA
damage    = 180, 20
animtype  = up
hitflag = MAF
guardflag = L
priority = 7, Hit
pausetime = 0,10
sparkno = s4200
guard.sparkno = s4500
sparkxy = 0, 0 
hitsound = s5,8
guardsound = s6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = 0,-14
air.velocity = 0,-14
fall = 1

[State 3000, 2]
type = PlaySnd
trigger1 = AnimElem = 7
value = s1,0

[State 3000, 3]
type = EnvShake
trigger1 = AnimElem = 7
time = 24
freq = 60
ampl = -6
phase = 90

[State 3000, エフェクト]
type = Explod
trigger1 = AnimElem = 7
anim = 8110
postype = p1
sprpriority = 2
bindtime = -1
ID = 8110
removetime = 24
pos = 0, 0
scale = 2,2
ownpal = 1
removeongethit = 1

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

;*********************************************
; んちゃ砲
[Statedef 10050]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
velset = 0,0
anim = 10050
ctrl = 0
sprpriority = -1

;-----------------------
[State 19600, e1]
type = Explod
trigger1 = Time = 0
anim = 24400
ID = 19600
postype = p1
pos = 20, 0
removetime = 60
ownpal = 1
sprpriority = -1
vel = 0, 0


;-----------------------

[State 19600, s]
type = PlaySnd
trigger1 = AnimElem = 1
persistent = 0
value = 7000, 0

[State 19600, s]
type = PlaySnd
trigger1 = AnimElem = 2
persistent = 0
value = 20, 1

[State 19600, 6] 
type = HitDef
trigger1 = Time = 0
;trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 140
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s4300
guard.sparkno = s4500
sparkxy = -10,-60
hitsound   = s5,8
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
;ground.velocity = -10,-10
air.velocity = -12,-12
fall = 0

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

;--------------------------------
[State 19600 , 2]
type = Helper
trigger1 = AnimElem = 2
trigger1 = NumHelper(10050) < 1; 
id = 19600
name = "beem"
pos = 6, -40
postype = p1
stateno = 10051
helpertype = normal
keyctrl = 0
ownpal = 0
sprpriority = 2
facing = 1

[Statedef 10051]
type = S
movetype = A
velset = 0,0
;anim = 10070
;anim = 10100
anim = 10210
juggle = 1

[State 10051, 4]
type = PlaySnd
trigger1 = AnimElem = 3
;trigger1 = Time = 100
value = 500, 36

[State 10051,9]
type = DestroySelf
trigger1 = Animtime = 0

[State 10051, 6] 
type = HitDef
trigger1 = Time = 0
;trigger1 = p2bodydist X < 40
attr = S, SA
animtype  = Hard
damage    = 140
priority  = 6
guardflag = MA
pausetime = 0,35
sparkno = s4300
guard.sparkno = s4500
sparkxy = -10,-10
hitsound   = s5,8
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = 0,0
air.velocity = -12,-12
palfx.time = 100
palfx.add = 40,-70,-200
palfx.sinadd = 40,30,0,10
palfx.color = 0
palfx.invertall = 1
fall = 0

;===================================================
;キーン
[Statedef 2500]
type     = S
movetype = A
physics  = S
juggle   = 8
poweradd = -1000
ctrl     = 0
anim     = 2500
velset   = 0,0
sprpriority = 1

[state 2500,2]
type = varset
trigger1 = time = 0
var(6) = 0

[State 3000, 超必殺技暗転時間停止]
type = SuperPause
trigger1 = time = 0
anim = s10000 
pos = 0, -35 
sound = s3, 2
movetime = 30

[State 3007, スクロール]
type = ScreenBound
trigger1 = 1
value = 0
MoveCamera = 0,0

[State 2101, 無敵]
type = NotHitBy
trigger1 = 1
value = SCA
time = 2

[state 2500,0]
type = velset
trigger1 = time >= 35
x = 35

[State 3505, エフェクト]
type = Explod
trigger1 = time = 35
anim = 6040
postype = p1
pos = -30,0
scale = 1,1
sprpriority = 2
ownpal = 1
ID = 6040

[State 3505, 音を鳴らす]
type = PlaySnd
trigger1 = Time = 35
value = s1,19
volume = 255

[State 630, 2]
type = HitDef
trigger1 = time = 35
attr = S, HA
damage    = 300,40
animtype = back
hitflag = MAFD
;guardflag = M
priority = 7
pausetime = 0,15
sparkno = s4200
sparkxy = 0,-20
hitsound   = s2,5
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = 0,-18
air.velocity = 0,-18
fall = 1
envshake.time = 20
envshake.ampl = 5
envshake.freq = 120
getpower = 300
fall.recover = 0

[State 3505, エフェクト]
type = Explod
trigger1 = animelem = 3
trigger1 = numexplod(6030) = 0
anim = 6030
postype = p1
pos = 30,-34
scale = 2,2
sprpriority = 2
ownpal = 1
bindtime = -1
ID = 6030

[State 3504, 残像]
type = AfterImage
trigger1 = Time = 35
Time = 60
Trans = Add
FrameGap = 2
length = 40
palcolor = 256
PalBright   = 90,90,150
PalContrast = 180,180,256
PalAdd = 0,0,160
PalMul = 1,1,1

[State 1000,00]
type = Afterimagetime
trigger1 = (FrontEdgeDist < -120)
time = 0

[state 2500,2]
type = varset
trigger1 = var(59) = 0
trigger1 = command = "a";"meteor"
trigger2 = (var(59)!=0)&&(Random<=var(59)*100)
trigger2 = power >= 1000
trigger2 = p2life<85
var(6) = 1

[state 2500,1]
type = changestate
trigger1 = (FrontEdgeDist < -120)
trigger1 = power >= 1000
trigger1 = var(6) = 1
value = 2400

[state 2500,1]
type = changestate
trigger1 = (FrontEdgeDist < -120)
value = 2501

[state 2500,1]
type = changestate
trigger1 = time >= 120
value = 2502

;------------------------------------------------
;キーン終了
[Statedef 2501]
type     = S
movetype = I
physics  = N
poweradd = 0
ctrl     = 0
anim     = 2501
velset   = 0,0
sprpriority = 1

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

[state 2500,0]
type = velset
trigger1 = time = 30
x = -24

[State 3007, スクロール]
type = ScreenBound
trigger1 = 1
value = 0

[state 2500,0]
type = velmul
trigger1 = time > 30
x = 0.9

[state 2500,0]
type = velset
trigger1 = animelem = 2
x = 0

[State 106, 3]
type = MakeDust
trigger1 = time < 90
pos = 0,0

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

;------------------------------------------------
;キーン終了2
[Statedef 2502]
type     = S
movetype = I
physics  = S
juggle   = 1
poweradd = 0
ctrl     = 0
anim     = 2502
velset   = 20,0
sprpriority = 1

[State 1021]
type = Screenbound
trigger1 = 1
value = 0

[state 2500,0]
type = velmul
trigger1 = time > 0
x = 0.8

[state 2500,0]
type = velset
trigger1 = animelem = 2
x = 0

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

;*********************************************
; 回転
[Statedef 20500]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -1000
velset = 3,0
anim = 10190
ctrl = 0
sprpriority = 2

[State 20500, 1]
type = PlaySnd
trigger1 = Time = 1
value = 8000, 1

[State 20500, 1]
type = PlaySnd
trigger1 = Time = 14
value = 7000, 31

[State 20500, 1]
type = VelAdd
trigger1 = Time > 10
x = 5.0

[State 20500, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 96, 4
priority  = 5
guardflag = MA
pausetime = 5,5
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-50
hitsound   = s5,6
guardsound = s6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7.5
guard.velocity = -7
air.velocity = -3.5,-7.5
fall = 0

[State 20500, 5]
type = ChangeState
trigger1 = AnimTime = 0
value = 20501

;------------------
; 空中・強
[Statedef 20501]
type    = A
movetype= A
physics = N
velset = 1,-5.0
anim = 10190
hitdefpersist = 1 

[State 20501, 1]
type = VelAdd
trigger1 = Time = 10
y = -2.0

[State 20501, 2]
type = PosAdd
trigger1 = 1
x = P2Dist X

;-----------------------
[State 20501, e1]
type = Explod
trigger1 = Time = 0
anim = 10220
ID = 9040
postype = p1
pos = -20, 0
removetime = 28
ownpal = 1
sprpriority = 2
vel = 10, 0
scale = 1,1

[State 20501, e1]
type = explodbindtime
trigger1 = Time = 0
time = 28
;-----------------------

[State 20501, 4]
type = HitDef
trigger1 = Time = 0
attr = A, SA
animtype  = Medium
damage    = 96, 4
priority  = 5
guardflag = MA
pausetime = 20,20
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-50
hitsound   = s5,6
guardsound = s6,0
ground.type = Low
ground.slidetime = 18
ground.hittime  = 18
ground.velocity = -3.5,-7.5
guard.velocity = -7
air.velocity = -3.5,-7.5
fall = 1

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

;---------------------------------------------------------------------------
; みんなで突進
[Statedef 3050]
type = S
movetype = A
physics = S
poweradd= -1000
velset = 1, 0
anim = 3050
juggle = 8
ctrl = 0
sprpriority = 2

[State 3050, Snd1]
type = PlaySnd
trigger1 = Time = 0
value = 7000, 3
volume = 255

[State 3050, Snd2]
type = PlaySnd
trigger1 = Time = 0
value = 8000, 5
volume = 255


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

[State 3050, 3]
type = VelAdd
trigger1 = Time >= 30
x = 10

[State 3050, 3]
type = VelSet
trigger1 = Time >= 50
x = -6
[State 3050, 3]
type = VelAdd
trigger1 = Time >= 50
x = -2



;-----------------------
[State 3050, e1]
type = Explod
trigger1 = AnimElem = 1
anim = 10250
ID = 10250
postype = p1
pos = 0, 0
removetime = 100
ownpal = 1
sprpriority = 0
vel = 10, 0

[State 3050, 6] 
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 200, 4
priority  = 6
guardflag = MA
pausetime = 15,15
sparkno = s4200
guard.sparkno = s4500
sparkxy = -10,-20
hitsound   = s5,5
guardsound = s6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = 15,-12
air.velocity = -12,-12
fall = 1


[State 440,5]
type = Projectile
trigger1 = Time = 0
projanim = 10270
projhits = 10
Projemisstime = 30
projID = 10030
Projshadow = 100,10,100
offset = 0,0
hitsound = s5, 6
sparkno = s4200 
guard.sparkno = s4500 
guardsound = s6, 0
guardflag = HA
velocity = 10, 0
attr = S, SP        
damage = 3,4          
animtype = Hard   
pausetime = 0,20 
hitflag = MAF         
priority = 7, dodge  
palfx.time = 10
palfx.add = 100,0,255
invertall = 1
fall = 0

[State 440,5]
type = Projectile
trigger1 = Time = 15
projanim = 10270
projhits = 10
Projemisstime = 30
projID = 10030
Projshadow = 100,10,100
offset = 0,0
hitsound = s5, 6
sparkno = s4200 
guard.sparkno = s4500 
guardsound = s6, 0
guardflag = HA
velocity = 10, 0
attr = S, SP        
damage = 3,4          
animtype = Hard   
pausetime = 0,20 
hitflag = MAF         
priority = 7, dodge  
palfx.time = 10
palfx.add = 100,0,255
invertall = 1
fall = 0

;*********************************************
; ダミー（あられ用）
[Statedef 8880]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 10160
ctrl = 0
sprpriority = 2

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

;*********************************************
; ダミー（あられ用）
[Statedef 8888]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 10160
ctrl = 0
sprpriority = 2

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

;------------------
;パトカー投げ
[Statedef 3051]
type    = S
movetype= A
physics = S
poweradd= -1000
juggle  = 2
ctrl = 0
velset = 0,0
anim = 3051

[State 3051, 0]
type = PlaySnd
trigger1 = AnimElem = 7
value = s0, 5
volume = 255

[State 3051, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = s1, 7
volume = 255

[state 3051, 2]
type = helper
trigger1 = AnimElem = 7
helpertype = normal
name = "patcar"
ID = 3053
pos = 18,-62
stateno = 3053
ownpal = 1

[State 3054, 4]
type = Explod
trigger1 = AnimElem = 2
persistent = 0
anim = 3052
sprpriority = 2
postype = p1
pos = 0, 0
velocity = 0
accel = 0, .0
removetime = 30

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

;パトカー
[statedef 3053]
type = A
movetype = A
physics = N
ctrl = 0
velset = 6,-5
anim = 3053

[state 3053]
type = playerpush
trigger1 = 1
value = 0

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

[State 3053, Assert]
type = assertspecial
trigger1 = Animtime != 0
flag = noshadow

[State 3053, 2]
type = HitDef
trigger1 = time = 0
attr = S, HP
damage    = 105
animtype  = diagup
hitflag = MAF
guardflag = MA
priority = 7, Hit
pausetime = 0,12
guard.sparkno = s4500
sparkxy = 0,-15
sparkno = s4200
hitsound   = s5,7
guardsound = s6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -8,-4
air.velocity = -14,-4
getpower = 160
fall = 1

[state 3053, 2]
type = helper
trigger1 = pos Y>= -6
helpertype = normal
name = "patcar_break"
ID = 3054
pos = 0,0
stateno = 3054
ownpal = 1

[state 3053]
type = Destroyself
trigger1 = pos Y>= -6


;---------------------
;パトカー大破
[statedef 3054]
type = S
movetype = A
physics = N
anim = 3054
velset = 0,0
ctrl = 0

[State 3054, 2]
type = PlaySnd
trigger1 = Time = 0
value = s1,8
volume = 255


[state 3054]
type = playerpush
trigger1 = 1
value = 0

[State 3054, 2]
type = HitDef
trigger1 = time = 0
attr = S, HP
damage    = 105
animtype  = diagup
hitflag = MAF
guardflag = MA
priority = 5, Hit
pausetime = 0,12
sparkxy = 0,-15
sparkno = s4200
guard.sparkno = s4500
hitsound   = s5,7
guardsound = s6,0
ground.type = high
ground.slidetime = 10
ground.hittime  = 10
ground.velocity = -10,-4
air.velocity = -10,-4
getpower = 160
fall = 1

[state 3054]
type = destroyself 
trigger1 = Animtime = 0

[State 3054, 4]
type = Explod
trigger1 = Time =0
persistent = 0
anim = 3055
sprpriority = 2
postype = p1
pos = 0, 0
velocity = 0
accel = 0, .0
removetime = 42





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

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


[State -2, スクロール]
type = ScreenBound
trigger1 = numexplod(10005)
value = 0
MoveCamera = 0,0
IgnoreHitPause = 1

[state -2]
type = varset
trigger1 = palno = [1,6]
var(58) = 0

[state -2]
type = null;varset
trigger1 = palno = [7,12]
var(58) = 1


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

[Statedef -3]


[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0



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

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



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

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