;----------------------------------------------------------------------------
;Ghost - Appear
[Statedef 1605]
type    = S
movetype= A
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 3

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 1602
ID = 1605
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime = 999
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
ownpal = 0
removeongethit = 1

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time >0
ID = 1605
scale = const(size.xscale),const(size.yscale)
removetime = 999
removeongethit = 1



[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 8 || root, movetype = H
id = 1605


[State 1605, 3]
type = changestate
Triggerall = Parent, stateno = 1600
trigger1 = time = 8
value = 1606
ctrl = 0

[State 1605, 3]
type = changestate
Triggerall = Parent, stateno = 1601
trigger1 = time = 8
value = 1607
ctrl = 0

[State 1605, 3]
type = changestate
Triggerall = Parent, stateno = 1602
trigger1 = time = 8
value = 1608
ctrl = 0

[State 0, ChangeState]
type = DestroySelf
trigger1 = parent, movetype = H

;----------------------------------------------------------------------------
;Ghost - Part 2 (Slow)
[Statedef 1606]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1605
sprpriority = 3


[State 1606, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1600,10


;[State 1606, HitOverride]
;type = HitOverride
;trigger1 = time = 1
;attr = SCA,NP,SP,HP
;stateno = 1615
;time = 999

[State 0, VelSet]
type = VelSet
trigger1 = Time > 0
x = 1.4
y = 0


[State 0, Posadd]
type = Posadd
triggerall = p2dist y < -20
trigger1 = pos y != enemynear, pos y && enemynear, pos y < pos y
y =  -7


[State 0, Posadd]
type = posadd
Triggerall = p2dist y >= 20;parent, pos y < 0
trigger1 = enemynear, pos y > pos y && enemynear, vel y > 2
trigger2 = enemynear, pos y > pos y && enemynear, pos y = 0 && pos y < -75
y = 4.5

[State 0, Posadd]
type = posadd
triggerall = enemynear, pos y < pos y
trigger1 = enemynear, pos y != pos y && enemynear, vel y = 0
y = -2


;[State 0, Velset]
;type = Velset
;trigger1 = enemynear, pos y = 0 && Pos y >= -75
;trigger2 = pos y = enemynear, pos y
;y = 0


[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 10, 3			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
envshake.time = 3
envshake.ampl = 2
p2facing = 1

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1610
ID = 1610
pos = ceil(enemynear, pos x+100),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1611
ID = 1611
pos = ceil(enemynear, pos x-120),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1612
ID = 1612
pos = ceil(enemynear, pos x+100),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1613
ID = 1613
pos = ceil(enemynear, pos x-120),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)

[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost_Timer_1"
ID = 1680
stateno = 1680
pos = 0,0
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)

[State 0, SuperPause]
type = SuperPause
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
time = 10
anim = 1605
move = 0
darken = 0
poweradd = 0

[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0



[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0


[State 0, NotHitBy]
type = NotHitBy
trigger1 = time = 0
value = SCA,NA,SA,HA,NT,ST,HT
time = 9999

[State 0, changestate]
type = ChangeState
trigger1 = Moveguarded || Movecontact || matchover ;time = 275
Value = 1615
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -10



;----------------------------------------------------------------------------
;Ghost - Part 2 (Med)
[Statedef 1607]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1605
sprpriority = 3


[State 1607, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1600,10


;[State 0, HitOverride]
;type = HitOverride
;trigger1 = 1
;attr = SCA,NP,SP,HP
;stateno = 1615
;time = 999

[State 0, VelSet]
type = VelSet
trigger1 = Time > 0
x = 2.3
y = 0


[State 0, Posadd]
type = Posadd
triggerall = p2dist y < -20
trigger1 = pos y != enemynear, pos y && enemynear, pos y < pos y
y = -7.3


[State 0, Posadd]
type = posadd
Triggerall = p2dist y >= 20;parent, pos y < 0
trigger1 = enemynear, pos y > pos y && enemynear, vel y > 2
trigger2 = enemynear, pos y > pos y && enemynear, pos y = 0 && pos y < -75
y = 5


[State 0, Posadd]
type = posadd
triggerall = enemynear, pos y < pos y
trigger1 = enemynear, pos y != pos y && enemynear, vel y = 0
y = -3



;[State 0, VelAdd]
;type = Velset
;trigger1 = enemynear, pos y = 0 && Pos y >= -75
;trigger2 = pos y = enemynear, pos y
;y = 0




[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 10, 3			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1610
ID = 1610
pos = ceil(enemynear, pos x+100),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1611
ID = 1611
pos = ceil(enemynear, pos x-120),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1612
ID = 1612
pos = ceil(enemynear, pos x+100),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1613
ID = 1613
pos = ceil(enemynear, pos x-120),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, SuperPause]
type = SuperPause
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
time = 10
anim = 1605
move = 0
darken = 0
poweradd = 0

[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0



[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0




[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0




[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost_Timer_2"
ID = 1680
stateno = 1681
pos = 0,0
postype = p2    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NT,ST,HT
time = 9999


[State 0, changestate]
type = ChangeState
trigger1 = Moveguarded || Movecontact || matchover ;time = 275
Value = 1615
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -10


;----------------------------------------------------------------------------
;Ghost - Part 2 (Fast)
[Statedef 1608]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1605
sprpriority = 3

[State 1608, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = 1600,10



;[State 0, HitOverride]
;type = HitOverride
;trigger1 = 1
;attr = SCA,NP,SP,HP
;stateno = 1615
;time = 999

[State 0, VelSet]
type = VelSet
trigger1 = Time > 0
x = 3.3
y = 0

[State 0, Posadd]
type = Posadd
triggerall = p2dist y < -20
trigger1 = pos y != enemynear, pos y && enemynear, pos y < pos y
y =  -7.8


[State 0, Posadd]
type = posadd
Triggerall = p2dist y >= 20;parent, pos y < 0
trigger1 = enemynear, pos y > pos y && enemynear, vel y > 2
trigger2 = enemynear, pos y > pos y && enemynear, pos y = 0 && pos y < -75
y = 5


[State 0, Posadd]
type = posadd
triggerall = enemynear, pos y < pos y
trigger1 = enemynear, pos y != pos y && enemynear, vel y = 0
y = -3



;[State 0, VelAdd]
;type = Velset
;trigger1 = enemynear, pos y = 0 && Pos y >= -75
;trigger2 = pos y = enemynear, pos y
;y = 0


[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 10, 3			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = -1;s951				;Spark anim no (Def: set above)
guard.sparkno = -1;s935;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 951
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 935
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1010, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 0
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFP			;Flags of conditions that move can hit
priority = 3, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 15			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -5, -10		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s6300, 0			;Sound to play on guard
ground.type = high		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 10		;Time that the opponent slides back
ground.hittime  = 20		;Time opponent is in hit state
ground.velocity = -5		;Velocity at which opponent is pushed
airguard.velocity = -3.5,-3.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 = -4,-4		;X-velocity at which opponent is pushed,
air.hittime = 20			;Time before opponent regains control in air
ground.cornerpush.veloff = -3
guard.cornerpush.veloff = -3
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1610
ID = 1610
pos = ceil(enemynear, pos x+100),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1611
ID = 1611
pos = ceil(enemynear, pos x-120),-10
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1612
ID = 1612
pos = ceil(enemynear, pos x+100),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost"
stateno = 1613
ID = 1613
pos = ceil(enemynear, pos x-120),-130
postype = p2    ;p2,front,back,left,right
facing = ifelse((facing != enemynear, facing),1,1)
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)


[State 0, SuperPause]
type = SuperPause
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
time = 10
anim = 1605
move = 0
darken = 0
poweradd = 0

[State 0, Explod]
type = Explod
trigger1 = movehit
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0



[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = 1
bindtime = 1
vel = 5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0




[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,-7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0

[State 0, Explod]
type = Explod
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
anim = 1605
pos = 0,-70
postype = p2  ;p2,front,back,left,right
facing = -1
bindtime = 1
vel = -5,7
removetime = 11
supermovetime = 9999
pausemovetime = 9999
scale = const(size.xscale),const(size.yscale)
sprpriority = 1
ontop = 1
ownpal = 0
;removeongethit = 0



[State 0, Helper]
type = Helper
triggerall = enemynear, stateno != [130,155]
trigger1 = movehit && enemynear, movetype = H
helpertype = normal ;player
name = "Ghost_Timer_3"
ID = 1680
stateno = 1682
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
scale = const(size.xscale),const(size.yscale)
[State 0, NotHitBy]
type = NotHitBy
trigger1 = time = 0
value = SCA,NA,SA,HA,NT,ST,HT
time = 9999



[State 0, changestate]
type = ChangeState
trigger1 = Moveguarded || Movecontact || matchover ;time = 275
Value = 1615
ctrl = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = FrontEdgeBodyDist <= -10


;----------------------------------------------------------------------------
;Ghost - Attached 1
[Statedef 1610]
type    = S
movetype= A
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 7

[State 1610 VarAdd]
type = VarAdd
trigger1 = var(20) < 165 && moveguarded
v = 20    ;fv =
value = 1

[State 1610, VarAdd]
type = VarAdd
trigger1 = var(20) >= 165 && movehit
v = 20    ;fv =
value = -165


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1
value = 1606


[State 0, PosSet]
type = posSet
trigger1 = time > 0
x = enemynear, pos x+60
y = enemynear, pos y+-10



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype != A
trigger1 = time = ifelse((random > 200),80,90)
Trigger2 = time = ifelse((random > 200),196,205)
trigger3 = time = ifelse((random > 200),322,332)
value = 1610
;elem = 1



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype = A
trigger1 = time = ifelse((random > 200),80,90)
Trigger2 = time = ifelse((random > 200),196,205)
trigger3 = time = ifelse((random > 200),322,332)
value = 1615


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 150
trigger2 = Time = 270
trigger3 = time = 390
value = 1606

[State 0, Turn]
type = Turn
Triggerall = time = 0
trigger1 = parent, pos x > enemynear, pos x

[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 10			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -35, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s150, 0			;Sound to play on guard
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = -3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = -3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 30			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 13			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
sparkxy = -35, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = -3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = -3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
Triggerall = enemynear, stateno = [130,155]
trigger1 = var(20) >= 165 && time = 24
Trigger2 = var(20) >= 165 && time = 225
trigger3 = var(20) >= 165 && time = 346
attr = A, SP			;Attribute: Standing, Normal Attack
damage = 10			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 20, 35			;Time attacker pauses, time opponent shakes
sparkno = -1;s9105				;Spark anim no (Def: set above)
sparkxy = -35, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s150, 50			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 0		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 0,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 15
palfx.mul = 250,0,0
palfx.sinadd = 55,0,85,10
palfx.add = 0,0,0
envshake.time = 16
envshake.ampl = 8

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)


[State 0, changestate]
type = ChangeState
trigger1 = numhelper(1680) = 0
trigger2 = matchover || win || lose
Value = 1616
ctrl = 0

;----------------------------------------------------------------------------
;Ghost - Attached 2
[Statedef 1611]
type    = S
movetype= A
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 7


[State 1610 VarAdd]
type = VarAdd
trigger1 = var(20) < 165 && moveguarded
v = 20    ;fv =
value = 1

[State 1610, VarAdd]
type = VarAdd
trigger1 = var(20) >= 165 && movehit
v = 20    ;fv =
value = -165

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1
value = 1607


[State 0, VelSet]
type = posSet
trigger1 = time > 0
x = enemynear, pos x-80
y = enemynear, pos y-10



[State 0, Turn]
type = Turn
Triggerall = time = 0
trigger1 = parent, pos x > enemynear, pos x


[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype != A
trigger1 = time = ifelse((random > 200),85,95)
Trigger2 = time = ifelse((random > 200),196,205)
trigger3 = time = ifelse((random > 200),322,332)
value = 1611
;elem = 1



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype = A
trigger1 = time = ifelse((random > 200),85,95)
Trigger2 = time = ifelse((random > 200),196,205)
trigger3 = time = ifelse((random > 200),322,332)
value = 1616




[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 150
trigger2 = Time = 270
trigger3 = time = 390
value = 1607
;elem = 1



[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 10			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -10, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s150, 0			;Sound to play on guard
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 30			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 13			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
sparkxy = -10, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
Triggerall = enemynear, stateno = [130,155]
trigger1 = var(20) >= 165 && time = 24
Trigger2 = var(20) >= 165 && time = 225
trigger3 = var(20) >= 165 && time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 10			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 20, 35			;Time attacker pauses, time opponent shakes
sparkno = -1;s9105				;Spark anim no (Def: set above)
sparkxy = -10, -45		;X-offset for the "hit spark" rel. to p2,
hitsound = s150, 50			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 0		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 0,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 15
palfx.mul = 250,0,0
palfx.sinadd = 55,0,85,10
palfx.add = 0,0,0
envshake.time = 16
envshake.ampl = 8

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9105
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)


[State 0, changestate]
type = ChangeState
trigger1 = numhelper(1680) = 0
trigger2 = matchover || win || lose
Value = 1617
ctrl = 0


;----------------------------------------------------------------------------
;Ghost - Attached 3
[Statedef 1612]
type    = S
movetype= A
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 7

[State 1610 VarAdd]
type = VarAdd
trigger1 = var(20) < 165 && moveguarded
v = 20    ;fv =
value = 1

[State 1610, VarAdd]
type = VarAdd
trigger1 = var(20) >= 165 && movehit
v = 20    ;fv =
value = -165


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1
value = 1608


[State 0, VelSet]
type = posSet
trigger1 = time > 0
x = enemynear, pos x+60
y = enemynear, pos y-120



[State 0, Turn]
type = Turn
Triggerall = time = 0
trigger1 = parent, pos x > enemynear, pos x



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype != A
trigger1 = time = ifelse((random > 200),85,95)
Trigger2 = time = ifelse((random > 200),201,211)
trigger3 = time = ifelse((random > 200),317,327)
value = 1612
;elem = 1



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype = A
trigger1 = time = ifelse((random > 200),85,95)
Trigger2 = time = ifelse((random > 200),201,211)
trigger3 = time = ifelse((random > 200),317,327)
value = 1617
;elem = 1




[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 150
trigger2 = Time = 270
trigger3 = time = 390
value = 1608
;elem = 1


[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 10			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -35, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s150, 0			;Sound to play on guard
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = -3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = -3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 30			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 13			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
sparkxy = -35, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = -3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = -3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
Triggerall = enemynear, stateno = [130,155]
trigger1 = var(20) >= 165 && time = 24
Trigger2 = var(20) >= 165 && time = 225
trigger3 = var(20) >= 165 && time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 10			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 20, 35			;Time attacker pauses, time opponent shakes
sparkno = -1;s9105				;Spark anim no (Def: set above)
sparkxy = -35, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s150, 50			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 0		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 0,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 15
palfx.mul = 250,0,0
palfx.sinadd = 55,0,85,10
palfx.add = 0,0,0
envshake.time = 16
envshake.ampl = 8

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9105
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, changestate]
type = ChangeState
trigger1 = numhelper(1680) = 0
trigger2 = matchover || win || lose
Value = 1616
ctrl = 0



;----------------------------------------------------------------------------
;Ghost - Attached 4
[Statedef 1613]
type    = S
movetype= A
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 7

[State 1610 VarAdd]
type = VarAdd
trigger1 = var(20) < 165 && moveguarded
v = 20    ;fv =
value = 1

[State 1610, VarAdd]
type = VarAdd
trigger1 = var(20) >= 165 && movehit
v = 20    ;fv =
value = -165

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 1
value = 1609

[State 0, VelSet]
type = posSet
trigger1 = time > 0
x = enemynear, pos x-80
y = enemynear, pos y-120



[State 0, Turn]
type = Turn
Triggerall = time = 0
trigger1 = parent, pos x > enemynear, pos x



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype != A
trigger1 = time = ifelse((random > 200),75,85)
Trigger2 = time = ifelse((random > 200),206,216)
trigger3 = time = ifelse((random > 200),322,332)
value = 1613
;elem = 1



[State 0, ChangeAnim]
type = ChangeAnim
Triggerall = enemynear, movetype = A
trigger1 = time = ifelse((random > 200),75,85)
Trigger2 = time = ifelse((random > 200),206,216)
trigger3 = time = ifelse((random > 200),322,332)
value = 1618



[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 150
trigger2 = Time = 270
trigger3 = time = 390
value = 1609
;elem = 1


[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype != A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 20			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA			;Flags on how move is to be guarded against
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 10			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
guard.sparkno = -1;s9100;Y-offset for the spark rel. to p1
sparkxy = -10, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
guardsound = s150, 0			;Sound to play on guard
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
envshake.time = 3
envshake.ampl = 2

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 200, Explod]
type = Explod
trigger1 = MoveGuarded = 1
anim = 9100
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 3
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
triggerall = enemynear, movetype = A
trigger1 = time = 24
Trigger2 = time = 225
trigger3 = time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 30			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 5, 13			;Time attacker pauses, time opponent shakes
sparkno = -1;s9101				;Spark anim no (Def: set above)
sparkxy = -10, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s200, 40			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 3		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 3		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 3,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
Down.hit = 1
down.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 10
palfx.mul = 256,256,256
palfx.sinadd = 0,0,0,0
palfx.add = 125,125,125
envshake.time = 6
envshake.ampl = 6

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9101
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 1610, 1]
type = HitDef
Triggerall = enemynear, stateno = [130,155]
trigger1 = var(20) >= 165 && time = 24
Trigger2 = var(20) >= 165 && time = 225
trigger3 = var(20) >= 165 && time = 346
attr = A, SA			;Attribute: Standing, Normal Attack
damage = 10			;Damage that move inflicts, guard damage
animtype = Heavy			;Animation type: Light, Medium, Heavy, Back (def: Light)
;guard.pause = 13
hitflag = MAFD			;Flags of conditions that move can hit
priority = 7, Hit			;Attack priority: 0 (least) to 7 (most), 4 default
pausetime = 20, 35			;Time attacker pauses, time opponent shakes
sparkno = -1;s9105				;Spark anim no (Def: set above)
sparkxy = -10, 45		;X-offset for the "hit spark" rel. to p2,
hitsound = s150, 50			;Sound to play on hit
ground.type = Low		;Type: High, Low, Trip (def: Normal)
ground.slidetime = 0		;Time that the opponent slides back
ground.hittime  = 18		;Time opponent is in hit state
ground.velocity = 0		;Velocity at which opponent is pushed
;airguard.velocity = -3.5,-3.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 = 0,-4		;X-velocity at which opponent is pushed,
air.hittime = 18
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
palfx.time = 15
palfx.mul = 250,0,0
palfx.sinadd = 55,0,85,10
palfx.add = 0,0,0
envshake.time = 16
envshake.ampl = 8

[State 200, Explod]
type = Explod
trigger1 = MoveHit = 1
anim = 9105
postype = p2
pos = 12,-75
persistent = 0
sprpriority = 7
ignorehitpause = 1
scale = const(size.xscale),const(size.yscale)

[State 0, changestate]
type = ChangeState
trigger1 = numhelper(1680) = 0
trigger2 = matchover || win || lose
Value = 1617
ctrl = 0


;----------------------------------------------------------------------------
;Ghost - Remove 1
[Statedef 1615]
type    = S
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 2

[State 0, Explod]
type = Explod
trigger1 = numhelper(1605) = 1 && time = 0
anim = 1602
ID = 1615
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime = 99
scale = 0.64,0.64
sprpriority = 2
ownpal = 0
removeongethit = 0


[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time >0
ID = 1615
scale = 0.64,0.64-(time/4)
removetime = 8
removeongethit = 1



[State 0, DestroySelf]
type = Destroyself
trigger1 = time = 8

;----------------------------------------------------------------------------
;Ghost - Remove 2
[Statedef 1616]
type    = S
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 2

[State 0, Explod]
type = Explod
trigger1 = numhelper(1610) = 1 && time = 0
trigger2 = numhelper(1612) = 1 && time = 0
anim = 1621
ID = 1615
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime =  99
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ownpal = 0
removeongethit = 0



[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time >0
ID = 1615
scale = const(size.xscale),const(size.yscale)
removetime = 8
removeongethit = 1



[State 0, DestroySelf]
type = Destroyself
trigger1 = time = 8

;----------------------------------------------------------------------------
;Ghost - Remove 3
[Statedef 1617]
type    = S
physics = S
velset = 0,0  ;1,-2
ctrl = 0
anim = 1619
sprpriority = 2


[State 0, Explod]
type = Explod
trigger1 = numhelper(1611) = 1 && time = 0
trigger2 = numhelper(1613) = 1 && time = 0
anim = 1622
ID = 1615
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
bindtime = 1
removetime = 99
scale = const(size.xscale),const(size.yscale)
sprpriority = 2
ownpal = 0
removeongethit = 0

[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time >0
ID = 1615
scale = 1.27333333333333,1.2714285714285-(time/4)
removetime = 8
removeongethit = 1



[State 0, DestroySelf]
type = Destroyself
trigger1 = time = 8


;---------------------------------------------
;Ghost Timer 1
[Statedef 1680]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1690

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 0
y = -100


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 160


;---------------------------------------------
;Ghost Timer 2
[Statedef 1681]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1690

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 0
y = -100


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 280



;---------------------------------------------
;Ghost Timer 3 - Activate
[Statedef 1682]
type    = A
movetype= A
physics = N
velset = 0,0  ;1,-2
ctrl = 0
anim = 1690
sprpriority = 3

[State 0, PosSet]
type = PosSet
trigger1 = 1
x = 0
y = -100


[State 0, DestroySelf]
type = DestroySelf
trigger1 = time = 430




