[Data]
life = 3000
power = 3000
attack = 70
defence = 100
fall.defence_up = 55
liedown.time = 1
airjuggle = 10
sparkno = 2
guard.sparkno = 40
KO.echo = 0
volume = 255
IntPersistIndex = 60
FloatPersistIndex = 40

;---------------------------------------------------------------------------
[Size]
xscale = .8         ;Horizontal scaling factor.
yscale = .8        ;Vertical scaling factor.
ground.back = 30     ;Player width (back, ground)
ground.front = 30    ;Player width (front, ground)
air.back = 30        ;Player width (back, air)
air.front = 30       ;Player width (front, air)
height = 80          ;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
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

;---------------------------------------------------------------------------
[Velocity]
walk.fwd  = 2      	;Walk forward
walk.back = -1.7     	;Walk backward
run.fwd  = 6, 0   		;Run forward (x, y)
run.back = -6, 0 		;Hop backward (x, y)
jump.neu = 0, 0    	;Neutral jumping velocity (x, y)
jump.back = 0, 0    	;Jump back Speed (x, y)
jump.fwd = 0, 0     	;Jump forward Speed (x, y)
runjump.back = 0, 0	 ;Running jump speeds (opt)
runjump.fwd = 0, 0     
airjump.neu = 0, 0     
airjump.back = 0      ;Air jump speeds (opt)
airjump.fwd = 0         ;.

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



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

; 立ち状態
[Statedef 0]
type = S
physics = S
sprpriority = 1
anim = 1111

[state 0,0]
type =changestate
triggerall = numhelper(1) = 1
trigger1 = ishelper(1)
value = 1

[state 0,0]
type =changestate
triggerall = numhelper(2) = 1
trigger1 = ishelper(2)
value = 2

[state 0,0]
type =changestate
triggerall = numhelper(3) = 1
trigger1 = ishelper(3)
value = 3

[state 1,0]
type = varset
trigger1 = (roundstate = 0) || (roundstate=1)
trigger1 = Facing = 1
v = 2
value = 1

[state 1,0]
type = varset
trigger1 = (roundstate = 0) || (roundstate=1)
trigger1 = Facing = -1
v = 2
value = -1

[State 0, CtrlSet]
type = CtrlSet
trigger1 = Var(31) >= 30
trigger1 = roundstate = 2
trigger1 = numhelper(1) = 1
trigger1 = numhelper(2) = 1
trigger1 = numhelper(3) = 1
trigger1 = helper(1),stateno = 1
trigger1 = helper(2),stateno = 2
trigger1 = helper(3),stateno = 3
trigger2 = roundstate = 3
value = 1

[State 0, CtrlSet]
type = CtrlSet
triggerall = numhelper(1) = 1
triggerall = numhelper(2) = 1
triggerall = numhelper(3) = 1
trigger1 = helper(1),stateno != 1
trigger2 = helper(2),stateno != 2
trigger3 = helper(3),stateno != 3
trigger3 = (roundstate = 0) || (roundstate=1)
value = 0

[State 0, body]
type = Helper
;trigger1 = time = 0
trigger1 = Numhelper(1) = 0
helpertype = normal
name = "body"
postype = p1
pos = 0,0
stateno = 1
ownpal = 0
id = 1
keyctrl = 0

[State 0, rarm]
type = Helper
;trigger1 = time = 0
trigger1 = Numhelper(2) = 0
helpertype = player
name = "arm"
postype = p1
pos = 0,0
stateno = 2
ownpal = 0
id = 2
keyctrl = 1

[State 0, larm]
type = Helper
;trigger1 = time = 0
trigger1 = Numhelper(3) = 0
helpertype = normal
name = "left"
postype = p1
pos = 0,0
stateno = 3
ownpal = 0
id = 3
keyctrl = 0

;---------------------------------------------------------------------------
; body
[Statedef 1]
type = S
physics = S
sprpriority = -4
anim = 1

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

[state 1,0]
type = varset
trigger1 = time = 0
v = 40
value = 0

[state 1,0]
type = varset
trigger1 = time = 30
v = 39
value = 0

[state 0,0]
type = varset
trigger1 = time = 0
v = 38
value = 1

[State 4000, 51]
type = turn
trigger1 = facing != parent,facing

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[State 1200, 9]
type = Width
trigger1 = time >= 0
value = -45, 45

[State 210, 3]
type = PlayerPush
trigger1 = 1
value = 1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[State 10011, 4]
type = HitOverride
trigger1 = 1
attr = SCA, NA, SA, HA, NP,SP,HP
stateno = 4
time = 2

[state 0,0]
type = Changestate
trigger1 = parent,stateno = [230,240]
trigger2 = parent,stateno = [1000,1010]
trigger3 = parent,stateno = [1050,1060]
trigger4 = parent,stateno = [3000,3060]
value = parent,stateno+2

[state 0,0]
type = Changestate
trigger1 = helper(2),stateno = 5
value = 4

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0

;---------------------------------------------------------------------------
; arm
[Statedef 2]
type = S
physics = S
sprpriority = 4
anim = 2

[state 0,0]
type = varset
trigger1 = animtime = 0
trigger1 = Var(21) = 0
v = 19
value = 0



[State -2, VarSet]
Type = VarSet
Trigger1 = Var(19) < 2
V = 19
Value = helper(2),AnimElemNo(0)

[state 0,0]
type = varset
trigger1 = 1
v = 20
value = 2

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = time = 1
Value = Var(20)
Elem = Var(19)

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[state 0,0]
type = Changeanim
trigger1 = parent,stateno = 0
trigger1 = anim != 2
value = 2

[state 0,0]
type = varset
trigger1 = time = 30
v = 39
value = 0

[state 0,0]
type = varset
trigger1 = time = 0
v = 40
value = 0

[State 4000, 51]
type = turn
trigger1 = facing != parent,facing

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[state 0,0]
type = Changestate
trigger1 = parent,stateno = [210,220]
trigger2 = parent,stateno = 230
trigger3 = parent,stateno = [1000,1010]
trigger4 = parent,stateno = [1040,1050]
trigger5 = parent,stateno = 1060
value = parent,stateno+1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 21
value = 0

[State 10011, 4]
type = HitOverride
trigger1 = 1
attr = SCA, NA, SA, HA,NP,SP,HP
stateno = 5

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0

;---------------------------------------------------------------------------
; left arm
[Statedef 3]
type = S
physics = S
sprpriority = -5
anim = 1111

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 4000, 51]
type = turn
trigger1 = facing != parent,facing

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[state 0,0]
type = Changestate
trigger1 = parent,stateno = 240
value = parent,stateno+1

;[state 0,0]
;type = Changestate
;trigger1 = parent,stateno = 2000
;trigger2 = parent,stateno = 3000
;value = parent,stateno+2

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0

;---------------------------------------------------------------------------
; body damaged anim
[Statedef 4]
type = S
physics = S
movetype = H
sprpriority = -4

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = helper(3),anim = 241 
Value = 4

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = anim != 5
Value = 5

[State 9999, 4]
type = ChangeState
Trigger1 = helper(2),stateno = 2
Trigger2 = helper(2),movetype != H
value = 1
ctrl = 0

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0

;---------------------------------------------------------------------------
; arm damaged
[Statedef 5]
type = U
physics = N
movetype = H
Ctrl = 0
sprpriority = 4


[state -2,0]
type = varset
trigger1 = Var(21) = 0
v = 21
value = 1
ignorehitpause=1

[State 9999,アーマー]
type = PalFX
trigger1 = time = 0
time = 3
add = 0,0,0
mul = 256,256,256
sinadd = 256,256,256,10
invertall = 0
color = 256
ignorehitpause=1

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = 1
Value = var(20)
Elem = var(19)
ignorehitpause=1

[State 1000, 0]
type = StopSnd
trigger1 = time = 0
channel = 0
ignorehitpause=1

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(8) = 1
value = 14, 0
ignorehitpause=1

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(8) = 2
value = 14, 1
ignorehitpause=1

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(8) = 3
value = 14, 2
ignorehitpause=1

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
trigger1 = var(8) = 0
value = 14, 5
ignorehitpause=1

[State 180, 0]
type = VarRandom
trigger1 = time >= 0
v = 8
range = 3
ignorehitpause=1

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0
ignorehitpause=1

[State 1200, 9]
type = Width
trigger1 = time >= 0
value = -12,-12
ignorehitpause=1

[State 4000, 51]
type = turn
trigger1 = facing != parent,facing
ignorehitpause=1

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0
ignorehitpause=1

[state 0,0]
type = varset
trigger1 = time = 0
v = 39
value = var(39)+1
ignorehitpause=1

[state 0,0]
type = parentvarset
trigger1 = time = 0
v = 42
value = 1
ignorehitpause=1

[state 0,0]
type = varset
trigger1 = time = 0
v = 40
value = ifelse( gethitvar(damage) > 300, 300, gethitvar(damage) )
ignorehitpause=1

[State 9999, 4]
type = ChangeState
Trigger1 = GetHitVar(HitShakeTime) = 0
trigger1 = time >= 1
value = Var(20)
ctrl = 1
ignorehitpause=1

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1
ignorehitpause=1

[State 10011, 4]
type = HitOverride
trigger1 = Time >= 0
attr = SCA, NA, SA, HA,NP,SP,HP
stateno = 5
Time = -1
ignorehitpause=1

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0
ignorehitpause=1

;---------------------------------------------------------------------------
; body anim2
[Statedef 6]
type = S
physics = S
movetype = A
sprpriority = -4

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = helper(2),anim = 1051
Trigger2 = helper(2),anim = 1061
Value = 4

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = anim != 5
Value = 5

[State 9999, 4]
type = ChangeState
Trigger1 = helper(2),stateno = 2
Trigger2 = helper(2),movetype != A
value = 1

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150
trigger2 = parent,alive = 0

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

[State 180, 0]
type = VarRandom
trigger1 = time = 0
v = 8
range = 2

[State 180, 1]
type = ChangeState
trigger1 = time >= 1
trigger1 = Var(8) = 1
value = 181

[State 180, 1]
type = ChangeState
trigger1 = time >= 1
trigger1 = Var(8) = 2
value = 182

[State 180, 1]
type = ChangeState
trigger1 = time >= 1
trigger1 = Var(8) = 0
value = 183

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

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
value = 0, 2
channel = 0

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

[State 181, 2]
type = AssertSpecial
trigger1 = time = [1,450]
flag = RoundNotOver

; Win pose 2 - Bow
[Statedef 182]
type = S
ctrl = 0
velset = 0,0

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

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

[State 181, 2]
type = AssertSpecial
trigger1 = time = [1,270]
flag = RoundNotOver

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

[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
value = 0, 3
channel = 0

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

[State 181, 2]
type = AssertSpecial
trigger1 = time = [1,350]
flag = RoundNotOver

;---------------------------------------------------------------------------
;
[Statedef 195]
type = S
physics = S
ctrl = 0
velset = 0,0



[State 1000, 0]
type = PlaySnd
trigger1 = time = 0
value = 2, 6
channel = 0
loop = 1

[State 195]
type = PowerAdd
trigger1 = time >= 0
value = -3

[State 195]
type = lifeAdd
trigger1 = time >= 0
value = 2

[State 195, 10]
type = ChangeState
trigger1 = life = lifemax
trigger2 = command != "hold_c"
trigger3 = helper(2),stateno = 5
trigger4 = power <= 0
value = 196
ctrl = 1

[Statedef 196]
type = S
physics = S
ctrl = 0
velset = 0,0

[State 1000, 0]
type = StopSnd
trigger1 = time = 0
channel = 0

[State 195, 10]
type = ChangeState
trigger1 = time >= 1
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; stand punch

; main
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
anim = 1111
poweradd = 60
sprpriority = 4

[State 210, 3]
type = varadd
trigger1 = var(51) = 210
trigger1 = time = 0
v = 52
value = 1

[State 210, 3]
type = varset
trigger1 = var(51) != 210
trigger1 = time = 0
v = 52
value = 0

[State 210, 3]
type = varset
trigger1 = var(51) != 210
trigger1 = time = 0
v = 51
value = 210

[State 210, 3]
type = ChangeState
trigger1 = helper(2),stateno = 211
trigger1 = helper(2),animtime = 0
trigger2 = (time > 2) && helper(2),stateno != 211
value = 0
ctrl = 1


;======================================

; arm
[Statedef 211]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
sprpriority = 4



[State -2, VarSet]
Type = VarSet
Trigger1 = Var(19) < 22
V = 19
Value = helper(2),AnimElemNo(0)

[state -2,0]
type = varset
trigger1 = 1
v = 20
value = 211

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = time = 1
Value = Var(20)
Elem = Var(19)

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[State 10011, 4]
type = HitOverride
trigger1 = 1
attr = SCA, AA,AP
stateno = 5

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[State 1000, 0]
type = PlaySnd
trigger1 = time = 3
value = 0, 5

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 1
trigger1 = AnimElem >= 5
attr = S, NA
damage = 84, 12
getpower = 80
givepower = 30
animtype = hard
guardflag = MA
hitflag = MAF
affectteam = B
priority = 5, Hit
pausetime = 0,12;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -20, -26
hitsound = S15,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = -5
air.velocity = -2,-3
envshake.time = 15
envshake.freq = 80
envshake.ampl = 8
envshake.phase = 95

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 0
trigger1 = AnimElem >= 5
attr = S, NA
damage = 70, 10
getpower = 80
givepower = 30
animtype = hard
guardflag = MA
hitflag = MAF
affectteam = B
priority = 5, Hit
pausetime = 0,6;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -20, -26
hitsound = S15,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = -5
air.velocity = -2,-3
envshake.time = 15
envshake.freq = 80
envshake.ampl = 8
envshake.phase = 95

[State 211]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1, 0
channel = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 21
value = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 20
value = 2

[State 211, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 2

;---------------------------------------------------------------------------
; stand punch2

; main
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
anim = 1111
poweradd = 60
sprpriority = 4

[State 210, 3]
type = varadd
trigger1 = var(51) = 220
trigger1 = time = 0
v = 52
value = 1

[State 210, 3]
type = varset
trigger1 = var(51) != 220
trigger1 = time = 0
v = 52
value = 0

[State 210, 3]
type = varset
trigger1 = var(51) != 220
trigger1 = time = 0
v = 51
value = 210

[State 210, 3]
type = ChangeState
trigger1 = helper(2),stateno = 221
trigger1 = helper(2),animtime = 0
trigger2 = (time > 2) && helper(2),stateno != 221
value = 0
ctrl = 1


;======================================

; arm
[Statedef 221]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
sprpriority = 4



[State -2, VarSet]
Type = VarSet
Trigger1 = Var(19) < 20
V = 19
Value = helper(2),AnimElemNo(0)

[state -2,0]
type = varset
trigger1 = 1
v = 20
value = 221

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = time = 1
Value = Var(20)
Elem = Var(19)

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[State 10011, 4]
type = HitOverride
trigger1 = 1
attr = SCA, NA, SA, HA,NP,SP,HP
stateno = 5

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[State 1000, 0]
type = PlaySnd
trigger1 = AnimElem = 16
trigger1 = Var(32) = 0
value = 15, 3

[State 1000, 0]
type = EnvShake
trigger1 = AnimElem = 16
trigger1 = Var(32) = 0
time = 15
freq = 80
ampl = 8

[state 0,0]
type = varset
trigger1 = AnimElemTime(16) = 1
v = 32
value = 1

[state 0,0]
type = varset
trigger1 = AnimElem = 17
v = 32
value = 0

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 1
trigger1 = AnimElem >= 11
attr = S, NA
damage = 120, 24
getpower = 90
givepower = 50
animtype = Back
air.animtype = hard
guardflag = MA
hitflag = MAFD
affectteam = B
priority = 6, Hit
pausetime = 0,12;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -20, -26
hitsound = S15,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = 0
air.velocity = -2,30
fall = 1
fall.recover = 0
fall.damage = 20 
fall.envshake.ampl = 6 
fall.envshake.freq = 178
fall.envshake.time = 15

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 0
trigger1 = AnimElem >= 11
attr = S, NA
damage = 100, 20
getpower = 90
givepower = 50
animtype = Back
air.animtype = hard
guardflag = MA
hitflag = MAFD
affectteam = B
priority = 6, Hit
pausetime = 0,6;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -20, -26
hitsound = S15,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = 0
air.velocity = -2,30
fall = 1
fall.recover = 0
fall.damage = 20 
fall.envshake.ampl = 6 
fall.envshake.freq = 178
fall.envshake.time = 15

[State 211]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1, 1
channel = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 21
value = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 20
value = 2

[State 211, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 2

;---------------------------------------------------------------------------
; stand punch3

; main
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
anim = 1111
poweradd = 65
sprpriority = 4

[State 210, 3]
type = varadd
trigger1 = var(51) = 230
trigger1 = time = 0
v = 52
value = 1

[State 210, 3]
type = varset
trigger1 = var(51) != 230
trigger1 = time = 0
v = 52
value = 0

[State 210, 3]
type = varset
trigger1 = var(51) != 230
trigger1 = time = 0
v = 51
value = 230

[State 210, 3]
type = ChangeState
trigger1 = helper(2),stateno = 231
trigger1 = helper(2),animtime = 0
trigger2 = (time > 2) && helper(2),stateno != 231
value = 0
ctrl = 1


;======================================

; arm
[Statedef 231]
type    = S
movetype= A
physics = S
juggle  = 5
ctrl = 0
sprpriority = 4


[State -2, VarSet]
Type = VarSet
Trigger1 = Var(19) < 23
V = 19
Value = helper(2),AnimElemNo(0)

[state -2,0]
type = varset
trigger1 = 1
v = 20
value = 231

[State -2, ChangeAnim]
Type = ChangeAnim
Trigger1 = time = 1
Value = Var(20)
Elem = Var(19)

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[State 10011, 4]
type = HitOverride
trigger1 = 1
attr = SCA, NA, SA, HA,NP,SP,HP
stateno = 5

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[State 1000, 0]
type = PlaySnd
trigger1 = time = 3
value = 0, 5

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 1
trigger1 = AnimElem >= 7
attr = S, NA
damage = 84,6
getpower = 70
givepower = 20
animtype = Up
guardflag = MA
hitflag = MAF
affectteam = B
priority = 5, Hit
pausetime = 0,12;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -50, -56
hitsound = S15,4
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = -3,-12
air.velocity = -4,-12
envshake.time = 15
envshake.freq = 80
envshake.ampl = 8
envshake.phase = 95
fall.recovertime = 50
fall.damage = 20 
fall.envshake.ampl = 6 
fall.envshake.freq = 178
fall.envshake.time = 15

[State 211]
type = HitDef
trigger1 = parent,Var(3) = 0
trigger1 = AnimElem >= 7
attr = S, NA
damage = 70, 5
getpower = 70
givepower = 20
animtype = Up
guardflag = MA
hitflag = MAF
affectteam = B
priority = 5, Hit
pausetime = 0,6;12, 6
guard.sparkno = 40
sparkno = 2
sparkxy = -50, -56
hitsound = S15,4
guardsound = 6,0
ground.type = High
ground.slidetime = 30
ground.hittime  = 20
ground.velocity = -3,-12
air.velocity = -4,-12
envshake.time = 15
envshake.freq = 80
envshake.ampl = 8
envshake.phase = 95
;fall = 1
fall.recovertime = 20
fall.damage = 20 
fall.envshake.ampl = 6 
fall.envshake.freq = 178
fall.envshake.time = 15

[State 211]
type = PlaySnd
trigger1 = AnimElem = 3
value = 1, 2
channel = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 21
value = 0

[state -2,0]
type = varset
trigger1 = AnimTime = 0
v = 20
value = 2

[State 211, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 2

;body

[Statedef 232]
type = S
physics = S
sprpriority = -4

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = 1
Value = 5

[State 211, 3]
type = ChangeState
trigger1 = Time > 52
value = 1

;---------------------------------------------------------------------------
; esc key

; main
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
anim = 1111
poweradd = 10
sprpriority = 4

[State 210, 3]
type = varadd
trigger1 = var(51) = 240
trigger1 = time = 0
v = 52
value = 1

[State 210, 3]
type = varset
trigger1 = var(51) != 240
trigger1 = time = 0
v = 52
value = 0

[State 210, 3]
type = varset
trigger1 = var(51) != 240
trigger1 = time = 0
v = 51
value = 240

[State 210, 3]
type = ChangeState
trigger1 = helper(3),stateno = 241
trigger1 = helper(3),animtime = 0
trigger2 = (time > 2) && helper(3),stateno != 241
value = 0
ctrl = 1

;======================================

; larm
[Statedef 241]
type    = S
movetype= A
physics = S
juggle  = 1
ctrl = 0
sprpriority = -5

[State -2, VarAdd]
Type = VarAdd
Triggerall = stateno != 5
Trigger1 = Time > 0
Trigger2 = Time = 0
Trigger2 = Var(21) = 1
V = 19
Value = 1

[State -2, VarSet]
Type = VarSet
Trigger1 = Var(19) > 1
V = 19
Value = 1

[state -2,0]
type = varset
trigger1 = 1
v = 20
value = 2

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = time = 1
Value = 241

[state 0,0]
type = destroyself
trigger1 = parent,stateno = 5150

[State 181, 1]
type = NotHitBy
trigger1 = 1
value = , NT, ST, HT
time = 1

[State -2, ScreenBound]
type = ScreenBound
trigger1 = 1
value = 0
movecamera = 0,0

[State 0, 0]
type = BindToParent
trigger1 = 1
time = 2
pos = 0,0

[State 1000, 0]
type = PlaySnd
trigger1 = time = 3
value = 0, 5

[State 1300, 飛び道具]
type = Projectile
trigger1 = AnimElem = 3
attr = S, NP 
affectteam = B
damage = 5,0 
getpower = 10
animtype = light
pausetime = 0,12
offset = 100,-50 
velocity = 3,-8
remvelocity = -1,5 
accel = 0,0.4  
projID = 246 
projanim = 246  
projhitanim = 246 
projremanim = 246  
projscale = .8,.8  
projshadow = 0,0,0  
projhits = 1 
projmisstime = 1
projpriority = 3 
projremovetime = -1
projremove = 1 
guardflag = MA
hitflag = MAFD
priority = 3
sparkno = 2
sparkxy = 0,0
guard.sparkno = 40
hitsound = 5,3
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime = 16
ground.velocity = 0,0
air.velocity = -0.4,0
air.juggle = 10
projedgebound = 100
projstagebound = 100 

[State 211]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1, 3
channel = 0

[State 211, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 3

[State 210, 3]
type = ParentVarAdd
trigger1 = time = 1
v = 18
value = -1

;body

[Statedef 242]
type = S
physics = S
sprpriority = -4

[state 0,0]
type = Changestate
trigger1 = helper(2),stateno = 5
value = 4

[State 0, ChangeAnim]
Type = ChangeAnim
Trigger1 = 1
Value = 3

[State 211, 3]
type = ChangeState
trigger1 = Time > 14
value = 1

[Statedef 9999]
type = S
physics = S

[state 0,0]
type = destroyself
trigger1 = 1