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

[Data]
life = 1000;Amount of life to start with
attack = 100;attack power (more is stronger)
defence = 100;defensive power (more is stronger)
fall.defence_up = 50;Percentage to increase defense everytime player is knocked down
liedown.time = 20;Time w hich player lies down for, before getting up
airjuggle = 15;Number of points for juggling
sparkno = 7000;Default hit spark number for HitDefs
guard.sparkno = 40;Default guard spark number
KO.echo = 0;1 to enable echo on KO
volume = 255;Volume offset (negative for softer) 
IntPersistIndex = 60
FloatPersistIndex = 40

[Size]
xscale = 1.21           ;Horizontal scaling factor.
yscale = 1.21           ;Vertical scaling factor.
ground.back = 80     ;Player width (back, ground)
ground.front = 80    ;Player width (front, ground)
air.back = 80        ;Player width (back, air)
air.front = 68       ;Player width (front, air)
height = 240         ;Height of player (for opponent to jump over)
attack.dist = 640    ;Default attack distance
proj.attack.dist = 360 ;Default attack distance for projectiles
proj.doscale = 1     ;Set to 1 to scale projectiles too
head.pos = -20, -325 ;Approximate position of head
mid.pos = -20, -230  ;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). Recommended 0,0

[Velocity]
walk.fwd  = 9.6      ;Walk forward
walk.back = -8.0     ;Walk backward
run.fwd  = 18.4, 0   ;Run forward (x, y)
run.back = -18,0 ;-18,-15.2 ;Hop backward (x, y)
jump.neu = 0,-33.6   ;Neutral jumping velocity (x, y)
jump.back = -10.2,-33.6 ;Jump back Speed (x, y)
jump.fwd = 10,-33.6     ;Jump forward Speed (x, y)
runjump.back = -10.2,-32.4 ;Running jump speeds (opt)
runjump.fwd = 18.4,-32.4    ;.
airjump.neu = 0,-32.4     ;.
airjump.back = -10.2      ;Air jump speeds (opt)
airjump.fwd = 10          ;.
air.gethit.groundrecover = -.6,-14    ;Velocity for ground recovery state (x, y) **MUGEN 1.0**
air.gethit.airrecover.mul = .5,.2     ;Multiplier for air recovery velocity (x, y) **MUGEN 1.0**
air.gethit.airrecover.add = 0,-18     ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -4       ;Extra x-velocity for holding back during air recovery **MUGEN 1.0**
air.gethit.airrecover.fwd = 0         ;Extra x-velocity for holding forward during air recovery **MUGEN 1.0**
air.gethit.airrecover.up = -8         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 6        ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**

[Movement]
airjump.num = 1      ;Number of air jumps allowed (opt)
airjump.height = 100 ;Minimum distance from ground before you can air jump (opt)
yaccel = 1.36  ;1.76         ;Vertical acceleration
stand.friction = .85  ;Friction coefficient when standing
crouch.friction = .82 ;Friction coefficient when crouching
stand.friction.threshold = 4          ;If player's speed drops below this threshold while standing, stop his movement **MUGEN 1.0**
crouch.friction.threshold = .2        ;If player's speed drops below this threshold while crouching, stop his movement **MUGEN 1.0**
air.gethit.groundlevel = 100          ;Y-position at which a falling player is considered to hit the ground **MUGEN 1.0**
air.gethit.groundrecover.ground.threshold = -80 ;Y-position below which falling player can use the recovery command **MUGEN 1.0**
air.gethit.groundrecover.groundlevel = 40   ;Y-position at which player in the ground recovery state touches the ground **MUGEN 1.0**
air.gethit.airrecover.threshold = -4  ;Y-velocity above which player may use the air recovery command **MUGEN 1.0**
air.gethit.airrecover.yaccel = 1.4    ;Vertical acceleration for player in the air recovery state **MUGEN 1.0**
air.gethit.trip.groundlevel = 60      ;Y-position at which player in the tripped state touches the ground **MUGEN 1.0**
down.bounce.offset = 0, 80            ;Offset for player bouncing off the ground (x, y) **MUGEN 1.0**
down.bounce.yaccel = 1.6              ;Vertical acceleration for player bouncing off the ground **MUGEN 1.0**
down.bounce.groundlevel = 48          ;Y-position at which player bouncing off the ground touches the ground again **MUGEN 1.0**
down.friction.threshold = .2          ;If the player's speed drops below this threshold while lying down, stop his movement **MUGEN 1.0**

;Default language victory quotes **MUGEN 1.0**
;The default language victory quotes must be implemented in English.
[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "You must defeat Tu Shou to stand a chance."
victory2 = "You need a lot of training. Come back in ten years."
victory3 = "You look familiar. Did I see you on TV?"
victory4 = "Your moves are too predictable. You want to learn Kung Fu Palm? It's not for novices."
victory5 = "That was a good workout."
victory6 = "I want to challenge more skilled fighters."
victory7 = "What do you mean my girlfriend is in another temple?"
 
[ja.Quotes]
victory1 = "カンフー突き手を破らぬ限り、お前に勝ち目はない！"
victory2 = "十年早いんだぞ"
victory3 = "お前は見覚えがあるな。テレビにでも…？"
victory4 = "お前の動きは見破りやすすぎる。　なに、カンフー突き手が覚えたいんだと？　素人には無理だぞ"
victory5 = "ふー。　いい汗だった"
victory6 = "もっと強い相手に挑戦したい"
victory7 = "なんだと！彼女はここにもいないと？"

;---------------------------------------------------------------------------
; 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).
;var 3 =  
;var 4 = dirrection presses 1/X values
;var 5 = charging power / button held
;var 6 = dirrection presses 2/Y values
;var 7 = N/A
;var 8 = Ball bouncer
;var 9 = floating
;var 10 = chest tracking variable
;var 18 = rapid button presses for power
;
;var 28 = charge beam charged
; 
; fvar 2 = button presses
; fvar 4 = screw attack X
; fvar 6 = screw attack y
; fvar 14 = Const(size.xscale) ;used for positioning projectiles
; fvar 20 - 29 = whip helper positions







;---------------------- Integer variable list ----------------------

; var(1):= -1 - Don't remove the following line. It's required by the CMD standard.
;var(11):= -1 - Don't remove the following line. It's required by the CMD standard.

;---------------------- Float variable list ----------------------
















;---------------------------------------------------------------------------
; Lose by Time Over 
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

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

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

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

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

[State 181, Intro]
type = AssertSpecial
trigger1 = 1
flag = roundnotover

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

[State 181, Fim]
type = ChangeState
trigger1 = AnimTime = 0
value = 0

;---------------------------------------------------------------------------
;Metroid Introduction 
[Statedef 191]
type = S
ctrl = 0
anim = 190
velset = 0,0

[state - 2, Samus scale] 
type = VarSet
trigger1 = time = 0
trigger1 = fvar(14) = 0
fv = 14    ;fv = 10
value = Const(size.xscale)

[State 191, 1] 
type = ChangeAnim
triggerall = Time = 0
trigger1 = RoundState = 0
trigger1 =  enemy, name = "Ryu" && enemy, authorname = "GGN & Odb718"
value = 192

[State 191, 1]  
type = ChangeAnim
triggerall = Time = 0
trigger1 = RoundState = 0
trigger1 =  enemy, name != "Ryu" && enemy, authorname != "GGN & Odb718"
value = 190

[State 191, 2]  
type = AssertSpecial
trigger1 = 1
flag = Intro
 
[State 191, Snd 1]
type = null; PlaySnd
trigger1 = AnimElem = 7
value = F5,2
volume = -40

[State 191, Snd 2]
type = null; PlaySnd
trigger1 = AnimElemTime(7) = 3
value = F5,3
volume = -80
 
[State 3500, helper]
type=Helper
trigger1 = time = 0
trigger1 = anim != 192
name="Metroid Intro"
ID=191
pos=floor(-150*fvar(14)),0 
postype=p1
stateno=3599
helpertype=normal
keyctrl=0
ownpal=1 

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

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

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

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


;---------------------------------------------------------------------------
;Light Punch 
[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 = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 210.0, 210.0, cond(fvar(16) > 300.0,300.0, fvar(16))) ;*fvar(14)
persistent = 1

;(target,const(size.ground.front)-10),var(12)-floor(p2dist y)


[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 20,0
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 = 1, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 8, 8                 ;Time attacker pauses, time opponent shakes
guard.sparkno = s7001
sparkno = s7000 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
hitsound = 5, 0                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -16            ;Velocity at which opponent is pushed
airguard.velocity = -7.6,-3.2    ;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 = -5.6,-12          ;X-velocity at which opponent is pushed,
;Y-velocity at which opponent is pushed
air.hittime = 15                 ;Time before opponent regains control in air

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

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

;---------------------------------------------------------------------------
;medium punch 
[Statedef 220]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 30
ctrl = 0
velset = 0,0
anim = 220
sprpriority = -1
  
[State 220, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 255.0, 255.0, cond(fvar(16) > 385.0,385.0, fvar(16))) ;*fvar(14)
persistent = 1

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
trigger1 = animelem >= 5
fv = 17
value = -85 ;*fvar(14)
persistent = 1
[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
trigger1 = animelem = 4
fv = 17
value = -245.0 
persistent = 1
[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
trigger1 = animelem = 3
fv = 17
value = -380.0 
persistent = 1

[State 0, Width]
type = Width 
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (4) < 0)
edge = 150,0 
player = 150,0 

[State 0, Width]
type = Width 
trigger1 = (AnimElemTime (4) >= 0) && (AnimElemTime (12) < 0)
edge = 245,0 
player = 245,0 

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

[State 220, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage = 29,2
priority = 2,hit
guardflag = MA
pausetime = 12,12  
sparkno = s7010 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(fvar(17)*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14))
;sparkxy=1, ifelse(P2BodyDist X<124,ifelse(P2BodyDist Y<-38,-88,ifelse(P2BodyDist X>171,ifelse(P2BodyDist Y<-73,-123,ceil(P2BodyDist Y-50)),ceil(P2BodyDist Y-50))),-88)
guard.sparkno = s7011
hitsound   = 5,2 
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 220, 4]
type = SprPriority
trigger1 = AnimElem = 5
value = 2

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

;-----------------------------------------------------------------------------
;Fierce Punch
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 30
ctrl = 0
velset = 0,0
anim = 244
sprpriority = -1
 
[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 210.0, 210.0, cond(fvar(16) > 340.0,340.0, fvar(16))) ;*fvar(14)
persistent = 1

[State 0, Width]
type = Width
trigger1 = anim = 244
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (7) < 0)
edge = 50,0;145
player = 50,0;145

[State 0, Width]
type = Width
trigger1 = anim = [240,242]
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (18) < 0)
edge = 180,0;45
player = 180,0;45
[State 0, Width]
type = Width
trigger1 = anim = [240,242]
trigger1 = (AnimElemTime (18) >= 0) && (AnimElemTime (21) < 0)
edge = 125,0;45
player = 125,0;45
[State 0, Width]
type = Width
trigger1 = anim = [240,242]
trigger1 = (AnimElemTime (18) >= 0) && (AnimElemTime (29) < 0)
edge = 95,0;145
player = 95,0;145
;value = 0,0
;ignorehitpause = 
;persistent = 


[State 240, 1]
type = PlaySnd
triggerall = Anim != 244
trigger1 = AnimElem = 2
value = 0, 4
  
[State 240, VarSet]
type = VarSet
trigger1 = command = "holdup"  
trigger1 = command != "holdz"
trigger2 = command = "holdup" 
trigger2 = time = 46
trigger3 = command = "holdupfwd"  
trigger3 = command != "holdz"
trigger4 = command = "holdupfwd" 
trigger4 = time = 46
v = 4    ;fv = 10
value = 242  

[State 240, VarSet]
type = VarSet
trigger1 = command = "holddown"
trigger1 = command != "holdz"
trigger2 = command = "holddown"
trigger2 = time = 46
trigger3 = command = "holddownfwd" 
trigger3 = command != "holdz"
trigger4 = command = "holddownfwd"
trigger4 = time = 46
v = 4    ;fv = 10
value = 240 

[State 240, VarSet]
type = VarSet
triggerall = command != "holddown"
triggerall = command != "holddownfwd" 
triggerall = command != "holdup"  
triggerall = command != "holdupfwd" 
trigger1 = command != "holdz" 
trigger2 = time = 46 
v = 4    ;fv = 10
value = 241 
 
[State 240, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 244
trigger1 = command != "holdz"
trigger2 = time = 47
value = var(4) 
 

[State 240, VarSet]
type = VarSet
trigger1 = time = 0
v = 5   
value = 1 

[State 240, VarAdd]
type = VarAdd
triggerall = Anim = 244
trigger1 = time = 10   
trigger2 = time = 16 
trigger3 = time = 23 
trigger4 = time = 35 
trigger5 = time = 46 
v = 5   
value = 5
 

[State 1002, Trilha de poeira]
type = Helper
triggerall = anim = 244
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Trilha de Poeira"
postype = P1
pos = -225,11
stateno = 8050
ownpal = 1
persistent = 0
size.xscale = 3
size.yscale= 3

[State 9980, 8burst] ;Odb718 random
type = Explod 
trigger1 = anim = 244
trigger1 = animelem = 2
anim =9980
ID = 9980
pos = Floor(-130*fvar(14)),Floor(-215 *fvar(14)) 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 1.2*fvar(14),1.2*fvar(14) ;makes it Samus's size
sprpriority = 9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 9980, 8burst] ;Odb718 random
type = Explod
triggerall = anim = 244
trigger1 = animelem = 5
trigger2 = animelem = 6
trigger3 = animelem = 7
trigger4 = animelem = 8 
anim =9980
ID = 9980
pos = Floor(-130*fvar(14)),Floor(-215 *fvar(14)) 
random = 80,80 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 1.0*fvar(14),1.0*fvar(14) ;makes it Samus's size
sprpriority = ifelse(random>500, -9, 9)
ontop =  ifelse(random>500, 1, 0)
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 1200, Poeira]
type = Explod
triggerall = Anim != 244
trigger1 = AnimElem = 1
anim = 8020
ID = 8020
postype = P1
pos = -90,-4 
scale = 1.0 * (var(5) / 20.0) + 3.01,1.0 * (var(5) / 20.0) + 3.01 ;rajaa
sprpriority = -7
ownpal = 1

[State 1200, Poeira]
type = Explod
triggerall = Anim != 244
trigger1 = AnimElem = 1
anim = 8020
ID = 8020
postype = P1
pos = -90,-4
scale = 1.0 * (var(5) / 20.0) + 3.01,1.0 * (var(5) / 20.0) + 3.01 ;rajaa
sprpriority = 7
ownpal = 1
 

[State 240, 2]
type = HitDef
trigger1 = anim != 244
trigger1 = anim = 240 ;low
trigger1 = AnimElem = 3
attr = S, NA
priority = 3,hit
animtype  = Medium 
damage    = 28+var(5)
guardflag = MA
pausetime = 12,12
sparkno = s7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-90*fvar(14)) 
;sparkxy = floor(P2Dist X-(320*fvar(14))), floor(-60*fvar(14))
guard.sparkno = s7021
hitsound   = 5,2
guardsound = 6,0
ground.type = low 
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22-var(5)
air.velocity = -10-var(5),-16
forcenofall = 1

[State 240, 2]
type = HitDef
trigger1 = anim != 244
trigger1 = anim = 241 ;mid
trigger1 = AnimElem = 3
attr = S, NA
animtype  = heavy;Medium 
damage    = 28+var(5)
guardflag = MA
pausetime = 12,12
sparkno = s7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-180*fvar(14)) 
;sparkxy = floor(P2Dist X-(330*fvar(14))), floor(-180*fvar(14))
;sparkxy = -40, -260 
guard.sparkno = s7021
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22-var(5)
air.velocity = -10-var(5),-16
forcenofall = 1
 
[State 240, 2]
type = HitDef
trigger1 = anim != 244
trigger1 = anim = 242 ;high
trigger1 = AnimElem = 3
attr = S, NA
animtype =heavy;Up;ifelse( var(5)=25,Up,heavy)
air.animtype = Up
fall.animtype = Up 
damage    = 28+var(5)
guardflag = MA
pausetime = 12,12
sparkno = s7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(310*fvar(14))), floor(-270*fvar(14))
guard.sparkno = s7021
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22-var(5),-var(5)
air.velocity = -10-var(5),-16-var(5)
forcenofall = 1
 
[State 240, 4]
type = SprPriority
trigger1 = AnimElem = 5
value = 2

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

;---------------------------------------------------------------------------
;light kick 
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 11
ctrl = 0
velset = 0,0
anim = 210
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 135.0, 135.0, cond(fvar(16) > 305.0,305.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
priority = 1,hit
animtype  = light;Medium
damage = 20,0
guardflag = MA
pausetime = 12,12
sparkno = s7000 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14))
guard.sparkno = s7001
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 14
ground.velocity = -20
air.velocity = -10,-14


[State 210, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 16
value = 1

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

;---------------------------------------------------------------------------
;medium kick 
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 230
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 130.0, 130.0, cond(fvar(16) > 360.0,360.0, fvar(16))) ;*fvar(14)
persistent = 1

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


[State 230, 2]
type = HitDef
trigger1 = Time = 0
attr = S, NA
priority = 2,hit
animtype  = Medium
damage = 29,2
guardflag = MA
pausetime = 12,12
sparkno = s7010 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14))
guard.sparkno = s7011
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -24
air.velocity = -8.8,-12.8

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

[State 210, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 17
value = 1

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

;---------------------------------------------------------------------------
;fierce kick 
[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 250
sprpriority = 2
 
[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 125.0, 125.0, cond(fvar(16) > 265.0,265.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 250, Hitdef]
type = HitDef
trigger1 = AnimElem = 3 
attr = S, NA
priority = 3,hit
animtype  = heavy;Medium
damage = 38,2
guardflag = MA
pausetime = 12,12
sparkno = s7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14))
guard.sparkno = s7021
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -24
air.velocity = -8.8,-12.8 
 
[State 250, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 48

[State 210, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 24
value = 1

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

;---------------------------------------------------------------------------
;fierce kick 
[Statedef 251]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 251
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 225.0, 225.0, cond(fvar(16) > 385.0,385.0, fvar(16))) ;*fvar(14)
persistent = 1

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


[State 1200, Poeira]
type = Explod 
triggerall = !movehit
trigger1 = AnimElem = 20
anim = 8060
ID = 8060
postype = P1
pos = 485,11
scale = 2,2
sprpriority = 7
ownpal = 1

[State 251, Hitdef]
type = HitDef
trigger1 = AnimElem = 10
trigger2 = AnimElem = 15
trigger3 = AnimElem = 17
attr = S, NA
priority = 3,hit
animtype  = Medium
damage = 15,1
damage    = 7
guardflag = MA
pausetime = 12,12
sparkno = s7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14))
guard.sparkno = s7021
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -24
air.velocity = -8.8,-12.8
 
[State 251, 3]
type = PosAdd
trigger1 = AnimElem = 7
x = 48

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

;---------------------------------------------------------------------------
;Crouching light punch 
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 8
ctrl = 0
anim = 400
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 90.0, 90.0, cond(fvar(16) > 220.0,220.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage = 20,2
priority  = 1,hit
animtype  = Light
hitflag = MAF
guardflag = L
pausetime = 10,11
sparkno = s7000
guard.sparkno = s7001  
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-40*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-40*fvar(14))
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 6
ground.hittime  = 9
ground.velocity = -16
air.velocity = -6,-12

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

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

;---------------------------------------------------------------------------
;Crouching Medium punch 
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 420
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 100.0, 100.0, cond(fvar(16) > 195.0,195.0, fvar(16))) ;*fvar(14)
persistent = 1

[State 420, 1]
type = PlaySnd
trigger1 = Time = 1
value = 0, 0
 
[State 420, 2]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
priority = 2,hit
damage = 29,2
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = s7010
guard.sparkno = s7011 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-40*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-40*fvar(14))
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -16
air.velocity = -12,-16
 
[State 420, 3]
type = null;HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage    = 36
animtype  = Medium
hitflag = MAF
guardflag = MA
pausetime = 12,12
sparkxy = -40,-332
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -28
air.velocity = -12,-16

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

;---------------------------------------------------------------------------
;Crouching Fierce punch 
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 25
ctrl = 0
anim = 440
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 150.0, 150.0, cond(fvar(16) > 260.0,260.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 440, Blasts]
type = PlaySnd 
trigger1 = AnimElem = 6 
value = 6, 0 

[State 440, Explod]
type = Explod
trigger1 = AnimElem = 6 
anim = 11244
ID =  10420
pos = 280,0; 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0 
accel = 0,0
random = 0,0
removetime = -2
scale = 2,2
sprpriority = 6
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause = 
;persistent = 

[State 440, Explod]
type = Explod
trigger1 = AnimElem = 6 
anim = 11244
ID =  10420
pos = 280,0; 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0 
accel = 0,0
random = 0,0
removetime = -2
scale = 2,2
sprpriority = -6
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause = 
;persistent = 
  

[State 440, HitDef]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
priority = 3,hit
damage = 38,2
animtype = Up
air.animtype = Up
fall.animtype = Up
;animtype = Heavy
guardflag = M
hitflag = MAF 
pausetime = 12,10
sparkno = S7020 
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-72*fvar(14)) 
;sparkxy = floor(P2Dist X-(12*fvar(14))), floor(-72*fvar(14))
guard.sparkno = S7021
hitsound = S10,2
guardsound = S13,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 40
ground.velocity = 0,-46
air.hittime = 28
air.velocity = -4,-32


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

;---------------------------------------------------------------------------
;Crouching light kick 
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 5
poweradd= 11
ctrl = 0
anim = 410
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 35.0, 35.0, cond(fvar(16) > 180.0,180.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 410, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
priority = 1,hit
damage = 20,2
animtype  = Light
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-32*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-32*fvar(14))
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 8
ground.hittime  = 10
ground.velocity = -20
air.velocity = -8,-12
down.velocity = -20,0
down.hittime = 22

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

;---------------------------------------------------------------------------
;Crouch Medium Kick 
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 35
ctrl = 0
anim = 431
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 135.0, 135.0, cond(fvar(16) > 360.0,360.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 430, 3]
type = HitDef
trigger1 = Time = 0 
attr = C, NA
priority = 2,hit
damage = 29,2
animtype  = Medium
hitflag = MAF
guardflag = M
pausetime = 12,12
sparkno = s7010  
guard.sparkno = s7011
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-220*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-220*fvar(14))
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 14
ground.hittime  = 17
ground.velocity = -16
air.velocity = -12,-16

[State 430, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1
;---------------------------------------------------------------------------
;Crouch Fierce Kick 
[Statedef 450]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 35
ctrl = 0
anim = 450
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 110.0, 110.0, cond(fvar(16) > 300.0,300.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 450, Poeira]
type = Explod  
trigger1 = AnimElem = 3
anim = 8057
ID = 8057
postype = P1
pos = 0,28
scale = 4,4
sprpriority = 7
ownpal = 1

[State 9980, 8burst] ;Odb718 random
type = Explod 
trigger1 = animelem = 4
anim =9980
ID = 9980
pos = Floor(-150*fvar(14)),Floor(-15 *fvar(14)) 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 1.2*fvar(14),1.2*fvar(14) ;makes it Samus's size
sprpriority = -9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0

[State 450, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
priority = 3,hit
damage = 38,2
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkno = s7020
guard.sparkno = s7021  
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-40*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-40*fvar(14))
hitsound   = 5,2
guardsound = 6,0
ground.type = Trip
ground.slidetime = 12
ground.hittime  = 17
ground.velocity = -6,-8
air.velocity = -4.8,-12
guard.velocity = -20
fall = 1

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

;---------------------------------------------------------------------------
;Jump Light Punch 
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 5
ctrl = 0
anim = 600
sprpriority = 2

[State 600, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 95.0, 95.0, cond(fvar(16) > 210.0,210.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 600, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 20,2
guardflag = HA
priority = 1,hit
pausetime = 7,8
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-232*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-232*fvar(14))
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 7
ground.hittime  = 8
ground.velocity = -16
air.velocity = -5.2,-12
air.hittime = 14

[State 600, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 11
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Strong Punch 
[Statedef 620]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 620
sprpriority = 2

[State 620, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 115.0, 115.0, cond(fvar(16) > 230.0,230.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 620, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 29,2
guardflag = HA
priority = 2,hit
pausetime = 12,12
sparkno = s7010  
guard.sparkno = s7011
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-217*fvar(14)) 
;sparkxy = floor(P2Dist X-(217*fvar(14))), floor(-217*fvar(14))
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -24
air.velocity = -12,-16

[State 620, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 16
value = 1


[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Fierce Punch 
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 640
sprpriority = 2

[State 640, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < -170.0, -170.0, cond(fvar(16) > 220.0,220.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 9980, 8burst] ;Odb718 random
type = Explod 
trigger1 = animelem = 6
anim =9980
ID = 9980
pos = Floor(165*fvar(14)),Floor(-155 *fvar(14)) 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 1.2*fvar(14),1.2*fvar(14) ;makes it Samus's size
sprpriority = -9
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0


[State 640, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 38,2
guardflag = HA
priority = 3,hit
pausetime = 12,12
sparkno = s7020  
guard.sparkno = s7021
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-220*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-220*fvar(14))
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -24
air.velocity = -12,-16

[State 640, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 20
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Light Kick 
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 10
ctrl = 0
anim = 610
sprpriority = 2

[State 610, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 75.0, 75.0, cond(fvar(16) > 235.0,235.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 610, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 20,2
guardflag = HA
priority = 1,hit
pausetime = 8,8
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-260*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-140*fvar(14)) 
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 8
ground.hittime  = 10
ground.velocity = -16
air.velocity = -8,-12
air.hittime = 14

[State 610, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 13
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Light Knee 
[Statedef 611]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 10
ctrl = 0
anim = 611
sprpriority = 2

[State 200, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 60.0, 60.0, cond(fvar(16) > 95.0,95.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 611, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 20,0
guardflag = HA
priority = 1,hit
pausetime = 8,8
sparkno = 1
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-140*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-140*fvar(14)) 
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 8
ground.hittime  = 10
ground.velocity = -16
air.velocity = -8,-12
air.hittime = 14

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699


;---------------------------------------------------------------------------
;Face Stomp 
[Statedef 612]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 10
ctrl = 0
anim = 612
sprpriority = 2

[State 612, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 70.0, 70.0, cond(fvar(16) > 140.0,140.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 612, 2]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 10,0
guardflag = HA
priority = 2,hit
pausetime = 8,8
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-140*fvar(14)) 
;sparkxy = floor(P2Dist X-(20*fvar(14))), floor(-140*fvar(14)) 
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 8
ground.hittime  = 10
ground.velocity = -16
air.velocity = -8,-12
air.hittime = 14

[State 612, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 9
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Strong Kick 
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 630
sprpriority = 2

[State 630, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 110.0, 110.0, cond(fvar(16) > 310.0,310.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State 630, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage = 29,2
guardflag = HA
priority = 2,hit
pausetime = 12,12
sparkno = s7000  
guard.sparkno = s7001
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-160*fvar(14)) 
;sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-160*fvar(14))  
hitsound   = 5,3
guardsound = 6,0
animtype = Med
ground.type = High
ground.slidetime = 14
ground.hittime  = 15
ground.velocity = -28
air.velocity = -12,-16

[State 650, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 23
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Jump Fierce Kick
[Statedef 650]
type    = A
movetype= A
physics = A
juggle  = 4
poweradd= 30
ctrl = 0
anim = 650
sprpriority = 2

[State 650, SparkXpos]
type = VarSet
trigger1 = time%1 = 0 
fv = 15
value = cond(fvar(16) < 15.0, 15.0, cond(fvar(16) > 230.0,230.0, fvar(16))) ;*fvar(14)
persistent = 1

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

[State -2, VarSet]
type = VarSet
trigger1 = var(18) = 0
v = 30    ;fv = 10
value = 0
;ignorehitpause = 
;persistent = 

[State 650, 1]
type = HitDef
TriggerAll=!movecontact && !movereversed
Trigger1=animelem=7
Trigger2=animelem=8
Trigger3=animelem=9
Trigger4=animelem=10
attr = S, NA
damage = 40
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 10
sparkno = s7020  
guard.sparkno = s7021
sparkxy = floor(p2dist x - fvar(15)*fvar(14)), floor(-53*fvar(14))  
;sparkxy = floor(P2Dist X-(10*fvar(14))), floor(-53*fvar(14))  
hitsound   = 5,3
guardsound = 6,0
guard.slidetime = 11
guard.hittime = 11
guard.velocity = -13
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
air.type = High
air.velocity = ifelse(AnimElemNo(0) > 8,0,ifelse(AnimElemNo(0) < 8,-12,-8)),ifelse(AnimElemNo(0) < 9,6,12);12
airguard.velocity = -1.9,-.8
air.fall = 1
fall.recover = 0
fall.envshake.time = 10
fall.envshake.ampl = 5
fall.xvelocity = -5
fall.yvelocity = 0

[State 650, Ctrl]
type = CtrlSet
trigger1 = AnimElem = 13
value = 1

[State 699, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 699

;---------------------------------------------------------------------------
;Air Attack Falling
[Statedef 699]
type    = A
movetype= I
physics = A
anim = 44
sprpriority = 1
ctrl = 1
 
[State 699, Ctrl]
type = null;CtrlSet
trigger1 = prevstateno = 4100
value = 0
  
[State 699, Turn]
type = Turn
trigger1 = P2Dist X < -5

[State 699, VelSet]
type = VelSet
trigger1 = FrontEdgeBodyDist <= 0
x = 0

[State 699, ChangeState]
type = ChangeState
trigger1 = (Pos Y >= 0) && (Vel Y > 0)
value = 52


;---------------------------------------------------------------------------
;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 = 1009       ;On success, KFM changes to state 810
p2stateno = 10008;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 = 0
 
[State 810, Holding fwd?]
type = VarSet
trigger1 = Time = 0
var(2) = command = "holdfwd"

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

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

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemTime(2) < 0
pos = 112, 0

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

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

[State 810, Bind 5]
type = TargetBind
trigger1 = AnimElemTime(5) >= 0 && AnimElemTime(6) < 0
pos = 188, 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 = -148

[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 = 164, -240

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

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

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

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

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

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

[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
 
[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 = 11.2,-28
poweradd = 40

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

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -80
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



;---------------------------------------------------------------------------
;Air Throw - P1
[Statedef 850]
type    = A
movetype= A
physics = N
anim = 850
velset = 0,0

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 1
;ignorehitpause = 
;persistent = 

[State 850, Agarrão]
type = null;PlaySnd
trigger1 = Time = 0
value = S4,2

[State 850, IA!]
type = null;PlaySnd
trigger1 = AnimElem = 3
value = S2,5

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 5
x = 3
y = -9

[State 850, VelAdd]
type = VelAdd
trigger1 = Time >= 30
y = 0.5

[State 850, TargetBind]
type = TargetBind
trigger1 = Time = 1
pos = 0, 0
 
[State 850, TargetState]
type = TargetState
trigger1 = Time = 14
value =  852

[State 850, ai!]
type = TargetLifeAdd
trigger1 = AnimElem = 7
value = -120


[State 850, CtrlSet]
type = CtrlSet
trigger1 = AnimElem = 19
value = 1 

[State 5210, 2] ;Turn if not facing opponent
type = Turn 
trigger1 = animelem >= 26
trigger1 = p2dist X < Const720p(-80)


[State 850, Fim]
type = ChangeState
trigger1 = Pos Y >= 0
value = 52
ctrl = 1

;---------------------------------------------------------------------------
;Air Throw - P2 a
[Statedef 851]
type    = A
movetype= H
physics = N
velset = 0,0

[State 0, SprPriority]
type = SprPriority
trigger1 = animelem = 1
value = -2
;ignorehitpause = 
;persistent = 
[State 0, SprPriority]
type = SprPriority
trigger1 = animelem = 6
value = 5
;ignorehitpause = 
;persistent = 


[State 851, ChangeAnim2]
type = ChangeAnim2
Trigger1 = Time = 0
value = 851
 ;------------------------------ 
;Air Throw - P2 b
[Statedef 852]
type    = A
movetype= H
physics = N
velset = 2,29

[State 325, 0]
type = null;velset
trigger1 = time = 0
x = 2
y = 29
[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 1
sysvar(1) = floor(vel y)

[State 852, HitBy]
type = null;HitBy
trigger1 = TIME = 0
value = SCA, SP, NP
  
[State 852, VelAdd]
type = VelAdd
trigger1 = Time >= 0
y = .5 
[State 0, EnvShake]
type = EnvShake
trigger1 = Pos Y >= 0 
time = 20
freq = 110
ampl = -13
phase = 90
;ignorehitpause = 
;persistent = 
 




[State 10009, 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 10009, 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 10009, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground








[State 852, SelfState]
type = null;SelfState
trigger1 = Pos Y >= 0
trigger2 = Anim = 851
trigger2 = animelem = 9 
trigger3 = time = 4
value = 5050
 
;---------------------------------------------------------------------------
;Air Throw attempt
[Statedef 855]
type    = A
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 898
sprpriority = 2

[State 855, HitDef]
type = HitDef
trigger1 = Time = 0
attr = A, NT
hitflag = A-
priority = 1, Miss
sparkno = -1 
p2facing = 1
p1facing = ifelse(command = "holdfwd",1,-1)
p1stateno = 850
p2stateno = 851
;p2getp1state = 1
;yaccel = 0.55
;guard.dist = 0
;fall.xvelocity = 0
;fall.yvelocity = 1
fall = 1
;fall.recover = 0
;fall.damage = 0

[State 855, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA

[State 855, ChangeState]
type = ChangeState
Trigger1 = AnimTime = 0
value = 699
ctrl = 1

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


;---------------------------------------------------------------------------
;Catch
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1000
sprpriority = 3


[State 1000, Poeira]
type = Explod  
trigger1 = anim = 1000
trigger1 = AnimElem = 5
anim = 8064
ID = 8064
postype = P1
pos = -190,11
scale = 4,4
sprpriority = -7
ownpal = 1
[State 1000, Poeira]
type = Explod  
trigger1 = anim = 1000
trigger1 = AnimElem = 5
anim = 8064
ID = 8064
postype = P1
pos = -190,11
scale = 4,4
sprpriority = 7
ownpal = 1

[state 1000, SlapCounter]
type = varset 
trigger1 = time = 0
fv = 2
value = 0
 
[State 1001, CS1]
type = ChangeState
triggerall = P2BodyDist X >= floor(155*fvar(14))  && P2BodyDist X <= floor(157*fvar(14)); [188.9,190.00] 
trigger1 = command = "Dirtythrow2"
value = 1008
ctrl = 0

[State 1000, NHB]
type = NotHitBy
trigger1 = movehit
trigger2 = anim = 1002
value = SCA
time = 1
persistent = 1

[State 1000, Poeira]
type = Explod  
trigger1 = anim = 1000
trigger1 = AnimElem = 3
anim = 1090
ID = 1090
postype = P1
pos = 0,0
scale = fvar(14),fvar(14)
sprpriority = 4
ownpal = 1
ignorehitpause = 1

[State 1000, Poeira]
type = Explod  
trigger1 = anim = 1000
trigger1 = AnimElem = 3
anim = 1091
ID = 1090
postype = P1
pos = 0,0
scale = fvar(14),fvar(14)
sprpriority = 4
ownpal = 1
ignorehitpause = 1

[State 1000, Poeira]
type = Explod  
trigger1 = anim = 1000
trigger1 = AnimElem = 3
anim = 1092
ID = 1090
postype = P1
pos = 0,0
scale = fvar(14),fvar(14)
sprpriority = 4
ownpal = 1
ignorehitpause = 1

[State 1000, RemoveExplod]
type = RemoveExplod
trigger1 = movehit || movecontact
trigger2 = anim = 1002
trigger3 = P2BodyDist X =  [188.9,190.00] 
trigger3 = animelem >= 17
id = 1090
ignorehitpause = 1  


[State 1000, Width]
type = Width
trigger1 = anim = [1000,1002]
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (18) < 0)
edge = 350,0;45 

[State 1000, sound]
type = null;PlaySnd
trigger1 = anim = 1000
trigger1 = Time = 2
value = 0, 1

[State 1000, Whip]
type = Helper
trigger1 = anim = 1000
trigger1 = animelem = 17
helpertype = normal ;player
name = "whip"
ID = 10001
stateno = 10001
pos = floor(fvar(14)*253), floor(fvar(14)*-159)
postype = p1 
facing = 1
keyctrl = 0
ownpal = 0 

[State 1000, HitDef]
type = HitDef
trigger1 = anim = 1000
trigger1 = animelem = 1
attr = S, NA
animtype  = Medium
damage    = 5
guardflag = MA
pausetime = 12,12
sparkno = s7010  
sparkxy = floor(P2Dist X-(40*fvar(14))), floor(-260*fvar(14)) 
guard.sparkno = s7011
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 0;15;ifelse(guarded = 1,0,15)
ground.hittime  = 30;ifelse(guarded = 1,0,20)
ground.velocity = 0,0
air.velocity = 0,0 
p1sprpriority = 3
p2stateno = 10002;3240

 

[State 1000, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1000
trigger1 = movehit
trigger2 = (numhelper(10001) >= 1)
trigger2 = helper(10001), movehit
trigger3 = anim = 1001
trigger3 = AnimTime = 0
value = 1002 
ignorehitpause = 0 


[state 10002, buttons]
type = Changestate;ChangeAnim
triggerall = anim != 1000
triggerall = P2BodyDist X =  [188.9,190.00]
triggerall = p2stateno = [10002,10003]
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
value = 1001 
ctrl = 0
 
[State 1000, CS3]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = anim = 1000
trigger2 = anim = 1002
trigger2 = p2stateno != [10002,10003];time = 205
trigger3 = Roundstate > 2 
value = 1005
ctrl = 1

;---------------------------------------------------------------------------
;Catch Slap
[Statedef 1001] 
type = C       ;S,A,C,L
movetype = A        ;I,A,H
physics = C         ;A,C,S,N
juggle  = 0
poweradd= 5
ctrl = 0
velset = 0,0
anim = 1001
sprpriority = 3

[State 1001, 4]
type = TargetState
triggerall = fvar(2) < 8
trigger1 = command = "Dirtythrow2"
value = 10008

[State 1001, 4]
type = ChangeState
triggerall = fvar(2) < 8
trigger1 = command = "Dirtythrow2"
value = 1009
ctrl = 0
[state 10003, SlapCount]
type = varadd
trigger1 = anim = 1001
trigger1 =AnimElemTime(1) = 1  ; animelem = 1 
fv = 2
value = 1
persistent = 1


[State 181, 1]
type = NotHitBy
trigger1 = movehit
trigger2 = anim = 1001
trigger3 = anim = 1002
value = SCA
time = 1
persistent = 1

[State 0, Width]
type = Width
trigger1 = anim = [1000,1002]
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (18) < 0)
edge = floor(290*fvar(14)),0;45 

[State 1001, 1]
type = PlaySnd
trigger1 = anim = 1000
trigger1 = Time = 2
value = 0, 1
  

[State 1001, 2]
type = HitDef 
trigger1 = anim = 1001
trigger1 = (AnimElemTime (1) >= 0) && (AnimElemTime (3) < 0)
attr = C, HT
animtype  = light
damage    = 50
guardflag = MA
pausetime = 12,12
sparkno = s7010  
;sparkxy = floor(P2Dist X-(40*fvar(14)))*-1, floor(-260*fvar(14))  
sparkxy = floor(P2Dist X-310), floor(-260*fvar(14))  
sparkxy = floor(P2Dist X)-(250*fvar(14)), floor(-260*fvar(14))  
guard.sparkno = s7011
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 0;15;ifelse(guarded = 1,0,15)
ground.hittime  = 30;ifelse(guarded = 1,0,20)
ground.velocity = 0,0
air.velocity = 0,0 
p1sprpriority = 3
p2stateno = ifelse(p2stateno = 10002 , 10003, ifelse(p2stateno = 10003 , 10003,10005))
 
[State 1001, ChangeAnim]
type = ChangeAnim
trigger1 =  anim = 1001
trigger1 = AnimTime = 0
value = 1002 
ignorehitpause = 0 

[state 1001, buttons]
type = ChangeAnim 
triggerall = P2BodyDist X =  [188.9,190.00]
triggerall = p2stateno = [10002,10003]
triggerall =anim = 1002 || (anim = 1001 && (AnimElemTime (9) >= 0))
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
value = 1001 
ignorehitpause = 0



[State 1001, 4]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = anim = 1000
trigger2 = anim = 1002
trigger2 = p2stateno != [10002,10003] 
trigger3 = fvar(2) > 7
trigger4 = Roundstate > 2 ;Seravy @ MFG
value = 1005
ctrl = 1

;---------------------------------------------------------------------------
;Catch Break
[Statedef 1005] 
type = S       ;S,A,C,L
movetype = A        ;I,A,H
physics = S         ;A,C,S,N  
ctrl = 0
velset = 0,0
anim = 1005
sprpriority = 3
 
[state 1005, detract]
type = varset
trigger1 = time = 0 
fv = 2
value = 0

[State 0, Width]
type = Width
trigger1 = anim = 1005
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (5) < 0)
edge = 100,0;45 

[State 1001, 1]
type = PlaySnd
trigger1 = anim = 1000
trigger1 = Time = 2
value = 0, 1
   
[State 1001, 4]
type = ChangeState
trigger1 = AnimTime = 0  
value = ifelse(command != "holddown",0,11)
ctrl = 1

;-------------------------------------------------------------------------
;Dirty Throw Try (P1)
[Statedef 1008]
type = S
movetype= A
physics = S
juggle = 0
velset = 0,0
ctrl = 0
anim = 1007

[State 1008, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M
priority = 1, Miss
sparkno = -1
;sprpriority = 1
p1facing = ifelse (command = "holdback", -1, 1)
p2facing = 1
p1stateno = 1009
p2stateno = 10008
fall = 1

[State 1008, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S3,0 
 
[State 1008, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1


;----------------------------------------------------------------------
;Catch Throw (P1)
[Statedef 1009]
type = S
movetype= A
physics = N
anim = 1009
poweradd = 60

[State 0, VarSet]
type = VarSet
triggerall = time = 0
trigger1 = command = "holdback" 
fv = 2    ;fv = 10
value = 33
;ignorehitpause = 
;persistent = 


[State 1009, Agarrão]
type = PlaySnd
trigger1 = Time = 0
value = S4,2

 
[State 1009, SprPriority]
type = SprPriority
trigger1 = AnimElem =1
value = 1 

[State 1009, SprPriority]
type = SprPriority
trigger1 = AnimElem =5
value = 3 

[State 1009, IA!]
type = PlaySnd
trigger1 = AnimElem = 4
value = S2,3 



[State 1009, Bind 1]
type = TargetBind
trigger1 = AnimElem = 1
pos = 225, -270

[State 1009, Bind 2]
type = TargetBind
trigger1 = AnimElem = 2
pos = 79, -308

[State 1009, Bind 3]
type = TargetBind
trigger1 = AnimElem = 3
pos = -95, -406

[State 1009, Bind 4]
type = TargetBind
trigger1 = AnimElem = 4
pos = -173, -486

[State 1009, Bind 5]
type = TargetBind
trigger1 = AnimElem = 5
pos = -141, -448

[State 1009, Bind 6]
type = TargetBind
trigger1 = AnimElem = 6
pos = -103, -436

[State 1009, Bind 7]
type = TargetBind
trigger1 = AnimElem = 7
pos = -55, -408

[State 1009, Bind 8]
type = TargetBind
trigger1 = AnimElem = 8
pos = -17, -400

[State 1009, Bind 9]
type = TargetBind
trigger1 = AnimElem = 9
pos = -5, -402

[State 1009, Bind 10]
type = TargetBind
trigger1 = AnimElem = 10
pos = -27, -432

[State 1009, Bind 11]
type = TargetBind
trigger1 = AnimElem = 11
pos = -153, -446

[State 1009, Bind 12]
type = TargetBind
trigger1 = AnimElem = 12
pos = -69, -488

[State 1009, Bind 13]
type = TargetBind
trigger1 = AnimElem = 13
pos = 209, -436

[State 1009, Bind 14]
type = TargetBind
trigger1 = AnimElem = 14
pos = 385, -390


[State 66166, VelSet]
type = null;VelSet
trigger1 = AnimElem = 14
x = -6
y = -6
[State 1009, Hurt]
type = TargetLifeAdd
trigger1 = AnimElem = 14
value = -30


[State 1009, jumps]
type = PlaySnd
trigger1 = AnimElem = 7
value = S4,5 

[State 1009, Throw]
type = TargetState
trigger1 = AnimElem = 15
value = 10009

[State 1009, ChangeState]
type = ChangeState
trigger1 = Animtime = 0
value = 0
ctrl = 1

;=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}
;=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}=]}

;---------------------------------------------------------------------------
;Light Punch 
[Statedef 299]
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 = 10                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)
 
[State 0, Helper]
type = Helper
trigger1 = time = 2
helpertype = normal ;player
name = "A1"
ID = 1010
stateno = 1010 
pos = floor(100*fvar(14)), floor(-200*fvar(14))
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0   


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

[State 299, 3]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;HELPER Whip 0A
[Statedef 1010]
type    = U
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 1094  
sprpriority = 2
velset = 0,0


[State Debug Display]
type = DisplayToClipboard
text = "posX = %f fV(10) = %f fV(3) = %f fV(20) =%f fV(4) =%f"
params =  pos x, fvar(10), fvar(3), fvar(20), fVar(4) 
trigger1 = 1
trigger2 = time%1 = 0



;{{{{{{{{{{{{{}}}}}}}}}}}}}}}
[State 0, Bx]
type = VarSet
trigger1 = 1
fv = 1   
value = pos x -( root,var(22) - (100*root,var(14)))
ignorehitpause = 1

[State 0, By]
type = VarSet
trigger1 = 1
fv = 2   
value = pos y -(root,var(32) - (200*root,var(14)))
ignorehitpause = 1 

[State 0, DistanceX]
type = VarSet
trigger1 = 1
fv = 10   
value =  fvar(1) - pos x
ignorehitpause = 1 
[State 0, DistanceY]
type = VarSet
trigger1 = 1
fv = 20   
value =  fvar(2) - pos y
ignorehitpause = 1 


[State 0, alpha] ; this is cos alpha
type = VarSet
trigger1 = 1
fv = 3  
value = tan( fvar(20)/ fvar(10))
ignorehitpause = 1 

[State 0, euclidean] ;this determines the euclidean distance... I hope
type = VarSet
trigger1 = 1
fv = 4  
value = fvar(10)/ cos(fvar(3))
ignorehitpause = 1 

;[State 0, VelSet]
;type = VelSet
;trigger1 = fvar(4) > 100
;x = 5
;y = 5

;{{{{{{{{{{{{{}}}}}}}}}}}}}}}



[State 0, Helper]
type = Helper
trigger1 = time = 2
helpertype = normal ;player
name = "A2"
ID = 1011
stateno = 1011 
pos = floor(root,var(22) -100),  floor(root,var(32) +200)
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0   
 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag =  noshadow 

[State 1010, DestroySelf]
type = DestroySelf
trigger1 =time = 349
;ignorehitpause = 
;persistent = 

 
;---------------------------------------------------------------------------
;HELPER Whip 0A
[Statedef 1011]
type    = U
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 1094  
sprpriority = 2
velset = 2,0
 
[State 0, Helper]
type = Helper
trigger1 = time = 12
helpertype = normal ;player
name = "A3"
ID = 1012
stateno = 1012 
pos = floor(root,var(22) -100),  floor(root,var(32) +200)
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 0
pausemovetime = 0   

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag =  noshadow 

[State 1011, DestroySelf]
type = DestroySelf
trigger1 = time = 349
;ignorehitpause = 
;persistent = 

;---------------------------------------------------------------------------
;HELPER Whip 0A
[Statedef 1012]
type    = U
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 1094  
sprpriority = 2
velset = 2,0

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow

[State 1011, DestroySelf]
type = DestroySelf
trigger1 =time = 349
;ignorehitpause = 
;persistent = 



;---------------------------------------------------------------------------
;HELPER Grab Whip 
[Statedef 10001]
type    = U
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 1097 ;1098;1098 for testing without hitting
sprpriority = 2
 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow 
 
[State 0, PosSet]
type = null;PosSet
trigger1 = time = 1
y =-160*fvar(14) 
x =158*fvar(14)  
ignorehitpause = 1
;persistent = 

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fv = 22    
value = 1 

[State 0, PosAdd]
type = PosAdd
trigger1 = time < 17
x = 21


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


[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 1099
ID = 1099
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 60 
;scale = fvar(14),fvar(14) ;makes it Samus's size
sprpriority = 9
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause = 
;persistent = 

[State 1004, HitDef]
type = HitDef     
trigger1 =  time = 1
attr = S, NA 
damage   = 60, 6
animtype = heavy
guardflag = MA
hitflag = MAF
pausetime = 0,0 
sparkno = s9990
guard.sparkno = s7001
sparkxy = 0,-100;floor(P2Dist X-(50*fvar(14))), 0;floor(-140*fvar(14)) 
ground.type = high
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.slidetime = 0;15;ifelse(guarded = 1,0,15)
ground.hittime  = 30;ifelse(guarded = 1,0,20)
ground.velocity = 0,0
air.velocity = 0,0
air.juggle = 3
sparkno = s9990
;hitsound   = s8000,3
p2stateno = 10002 
p1stateno = 10011 
kill = 0
p1sprpriority = 2

[State 10001, a6]
type = DestroySelf
trigger1 = Time >= 18
trigger2 = parent, anim != 1000

;=============================================================================================
;Helper Whip 2
[Statedef 10011]
type    = U
movetype= H
physics = N
ctrl = 0
velset = 0,0
 
[State -2, Gas Sjump fwd]
type = RemoveExplod
trigger1 = time = 0
id = 1099

[State 0, ChangeAnim] ;50 - 120 - 190
type = ChangeAnim
trigger1 = anim != 1095
trigger1 = ParentDist X >= -280
value = 1095  
ignorehitpause = 1
[State 0, ChangeAnim] ;50 - 120 - 190
type = ChangeAnim
trigger1 = anim != 1096
trigger1 = ParentDist X >= -220
value = 1096 
ignorehitpause = 1
;persistent = 


;fvar(20) = 1
[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = time%1 =0
fv = 22
value = ParentDist X ;pos x 

[State 0, PosAdd]
type = PosAdd
trigger1 = ParentDist X <= -171
x = -10


[State 10001, a6]
type = DestroySelf
trigger1 = parent, anim != 1002; Time >= 18
trigger2 = ParentDist X >= -171
 

;=============================================================================================
;Catch Victim 1
[Statedef 10002]
type    = S
movetype= H
physics = N
ctrl = 0
velset = 0,0

[State 0, PosSet]
type = PosSet
trigger1 = time = 0 
y = 0
ignorehitpause = 1 


[State 0, NotHitBy]
type = NotHitBy
trigger1 = time = 1
value = SA,NA,SA,HA,NP,SP,HP,NT,ST 
time = 1 


[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 1003 


[State 0, PosSet]
type = PosAdd
trigger1 = anim = 1003
trigger1 = P2BodyDist X <189; [208.9,210.00]
x =  ceil(189 - P2BodyDist X)*-1
persistent = 0
[State 0, PosAdd]
type = PosAdd
trigger1 = anim = 1003
trigger1 = P2BodyDist X = [190,199]
x = ceil(P2BodyDist X - 188) 
persistent = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = anim = 1003
trigger1 = P2BodyDist X > 199
x = 10;ceil(P2BodyDist X /33) 
persistent = 1

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = anim = 1003
trigger1 = P2BodyDist X = [188.9,190.00]
value = 1004 
 

[state 10002, choque]
type = varset
trigger1 = ctrl = 1 
trigger1 = time = 0
fv = 2
value = 0

[state 10002, buttons]
type = varadd 
triggerall = fvar(2) < 14
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
fv = 2
value = 2

[state 10002, detract]
type = varadd
trigger1 = time%4 = 0
trigger1 = fvar(18) > 0
fv = 2
value = -1
 
[State 10003, 4]
type = ChangeState
trigger1 = anim = 1004 
trigger1 = time = 150
trigger2 = fvar(2) > 13
trigger3 = p2stateno = 1005
value = 10005
ctrl = 1


;=============================================================================================
;Catch Slap Victim 
[Statedef 10003]
type    = S
movetype= H
physics = N 
velset = 0,0

[State 10003, ChangeAnim2]
type = ChangeAnim2
triggerall = fvar(2) < 14
trigger1 = time = 0
value = 1003 

[state 10003, choque]
type = null;varset
trigger1 = prevstateno != 10002
trigger1 = time = 0
fv = 2
value = 0

[State 10003, PosSet]
type = PosSet
triggerall = fvar(2) < 14
trigger1 = time = 0 
y = 0
ignorehitpause = 1
;persistent = 


[State 10003, NotHitBy]
type = NotHitBy
trigger1 = time = 1
value = SA,NA,SA,HA,NP,SP,HP,NT,ST 
time = 1 

[State 0, PosSet]
type = PosAdd
triggerall = fvar(2) < 14
trigger1 = anim = 1003
trigger1 = P2BodyDist X <189; [208.9,210.00]
x =  ceil(189 - P2BodyDist X)*-1
persistent = 0
[State 0, PosAdd]
type = PosAdd
triggerall = fvar(2) < 14
trigger1 = anim = 1003
trigger1 = P2BodyDist X = [190,199]
x = ceil(P2BodyDist X - 188) 
persistent = 1
[State 0, PosAdd]
type = PosAdd
triggerall = fvar(2) < 14
trigger1 = anim = 1003
trigger1 = P2BodyDist X > 199
x = 10;ceil(P2BodyDist X /33) 
persistent = 1

[State 10003, ChangeAnim2]
type = ChangeAnim2
triggerall = fvar(2) < 14
trigger1 = anim = 1003
trigger1 = P2BodyDist X = [188.9,190.00]
value = 1004 
 

[state 10003, buttons]
type = varadd 
triggerall = fvar(2) < 14
trigger1 = command = "a"
trigger2 = command = "b"
trigger3 = command = "c"
trigger4 = command = "x"
trigger5 = command = "y"
trigger6 = command = "z"
fv = 2
value = 2

[state 10003, detract]
type = varadd
trigger1 = time%4 = 0
trigger1 = fvar(18) > 0
fv = 2
value = -1

[State 10003, 4]
type = ChangeState
trigger1 = anim = 1004 
trigger1 = time = 150
trigger2 = fvar(2) > 13
trigger3 = p2stateno = 1005
value = 10005
ctrl = 1
 


;=============================================================================================
;Catch Escape Victim 
[Statedef 10005]
type    = S
movetype= H
physics = N
;ctrl = 0
velset = 0,0

[State 10003, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 1006  

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

[state 10005, detract]
type = varset
trigger1 = time = 0 
fv = 2
value = 0

[State 10005, 4]
type = SelfState
trigger1 = Time = 0 
;trigger1 = AnimTime = 0  
value = 0
ctrl = 1
 
;---------------------------------------------------------------------
;Getting Dirty (P2)
[Statedef 10008]
type = A
movetype = H
physics = N
velset = 0,0
ctrl = 0
sprpriority = 2

[State 10008, 1]
type = ChangeAnim2
Trigger1 = Time = 0
value = 1008

[State 821, VelSet]
type = VelSet
trigger1 = Animelem = 15
X = -16
Y = -16
 
;---------------------------------------------------------------------
;Dirty Airborn (P2)
[Statedef 10009]
type = A
movetype = H
physics = N
velset = -18,-26 

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

[State 10009, 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 10009, 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 10009, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground



;---------------------------------------------------------------------------
;Blast Roof X
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1100
sprpriority = 2

[State 0, PlayerPush]
type = PlayerPush 
trigger1 = MoveContact != 1
value = 0 
[State 0, PlayerPushB]
type = PlayerPush
trigger1 = ANIMELEM =20 
value = 1 

[State 1100, palfx]
type=palfx
trigger1 = anim = 1120 
time=0 

[State 1100, palfx]
type=palfx
trigger1 = anim = 1100
trigger1 = time%1 = 0
time=-1
sinadd=50,50,50,8

[State 1002, Trilha de poeira]
type = Helper
triggerall = anim = 1110
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Trilha de Poeira"
postype = P1
pos = -80,31;-225,11
stateno = 8050
ownpal = 1
persistent = 0
size.xscale = 3
size.yscale= 3

[State 9980, 8burst] ;Odb718 random
type = Explod
triggerall = anim = 1110
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 12
trigger4 = animelem = 15
trigger5 = animelem = 17
trigger6 = animelem = 19
trigger7 = animelem = 20
anim =9980
ID = 9980
pos = Floor((170-(var(5)*16))*fvar(14)),Floor((-370+(var(5)*5))*fvar(14))
random = 80,80 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 0.5*fvar(14),0.5*fvar(14) ;makes it Samus's size
sprpriority = ifelse(random>500, -9, 9)
ontop =  ifelse(random>500, 1, 0)
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause = 
;persistent = 


[State 1100, 1]
type = PlaySnd
triggerall = Anim = 1110
trigger1 = AnimElem = 21
value = 0, 4

[State 1100, 1]
type = PlaySnd
triggerall = Anim = 1100
trigger1 = AnimElem = 1
value = 0, 4
; 6, 0 
 
[State 1100, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 1100
triggerall = AnimElem =11  
trigger1 = command = "holdx"   
value = 1110 

[State 1100, ChangeAnim]
type = ChangeAnim 
triggerall = Anim != 1120 
trigger1 = Anim = 1100 
trigger1 = AnimElem = 11 
trigger1 = command != "holdx" 
trigger2 = Anim = 1110 
trigger2 = AnimElem = 21 
trigger3 = Anim = 1110 
trigger3 = command != "holdx" 
value = 1120  


[State 1100, PowerReset]
type = VarSet
trigger1 = time = 0
v = 5   
value = 1 

[State 1100, BlastPower]
type = VarSet
triggerall = Anim = 1110
triggerall = var(5) <= 5
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 11
trigger4 = animelem = 15
trigger5 = animelem = 19
v = 5   
value = var(5)+1

[State 1100, PowerCheck]
type = VarSet
triggerall = var(5) >= 2  
trigger1 = Anim = 1120  
v = 5    
value = ifelse(var(5) >= 6,6,var(5)) 
 

[State 1100, Blasts]
type = PlaySnd
triggerall = Anim = 1120  
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
trigger3 = AnimElem = 9
trigger4 = AnimElem = 13
trigger5 = AnimElem = 17
value = 6, 0 


[State 440, HitDef]
type = HitDef
triggerall = Anim = 1120 
trigger1 = AnimElem = 1
trigger1 = !movehit
attr = C, NA
damage = 38,2
animtype = Up
air.animtype = Up
fall.animtype = Up
;animtype = Heavy
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 12,10
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
hitsound = S10,2
guardsound = S13,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 40
ground.velocity = ifelse(P2dist X<100,2,6),ifelse(P2dist X<100,-46,-36) ;0,-46
air.hittime = 28
air.velocity = 10,ifelse(P2Dist Y <-1,-2,-22);-2.5,-2
;air.velocity = -4,-32

 
[State 1100, Projectile1]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 3
trigger1 = !movehit
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
offset = 240*fvar(14),fvar(14)*-430
projremovetime = 20
getpower = 100
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile2]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 5
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = 105*fvar(14),fvar(14)*-520
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = med
air.hittime = 28
air.velocity = 10,ifelse(var(9)<-520,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile3]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 9
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -50*fvar(14),fvar(14)*-515
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-515,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile4]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 13
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -140*fvar(14),fvar(14)*-480
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-480,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile5]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 17
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -220*fvar(14),fvar(14)*-420
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM 
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20 
air.animtype = DiagUp
animtype = DiagUp
air.hittime = 30
air.velocity = 15,-22;13,-8 
air.hittime = 28 
ground.velocity = 10,ifelse(var(9) <-430,-12,var(9)/3)  
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3


[State 1100, Turn]
type = Turn
triggerall = Anim = 1120
trigger1 = AnimElem = 30
trigger1 = P2BodyDist x <= -50

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 1120
trigger1 = AnimElem = 30 
trigger1 = P2BodyDist x <= -50
value = 5
;elem = 1
;ignorehitpause = 
;persistent = 


[State 1100, 4]
type = ChangeState
triggerall = Anim = 1120
trigger1 = AnimTime = 0
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Blast Roof Y
[Statedef 1110]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1100
sprpriority = 2

[State 1110, 1]
type = PlaySnd
triggerall = Anim = 1110
trigger1 = AnimElem = 21
value = 0, 4

[State 1110, 1]
type = PlaySnd
triggerall = Anim = 1100
trigger1 = AnimElem = 1
value = 0, 4
; 6, 0 
 
[State 1100, palfx]
type=palfx
trigger1 = anim = 1120 
time=0 

[State 1100, palfx]
type=palfx
trigger1 = anim = 1100
trigger1 = time%1 = 0
time=-1
sinadd=50,50,50,8

[State 1002, Trilha de poeira]
type = Helper
triggerall = anim = 1110
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Trilha de Poeira"
postype = P1
pos = -80,31;-225,11
stateno = 8050
ownpal = 1
persistent = 0
size.xscale = 3
size.yscale= 3
[State 9980, 8burst] ;Odb718 random
type = Explod
triggerall = anim = 1110
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 12
trigger4 = animelem = 15
trigger5 = animelem = 17
trigger6 = animelem = 19
trigger7 = animelem = 20
anim =9980
ID = 9980
pos = Floor((170-(var(5)*16))*fvar(14)),Floor((-370+(var(5)*5))*fvar(14))
random = 80,80 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 0.5*fvar(14),0.5*fvar(14) ;makes it Samus's size
sprpriority = ifelse(random>500, -9, 9)
ontop =  ifelse(random>500, 1, 0)
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause = 
;persistent = 

[State 1110, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 1100
triggerall = AnimElem =11  
trigger1 = command = "holdy"  
value = 1110 

[State 1110, ChangeAnim]
type = ChangeAnim 
triggerall = Anim != 1120 
trigger1 = Anim = 1100 
trigger1 = AnimElem = 11 
trigger1 = command !=  "holdy"  
trigger2 = Anim = 1110 
trigger2 = AnimElem = 21 
trigger3 = Anim = 1110 
trigger3 = command !=  "holdy" 
value = 1120  


[State 1110, VarReset]
type = VarSet
trigger1 = time = 0
v = 5   
value = 1 

[State 1110, VarSet]
type = VarSet
triggerall = Anim = 1110
triggerall = var(5) <= 5
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 11
trigger4 = animelem = 15
trigger5 = animelem = 19
v = 5   
value = var(5)+1

[State 1110, VarSet]
type = VarSet
triggerall = var(5) >= 2  
trigger1 = Anim = 1120  
v = 5    
value = ifelse(var(5) >= 6,6,var(5)) 
 

[State 1110, Blasts]
type = PlaySnd
triggerall = Anim = 1120  
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
trigger3 = AnimElem = 9
trigger4 = AnimElem = 13
trigger5 = AnimElem = 17
value = 6, 0 



[State 440, HitDef]
type = HitDef
triggerall = Anim = 1120 
trigger1 = AnimElem = 1
trigger1 = !movehit
attr = C, NA
damage = 38,2
animtype = Up
air.animtype = Up
fall.animtype = Up
;animtype = Heavy
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 12,10
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
hitsound = S10,2
guardsound = S13,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 40
ground.velocity = ifelse(P2dist X<100,2,6),ifelse(P2dist X<100,-46,-36) ;0,-46
air.hittime = 28
air.velocity = 10,ifelse(P2Dist Y <-1,-2,-22);-2.5,-2
;air.velocity = -4,-32

 
[State 1100, Projectile1]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 3
trigger1 = !movehit
ProjID = 10420
projanim = 9988;10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
offset = 240*fvar(14),fvar(14)*-430
projremovetime = 55;20
getpower = 100
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile2]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 5
ProjID = 10420
projanim = 9988;10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = 1,1
projremovetime = 55;20
getpower = 100
offset = 105*fvar(14),fvar(14)*-520
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = med
air.hittime = 28
air.velocity = 10,ifelse(var(9)<-520,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile3]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 9
ProjID = 10420
projanim = 9988;10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = 1,1
projremovetime = 55;20
getpower = 100
offset = -50*fvar(14),fvar(14)*-515
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-515,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile4]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 13
ProjID = 10420
projanim = 9988;10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = 1,1
projremovetime = 55;20
getpower = 100
offset = -140*fvar(14),fvar(14)*-480
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-480,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile5]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 17
ProjID = 10420
projanim = 9988;10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = 1,1
projremovetime = 55;20
getpower = 100
offset = -220*fvar(14),fvar(14)*-420
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM 
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20 
air.animtype = DiagUp
animtype = DiagUp
air.hittime = 30
air.velocity = 15,-22;13,-8 
air.hittime = 28 
ground.velocity = 10,ifelse(var(9) <-430,-12,var(9)/3)  
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3



[State 1110, 2]
type = null;HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1110, Turn]
type = Turn
triggerall = Anim = 1120
trigger1 = AnimElem = 30
trigger1 = P2BodyDist x <= -50

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 1120
trigger1 = AnimElem = 30 
trigger1 = P2BodyDist x <= -50
value = 5
;elem = 1
;ignorehitpause = 
;persistent = 


[State 1110, 4]
type = ChangeState
triggerall = Anim = 1120
trigger1 = AnimTime = 0
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Blast Roof Z
[Statedef 1120]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1100
sprpriority = 2

[State 1120, 1]
type = PlaySnd
triggerall = Anim = 1110
trigger1 = AnimElem = 21
value = 0, 4

[State 1120, 1]
type = PlaySnd
triggerall = Anim = 1100
trigger1 = AnimElem = 1
value = 0, 4
; 6, 0 
 
[State 1100, palfx]
type=palfx
trigger1 = anim = 1120 
time=0 

[State 1100, palfx]
type=palfx
trigger1 = anim = 1100
trigger1 = time%1 = 0
time=-1
sinadd=50,50,50,8

[State 1002, Trilha de poeira]
type = Helper
triggerall = anim = 1110
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Trilha de Poeira"
postype = P1
pos = -80,30;-225,11
stateno = 8050
ownpal = 1
persistent = 0
size.xscale = 3
size.yscale= 3

[State 9980, 8burst] ;Odb718 random
type = Explod
triggerall = anim = 1110
trigger1 = animelem = 4
trigger2 = animelem = 8
trigger3 = animelem = 12
trigger4 = animelem = 15
trigger5 = animelem = 17
trigger6 = animelem = 19
trigger7 = animelem = 20
anim =9980
ID = 9980
pos = Floor((170-(var(5)*16))*fvar(14)),Floor((-370+(var(5)*5))*fvar(14))
random = 80,80 
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 7
scale = 1.2*fvar(14),1.2*fvar(14) ;makes it Samus's size
sprpriority = ifelse(random>500, -9, 9)
ontop =  ifelse(random>500, 1, 0)
shadow = 0,0,0
ownpal = 1
removeongethit = 0
;ignorehitpause = 
;persistent = 

[State 1120, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 1100
triggerall = AnimElem =11  
trigger1 = command = "holdz"  
value = 1110 

[State 1120, ChangeAnim]
type = ChangeAnim 
triggerall = Anim != 1120 
trigger1 = Anim = 1100 
trigger1 = AnimElem = 11 
trigger1 = command !=  "holdz"  
trigger2 = Anim = 1110 
trigger2 = AnimElem = 21 
trigger3 = Anim = 1110 
trigger3 = command !=  "holdz" 
value = 1120  


[State 1120, VarReset]
type = VarSet
trigger1 = time = 0
v = 5   
value = 1 

[State 1120, VarSet]
type = VarSet
triggerall = Anim = 1110
triggerall = var(5) <= 5
trigger1 = animelem = 3
trigger2 = animelem = 7
trigger3 = animelem = 11
trigger4 = animelem = 15
trigger5 = animelem = 19
v = 5   
value = var(5)+1

[State 1120, VarSet]
type = VarSet
triggerall = var(5) >= 2  
trigger1 = Anim = 1120  
v = 5    
value = ifelse(var(5) >= 6,6,var(5)) 
 

[State 1120, Blasts]
type = PlaySnd
triggerall = Anim = 1120  
trigger1 = AnimElem = 1
trigger2 = AnimElem = 5
trigger3 = AnimElem = 9
trigger4 = AnimElem = 13
trigger5 = AnimElem = 17
value = 6, 0 


[State 440, HitDef]
type = HitDef
triggerall = Anim = 1120 
trigger1 = AnimElem = 1
trigger1 = !movehit
attr = C, NA
damage = 38,2
animtype = Up
air.animtype = Up
fall.animtype = Up
;animtype = Heavy
guardflag = M
hitflag = MAF
priority = 4, Hit
pausetime = 12,10
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
hitsound = S10,2
guardsound = S13,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 40
ground.velocity = ifelse(P2dist X<100,2,6),ifelse(P2dist X<100,-46,-36) ;0,-46
air.hittime = 28
air.velocity = 10,ifelse(P2Dist Y <-1,-2,-22);-2.5,-2
;air.velocity = -4,-32

 
[State 1100, Projectile1]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 3
trigger1 = !movehit
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
offset = 240*fvar(14),fvar(14)*-430
projremovetime = 20
getpower = 100
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile2]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 5
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = 105*fvar(14),fvar(14)*-520
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = med
air.hittime = 28
air.velocity = 10,ifelse(var(9)<-520,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile3]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 9
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -50*fvar(14),fvar(14)*-515
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-515,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile4]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 13
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -140*fvar(14),fvar(14)*-480
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 4,ifelse(P2Dist Y =0,-22,-2)
air.animtype = heavy 
air.hittime = 28
air.velocity = 10,ifelse(var(9) <-480,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3

[State 0, Projectile5]
type = Projectile
triggerall = Anim = 1120  
trigger1 = AnimElem = 17
ProjID = 10420
projanim =9988; 10420+var(5)
;projhitanim = 10420
;projremanim = 10420
;projcancelanim = 10420 
projscale = fvar(14),fvar(14)
projremovetime = 20
getpower = 100
offset = -220*fvar(14),fvar(14)*-420
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM 
damage = 4*var(5)+10,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20 
air.animtype = DiagUp
animtype = DiagUp
air.hittime = 30
air.velocity = 15,-22;13,-8 
air.hittime = 28 
ground.velocity = 10,ifelse(var(9) <-430,-12,var(9)/3)  
air.velocity = 10,ifelse(var(9) <-430,-6,(-520-var(9))/6.5);Change 430 to height of projectile
air.juggle = 3



[State 1120, 2]
type = null;HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1120, Turn]
type = Turn
triggerall = Anim = 1120
trigger1 = AnimElem = 30
trigger1 = P2BodyDist x <= -50

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = Anim = 1120
trigger1 = AnimElem = 30 
trigger1 = P2BodyDist x <= -50
value = 5
;elem = 1
;ignorehitpause = 
;persistent = 


[State 1120, 4]
type = ChangeState
triggerall = Anim = 1120
trigger1 = AnimTime = 0
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Charge Shot X
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0 
sprpriority = 2
 
[State 1200, ChangeAnim]
type = ChangeAnim 
triggerall = anim != 1200
trigger1 = prevstateno != 1205 
trigger1 = time = 0
value = 1200 


[State 1200, powerup]
type = PlaySnd
;triggerall = var(29) = 5
triggerall = Anim = 1200
trigger1 = AnimElem = 1
value = S1200,0
channel = 0
 
[State 1200, powerup continue]
type = PlaySnd 
trigger1 = (prevstateno = 1205) && (Anim = 1210) && (time = 1) 
value = S1200,var(29)
channel = 0
 
[State 1200, 1]
type = PlaySnd
triggerall = var(29) >= 4
triggerall = Anim = 1220
trigger1 = AnimElem = 3
value = 5,3
channel = 1
[State 1200, 1]
type = PlaySnd
triggerall = var(29) = 3
triggerall = Anim = 1220
trigger1 = AnimElem = 3
value = 5,2 
channel = 1
[State 1200, 1]
type = PlaySnd
triggerall = var(29) = 2
triggerall = Anim = 1220
trigger1 = AnimElem = 3
value = 5,1
channel = 1
[State 1200, 1]
type = PlaySnd
triggerall = var(29) = 1
triggerall = Anim = 1220
trigger1 = AnimElem = 3
value = 5,0 
channel = 1

[State 1200, VarSet]
type = VarSet 
trigger1 = prevstateno != 1205
trigger1 = time = 0
v = 29   
value = 1 

[State 1200, VarSet]
type = VarSet 
trigger1 = prevstateno = 1205
trigger1 = time = 0
v = 25                  ;watches for multiple shots
value = 1 

[State 1200, VarSet]
type = VarSet
triggerall = Anim = 1210
triggerall = var(29) <= 6
trigger1 = animelem = 4
trigger2 = animelem = 9
trigger3 = animelem = 14
v = 29  
value = var(29)+1

[State 1200, VarSet]
type = VarSet
triggerall = var(29) >= 2  
trigger1 = Anim = 1220  
v = 29    
value = ifelse(var(29) >= 7,7,var(29)) 

 
[State 1200, ChangeAnim]
type = ChangeAnim   
triggerall = anim != 1210 
triggerall = command = "holdx"  ||  command = "holdy"  || command = "holdz"
trigger1 = Anim = 1200
trigger1 = AnimElem =14
trigger2 = prevstateno = 1205
trigger2 = var(25) = 1  ;makes sure only one shot can happen... remove for cheats ;P
value = 1210 

[State 1200, ChangeAnim]
type = varset
triggerall = Anim != 1220 
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz" 
trigger1 = Anim = 1200 
trigger1 = AnimElem = 14 
trigger2 = Anim = 1210  
trigger3 = prevstateno = 1205
v = 25
value = 2  
[State 1200, ChangeAnim]
type = ChangeAnim 
triggerall = Anim != 1220 
triggerall = command != "holdx" 
triggerall = command != "holdy" 
triggerall = command != "holdz" 
trigger1 = Anim = 1200 
trigger1 = AnimElem = 14 
trigger2 = Anim = 1210  
trigger3 = prevstateno = 1205
value = 1220  

[State 0, StopSnd]
type = StopSnd
trigger1 = anim = 1220 && animelem = 1
channel = 0
;ignorehitpause = 
;persistent = 
 
[State 1002, Carregue efeitos tiro]
type = Helper
triggerall = numhelper(8049) = 0
triggerall = anim = 1210
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Carregue efeitos tiro"
postype = P1
pos = 0,0
stateno = 8049
ownpal = 1
persistent = 0 
 
[State 1002, Trilha de poeira]
type = Helper
triggerall = anim = 1210
trigger1 =AnimElemTime(1) = 1
helpertype = normal
name = "Trilha de Poeira"
postype = P1
pos = -225,11
stateno = 8050
ownpal = 1
persistent = 0
size.xscale = 3
size.yscale= 3


[State 1200, Poeira]
type = Explod
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
anim = 8021
ID = 8021
postype = P1
pos = -90,-4
scale = 3+(var(29)/4), 3+(var(29)/4)
sprpriority = -7
ownpal = 1

[State 1200, Poeira]
type = Explod
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
anim = 8020
ID = 8020
postype = P1
pos = -90,-4
scale = 3+(var(29)/4), 3+(var(29)/4)
sprpriority = 7
ownpal = 1
 
[State 1200, 2]
type = HitDef
triggerall = Anim = 1220
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1200, helper]
type=Helper
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
name="Charge Shot"
ID=1250
pos= 85,-238;floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1250
helpertype=normal
keyctrl=0
ownpal=1
;scale = 0.5,0.5
  
[State 1200, 4]
type = ChangeState
triggerall = Anim = 1220
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[State 1200, 5]
type = ChangeState 
trigger1 = command = "BB"
value = 1205
ctrl = 0

[State 1205, 6]
type = ChangeState
trigger1 = var(29) = 7 && anim = 1210 && animelem = 4
value = 1230 
ctrl = 0

 
;---------------------------------------------------------------------------
;Charged Shot Held
[Statedef 1201]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0 
sprpriority = 2
anim = 1220
   
[State -2, palfx]
type=palfx
trigger1= time = 1
time=0 

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 28   ;fv = 10
value = 0
ignorehitpause = 1
;persistent = 

[State 1201, 1]
type = PlaySnd
triggerall = var(29) >= 4
triggerall = Anim = 1220
trigger1 = AnimElem = 3
value = 5,3
channel = 1     

[State 1201, Poeira]
type = Explod
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
anim = 8021
ID = 8021
postype = P1
pos = -90,-4
scale = 3+(var(29)/4), 3+(var(29)/4)
sprpriority = -7
ownpal = 1

[State 1201, Poeira]
type = Explod
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
anim = 8020
ID = 8020
postype = P1
pos = -90,-4
scale = 3+(var(29)/4), 3+(var(29)/4)
sprpriority = 7
ownpal = 1
 
[State 1201, 2]
type = HitDef
triggerall = Anim = 1220
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(29)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1201, helper]
type=Helper
triggerall = Anim = 1220 
trigger1 = AnimElem = 1
name="Charge Shot"
ID=1250
pos= 85,-238;floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1250
helpertype=normal
keyctrl=0
ownpal=1
;scale = 0.5,0.5
  
[State 1201, 4]
type = ChangeState
triggerall = Anim = 1220
trigger1 = AnimTime = 0
value = 0
ctrl = 1  


;---------------------------------------------------------------------------
; Charge Shot Dodge 
[Statedef 1205]
type    = S
physics = N;S
anim = 105
sprpriority = 1
ctrl = 0



[State 1200, 1]
type = PlaySnd
;triggerall = var(5) = 5
triggerall = Anim = 1200
trigger1 = AnimElem = 1
value = S1200,0


[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = 0
;ignorehitpause = 
;persistent = 



[State 1205, 1]
type = VelSet 
trigger1 = animelem = 1 
x = const(velocity.run.fwd.x)*-1  
persistent = 1

[State 1205, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 19
statetype = C       ;S,A,C,L
movetype = I        ;I,A,H
physics = C         ;A,C,S,N
;ignorehitpause = 
;persistent = 
 

[State 1205, Poeira]
type = Explod
triggerall = Anim = 1205 
trigger1 = AnimElem = 1
anim = 8057
ID = 8057
postype = P1
pos = 0,20
scale = 4,4
sprpriority = -7
ownpal = 1
vel = -4,0

[State 1205, Poeira]
type = Explod
triggerall = Anim = 1205 
trigger1 = AnimElem = 1
anim = 8057
ID = 8057
postype = P1
pos = 0,20
scale = 4,4
sprpriority = 7
ownpal = 1
vel = -4,0

 
[State 1205, 1]
type = VelSet
trigger1 = animelem = 19
x = -7
 
[State 1205, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 1205, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk
   
[State 1205, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 1200;ifelse(command != "holddown",12,11)
ctrl = 1
;---------------------------------------------------------------------------
; Charge to Stand
[Statedef 1230]
type    = S
physics = S
anim = 1230
ctrl = 0

[State 1230, VarSet]
type = VarSet
trigger1 = time = 0
v = 28   ;fv = 10
value = 1
ignorehitpause = 1
;persistent = 

[State 1230, palfx]
type=palfx
trigger1= time = 1
time=-1
sinadd=-25,-25,-25,80 

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

 
;---------------------------------
;HELPER Charge Shot 
[Statedef 1250]
type=A
movetype=A
physics=N
ctrl=0 
sprpriority=3
;anim=22010+parent,var(29)

[State 1250, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 22009+parent, var(29) 
 
[State 1250, AngleDraw]
type = Angledraw
trigger1= anim = 22009+parent,var(29)  
scale =  (0.16*parent,var(29)) , (0.16*parent,var(29)) 

 
[State 1250, b]
type=AssertSpecial
trigger1=1
flag=noshadow
   
 
[State 1250, c]
type = VelSet
trigger1 = time = 1  
x = ceil( 6.5+(4.5*parent,var(29)) )
 
[State 1250, d]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1352
time = -1

[State 1250, e]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1250]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
[State 1250, f]
type = HitDef 
triggerall = vel x < 21
trigger1 = time = 1
attr = A, SP
damage =  ceil( vel x);50+ceil( (parent,fvar(29)*2))
animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 4,miss
pausetime = 0,10
sparkno = s7020
guard.sparkno=S7021
sparkxy = 0,0
guardsound=S0,13
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0  

[State 1250, g]
type = HitDef 
triggerall = vel x > 20.9
trigger1 = time = 1
damage = 50 +ceil((parent,fvar(29)*2))
priority = 7,miss
pausetime = 0,10
sparkno = s7100
guard.sparkno=S7004
sparkxy = 0,0
guardsound=S0,13
ground.slidetime = ceil(  vel x - 10);14
ground.hittime  = 16
ground.velocity =  ceil( -12-vel x),-15
air.velocity =  ceil( -vel x), -24
guard.velocity =  ceil( -vel x*0.7);ceil(-1.5-parent,fvar(5))
air.hittime = 16;ceil(35+parent,fvar(5)*2)
airguard.velocity =  ceil(  -vel x*0.7),-5;ceil(-1.5-parent,fvar(5)),ceil(-parent,fvar(5))
air.fall = 1
fall = 0
fall.recover = 0 
attr = A, SP
animtype =heavy;Up;ifelse( var(5)=25,Up,heavy)
air.animtype = Up
fall.animtype = Up 
hitflag = MAFD
guardflag = MA
ground.type = High
 

[State 1250, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1352
ignorehitpause = 1

[State 1250, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301)
trigger2 = roundstate!=2
value = 1353
ignorehitpause = 1  

[State 1250, justincase]
type = destroyself
trigger1 = time > 170 

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

;---------------------------------------------------------------------------
;missile Shot X
[Statedef 1300]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2

[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
[State 1300, Poeira]
type = Explod
triggerall = Anim = 1300 
trigger1 = AnimElem = 17
anim = 8021
ID = 8021
postype = P1
pos = 4,-4
scale = 3,3
sprpriority = -7
ownpal = 1

[State 1300, Poeira]
type = Explod
triggerall = Anim = 1300 
trigger1 = AnimElem = 17
anim = 8020
ID = 8020
postype = P1
pos = 4,-4
scale = 3,3
sprpriority = 7
ownpal = 1


[State 1300, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1300, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Seeking Missile X"
ID=1350
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1350
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5
  
[State 1300, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;missile Shot Y
[Statedef 1310]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2

[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
[State 1310, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1310, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Seeking Missile Y"
ID=1360
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1360
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5
  
[State 1310, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;missile Shot Z
[Statedef 1320]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2

[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
 
[State 1320, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1
 
[State 1320, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Seeking Missile Z"
ID=1370
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1370
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5
  
[State 1320, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1



;---------------------------------
;HELPER Missile A 
[Statedef 1350]
type=A
movetype=A
physics=N
ctrl=0
velset=8,0
sprpriority=3
anim=13050 
  

[State 1350, upEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13065
trigger1 = vel y <= -5.1 
trigger1 = 1
value = 13065
[State 1350, up5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13065
triggerall = anim != 13064
trigger1 = vel y <= -4.1 
trigger1 = 1
value = 13064
[State 1350, up4]
type = ChangeAnim
triggerall = anim != 13064
trigger1 = vel y = [-5, -4.1] 
trigger1 = 1
value = 13064
[State 1350, up3]
type = ChangeAnim
triggerall = anim != 13063
trigger1 = vel y = [-4, -3.1] 
trigger1 = 1
value = 13063 
[State 1350, up2]
type = ChangeAnim
triggerall = anim != 13062
trigger1 = vel y = [-3, -2.1] 
trigger1 = 1
value = 13062
[State 1350, up1]
type = ChangeAnim
triggerall = anim != 13061
trigger1 = vel y = [-2, -1.1] 
trigger1 = 1
value = 13061 
[State 1350, CENTER]
type = ChangeAnim
triggerall = anim != 13050
trigger1 = vel y = [-1, 1]
trigger1 = 1
value = 13050 
[State 1350, dwn1]
type = ChangeAnim
triggerall = anim != 13051
trigger1 = vel y = [1.1, 2]
trigger1 = 1
value = 13051 
[State 1350, dwn2]
type = ChangeAnim
triggerall = anim != 13052
trigger1 = vel y = [2.1, 3]
trigger1 = 1
value = 13052 
[State 1350, dwn3]
type = ChangeAnim
triggerall = anim != 13053
trigger1 = vel y = [3.1, 4]
trigger1 = 1
value = 13053 
[State 1350, dwn4]
type = ChangeAnim
triggerall = anim != 13054
trigger1 = vel y = [4.1, 5]
trigger1 = 1
value = 13054 
[State 1350, dwn5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13055
triggerall = anim != 13054
trigger1 = vel y >= 4.1 
trigger1 = 1
value = 13054
[State 1350, dwnEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13055
trigger1 = vel y >= 5.1 
trigger1 = 1
value = 13055

 
[State 1350, gas]
type= Explod
Anim=13018
trigger1=Time<=125 ;fuel supply
trigger1=time%3=1
postype=p1
pos=0,0 
scale=1,1 
bindTime=1
sprpriority=5
removetime = 26
ownpal=1
  
[State 1350, outofgas]
type = VelSet 
trigger1 = Time  >= 125 ;fuel supply
trigger1 = Time%1 = 0
x = ifelse(vel x > 4,vel x -1,4) 


 
[State 1350, Chest Finder]
type = VarSet
trigger1 = (Time%1) = 0 
v = 12    ;fv = 10
value = floor( (const(size.head.pos.y) - const(size.mid.pos.y) )/2 ) 

[State 1350, Chest Tracker]
type = VarSet
trigger1 = (Time%1) = 0 
v = 13    ;fv = 10
;value = floor( const(size.mid.pos.y) +  var(12)) 
value = ifelse(enemynear(0), statetype = L , 10, ifelse(enemynear(0), statetype = C ,floor( const(size.mid.pos.y)/2), floor( const(size.mid.pos.y) +  var(12))))

[State 1350, WTFisIT]
type = VarSet
trigger1 = (Time%1) = 0 
v = 10
value = ceil(P2BodyDist Y + var(13)  )/20;10 

[State 1350, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 10    ;fv = 10
value = var(10)
[State 1350, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 9    ;fv = 10
value = floor( vel Y )


[State 1350, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=125 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) = [1,-1] 
y = 0
[State 150, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=125 ;fuel supply
triggerall = (Time%1) = 0 
trigger1 = var(10) = [-8,-1.1]
trigger2 = var(10) = [1.1,8] 
y =  var(10)/2  ;exact spot of chest 
  
;positive samus is below, negative samus is above.
[State 1350, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=125 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) < -8 
y = ifelse(vel y >= 5.1,2.1,vel y - 3)
[State 1350, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=125 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) > 8 
y = ifelse(vel y <= -5.1,-2.1,vel y + 3)
  
 
[State 1350, Max]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y > 6
y = 6
[State 1350, Min]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y < -6
y = -6 

[State 1350]
type=AssertSpecial
trigger1=1
flag=noshadow
   
[State 1350]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1352
time = -1

[State 1350]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1350]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
[State 1350]
type = HitDef 
trigger1 = 1
attr = A, SP
damage =50
animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 7,miss
pausetime = 0,10
sparkno = s7010  
guard.sparkno = s7011
sparkxy = 120,0
hitsound=S0,7
guardsound=S0,13
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p1stateno=1352


[State 1350, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1352
ignorehitpause = 1

[State 1350, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301)
trigger2 = roundstate!=2
value = 1353
ignorehitpause = 1 


[State 1350, justincase]
type = destroyself
trigger1 = time > 170 



;---------------------------------
;HELPER Missile B 
[Statedef 1360]
type=A
movetype=A
physics=N
ctrl=0
velset=9,0
sprpriority=3
anim=13050 

[State 1360, no shadow]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1360, upEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13065
trigger1 = vel y <= -5.1 
trigger1 = 1
value = 13065
[State 1360, up5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13065
triggerall = anim != 13064
trigger1 = vel y <= -4.1 
trigger1 = 1
value = 13064
[State 1360, up4]
type = ChangeAnim
triggerall = anim != 13064
trigger1 = vel y = [-5, -4.1] 
trigger1 = 1
value = 13064
[State 1360, up3]
type = ChangeAnim
triggerall = anim != 13063
trigger1 = vel y = [-4, -3.1] 
trigger1 = 1
value = 13063 
[State 1360, up2]
type = ChangeAnim
triggerall = anim != 13062
trigger1 = vel y = [-3, -2.1] 
trigger1 = 1
value = 13062
[State 1360, up1]
type = ChangeAnim
triggerall = anim != 13061
trigger1 = vel y = [-2, -1.1] 
trigger1 = 1
value = 13061 
[State 1360, CENTER]
type = ChangeAnim
triggerall = anim != 13050
trigger1 = vel y = [-1, 1]
trigger1 = 1
value = 13050 
[State 1360, dwn1]
type = ChangeAnim
triggerall = anim != 13051
trigger1 = vel y = [1.1, 2]
trigger1 = 1
value = 13051 
[State 1360, dwn2]
type = ChangeAnim
triggerall = anim != 13052
trigger1 = vel y = [2.1, 3]
trigger1 = 1
value = 13052 
[State 1360, dwn3]
type = ChangeAnim
triggerall = anim != 13053
trigger1 = vel y = [3.1, 4]
trigger1 = 1
value = 13053 
[State 1360, dwn4]
type = ChangeAnim
triggerall = anim != 13054
trigger1 = vel y = [4.1, 5]
trigger1 = 1
value = 13054 
[State 1360, dwn5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13055
triggerall = anim != 13054
trigger1 = vel y >= 4.1 
trigger1 = 1
value = 13054
[State 1360, dwnEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13055
trigger1 = vel y >= 5.1 
trigger1 = 1
value = 13055


[State 1360, gas]
type=Explod
Anim=13018
trigger1=Time<=100 ;fuel supply
trigger1=time%3=1
postype=p1
pos=0,0 
scale=1,1 
bindTime=1
sprpriority=5
removetime = 26
ownpal=1

[State 1360, outofgas]
type = VelSet 
trigger1 = Time  >= 100 ;fuel supply
trigger1 = Time%3 = 0
x = ifelse(vel x > 4,vel x -1,4) 


[State 1360, Chest Finder]
type = VarSet
trigger1 = (Time%1) = 0 
v = 12    ;fv = 10
value = floor( (const(size.head.pos.y) - const(size.mid.pos.y) )/2 ) 

[State 1360, Chest Tracker]
type = VarSet
trigger1 = (Time%1) = 0 
v = 13    ;fv = 10
;value = floor( const(size.mid.pos.y) +  var(12)) 
value = ifelse(enemynear(0), statetype = L , 10, ifelse(enemynear(0), statetype = C ,floor( const(size.mid.pos.y)/2), floor( const(size.mid.pos.y) +  var(12))))

[State 1360, WTFisIT]
type = VarSet
trigger1 = (Time%1) = 0 
v = 10
value = ceil(P2BodyDist Y + var(13)  )/20;10 
 
[State 1360, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 10    ;fv = 10
value = var(10)
[State 1360, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 9    ;fv = 10
value = floor( vel Y )
 
[State 1360, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=100 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) = [1,-1] 
y = 0
[State 1360, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=100 ;fuel supply
triggerall = (Time%1) = 0 
trigger1 = var(10) = [-8,-1.1]
trigger2 = var(10) = [1.1,8] 
y =  var(10)/2  ;exact spot of chest 
  
;positive samus is below, negative samus is above.
[State 1360, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=100 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) < -8 
y = ifelse(vel y >= 5.1,2.1,vel y - 3)
[State 1360, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=100 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) > 8 
y = ifelse(vel y <= -5.1,-2.1,vel y + 3)
  
 
[State 1360]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y > 9
y = 9
[State 1360]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y < -9
y = -9 

[State 1360]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1352
time = -1

[State 1360, hitby]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1360, nhb]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
[State 1360, hitdef]
type = HitDef 
trigger1 = 1
attr = A, SP
damage =60
animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 7,miss
pausetime = 0,10
sparkno = s7010  
guard.sparkno = s7011
sparkxy = 120,0
;hitsound=S0,7
guardsound=S0,13
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p1stateno=1352


[State 1360, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1352
ignorehitpause = 1

[State 1360, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301)
trigger2 = roundstate!=2
value = 1353
ignorehitpause = 1 


[State 1360, justincase]
type = destroyself
trigger1 = time > 170 

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

;---------------------------------
;HELPER Missile C
[Statedef 1370]
type=A
movetype=A
physics=N
ctrl=0
velset=10,0
sprpriority=3
anim=13050 

[State 1370, no shadow]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1370, upEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13065
trigger1 = vel y <= -5.1 
trigger1 = 1
value = 13065
[State 1370, up5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13065
triggerall = anim != 13064
trigger1 = vel y <= -4.1 
trigger1 = 1
value = 13064
[State 1370, up4]
type = ChangeAnim
triggerall = anim != 13064
trigger1 = vel y = [-5, -4.1] 
trigger1 = 1
value = 13064
[State 1370, up3]
type = ChangeAnim
triggerall = anim != 13063
trigger1 = vel y = [-4, -3.1] 
trigger1 = 1
value = 13063 
[State 1370, up2]
type = ChangeAnim
triggerall = anim != 13062
trigger1 = vel y = [-3, -2.1] 
trigger1 = 1
value = 13062
[State 1370, up1]
type = ChangeAnim
triggerall = anim != 13061
trigger1 = vel y = [-2, -1.1] 
trigger1 = 1
value = 13061 
[State 1370, CENTER]
type = ChangeAnim
triggerall = anim != 13050
trigger1 = vel y = [-1, 1]
trigger1 = 1
value = 13050 
[State 1370, dwn1]
type = ChangeAnim
triggerall = anim != 13051
trigger1 = vel y = [1.1, 2]
trigger1 = 1
value = 13051 
[State 1370, dwn2]
type = ChangeAnim
triggerall = anim != 13052
trigger1 = vel y = [2.1, 3]
trigger1 = 1
value = 13052 
[State 1370, dwn3]
type = ChangeAnim
triggerall = anim != 13053
trigger1 = vel y = [3.1, 4]
trigger1 = 1
value = 13053 
[State 1370, dwn4]
type = ChangeAnim
triggerall = anim != 13054
trigger1 = vel y = [4.1, 5]
trigger1 = 1
value = 13054 
[State 1370, dwn5]
type = ChangeAnim
triggerall = vel x != 4
triggerall = anim != 13055
triggerall = anim != 13054
trigger1 = vel y >= 4.1 
trigger1 = 1
value = 13054
[State 1370, dwnEnd]
type = ChangeAnim
triggerall = vel x = 4
triggerall = anim != 13055
trigger1 = vel y >= 5.1 
trigger1 = 1
value = 13055


[State 1370, gas]
type=Explod
Anim=13018
trigger1=Time<=75 ;fuel supply
trigger1=time%3=1
postype=p1
pos=0,0 
scale=1,1 
bindTime=1
sprpriority=5
removetime = 26
ownpal=1

[State 1370, outofgas]
type = VelSet 
trigger1 =Time >=75 ;fuel supply 
trigger1 = Time%3 = 0
x = ifelse(vel x > 4,vel x -1,4) 


[State 1370, Chest Finder]
type = VarSet
trigger1 = (Time%1) = 0 
v = 12    ;fv = 10
value = floor( (const(size.head.pos.y) - const(size.mid.pos.y) )/2 ) 

[State 1370, Chest Tracker]
type = VarSet
trigger1 = (Time%1) = 0 
v = 13    ;fv = 10
;value = floor( const(size.mid.pos.y) +  var(12)) 
value = ifelse(enemynear(0), statetype = L , 10, ifelse(enemynear(0), statetype = C ,floor( const(size.mid.pos.y)/2), floor( const(size.mid.pos.y) +  var(12))))

[State 1370, WTFisIT]
type = VarSet
trigger1 = (Time%1) = 0 
v = 10
value = ceil(P2BodyDist Y + var(13)  )/20;10 
 
[State 1370, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 10    ;fv = 10
value = var(10)
[State 1370, Display]
type = null;ParentVarSet
trigger1 = (Time%1) = 0 
v = 9    ;fv = 10
value = floor( vel Y )
 
[State 1370, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=75 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) = [1,-1] 
y = 0
[State 1370, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=75 ;fuel supply
triggerall = (Time%1) = 0 
trigger1 = var(10) = [-8,-1.1]
trigger2 = var(10) = [1.1,8] 
y =  var(10)/2  ;exact spot of chest 
  
;positive samus is below, negative samus is above.
[State 1370, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=75 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) < -8 
y = ifelse(vel y >= 5.1,2.1,vel y - 3)
[State 1370, RELEASEtheHounds]
type = Velset
triggerall = P2Dist X > 0 ;where'd it go?
triggerall = time >= 7 ;out of the gun
triggerall=Time<=75 ;fuel supply
trigger1 = (Time%1) = 0 
trigger1 = var(10) > 8 
y = ifelse(vel y <= -5.1,-2.1,vel y + 3)
 

[State 1370]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y > 9
y = 9
[State 1370]
type = VelSet
trigger1 = (Time%1) = 0 
trigger1 = vel Y < -9
y = -9 

[State 1370]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1352
time = -1

[State 1370]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1370]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
[State 1370]
type = HitDef 
trigger1 = 1
attr = A, SP
damage =60
animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 7,miss
pausetime = 0,10
sparkno = s7010  
guard.sparkno = s7011
sparkxy = 120,0
;hitsound=S0,7
guardsound=S0,13
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p1stateno=1352


[State 1370, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1352
ignorehitpause = 1

[State 1370, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301)
trigger2 = roundstate!=2
value = 1353
ignorehitpause = 1 


[State 1370, justincase]
type = destroyself
trigger1 = time > 170 

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



;---------------------------------
;Missile Hit 
[Statedef 1352]
type=S
physics=N
ctrl=0
anim=10420
velset=0,0
sprpriority=3
movehitpersist=1

[State 1352, hitsnd]
type=playsnd
trigger1=Time=0
value=0,7
persistent=0
ignorehitpause=1

[State 1352]
type=Posadd
trigger1=time=0
x=20
y=0

[State 1352]
type=velset
trigger1=1
x=0
y=0

[State 1352]
type=Explod
Anim=6019
trigger1=time=0
trigger1=movehit&&numtarget
trigger1=!(target,time)&&target,movetype=H
postype=left
pos=ceil((target,pos x)-((target,const(size.ground.front)+10)*facing)+135),ceil(screenpos y)+10
sprpriority=4
removetime=-2
ownpal=1
facing=ifelse(facing=-1,-1,1)
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=0
scale=.5,.5

[State 1352]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1352]
type=DestroySelf
trigger1=time >=30

;---------------------------------
;Missile Blocked 
[Statedef 1353]
type=S
physics=N
ctrl=0
anim=10800
velset=0,0
sprpriority=3
movehitpersist=1

[State 1353]
type=PlaySnd
triggerall=Time=0
trigger1=p2stateno!=[120,155]
trigger2=roundstate!=2
value=0,18

[State 1353]
type=Posadd
trigger1=time=0
x=20
y=0

[State 1353]
type=velset
trigger1=1
x=0
y=0

[State 1353]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1353]
type=DestroySelf
trigger1=time >=27

;--------------------------------------
;---------------------------------------------------------------------------
;Super missile A
[Statedef 1400]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2


[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 1

[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
[State 1400, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1


 
[State 1400, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Super Missile"
ID=1450
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5
   

[State 1400, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
  ;---------------------------------------------------------------------------
;Super missile B
[Statedef 1401]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2


[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 2



[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
[State 1401, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1


 
[State 1401, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Super Missile"
ID=1450
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5
   

[State 1401, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Super missile C
[Statedef 1402]
type    = S
movetype= A
physics = S
juggle  = 5
poweradd= 30
ctrl = 0
velset = 0,0
anim = 1300
sprpriority = 2


[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 3.5


[State 1300, 1]
type = PlaySnd
triggerall = Anim = 1300
trigger1 = AnimElem = 16
value = 10, 0
 
[State 1402, 2]
type = HitDef 
trigger1 = AnimElem = 1
attr = S, NA
animtype  = Medium
damage    = 7 ; var(5)
guardflag = MA
pausetime = 12,12
sparkno = 1
sparkxy = -40,-280
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 16
ground.velocity = -22
air.velocity = -10,-16
forcenofall = 1


 
[State 1402, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="Super Missile"
ID=1450
scale = 0.1,0.1
pos= floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
   

[State 1402, 4]
type = ChangeState
triggerall = Anim = 1300
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
  
;---------------------------------
;HELPER Super Missile 
[Statedef 1450]
type=A
movetype=A
physics=N
ctrl=0
velset=3,0
sprpriority=3 

[State 1450, Buttons]
type = ChangeAnim
trigger1 = time = 0  
value =  ifelse(parent, fvar(2) = 1,8000,ifelse(parent, fvar(2) = 2,8001,8002))
;value =  ifelse(command = "SuperMissleA",8000,ifelse(command = "SuperMissleB",8001,8002))
;elem = 1
;ignorehitpause = 
;persistent = 


[State 1450, Flames]
type=Explod
Anim=8300
trigger1=time = 1;animelem = 1
postype=p1
ID = 8300
pos= Floor(parent, fvar(2)*-3) ,0;pos x,pos y 
scale= (parent, fvar(2)*0.3+1)*1.5 ,1.5;  
bindTime=-1
sprpriority=-5
removetime =-2
ownpal=1
removeongethit = 0
 

[State 1450]
type= AssertSpecial
trigger1=1
flag=noshadow
 
[State 0, AngleDraw]
type =null; AngleDraw
trigger1 = 1
;value = 1
scale = 0.3,0.3
;ignorehitpause = 
;persistent = 

   
 
[State 1450]
type = VelSet
trigger1 = (Time%3) = 0 
trigger1 = vel X < (parent,fvar(2)*2)+12
x = vel x + parent,fvar(2)
 
 
[State 1450]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1352
time = -1

[State 1450]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1450]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
[State 1450]
type = HitDef 
trigger1 = 1
attr = A, SP
damage =50
animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 7,miss
pausetime = 0,10
sparkno = s7010  
guard.sparkno = s7011
sparkxy = 120,0 
;hitsound=S0,7
guardsound=S0,13
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p1stateno=1452
 
[State 1450, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1452
ignorehitpause = 1

[State 1450, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301)
trigger2 = roundstate!=2
value = 1453
ignorehitpause = 1 


[State 1450, justincase]
type = destroyself
trigger1 = time > 170 


;---------------------------------
;Super Missile Hit 
[Statedef 1452]
type=S
physics=N
ctrl=0
anim=10420
velset=0,0
sprpriority=3
movehitpersist=1

[State 1450, RemoveExplod]
type = RemoveExplod
trigger1 = time = 0
id = 8300
;ignorehitpause = 
;persistent = 


[State 1525, shake]
type=envshake
trigger1 = time = 1
time=12
freq=120
ampl=12

[State 1452, hitsnd]
type=playsnd
trigger1=Time=0
value=0,7
persistent=0
ignorehitpause=1

[State 1452]
type=Posadd
trigger1=time=0
x=20
y=0

[State 1452]
type=velset
trigger1=1
x=0
y=0

[State 1452]
type=Explod
Anim=6019
trigger1=time=0
trigger1=movehit&&numtarget
trigger1=!(target,time)&&target,movetype=H
postype=left
pos=ceil((target,pos x)-((target,const(size.ground.front)+10)*facing)+135),ceil(screenpos y)+10
sprpriority=4
removetime=-2
ownpal=1
facing=ifelse(facing=-1,-1,1)
ignorehitpause=1
persistent=0
pausemovetime=100
supermovetime=0
scale=.5,.5

[State 1452]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1452]
type=DestroySelf
trigger1=time >=30

;---------------------------------
;Super Missile Blocked 
[Statedef 1453]
type=S
physics=N
ctrl=0
anim=10800
velset=0,0
sprpriority=3
movehitpersist=1

[State 1450, RemoveExplod]
type = RemoveExplod
trigger1 = time = 0
id = 8300
;ignorehitpause = 
;persistent = 

[State 1525, shake]
type=envshake
trigger1 = time = 1
time=12
freq=120
ampl=12

[State 1453]
type=PlaySnd
triggerall=Time=0
trigger1=p2stateno!=[120,155]
trigger2=roundstate!=2
value=0,18

[State 1453]
type=Posadd
trigger1=time=0
x=20
y=0

[State 1453]
type=velset
trigger1=1
x=0
y=0

[State 1453]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 1453]
type=DestroySelf
trigger1=time >=27

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

;---------------------------------------------------------------------------
;Bomb Drop X
[Statedef 1500]
type    = U
movetype= A
physics = N
juggle  = 5
poweradd= 30
ctrl = 0 
anim = 4; ifelse(prevstateno = 1550,1,4)
sprpriority = 2
  
[State 0, Width]
type = Width
trigger1 = 1 
edge = -50,0
player = -50,0

[State 1500, ChangeAnim2]
type = ChangeAnim
triggerall = anim = 4
;trigger1 = animelem = 5
trigger1 = AnimTime = 0
value = 2 

[State 20, 1]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 1
trigger1 = command = "holdfwd"
value = 1;const(velocity.walk.fwd.x)/2
persistent = 1

[State 20, 2]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 3
trigger1 = command = "holdback"
value = 3;const(velocity.walk.fwd.x)/-2
persistent = 1

[State 20, 2]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 2
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
value = 2;const(velocity.walk.fwd.x)/-2
persistent = 1


[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 1 
statetype = A
movetype = A
physics = N 

[State 1550, PosSet]
type = PosSet 
triggerall = anim != 4
triggerall = vel y  = [-0.01,2.99]
trigger1 = var(8) >= 2
trigger1 = pos y >=0
;trigger1 = (time%3) = 0
y = 0  

[State 1550, VelSet]
type = VelSet
triggerall = anim != 4
triggerall = vel y  != [-100,2.99] 
trigger1 = pos y >=1;+(vel y/-2)
;trigger1 = (time%3) = 0
y = vel y/-3.5 

[State 1550, VelSet]
type = VelSet
triggerall = anim != 4
triggerall = vel y  = [-0.01,2.99]
;trigger1 = (time%3) = 0
trigger1 = var(8) >= 2
trigger1 = pos y =0 
y = 0 
 
[State 0, VelSet]
type = VelSet
triggerall = anim = 4  
trigger1 = animelem = 1
y = -16 
[State 0, VelSet]
type = VelSet
triggerall = anim != 4
trigger1 = time = 11 ;AnimElem = 4 
x = 0
y = -6 

[State 20, 1]
type = VelSet 
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)/2

[State 20, 2]
type = VelSet 
trigger1 = command = "holdback"
x = const(velocity.walk.fwd.x)/-2

[State 1500, sound]
type = PlaySnd 
trigger1=time = 13
;trigger1=AnimElem=6,=0 
value = 105, 0

 
[State 1550]
type=Helper
trigger1=anim = 4
trigger1=animelem = 5;AnimElem=6,=0 
name="Bomb"
ID=1520
stateno=1520
pos=0,0
postype=p1
helpertype=normal
keyctrl=0
ownpal=1   

[State 1550, ChangeState]
type = ChangeState
triggerall = Anim != 4
triggerall = statetype != A
trigger1 = command = "UpUp"
value = 45;50
ctrl = 1 

[State 1550, ChangeState]
type = ChangeState
triggerall = Anim != 4
triggerall = statetype = A
trigger1 = command = "UpUp"
value = 669;50
ctrl = 1 

[State 1500, end]
type = ChangeState 
triggerall = Anim != 4
trigger1 = Time >= 30
value = 1550
ctrl = 0

;---------------------------------------------------------------------------
;---------------------------------
;HELPER Bomb
[Statedef 1520]
type=A
movetype=A
physics=N
ctrl=0
anim=1550;8000 
velset=0,0
;velset=0,-9
;sprpriority=4
sprpriority=99

;======================================================Bouncing
[State 1550, BounceSet]
type = VarSet
trigger1 = time=0
fv = 13 
value = 0 

[State 1550, Bounces]
type = Varadd
trigger1 = vel y > 0
trigger1 = pos y >=1
;trigger1 = (time%3) = 0
fv = 13  
value = 1 
 
;----------------------------------------velocities
 
[State 52, Down]
type = Veladd
;triggerall = fvar(13) = 0
trigger1 = vel y < 25
y = 0.3

[State 52, DownLIMIT]
type = VelSet
trigger1 = vel y >=25
y = 25

[State 1550, VelSet]
type = VelSet
triggerall = vel y  != [-100,2.99] 
trigger1 = pos y >=1 
y = vel y/-2.2 

;----------------------------------------Stop on the floor
[State 1550, Stop]
type = VelSet
triggerall = vel y  = [-2.01,2.99] 
trigger1 = fvar(13) >= 2
trigger1 = pos y >=0 
y = 0 
[State 1550, Stop]
type = PosSet 
triggerall = vel y  = [-2.01,2.99]
trigger1 = fvar(13) >= 2
trigger1 = pos y >=0 
y = 0   
;======================================================Bouncing

 

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 1551
ID = 1551
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 60 
scale = 1.21,1.21;fvar(14),fvar(14) ;makes it Samus's size
;sprpriority = -4
sprpriority = 98
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause = 
;persistent = 

[State 1520, AS]
type=AssertSpecial
trigger1=1
flag=noshadow
  
[State 1520, HO]
type = HitOverride
trigger1 = Time = 0
attr = SCA, AA, AT, AP
stateno = 1525;1352
time = -1

[State 1520, HB]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1

[State 1520, NHB]
type = NotHitBy
trigger1 = Time = 0
value = , AA, AT
time = -1
 
   
[State 1520, hits]
type = ChangeState
trigger1 = time >= 60   
value = 1525
ignorehitpause = 1
 

[State 1520, justincase]
type = destroyself 
trigger1 = time > 170  

;=================================================================
;Bomb EXPLOSION Hits Samus
[Statedef 1525]
type=A
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4
juggle=5
anim = 8010;10420

[State 1575, 11]
type = null;VarSet
trigger1 = 1 
trigger1 = var(11) != 0
var(11) = 0

[State 2300, EnemyExplosion]
type=Helper
trigger1=time=0 
name="BombBacker"
ID=1526
stateno=1526
pos=0,0
postype=p1
helpertype=normal
keyctrl=0
ownpal=1   

[State 1525, hitoverride]
type=hitoverride
trigger1=1
time=-1
attr=SCA,NP,SP,HP
stateno=1525
ignorehitpause=1

[State 1525, hitby]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1


[State 1525, strengthvar]
type=varset
trigger1=!time
var(19)=4

[State 1525, movehitvar]
type=varset
trigger1=movehit&&numtarget
trigger1=target,movetype=H
var(20)=1
ignorehitpause=1

[State 1525, shake]
type=envshake
trigger1=!time&&!prevstateno
time=12
freq=120
ampl=12


[State 1525, assert]
type=assertspecial
trigger1=1
flag=noshadow
ignorehitpause=1
 
[State 1525, HitThem]
type=null;hitdef
affectteam=E
trigger1=time =1
priority=6,Hit
attr=S,SA
damage=30,0
animtype=Up
hitflag=MAFD
guardflag=M
pausetime=0,6
sparkno=-1
guard.sparkno=s6001
guardsound=s2,0
ground.type=High
ground.slidetime=34
ground.hittime=34
ground.velocity=0,-11
ground.cornerpush.veloff=0
air.velocity=0,-10
p2facing=1
fall=1
fall.recover=0
getpower=0 
palfx.color=32
palfx.sinadd=80,25,0,8
palfx.mul=512,256,128
palfx.time=70 
ID=1525

[State 1525, HitUs]
type= hitdef
trigger1=time =1 
trigger1=P2stateno != [0,29] 
priority=6,Hit
affectteam=F  
attr=S,SA
damage=0,0  
animtype=Up
hitflag=HL;MAFD
guardflag=HL; M
ground.type=High 
ground.velocity=-2.5,-22 
air.velocity=-2.5,-22 
numhits =0 
p2stateno =1551; 7697;

[State 1525, HitUs]
type=hitdef
trigger1=time =1 
trigger1= (root,stateno = [0,29]) || (root,stateno = [1550, 1559])
priority=6,Hit
affectteam=F  
attr=S,SA
damage=0,0  
animtype=Up
hitflag=MAFD
guardflag=M
ground.type=High 
ground.velocity=-2.5,-22 
air.velocity=-2.5,-22 
numhits =0 
p2stateno =1551; 7697;

[State 1525, target]
type= null;targetstate
trigger1=movehit&&numtarget(1525)
trigger1=!(target(1525),ishelper)
trigger1=(target(1525),stateno!=7697)&&(target(1525),selfanimexist(7697))
value=7697
ignorehitpause=1
  
[State 1525, end]
type=destroyself
trigger1=time = 20 ;!animtime

;=================================================================
;Bomb EXPLOSION Hits Enemy
[Statedef 1526]
type=A
physics=N
movetype=A
ctrl=0
velset=0,0
sprpriority=4
juggle=5
anim = 8010;10420

[State 1526, hitoverride]
type=hitoverride
trigger1=1
time=-1
attr=SCA,NP,SP,HP
stateno=1525
ignorehitpause=1

[State 1526, hitby]
type=hitby
trigger1=1
time=-1
value=SCA,NP,SP,HP
ignorehitpause=1


[State 1526, strengthvar]
type=varset
trigger1=!time
var(19)=4

[State 1526, movehitvar]
type=varset
trigger1=movehit&&numtarget
trigger1=target,movetype=H
var(20)=1
ignorehitpause=1

[State 1526, shake]
type=envshake
trigger1=!time&&!prevstateno
time=12
freq=120
ampl=12


[State 1526, assert]
type=assertspecial
trigger1=1
flag=noshadow
ignorehitpause=1


[State 1526, hit]
type=hitdef
trigger1=time =1;&&!prevstateno
;trigger1=!time;&&!prevstateno
priority=6,Hit
attr=S,SA
damage=60,10 ;;;;;;;;;;;;;;ceil(240*(1-root,fvar(19)+root,fvar(11))),60
animtype=Up
hitflag=MAFD
guardflag=M
affectteam=E ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pausetime=0,6
sparkno=-1
guard.sparkno=s6001
guardsound=s2,0
ground.type=High
ground.slidetime=24
ground.hittime=24
ground.velocity=-2.5,-12 
ground.cornerpush.veloff=0
air.velocity=-2.5,-12 
p2facing=1
fall=1
fall.recover=0
getpower=0
envshake.time=12
envshake.freq=100
envshake.ampl=4
palfx.color=32
palfx.sinadd=80,25,0,8
palfx.mul=512,256,128
palfx.time=70
;sprpriority=4
ID=1526
 

[State 1526, target]
type= null;targetstate
trigger1=movehit&&numtarget(1525)
trigger1=!(target(1525),ishelper)
trigger1=(target(1525),stateno!=7697)&&(target(1525),selfanimexist(7697))
value=7697
ignorehitpause=1
  
[State 1526, end]
type=destroyself
trigger1=time = 20 ;!animtime



;=================================================================
;Bomb BURNED 
[Statedef 7697]
type=A
movetype=H
physics=N
velset=0,0
[State 7697, anim]
type=changeanim
triggerall = anim != [1,4]
trigger1=!time&&selfanimexist(4)
value=3
[State 7697, anim]
type=changeanim
triggerall = anim != [1,4]
trigger1=!time&&selfanimexist(7697)
value=7697
[State 7697, end]
type=selfstate
triggerall = anim != [1,4]
trigger1=!time&&!selfanimexist(7697)
value=5030
[State 7697, grav]
type=veladd
trigger1=1
y=gethitvar(yaccel)
[State 7697, vel]
type=hitvelset
trigger1=!time
x=1
y=1
[State 7697, end]
type=selfstate
;trigger1=hitover
trigger1=vel y>0&&pos y>=-10
value=1551;5100
 
;---------------------------------------------------------------------------
;Samus Bomb Ball
[Statedef 1550]
type    = A
physics = N;A
movetype = I        ;I,A,H
 
[State 0, Width]
type = Width
trigger1 = 1 
edge = -50,0
player = -50,0 


;==========================================Rolling
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 1
v = 17   ;fv = 10
value = 1
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 2
v = 17   ;fv = 10
value = 2
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 3
v = 17   ;fv = 10
value = 3
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 4
v = 17   ;fv = 10
value = 4
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 5
v = 17   ;fv = 10
value = 5
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 6
v = 17   ;fv = 10
value = 6
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 7
v = 17   ;fv = 10
value = 7
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 8
v = 17   ;fv = 10
value = 8
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 9
v = 17   ;fv = 10
value = 9
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 10
v = 17   ;fv = 10
value = 10
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 11
v = 17   ;fv = 10
value = 11
;ignorehitpause = 
persistent = 1
[State 0, VarSet]
type = VarSet
trigger1 = animelemno(0) = 12
v = 17   ;fv = 10
value = 12
;ignorehitpause = 
persistent = 1
;==========================================Rolling

;==========================================Animations
[State 20, 1]
type = Changeanim
triggerall = anim != 1
trigger1 = command = "holdfwd"
value = 1;const(velocity.walk.fwd.x)/2
elem = var(17)
;elem = ifelse(var(17)>12,1,var(17)) 

[State 20, 2]
type = Changeanim
triggerall = anim != 2
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
value = 2;const(velocity.walk.fwd.x)/-2
elem = ifelse(anim = 3,13-var(17),var(17))
;elem = ifelse(var(17)>12,1,var(17)) 

[State 20, 2]
type = Changeanim
triggerall = anim != 3
trigger1 = command = "holdback"
value = 3;const(velocity.walk.fwd.x)/-2 
elem = 13-var(17)
;elem = ifelse(var(17)>12,1,var(17))
;==========================================Animations

[State 1550, Reset]
type = VarSet
trigger1 = time=0
v = 8    ;fv = 10
value = 0 

[State 1550, Bounces]
type = Varadd
trigger1 = pos y >=1
trigger1 = (time%3) = 0
v = 8    ;fv = 10
value = 1 

[State 1550, Gravity]
type = Gravity
trigger1 = var(8) = 0
trigger1 = pos y <=-1
trigger2 = var(8) >= 1
trigger2 = pos y <=vel y*2

[State 1550, VelSet]
type = VelSet
triggerall = vel y  != [-100,2.99] 
trigger1 = pos y >=1;+(vel y/-2)
;trigger1 = (time%3) = 0
y = vel y/-3.5 

[State 1550, PosSet]
type = PosSet 
triggerall = vel y  = [-2.01,2.99]
trigger1 = var(8) >= 2
trigger1 = pos y >=0
trigger2 = var(8) >= 4
;trigger1 = (time%3) = 0
y = 0  
[State 1550, VelSet]
type = VelSet
triggerall = vel y  = [-2.01,2.99]
;trigger1 = (time%3) = 0
trigger1 = var(8) >= 2
trigger1 = pos y >=0 
trigger2 = var(8) >= 4
y = 0 


 
[State 1550, 1]
type = VelSet 
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x);/2

[State 1550, 2]
type = VelSet 
trigger1 = command = "holdback"
x = const(velocity.walk.fwd.x)*-1;/-2

[State 1550, 2]
type = VelSet 
triggerall = vel x  != [-1,1]
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
trigger1 = (time%3) = 0
x = vel x / 1.2 ;const(velocity.walk.fwd.x)/-2

[State 1550, 2]
type = VelSet 
triggerall = vel x  = [-1,1]
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
trigger1 = (time%3) = 0
x = 0 ;const(velocity.walk.fwd.x)/-2



[State 1550, CtrlSet]
type = CtrlSet
trigger1 = time >= 15
value = 1 

[State 1550, ChangeState]
type = ChangeState
trigger1 = command = "UpUp"
value = 52
ctrl = 1 

[State 1550, ChangeState]
type = ChangeState
triggerall = pos y = 0
triggerall = vel y = 0
trigger1 = command = "holdup"
value = 10
ctrl = 1 




;---------------------------------------------------------------------------
;Samus Hit Reaction
[Statedef 1551]
type = A
movetype = H
physics = A 
ctrl = 0 
anim =1559
  
[State 1551, Pop]
type=veladd
trigger1=1
;y=gethitvar(yaccel) 
y=-6.3 + numhelper(1550)

[State 1551, SelfState]
type = SelfState
trigger1 = time = 4; 19 
value = 1550 

 

;---------------------------------------------------------------------------
;Ball 
[Statedef 1575]
type    = U
movetype= A
physics = N
juggle  = 5
;poweradd= 30
ctrl = 0 
anim = 4
sprpriority = 2
 
[State 0, Width]
type = Width
trigger1 = 1 
edge = -50,0
player = -50,0

[State 1575, ChangeAnim2]
type = ChangeAnim
triggerall = anim = 4 
trigger1 = AnimTime = 0
value = 2 

[State 1575, 1]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 1
trigger1 = command = "holdfwd"
value = 1;const(velocity.walk.fwd.x)/2
persistent = 1

[State 1575, 2]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 3
trigger1 = command = "holdback"
value = 3;const(velocity.walk.fwd.x)/-2
persistent = 1

[State 1575, 2]
type = Changeanim
triggerall = anim != 4
triggerall = anim != 2
trigger1 = command != "holdback"
trigger1 = command != "holdfwd"
value = 2;const(velocity.walk.fwd.x)/-2
persistent = 1


[State 1575, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 1 
statetype = A
movetype = A
physics = N 
  
;==============================================Velocity checks
[State 1550, Reset]
type = VarSet
trigger1 = time=0
v = 8    ;fv = 10
value = 0 

[State 1550, Bounces]
type = Varadd
trigger1 = pos y >=1
trigger1 = (time%3) = 0
v = 8    ;fv = 10
value = 1 

[State 1550, Gravity]
type = Gravity
trigger1 = var(8) = 0
trigger1 = pos y <=-1
trigger2 = var(8) >= 1
trigger2 = pos y <=vel y*2


[State 1550, VelSet]
type = VelSet
triggerall = vel y  != [-100,2.99] 
trigger1 = pos y >=1;+(vel y/-2)
;trigger1 = (time%3) = 0
y = vel y/-3.5 

[State 1550, PosSet]
type = PosSet 
triggerall = vel y  = [-2.01,2.99]
trigger1 = var(8) >= 2
trigger1 = pos y >=0
trigger2 = var(8) >= 4
;trigger1 = (time%3) = 0
y = 0  
[State 1550, VelSet]
type = VelSet
triggerall = vel y  = [-2.01,2.99]
;trigger1 = (time%3) = 0
trigger1 = var(8) >= 2
trigger1 = pos y >=0 
trigger2 = var(8) >= 4
y = 0 

;==============================================Velocity checks

 

[State 1575, 1]
type = VelSet 
trigger1 = command = "holdfwd"
x = const(velocity.walk.fwd.x)/2

[State 1575, 2]
type = VelSet 
trigger1 = command = "holdback"
x = const(velocity.walk.fwd.x)/-2
 
 



[State 1575, ChangeState]
type = ChangeState
triggerall = Anim != 4
triggerall = statetype != A
trigger1 = command = "UpUp"
value = 45;50
ctrl = 1 

[State 1575, ChangeState]
type = ChangeState
triggerall = Anim != 4
triggerall = statetype = A
trigger1 = command = "UpUp"
value = 669;50
ctrl = 1 

[State 1575, end]
type = ChangeState 
triggerall = Anim != 4
trigger1 = Time >= 30
value = 1550
ctrl = 0

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;Drill Kick
[Statedef 2000]
type = A
movetype = A
physics = A
anim = 2000
ctrl = 0
poweradd= 84
juggle = 1

[State 2000, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6

[State 1100, NotHitBy]
type = NotHitBy
trigger1 = AnimElemTime(6) < 0
value = SCA

;[State 2000, VelAdd]
;type = VelAdd
;trigger1 = Time = 0 && Vel X >= 0 
;X = 1.5

;[State 2000, VelAdd]
;type = VelAdd
;trigger1 = Time = 0 
;Y = -1

[State 2000, G]
type = Gravity
trigger1 = animelem = 36

[State 2000, CtrlSet]
type = CtrlSet
trigger1 = animelem = 46 
value = 1 

  
[State 2000, HitDef]
type = HitDef 
trigger1 = AnimElem = 2
trigger2 = AnimElem = 6
attr = A, SA
damage = 50,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S8003
guard.sparkno = S8015
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-6.2
air.velocity = -12,-6.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
;juggle = 2 

[State 2000, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = AnimElem = 52
value = 2999
 
;---------------------------------------------------------------------------
;Air Blast Wall X
[Statedef 2100]
type = A
movetype = A
physics = N
anim = 2100
ctrl = 0
poweradd= 84
juggle = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 = time = 0
edge = 80,60
player = 60,60 

[State 2100, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6

[State 2100, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 

[State 2100, VelSet]
type = VelSet
trigger1 = Pos Y >= 10
trigger1 = Vel Y > 0
y = 0

[State 2100, VelMul]
type = VelMul
trigger1 = Time = 0
x = .12
y = .12

[State 2100, VelAdd]
type = VelAdd
trigger1 = Time = 0
trigger1 = Vel Y = [-.1,.1]
y = ifelse(Vel Y <= 0, .2, -.2)

[State 2100, VelAdd]
type = VelAdd
trigger1 = Time >= 32
y = .39

[State 2100, Blasts]
type = PlaySnd 
trigger1 = AnimElem = 8
trigger2 = AnimElem = 24
trigger3 = AnimElem = 30
value = 6, 0 
  
   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 8
ProjID = 10422
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(245*fvar(14)),ceil(fvar(14)*-340)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard ;high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 13
ProjID = 10423
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(230*fvar(14)),ceil(fvar(14)*-220)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard;high
air.velocity = -1,-12
air.juggle = 0   
 
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 19
ProjID = 10424
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(205*fvar(14)),ceil(fvar(14)*-115)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x*fvar(14)),ceil(fvar(14)*pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = light;Low
air.velocity = -1,-12
air.juggle = 0

  
  
[State 2100, HitDef]
type = HitDef 
trigger1 = AnimElem = 8
trigger2 = AnimElem = 13
attr = A, SA
damage = 20,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S7010
guard.sparkno = S7010
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-16.2
air.velocity = -2,-16.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
air.juggle = 0   

[State 2100, HitDef]
type = HitDef 
trigger1 =  AnimElem = 19
attr = A, SA
damage = 40,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S7010
guard.sparkno = S7011
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-16.2
air.velocity = -2,-16.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
air.juggle = 0   


[State 2100, CtrlSet]
type = CtrlSet
trigger1 = animelem = 41
value = 1 

[State 2100, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = AnimElem = 48
value = 2999;50 

[State 2100, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 32
value = 0
ctrl = 1

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


;---------------------------------------------------------------------------
;Air Blast Wall Y
[Statedef 2105]
type = A
movetype = A
physics = N
anim = 2105
ctrl = 0
poweradd= 84
juggle = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 = time = 0
edge = 80,60
player = 60,60 

[State 2105, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6

[State 2105, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 

[State 2105, VelSet]
type = VelSet
trigger1 = Pos Y >= 10
trigger1 = Vel Y > 0
y = 0

[State 2105, VelMul]
type = VelMul
trigger1 = Time = 0
x = .12
y = .12

[State 2105, VelAdd]
type = VelAdd
trigger1 = Time = 0
trigger1 = Vel Y = [-.1,.1]
y = ifelse(Vel Y <= 0, .2, -.2)

[State 2105, VelAdd]
type = VelAdd
trigger1 = Time >= 32
y = .39

[State 2105, Blasts]
type = PlaySnd 
trigger1 = AnimElem = 7
trigger2 = AnimElem = 14
trigger3 = AnimElem = 19 
value = 6, 0 
  
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 7
ProjID = 10421
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(230*fvar(14)),ceil(fvar(14)*-400)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 14
ProjID = 10422
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(245*fvar(14)),ceil(fvar(14)*-340)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard ;high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 19
ProjID = 10423
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(230*fvar(14)),ceil(fvar(14)*-220)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard;high
air.velocity = -1,-12
air.juggle = 0   
  
[State 2105, HitDef]
type = HitDef 
trigger1 = AnimElem = 6
trigger2 = AnimElem = 14
trigger3 = AnimElem = 19 
attr = A, SA
damage = 20,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S7010
guard.sparkno = S7010
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-16.2
air.velocity = -2,-16.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
air.juggle = 0   
 

[State 2105, CtrlSet]
type = CtrlSet
trigger1 = animelem = 41 
value = 1 

[State 2105, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = AnimElem = 48
value = 2999;50 

[State 2105, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 32 
value = 0
ctrl = 1


;---------------------------------------------------------------------------
;Air Blast Wall Z
[Statedef 2110]
type = A
movetype = A
physics = N
anim = 2110
ctrl = 0
poweradd= 84
juggle = 0

[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 1
;ignorehitpause = 
;persistent = 


[State 0, Width]
type = Width
trigger1 = time = 0
edge = 80,60
player = 60,60 

[State 2110, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6

[State 2110, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 

[State 2110, VelSet]
type = VelSet
trigger1 = Pos Y >= 10
trigger1 = Vel Y > 0
y = 0

[State 2110, VelMul]
type = VelMul
trigger1 = Time = 0
x = .12
y = .12

[State 2110, VelAdd]
type = VelAdd
trigger1 = Time = 0
trigger1 = Vel Y = [-.1,.1]
y = ifelse(Vel Y <= 0, .2, -.2)

[State 2110, VelAdd]
type = VelAdd
trigger1 = Time >= 32
y = .39

[State 2110, Blasts]
type = PlaySnd 
trigger1 = AnimElem = 6
trigger2 = AnimElem = 12
trigger3 = AnimElem = 19
trigger4 = AnimElem = 24
trigger5 = AnimElem = 30
value = 6, 0 
 
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 6
ProjID = 10420
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(240*fvar(14)), ceil(fvar(14)*-430)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = -4,-12
air.animtype = high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 12
ProjID = 10421
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(230*fvar(14)),ceil(fvar(14)*-400)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 19
ProjID = 10422
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(245*fvar(14)),ceil(fvar(14)*-340)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard ;high
air.velocity = -1,-12
air.juggle = 0   

   
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 24
ProjID = 10423
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(230*fvar(14)),ceil(fvar(14)*-220)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x),ceil(pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = hard;high
air.velocity = -1,-12
air.juggle = 0   
 
[State 0, Projectile]
type = Projectile 
trigger1 = AnimElem = 30
ProjID = 10424
projanim = 10420 
projhitanim = 10420
projremanim = 10420
projcancelanim = 10420 
projscale = 1,1
projremovetime = 20
getpower = 100
offset = ceil(205*fvar(14)),ceil(fvar(14)*-115)
postype = p1
velocity = 0,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAP
guardflag = LAM
animtype = Medium
damage = 20,10
priority = 6
pausetime = 0,0
sparkno = S7000
guard.sparkno = S7001
sparkxy = ceil(pos x*fvar(14)),ceil(fvar(14)*pos y); 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = 0,-12
air.animtype = light;Low
air.velocity = -1,-12
air.juggle = 0

  
  
[State 2110, HitDef]
type = HitDef 
trigger1 = AnimElem = 11
trigger2 = AnimElem = 18
trigger3 = AnimElem = 23 
attr = A, SA
damage = 20,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S7010
guard.sparkno = S7010
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-16.2
air.velocity = -2,-16.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
air.juggle = 0   

[State 2110, HitDef]
type = HitDef 
trigger1 = AnimElem = 5
trigger2 = AnimElem = 29
attr = A, SA
damage = 40,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S7010
guard.sparkno = S7011
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-16.2
air.velocity = -2,-16.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
air.juggle = 0   


[State 2110, CtrlSet]
type = CtrlSet
trigger1 = animelem = 52 
value = 1 

[State 2110, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = AnimElem = 59
value = 2999;50 

[State 2110, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1

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

;---------------------------------------------------------------------------
;Air Charge Shot
[Statedef 2200]
type    = A
movetype= A
physics = N
juggle  = 4 
anim = 2202
ctrl = 0
sprpriority = 2 

[State 2200, chargedshot]
type=palfx
trigger1= time = 1
time=0 

[State 2200, chargedshot]
type = VarSet
trigger1 = time = 0
v = 28   
value = 0
ignorehitpause = 1 

[State 2200, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2200, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2200, Shinkuu!]
type = PlaySnd
trigger1 = AnimElem = 2
value = 5,0
 
[State 2200, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2200, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 

[State 2200,3]
type = Projectile  
trigger1 = AnimElem = 17
projanim = 22010;8010
projhitanim = 8000
projremanim = 8000
projid = 8010
projscale = 0.5, 0.5
getpower = 100
offset = 155*fvar(14),fvar(14)*-165
postype = p1
velocity = 9.5,0
remvelocity = 0,0
accel = 0,0
attr = A, SP
hitflag = MAF
guardflag = MA
animtype = Medium
damage = 52,10
priority = 6
pausetime = 0,0
sparkno = s7000
guard.sparkno = s7001
sparkxy = 15,15 
ground.type     = high
ground.slidetime = 16
ground.hittime  = 20
ground.velocity = -4,0
air.animtype = light;Low
air.velocity = -2.5,-2
air.juggle = 3
;sprpriority = 1


[State 2200, CtrlSet]
type = CtrlSet
trigger1 = animelem = 40 
value = 1 


[State 2200, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 41 
value = 2999
ctrl = 1

[State 2200, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 41 
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Air Missile Shot A
[Statedef 2300]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 
;velset = 0,0

[State 2300, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2300, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2300, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2300, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 

[State 2300]
type=Helper
trigger1=AnimElem=6,=0 
name="Seeking Missile X"
ID=1350
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1350
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5

[State 2300, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 

[State 2300, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2300, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 


;---------------------------------------------------------------------------
;Air Missile Shot B
[Statedef 2310]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 
;velset = 0,0

[State 2310, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2310, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2310, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2310, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 

[State 2310]
type=Helper
trigger1=AnimElem=6,=0 
name="Seeking Missile Y"
ID=1360
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1360
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5

[State 2310, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 

[State 2310, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2310, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 

;---------------------------------------------------------------------------
;Air Missile Shot C
[Statedef 2320]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 
;velset = 0,0

[State 2320, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2320, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2320, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2320, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 

[State 2320]
type=Helper
trigger1=AnimElem=6,=0 
name="Seeking Missile Z"
ID=1360
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1370
helpertype=normal
keyctrl=0
ownpal=1
scale = 0.5,0.5

[State 2320, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 

[State 2320, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2320, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 

;---------------------------------------------------------------------------
;Air Super Missile A
[Statedef 2400]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 

[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 1

[State 2400, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2400, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2400, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2400, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 
 
 
[State 2400, helper]
type=Helper
trigger1=AnimElem=13,=0 
name="Super Missile a"
ID=1450 
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
 
[State 2400, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 
 
[State 2400, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2400, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Air Super Missile B
[Statedef 2401]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 

[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 2

[State 2401, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2401, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2401, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2401, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 
 
 
[State 2401, helper]
type=Helper
trigger1=AnimElem=13,=0 
name="Super Missile"
ID=1450 
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
 
[State 2401, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 
 
[State 2401, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2401, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Air Super Missile C
[Statedef 2402]
type    = A
movetype= A
physics = N
juggle  = 4
anim = 2300
ctrl = 0
sprpriority = 2 

[state 10003, buttons]
type = varset 
trigger1 = time = 0  
fv = 2
value = 3.5

[State 2402, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y <= -20
y = -15.5

[State 2402, dropper]
type = VelSet  
trigger1 = time = 1
trigger1 = vel y = 0
y = 0.5

[State 2402, VelSet]
type = VelSet 
trigger1 = Pos Y >= -10;-20
x = 0
y = 0 
 
[State 2300, 1]
type = PlaySnd
triggerall = Anim = 2300
trigger1 = AnimElem = 12
value = 10, 0
 
[State 2402, Width]
type = Width
trigger1 = Time >= 15
value = 30,0 
 
 
[State 2402, helper]
type=Helper
trigger1=AnimElem=13,=0 
name="Super Missile"
ID=1450 
pos= floor(225*fvar(14)),floor(fvar(14)*-250);-30,-98
postype=p1
stateno=1450
helpertype=normal
keyctrl=0
ownpal=1
 
[State 2402, CtrlSet]
type = CtrlSet
trigger1 = animelem = 38 
value = 1 
 
[State 2402, ChangeState]
type = ChangeState
triggerall = Pos Y <= -10;-20
triggerall = vel y != 0
trigger1 = animelem = 43 
value = 2999
ctrl = 1

[State 2402, ChangeState]
type = ChangeState
triggerall = Pos Y >= -10;-20
triggerall = vel y = 0
trigger1 = animelem = 43 
value = 0
ctrl = 1
 
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 2500] 
anim = 2400
ctrl = 0
poweradd= 84
juggle = 1
facep2 = 1
 
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 0
trigger1 = Pos Y = 0 
statetype = S       ;S,A,C,L
movetype = A        ;I,A,H
physics = S         ;A,C,S,N 
 

[State 1100, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 3
StateType = A
physics = A
movetype = A        ;I,A,H
 
[State 2500, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 2400
trigger1 = time = 66 
value = 2420

[State 2500, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6
 
[State 2500, GO]
type = VelSet 
trigger1 = time = 0
y = 0 ;fvar(6)
;x = ;fvar(4) 

[State 0, VelAdd]
type = VelAdd
trigger1 = time = 1 || time = 2 || time = 3 || time = 4 || time = 5 || time = 6 
y = -6
[State 0, VelAdd]
type = VelAdd
trigger1 = time = 9 || time = 12 || time = 15 || time = 20; || time = 25 || time = 30
y = -4

[State 0, VelAdd]
type = VelAdd
triggerall = command = "holdback"
triggerall = vel x >= -5 
trigger1 = time = 19 || time = 22 || time = 25  
trigger2 = time = 29 || time = 32 || time = 35 || time = 38;
trigger3 = time = 41 || time = 44 || time = 47 || time = 50; || time = 25 || time = 30
x =-1.2 
[State 0, VelAdd]
type = VelAdd  
triggerall = command = "holdfwd" 
triggerall = vel x <= 5 
trigger1 = time = 19 || time = 22 || time = 25  
trigger2 = time = 29 || time = 32 || time = 35 || time = 38;
trigger3 = time = 41 || time = 44 || time = 47 || time = 50; || time = 25 || time = 30
x =1.2
 
[State 2500,  G]
type = Gravity
trigger1 = Anim = 2420
  

[State 2500, Front]
type = Explod
trigger1 = Anim = 2400
trigger1 = AnimElem = 5
anim = 2497
ID = 2497
pos = ceil(12*fvar(14)),ceil(fvar(14)*-217)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 50 
scale = 1.25,1.25
sprpriority = 5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1 


[State 2500, Back]
type = Explod
trigger1 = Anim = 2400
trigger1 = AnimElem = 5
anim = 2498
ID = 2498
pos = ceil(12*fvar(14)),ceil(fvar(14)*-217)
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 50 
scale = 1.25,1.25
sprpriority = -5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1 



  
[State 2500, HitDef]
type = HitDef  
triggerall = HitCount < 8
trigger1 = time%2 = 0
;trigger1 = AnimElem = 2
;trigger2 = AnimElem = 6
attr = A, SA
damage = 50,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = s7020  
guard.sparkno = s7021
sparkxy = 120,0
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-19.2
air.velocity = -12,-9.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
;juggle = 2
  
 
[State 2500, End]
type = ChangeState
trigger1 = statetype = A
trigger1 = Pos Y >= 0 
trigger2 = Anim = 2420
trigger2 = AnimElem = 12
value = 2999 
ctrl = 1


;---------------------------------------------------------------------------
;Screw Attack
[Statedef 2550]
type = A
movetype = A
physics = N
anim = 2400
ctrl = 0
poweradd= 84
juggle = 1
 
[State 2550, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 2400
trigger1 = time = 66 
value = 2420

[State 2550, S]
type = Null;PlaySnd
trigger1 = AnimElem = 1
value = S1,6

;--------------------------------
;resets X & Y values
[State 2550, Xreset]
type = VarSet
trigger1 = time = 0 
fv = 4    ;fv = 10
value = 0
[State 2550, Yreset]
type = VarSet
trigger1 = time = 0  
fv = 6    ;fv = 10
value = -3 

;--------------------------------
;Y values
[State 2550, Ynuetral]
type = VarSet
triggerall = time = 1 
trigger1 = command = "holdback"  
trigger2 = command = "holdfwd" 
fv = 6    ;fv = 10
value = -4.5

[State 2550, Ynup]
type = VarSet
triggerall = time = 1 
trigger1 = command = "holdup"   
fv = 6    ;fv = 10
value = -3
 

[State 2550, Yup]
type = VarSet
triggerall = time = 1 
trigger1 = command = "holdupfwd"
trigger2 = command = "holdupback"  
fv = 6    ;fv = 10
value = -5

;--------------------------------
;X values
[State 2550, Xnuetral]
type = VarSet
triggerall = time = 1 
trigger1 = command = "holdup"   
fv = 4    ;fv = 10
value = 0

[State 2550, Xnback]
type = VarSet
triggerall = time = 1
trigger1 = command = "holdback" 
fv = 4    ;fv = 10
value = -3.5  

[State 2550, Xnfwd]
type = VarSet
triggerall = time = 1
trigger1 = command = "holdfwd"   
fv = 4    ;fv = 10
value = 3.5

[State 2550, Xback]
type = VarSet
triggerall = time = 1
trigger1 = command = "holdupback"  
fv = 4    ;fv = 10
value = -3

[State 2550, Xfwd]
type = VarSet
triggerall = time = 1
trigger1 = command = "holdupfwd"  
fv = 4    ;fv = 10
value = 3

[State 2550, GO]
type = VelSet
trigger1 = time = 1
x = fvar(4)
y = fvar(6)
 
[State 2550,  G]
type = Gravity
trigger1 = Anim = 2420


[State 2550, Explod]
type = Explod
trigger1 = Anim = 2400
trigger1 = AnimElem = 5
anim = 10810 
ID = 10810
pos = 12*fvar(14),fvar(14)*-217
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 12
;supermove
;pausemove
scale = 2,2
sprpriority = 5
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
;ignorehitpause = 
;persistent = 

  
[State 2550, HitDef]
type = HitDef 
trigger1 = AnimElem = 2
trigger2 = AnimElem = 6
attr = A, SA
damage = 50,5
animtype = Heavy
guardflag = MA
hitflag = MAF
sparkno = S8003
guard.sparkno = S8015
sparkxy = -10,-45
hitsound = S10,4
guardsound = S13,0
pausetime = 10,10
ground.type = High
ground.slidetime = 7
ground.hittime  = 15
air.hittime = 35
ground.velocity = -3,-6.2
air.velocity = -12,-6.2
fall = 1
fall.recover = 0
;air.recover = 0
;recover = 0
;juggle = 2
  
 
[State 2550, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = Anim = 2420
trigger2 = AnimElem = 12
value = 2999 
ctrl = 1



;---------------------------------------------------------------------------
;Grapel Beam
[Statedef 2600]
type    = A
movetype= A
physics = A
juggle  = 5
poweradd= 30
ctrl = 0
;velset = 0,0
anim = 2600
sprpriority = 3
 
[State 0, Width]
type = Width
trigger1 = anim = 2600
trigger1 = (AnimElemTime (2) >= 0) && (AnimElemTime (18) < 0)
edge = 350,0;45 

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

[State 1000, Whip]
type = Helper 
trigger1 = animelem = 5
helpertype = normal ;player
name = "whip"
ID = 10001
stateno = 2601
pos = 218,-323
postype = p1 
facing = 1
keyctrl = 0
ownpal = 0 

[State 1000, 2]
type = null;HitDef
trigger1 = anim = 1000
trigger1 = animelem = 1
attr = S, NA
animtype  = Medium
damage    = 5
guardflag = MA
pausetime = 12,12
sparkno = s7010 
sparkxy = -40, -260 
guard.sparkno = s7011
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 0;15;ifelse(guarded = 1,0,15)
ground.hittime  = 30;ifelse(guarded = 1,0,20)
ground.velocity = 0,0
air.velocity = 0,0 
p1sprpriority = 3
p2stateno = 10002;3240
 
[State 2600, End]
type = ChangeState
trigger1 = Pos Y >= 0
trigger2 = Anim = 2420
trigger2 = AnimElem = 12
value = 2999 
ctrl = 1

;---------------------------------------------------------------------------
;HELPER Air Whip
[Statedef 2601]
type    = U
movetype= A
physics = N
poweradd= 0
ctrl = 0
anim = 26001
sprpriority = 2
  
[State 2601, ground]
type = BindToParent
trigger1 = parent, animelem = 5   
time = -1
pos =  218,-323 

[State 2601, ground]
type = BindToParent
trigger1 = parent, animelem = 6  
time = -1
pos =  224,-324

[State 2601, ground]
type = BindToParent
trigger1 = parent, animelem = 7 
trigger2 = parent, animelem = 9 
trigger3 = parent, animelem = 11 
time = -1 
pos =  229,-327

[State 2601, ground]
type = BindToParent
trigger1 = parent, animelem = 8
trigger2 = parent, animelem = 10 
trigger3 = parent, animelem = 12 
time = -1
pos =  220,-339 

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


[State 2601, HitDef]
type = HitDef     
trigger1 =  time = 1
attr = S, NA 
damage   = 60, 6
animtype = heavy
guardflag = MA
hitflag = MAF
pausetime = 0,0 
sparkno = s7010  
guard.sparkno = s7011
sparkxy = 120,0
ground.type = high
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
ground.slidetime = 0;15;ifelse(guarded = 1,0,15)
ground.hittime  = 30;ifelse(guarded = 1,0,20)
ground.velocity = -16,0
air.velocity = -16,0
air.juggle = 3
;sparkno = s9991
;hitsound   = s8000,3 
kill = 0
p1sprpriority = 2

[State 2601, a6]
type = DestroySelf
trigger1 = Time >= 36
trigger2 = parent, anim != 2600
 




;---------------------------------------------------------------------------
;Air Move Fall
[Statedef 2999]
type    = A
movetype= A
physics = A
juggle  = 4
anim = 44 
ctrl = 1

[State 2999, ChangeState]
type = ChangeState
trigger1 = Pos Y >= 0
value = 52
ctrl = 1 

;---------------------------------------------------------------------------
;-----------------------------------ULTRA-----------------------------------
;---------------------------------------------------------------------------
;FINAL
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2
Poweradd = -1000

[State 0, SprPriority]
type = SprPriority
trigger1 = Time%1 = 0
value = 2 

[State 3500, Raio]
type = PlaySnd
trigger1 = AnimElem = 4;0
value = 3000,6
;channel = 1

[State 450, Poeira]
type = Explod  
trigger1 = anim = 3000
trigger1 = AnimElem = 14
anim = 8057
ID = 8057
postype = P1
pos = 0,28
scale = 4,4
sprpriority = 7
ownpal = 1

[State 3333, UltraHelper]
type = null;Helper
triggerall = anim = 3000
trigger1 = time = 0
helpertype = normal ;player
name = "ULTRA"
ID = 3333
stateno = 3333
pos = 0,0
postype = p1

;3333=====================================================================================
[State 3333, Portrait]
type = Explod 
trigger1 = Time = 0 
anim = 9001
postype = Back
pos = 0,50;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9001 
[State 3333, fade1]
type = Explod
trigger1 = Time = 23;1
anim = 9003 ;9001
postype = Back
pos = 0,50;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade2]
type = Explod
trigger1 = Time = 27;5
anim = 9003 ;9001
postype = Back
pos = -35,80;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade3]
type = Explod
trigger1 = Time = 31;9
anim = 9003 ;9001
postype = Back
pos = -70,110;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade4]
type = Explod
trigger1 = Time = 35;11
anim = 9003 ;9001
postype = Back
pos = -105,140;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade5]
type = Explod
trigger1 = Time = 39;13
anim = 9003 ;9001
postype = Back
pos = -140,170;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003


[State 3333, HyperBg]
type = Explod
trigger1 = AnimElem = 1
anim = 750
id = 750
pos = 640,0;160,-5 
sprpriority = -4
supermovetime = -1
postype = left
bindtime = -1
removetime = -1
removeongethit = 1
facing = 1
shadow = 68,68,68
ownpal = 1
ignorehitpause = 1
scale = 4,4
[State 3333, HyperBg]
type = Explod
trigger1 = AnimElem = 1
anim = 750
id = 750
pos = 640,0;160,-5 
sprpriority = -3
supermovetime = -1
postype = left
bindtime = -1
removetime = -1
removeongethit = 1
facing = -1
shadow = 68,68,68
ownpal = 1
ignorehitpause = 1
scale = 4,4
 
;3333=====================================================================================



[State 3333, SuperFocus]
type = SuperPause
triggerall = time = 1
trigger1 = anim = 3000 
Time = 40
movetime = 40
;Sound = S8889,0
Anim = S7001;S4532
Pos = 0,-50; 
 

[State 3333, UltraHelper]
type = Null;Helper
trigger1 = AnimElem = 2
helpertype = normal ;player
name = "ULTRA"
ID = 3333
stateno = 3333
pos = 0,0
postype = p1    ;p2,front,back,left,right
 

[State 1100, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 3000
trigger1 = AnimElem =50   
value = 3010 

[State 1100, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 3010
trigger1 = time = 150   
value = 3040 

[State 1100, ChangeAnim]
type = ChangeAnim 
triggerall = Anim = 3040
trigger1 = Animtime = 0 
value = 3050 
 
[State 0, standup]
type = null;VelSet
triggerall = Anim = 3050
trigger1 = Animelem = 1
trigger2 = Animelem = 4
trigger3 = Animelem = 7
trigger4 = Animelem = 10
trigger5 = Animelem = 13
x = 8.5
[State 0, standstop]
type = null;VelSet
triggerall = Anim = 3050
trigger1 = Animtime = 0
x = 0  

[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 2 
x = 4*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 3 
x = 5*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 8
trigger2 = Animelem = 9
trigger3 = Animelem = 10 
trigger4 = Animelem = 11
trigger5 = Animelem = 12  
x = 6*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 4
trigger2 = Animelem = 5
trigger3 = Animelem = 7  
x = 7*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 6
trigger2 = Animelem = 13 
x = 8*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 14 
x = 10*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 15 
x = 12*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 16 
trigger2 = Animtime = 0  ;adjust for statedef 0
x = 14*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 17 
x = 16*fvar(14) 
[State 3000, PosAdd]
type = Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 18 
x = 17*fvar(14) 



[State 0, PosSet]
type = null;Posadd
triggerall = Anim = 3050
trigger1 = Animelem = 18
x = pos x+9*fvar(14) 

[State 0, PosSet]
type = null;Posset
triggerall = Anim = 3050
trigger1 = Animtime = 0
x = pos x+145*fvar(14) 


[State 3000, Width]
type = Width
trigger1 = Time >= 15
value = 30,0

[State 3000, NotHitBy]
type = NotHitBy
trigger1 = AnimElem = 2
value = SCA
time = 20

[State 3510, HitDef]
type = HitDef
trigger1 = animelem = 4
trigger2 = animelem = 5
attr = A, HP
getpower = 0
animtype  = Heavy
damage  = 9,3;10,3
guardflag = MA
hitflag = MAFP
priority = 7, Hit
;sprpriority = 4
pausetime = 0,1 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,0
air.juggle = 3
air.type = Low
air.velocity = -1,0
air.animtype = Back
air.fall = 1
fall.recover = 0


[State 3000, Helper]
type = Helper
triggerall = Anim = 3000
trigger1 = AnimElem = 40
helpertype = Normal
ID = 3010
name = "Final"
postype = p1
;pos = 255*fvar(14),fvar(14)*-180
pos = 313,-235
stateno = 3010
ownpal = 1
;bindtime = -1

[State 3000, ChangeState]
type = ChangeState
triggerall = Anim = 3050
trigger1 = Animtime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Ultra Blast
[Statedef 3010]
type = A
movetype = A
ctrl = 0
anim = 3012
sprpriority = 9
  

[State 0, SprPriority]
type = SprPriority
trigger1 = Time%1 = 0
value = 9 

[State 3510, SolidBack]
type = Explod
trigger1 = time = 1
ID = 3012
anim = 83188;3012
postype = p1
pos = 0, 0
bindtime = 1
removetime = 99
ownpal = 0
sprpriority = -9
 

[State 3010, BindToParent]
type = BindToParent
trigger1 = parent, anim = 3000
trigger1 = Time = 0
time = -1
pos = 310*Const(size.xscale),-235*Const(size.xscale)

[State 0, PosSet]
type = BindToParent
trigger1 = time = 1
time = 2
pos = 310*Const(size.xscale),-235*Const(size.xscale) 
[State 0, PosSet]
type = BindToParent
trigger1 = time = 3
time = 2
pos = 268*Const(size.xscale),-225*Const(size.xscale) 
[State 0, PosSet]
type = BindToParent
trigger1 = time = 5
time = 1
pos = 222*Const(size.xscale),-240*Const(size.xscale) 
[State 0, PosSet]
type = BindToParent
trigger1 = time = 6
time = -1
pos = 157*Const(size.xscale),-245*Const(size.xscale) 
[State 0, PosSet]
type = BindToParent
trigger1 = time = 7
time = -1
pos = 167*Const(size.xscale),-245*Const(size.xscale) 


[state 3010, hitadds]
type = varset
trigger1 = time = 0
v = 18
value = 0

[state 3010, hitadds]
type = varadd
;triggerall = var(18) < 4
trigger1 = parent, command = "a"
trigger2 = parent, command = "b"
trigger3 = parent, command = "c"
trigger4 = parent, command = "x"
trigger5 = parent, command = "y"
trigger6 = parent, command = "z"
v = 18
value = 2

[state 3010, hitadds]
type = varadd
trigger1 = time%4 = 0
trigger1 = var(18) > 0
v = 18
value = -3


[State 3010, HitDef]
type = HitDef
trigger1 = Time <= 78
trigger1 = var(18) > 0
trigger1 = time%2 = 0
attr = A, HP
getpower = 0
animtype  = Heavy
damage  = 5,1
guardflag = MA
hitflag = MAFP
hitsound  = S3000,5
priority = 7, Hit
;sprpriority = 4
sparkno = S8655
sparkxy = ifelse((Random < 330),0,ifelse((Random = [330,660]),-45,-125)),-50
pausetime = 0,1 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,0
air.juggle = 3
air.type = Low
air.velocity = -1,0
air.animtype = Back
air.fall = 1
fall.recover = 0
kill = 0


[State 3010, HitDef]
type = HitDef
trigger1 = (Time%3) = 0
trigger1 = Time <= 78
attr = A, HP
getpower = 0
animtype  = Heavy
damage  = 9,0
guardflag = MA
hitflag = MAFP
hitsound  = S3000,5
priority = 7, Hit
;sprpriority = 4
sparkno = S8655
sparkxy = ifelse((Random < 330),0,ifelse((Random = [330,660]),-45,-125)),-50
pausetime = 0,1 
ground.type = Low
ground.slidetime = 15
ground.hittime  = 20
ground.velocity = -1,0
air.juggle = 3
air.type = Low
air.velocity = -1,0
air.animtype = Back
air.fall = 1
fall.recover = 0
kill = 0

[State 3010, HitDef]
type = HitDef
trigger1 = Time = 79
attr = A, HP
getpower = 0
animtype = Heavy
damage   = 17,0
guardflag = MA
hitflag = MAFP
hitsound  = S3000,5
priority = 7, Hit
;sprpriority = 4
sparkno = S8655
sparkxy = ifelse((Random < 330),0,ifelse((Random = [330,660]),-45,-125)),-50
pausetime = 0,10 
guard.pausetime = 0,30
ground.type = Low
ground.slidetime = 35
ground.hittime  = 20
ground.velocity = -12,-80
air.type = Low
air.velocity = -12,-70
air.animtype = Back
air.fall = 1
fall = 1
fall.recover = 0

[State 3010, DestroySelf]
type = DestroySelf
trigger1 = parent, stateno != 3000

[State 3010, ChangeState]
type = ChangeState
trigger1 = Time = 99 
value = 3011

;---------------------------------------------------------------------------
; Ultra Blast End
[Statedef 3011]
type = A
movetype = A
ctrl = 0
anim = 8319;3006
sprpriority = 4
 

[State 3510, SolidBack]
type = Explod
trigger1 = time = 1
ID = 3012
anim = 8319;3012
postype = p1
pos = 0, 0
bindtime = 1
removetime = 22
ownpal = 0
sprpriority = -2
 

[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = Time = 0
time = -1
pos = 165*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 8
time = 1
pos = 150*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 9
time = 1
pos = 130*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 10
time = 1
pos = 117*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 11
time = 1
pos = 102*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 12
time = 1
pos = 91*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 13
time = 1
pos = 79*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 14
time = 1
pos = 69*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 15
time = 1
pos = 60*Const(size.xscale),-245*Const(size.xscale) 
[State 3011, ground]
type = BindToParent
trigger1 = parent, anim = 3010
trigger1 = parent, animelem = 16
time = 20
pos = 51*Const(size.xscale),-245*Const(size.xscale) 


[State 3011, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0
trigger2 = parent, stateno != 3000
;---------------------------------------------------------------------------
;--------------------------------------------------------------------------- 

;-------------------Hypers--------------------------------------------------------
;Common Hyper FX
[Statedef 3333]
type = U
movetype = I
physics = N
anim = 9004


[State 3333, SuperFocus]
type = SuperPause
triggerall = parent, time = 1
trigger1 = parent, stateno = 3000 
trigger2 = parent, stateno = 3500 
Time = 24
;Sound = S8889,0
Anim = S7001;S4532
Pos = 0,-50; 
 
[State 3333, assertspecial]
type = null;assertspecial
trigger1 = time = [0,40]
flag = noBG
;flag2 = noFG
ignorehitpause = 1


[State 3333, Portrait]
type = Explod
;triggerall = parent, AnimElem = 1
triggerall = Time = 0
trigger1 = parent, stateno = 3000 
trigger2 = parent, stateno = 3500  
anim = 9001
postype = Back
pos = 0,50;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9001 
[State 3333, fade1]
type = Explod
trigger1 = Time = 1
anim = 9003 ;9001
postype = Back
pos = 0,50;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade2]
type = Explod
trigger1 = Time = 5
anim = 9003 ;9001
postype = Back
pos = -35,80;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade3]
type = Explod
trigger1 = Time = 9
anim = 9003 ;9001
postype = Back
pos = -70,110;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade4]
type = Explod
trigger1 = Time = 11
anim = 9003 ;9001
postype = Back
pos = -105,140;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003
[State 3333, fade5]
type = Explod
trigger1 = Time = 13
anim = 9003 ;9001
postype = Back
pos = -140,170;-169,-12
ownpal = 1
sprpriority = -2
supermovetime = -1
removeongethit = 1
bindtime = -1
removetime = -2
scale = 2.5,2.5;0.7,0.7
ID = 9003


[State 3333, HyperBg]
type = Explod
trigger1 = AnimElem = 1
anim = 750
id = 750
pos = 640,0;160,-5 
sprpriority = -4
supermovetime = -1
postype = left
bindtime = -1
removetime = -1
removeongethit = 1
facing = 1
shadow = 68,68,68
ownpal = 1
ignorehitpause = 1
scale = 4,4
[State 3333, HyperBg]
type = Explod
trigger1 = AnimElem = 1
anim = 750
id = 750
pos = 640,0;160,-5 
sprpriority = -3
supermovetime = -1
postype = left
bindtime = -1
removetime = -1
removeongethit = 1
facing = -1
shadow = 68,68,68
ownpal = 1
ignorehitpause = 1
scale = 4,4
[State 3333, RemoveExplod]
type = RemoveExplod
trigger1 = parent, stateno != [2770,3900] 
id = 750
 
[State 3333, Hyper Circle]
type = null;Explod
trigger1 = Time = 0
;trigger1 = Time = 16;30
anim = 4533
postype = p1
pos = -5,-100
ownpal = 1
sprpriority = 5
supermovetime = -1
ID = 3333


[State 3333, Ground Flash]
type = null;Explod
trigger1 = Time = 0
;trigger1 = time = 1;15
anim = 6666 
postype = P1
pos = -40,0
sprpriority = 7
ownpal = 1
supermovetime = -1
ID = 3333


[State 3333, RemoveExplod]
type = RemoveExplod
trigger1 = parent, stateno != [3000,3999]; || parent, stateno != 3500 ;[2770,3900]
ID = 3333

 
[State 3333, DestroySelf]
type = DestroySelf
trigger1 = parent, stateno != [3000,3999]

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

;---------------------------------------------------------------------------
;Metroid Ultra
[Statedef 3500]
type    = S
movetype= A
physics = S
juggle  = 5 
ctrl = 0
velset = 0,0
anim = 3500
sprpriority = 2
Poweradd = -3000

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 23    ;fv = 10
value = 0 
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 24    ;fv = 10
value = 0 

[State 3500, 1]
type = PlaySnd
triggerall = Anim = 3500
trigger1 = AnimElem = 61
value = 300, 1
 
[State 3500, Poeira]
type = Explod
triggerall = Anim = 3500 
trigger1 = AnimElem = 17
anim = 8021
ID = 8021
postype = P1
pos = 4,-4
scale = 3,3
sprpriority = -7
ownpal = 1

[State 3500, Poeira]
type = Explod
triggerall = Anim = 3500 
trigger1 = AnimElem = 17
anim = 8020
ID = 8020
postype = P1
pos = 4,-4
scale = 3,3
sprpriority = 7
ownpal = 1

 
[State 3333, UltraHelper]
type = Helper
triggerall = anim = 3500
trigger1 = time = 0
helpertype = normal ;player
name = "ULTRA"
ID = 3333
stateno = 3333
pos = 0,0
postype = p1

[State 3500, helper]
type=Helper
trigger1=AnimElem=17,=0 
name="METROID ATTACKS"
ID=3550 
stateno=3550
pos=-180,-1000;floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98 ;-320,-940-pos y;
postype=left ;p2,front,back,left,right
;pos=floor(185*fvar(14)),floor(fvar(14)*-235);-30,-98 ;-320,-940-pos y;
;postype=back ;p2,front,back,left,right
helpertype=normal
keyctrl=0
ownpal=1
;scale = 4,4

 
  
[State 3500, 4]
type = ChangeState
triggerall = Anim = 3500
trigger1 = AnimTime = 0
value = 0
ctrl = 1


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

;---------------------------------
;METROID ATTACK
[Statedef 3549]; 9020 EDITED from KoopaKoot's "Shiki"
type=A
movetype=A
physics=N
ctrl=0
velset=vel x * -4,vel y - 9;0,0
sprpriority=9
anim=3550
  
[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 9

[State 1350, override]
type = HitOverride
trigger1 = time = 1 
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 3550
time = 670
 

[State 3550]
type=AssertSpecial
trigger1=1
flag=noshadow
 
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0 

[State 3500, Poeira]
type =null; Explod
triggerall = Anim = 3550 
trigger1 = animelem = 1
trigger1 = (numhelper(3551) <= 0)
anim = 3551
ID = 3551
postype = P1
pos = 0,0 
sprpriority = 7
ownpal = 1
bindtime = -1
removetime = 670
scale = 1.21,1.21

[State 3500, Poeira]
type =null; Explod
triggerall = Anim = 3550 
trigger1 = animelem = 1
trigger1 = (numhelper(3551) <= 0)
anim = 3552
ID = 3552
postype = P1
pos = 0,0 
sprpriority = 8
ownpal = 1
bindtime = -1
removetime = 670
scale = 1.21,1.21

 
[State 3550, Y];track up and down if crouching
type = VelSet   
triggerall = enemynear(0), statetype = C  
triggerall = time >= 10
trigger1 = time%3=0
Y = ceil(P2BodyDist Y + (const(size.mid.pos.y)) )/20
[State 3550, Y] ;track up and down if standing
type = VelSet   
triggerall = time >= 10
triggerall = enemynear(0), statetype != C 
trigger1 = time%3=0
Y = ceil(P2BodyDist Y + (const(size.head.pos.y)) )/20

[State 3550, X] ;if metroid is far move slow  ;X = ceil(P2BodyDist X + (const(size.head.pos.x)) )/20
type = VelSet    
triggerall = time >= 10
trigger1 = time%3=0
trigger1 = P2BodyDist X < -350   
X = -6 
[State 3550, X] ; if metroid is near move faster
type = Veladd 
triggerall = time >= 10
trigger1 = time%3=0 
trigger1 = P2BodyDist X > -350   
trigger1 = P2BodyDist X < 0  
X = -2 

[State 3550, X] ;if metroid is far move slow 
type = Velset 
triggerall = time >= 10
trigger1 = time%3=0
trigger1 = P2BodyDist X > 350  
X = 6 
[State 3550, X] ; if metroid is near move faster
type = Veladd 
triggerall = time >= 10
trigger1 = time%3=0
trigger1 = P2BodyDist X <  350   
trigger1 = P2BodyDist X >  0  
X = 2 

 
[State 3550] ;Y speed cap
type = VelSet 
triggerall = time >= 10
trigger1 = (Time%3) = 0 
trigger1 = vel Y > 6
y = 6
[State 3550];Y speed cap
type = VelSet 
triggerall = time >= 10
trigger1 = (Time%3) = 0 
trigger1 = vel Y < -6
y = -6   
 
[State 3550];X speed cap
type = VelSet 
triggerall = time >= 10
trigger1 = (Time%3) = 0 
trigger1 = vel X > 20
X = 20
[State 3550];X speed cap
type = VelSet 
triggerall = time >= 10
trigger1 = (Time%3) = 0 
trigger1 = vel X < -20
X = -20   
  
 

[State 3550, block reset] 
type = VelSet 
triggerall = time >= 10
trigger1 = p2stateno = [120,180]
trigger1 = var(6) >= 1
X = vel x * -4
Y = vel y - 9
persistent = 30


[State 3550]
type = HitDef 
trigger1 =(MoveContact)=0
trigger1 = 1
trigger2 = p2stateno != [120,180]
trigger2 = var(6) >= 1
attr = A, SP
damage =1
animtype = hard;Back
air.animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 1,miss
pausetime = 0,10
sparkno = s7002
guard.sparkno=S7004
sparkxy = 0,0
;hitsound=S0,7
guardsound=S0,13
guard.dist = 40
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
guard.hittime = 35
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p2stateno=ifelse(p2statetype!=A,3551,3552);3551
p1stateno= 3559
ID = 666

[State 0, VarSet]
type = Varadd
trigger1 = movecontact != 0
v = 6    ;fv = 10
value = 1
;ignorehitpause = 
;persistent = 

 

[State 3550, blocked]
type =null; ChangeState
trigger1 =(MoveContact) ;|| (Time > 301) 
value = 3590
ignorehitpause = 1 

[State 3550, blocked]
type = ChangeState 
trigger1 = roundstate!=2
value = 3595
ignorehitpause = 1 


[State 3550, justincase]
type = changestate;destroyself
trigger1 = time > 670 
value = 3591
ignorehitpause = 1 


 
;---------------------------------
;---------------------------------
;METROID ATTACK
[Statedef 3550]; 9020 EDITED from KoopaKoot's "Shiki"
type=A
movetype=A
physics=N
ctrl=0 
velset= vel x * -8,vel y - 18;0,0
sprpriority=9
anim=3550


[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 9

[State 1350, override]
type = HitOverride
trigger1 = time = 1 
attr = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
stateno = 3549
time = 670
 

[State 3550]
type=AssertSpecial
trigger1=1
flag=noshadow
 
[State 0, PlayerPush]
type = PlayerPush
trigger1 = 1
value = 0 

[State 3500, Poeira]
type =null; Explod
triggerall = Anim = 3550 
trigger1 = animelem = 1
trigger1 = (numhelper(3551) <= 0)
anim = 3551
ID = 3551
postype = P1
pos = 0,0 
sprpriority = 7
ownpal = 1
bindtime = -1
removetime = 670
scale = 1.21,1.21

[State 3500, Poeira]
type =null; Explod
triggerall = Anim = 3550 
trigger1 = animelem = 1
trigger1 = (numhelper(3551) <= 0)
anim = 3552
ID = 3552
postype = P1
pos = 0,0 
sprpriority = 8
ownpal = 1
bindtime = -1
removetime = 670
scale = 1.21,1.21

 
[State 3550, Y];track up and down if crouching
type = VelSet  
triggerall = enemynear(0), statetype = C  
trigger1 = time%3=0
Y = ceil(P2BodyDist Y + (const(size.mid.pos.y)) )/20
[State 3550, Y] ;track up and down if standing
type = VelSet   
triggerall = enemynear(0), statetype != C 
trigger1 = time%3=0
Y = ceil(P2BodyDist Y + (const(size.head.pos.y)) )/20

[State 3550, X] ;if metroid is far move slow  ;X = ceil(P2BodyDist X + (const(size.head.pos.x)) )/20
type = VelSet    
trigger1 = time%3=0
trigger1 = P2BodyDist X < -350   
X = -6 
[State 3550, X] ; if metroid is near move faster
type = Veladd 
trigger1 = time%3=0 
trigger1 = P2BodyDist X > -350   
trigger1 = P2BodyDist X < 0  
X = -2 

[State 3550, X] ;if metroid is far move slow 
type = Velset 
trigger1 = time%3=0
trigger1 = P2BodyDist X > 350  
X = 6 
[State 3550, X] ; if metroid is near move faster
type = Veladd 
trigger1 = time%3=0
trigger1 = P2BodyDist X <  350   
trigger1 = P2BodyDist X >  0  
X = 2 

 
[State 3550] ;Y speed cap
type = VelSet 
trigger1 = (Time%3) = 0 
trigger1 = vel Y > 6
y = 6
[State 3550];Y speed cap
type = VelSet 
trigger1 = (Time%3) = 0 
trigger1 = vel Y < -6
y = -6   
 
[State 3550];X speed cap
type = VelSet 
trigger1 = (Time%3) = 0 
trigger1 = vel X > 20
X = 20
[State 3550];X speed cap
type = VelSet 
trigger1 = (Time%3) = 0 
trigger1 = vel X < -20
X = -20   
   
[State 3550, block reset] 
type = VelSet 
trigger1 = p2stateno = [120,180]
trigger1 = var(6) >= 1
X = vel x * -4
Y = vel y - 9
persistent = 30

 
[State 3550]
type = HitDef  
trigger1 =(MoveContact)=0
trigger1 = 1
trigger2 = p2stateno != [120,180]
trigger2 = var(6) >= 1
attr = A, SP
damage =1
animtype = hard;Back
air.animtype = Back
getpower  = 0
hitflag = MAFD
guardflag = MA
priority = 1,miss
pausetime = 0,10
sparkno = s7002
guard.sparkno=S7004
sparkxy = 0,0
;hitsound=S0,7
guardsound=S0,13
guard.dist = 40
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -2
guard.velocity = -1.5
guard.hittime = 35
air.hittime = 35
air.velocity = -2,-3
airguard.velocity = -1.5,0
air.fall = 1
fall = 0
fall.recover = 0
p2stateno=ifelse(p2statetype!=A,3551,3552);3551
p1stateno= 3559
ID = 666

[State 0, VarSet]
type = Varadd
trigger1 = movecontact != 0
v = 6    ;fv = 10
value = 1

;[State 3550, blocked]
;type =null; ChangeState
;trigger1 =(MoveContact) ;|| (Time > 301) 
;value = 3590
;ignorehitpause = 1 

[State 3550, WINNER]
type = ChangeState 
trigger1 = roundstate!=2
value = 3595
ignorehitpause = 1 


[State 3550, justincase]
type = changestate;destroyself
trigger1 = time > 670 
value = 3591
ignorehitpause = 1 


 
;---------------------------------
;METROID P2 Hit
[Statedef 3551] ;9120 
Type = S
MoveType =  H 
physics = S
VelSet = 0, 0
sprpriority = 1 
Ctrl = 0


[State 3551, Anim]
Type = ChangeAnim2
Trigger1 = !Time
Value = 3551
   
;---------------------------------  
;METROID P2 Air Hit 
[Statedef 3552]
Type = A
MoveType =  H
physics = A
VelSet = 0, 0
sprpriority = 1 
Ctrl = 0


[State 3552, Anim]
Type = ChangeAnim2
Trigger1 = !Time
Value = 3552
   
;---------------------------------  
;METROID P2 Hit 2
[Statedef 3553] ;9121
type    = S
movetype= H
physics = U
sprpriority = 1 
Ctrl = 0 
  

[state 6005, white fadeout] ;taken from evil ken
type           = BGPalFx
trigger1     = time = 0
;trigger1       = var(42) = 1
add            = 255,255,255
sinadd         = -255,-255,-255,50
time           = 12
ignorehitpause = 1
persistent     = 0
  
[State 811, Anim]
Type = ChangeAnim2
Trigger1 = Time =0
Value = ifelse(pos y > -10,3553,3554)
;Value = ifelse(pos y > -10,5007,5050)
;Value = 3553 ; 9121 ;5050

[State 0, StateTypeSet]
type = StateTypeSet 
triggerall = anim = 3554
trigger1 = statetype != A
movetype = A
physics = N

[State 5050, 3] ;Gravity
type = VelAdd
triggerall = anim = 3554
trigger1 = 1
y = GetHitVar(yaccel)

[State 0, PosSet]
type = PosSet
triggerall = anim != 3554
trigger1 = pos y > 0 
y = 0 


[State 240, 9]
type = HitDef
trigger1 = animelem = 2
animtype  = Light
ground.type = High
damage = 0
hitsound = -1
guardsound = -1
sparkno = -1
sparkxy = 0, 0
guard.sparkno = -1
guard.sparkxy = 0, 0
attr = A, NA
guardflag = N
hitflag = MA
priority = 1, Hit
pausetime = 0,0
ground.velocity = 0,0
air.velocity = 0,0
guard.velocity = 0
pausetime = 0,0
ground.slidetime = 0
ground.hittime  = 10
getpower = 0,0
givepower = 0,0
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.fall = 1
fall.recover = 0
ID = 9001
nochainID = 9001


[State 5001, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1

[State 5001, 3] ;Stop sliding back
type = VelMul
trigger1 = Time >= GetHitVar(slidetime)
x = .6

[State 5001, 4]
type = VelSet
trigger1 = HitOver
x = 0
 
[State 5001, 5]
type = DefenceMulSet
trigger1 = HitOver
value = 1

[State 5001, 6]
type = SelfState;ChangeState
trigger1 = HitOver
trigger1 = anim != 3554
value = 0
ctrl = 1
[State 5001, 6]
type = SelfState;ChangeState
triggerall = anim = 3554
trigger1 = HitOver
Trigger2 = vel y > 0 && pos y >= 0
value = 5050
ctrl = 1
 

;---------------------------------
;METROID Reverser
[Statedef 3559]; 9221
type=S
movetype=A
physics=N
ctrl=0
velset=0,0
sprpriority=9
anim=3561;3559


[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 9

[State 1000, Helper]
type = Helper
trigger1 = time = 2
;trigger2 = animelemtime(14) = 2
name = "EVIL SKULL OF DEATH"
helpertype = Normal
id = 3560
stateno = 3560
pos = 0, 0 ;50
postype = p1
facing = 1
keyctrl = 0
ownpal = 1
supermovetime = 0
pausemovetime = 0
     
[State 810, bind]
type = TargetBind
trigger1 = animelemtime(1) >= 0 && animelemtime(7) < 0
ID = 666
pos = 51, 0

[State 0, METROID set]
type = PosSet
trigger1 = 1
x = parent, pos x;+(7*cos(7*pi/60*time))
y = parent, pos y;Const(size.head.pos.y)+(enemynear,pos y)+(7*cos(5*pi/60*time))
;x = enemynear, pos x+(7*cos(7*pi/60*time))
;y = enemynear, Const(size.head.pos.y)+(enemynear,pos y)+(7*cos(5*pi/60*time))
ignorehitpause = 1


[State 801, fly p2]
type = TargetState
trigger1 = time = 1
value = 3553
ignorehitpause = 1
ID = 666

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = time%1 = 0
trigger1 = parent,var(23) = 0
;trigger1 = var(27) = 0
v = 23     ;fv = 
value = var(27) 

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = time%1 = 0
trigger1 = parent,var(24) = 0
;trigger1 = var(27) = 0
v = 24     ;fv = 
value = var(27) 
 
[State 3559, justincase]
type = destroyself
trigger1  = time > 1110; 610   
ignorehitpause = 1 
 
;--------------------------------- 

;METROID Eats 
[Statedef 3560];"EVIL SKULL OF DEATH" Taken from "Shiki" - K.O.D 
type = A
movetype = A
physics = N
ctrl = 0
velset = 0, 0 
sprpriority = 4
anim = 3558;3560


[State 3560, Sucks]
type = null;Explod
trigger1 = time = 10
ID = 8665
anim = 8665 
postype = p1
pos = 0, 0
bindtime = 1
removetime = 240
ownpal = 0
sprpriority = 3
ignorehitpause = 0
 
[state 0, ReversalDef]
type = ReversalDef
trigger1 = time = 0  
reversal.attr = A,NA
sparkno = -1
sparkxy = 0,0
pausetime = 0,0
hitsound = -1
numhits = 0

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = 9
;ignorehitpause = 
;persistent = 

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 3
movetype = I

[State 0, HitAdd]
type = HitAdd
trigger1 = 1
value = -1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = time%2=0
value = -1
kill = 0
absolute = 1


[State 0, PosSet];Metroid hits, lock on & move
type = PosSet
trigger1 = 1
trigger1 = enemynear, statetype = C
x = enemynear, pos x+(7*cos(7*pi/60*time))
y = enemynear, Const(size.mid.pos.y)+(enemynear,pos y)+(7*cos(5*pi/60*time))
ignorehitpause = 1
[State 0, PosSet];Metroid hits, lock on & move
type = PosSet
trigger1 = 1
trigger1 = enemynear, statetype != C
x = enemynear, pos x+(7*cos(7*pi/60*time))
y = enemynear, Const(size.head.pos.y)+(enemynear,pos y)+(7*cos(5*pi/60*time))
ignorehitpause = 1
 

[State 7001, Assert]
type = AssertSpecial
trigger1 = 1
flag = noshadow
ignorehitpause = 1

[State 10002, FindSamus]
type = ChangeState
trigger1 = ROOT,Movetype = H && (ROOT, stateno != [120,160])
trigger2 = time = 390
trigger3 = enemynear, alive = 0
trigger4 = enemynear, life <= 20
value = 3590
ctrl = 0
 
 

;---------------------------------
;METROID HEAL
[Statedef 3590]
type=A
movetype=A
physics=N
ctrl=0
velset=0,0
sprpriority=9
anim=3590;3550
 
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 3591
trigger1 = ROOTDist X = [-20,20]
trigger1 = ROOT,life <= 1399
value = 3591 

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 3590
trigger1 = ROOTDist X = [-20,20]
trigger1 = ROOT,life = 1400
value = 3590 

[State 0, EnergyWaves]
type = Explod
triggerall = root,var(23) > 0
triggerall = root,numhelper(15030) <= 0
trigger1 = root,var(23) < 520
trigger1 = gametime%17=0
anim = 15030
ID = 15030
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = -2
pausemovetime = 0
scale = 1,1
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0 



[State 3590]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 0, ParentVarSet]
type = ParentVarSet
triggerall = parent, var(23) = 0
trigger1 = ROOTDist X = [-20,20]
;trigger1 = var(27) = 0
v = 27   ;fv = 10
value = 1 
ignorehitpause = 1
  
[State 3590, VarSet]
type = VarSet
;triggerall = parent, var(23) = 0
trigger1 = ROOTDist X = [-20,20]
v = 26    ;fv = 10
value = 1

[State 2021, 1];Thomas Hsieh's Morgan edit
type = BindtoROOT
trigger1 = var(26) = 1 
;pos = 82*cos(2*pi/126*time+pi/2)-47, 82*sin(2*pi/126*time+pi/2)-84
pos = 7*cos(7*pi/140*time), ifelse(ROOT,statetype = C,5*sin(5*pi/140*time)-240 ,5*sin(5*pi/140*time)-355) 
  
[State 3590, Y]
type = VelSet  
triggerall = var(26) != 1
triggerall = ROOT, statetype = C  
trigger1 = time%3=0
Y = (ROOTdist y - 240)/20
;Y = ceil(P2BodyDist Y + (const(size.mid.pos.y)) )/20
[State 3590, Y]
type = VelSet  
triggerall = var(26) != 1
triggerall = ROOT, statetype != C 
trigger1 = time%3=0
Y = (ROOTdist y - 355)/20
;Y = ceil(P2BodyDist y + (const(size.head.pos.y)) )/20
X = ROOT,var(22) 

[State 3590, X] ;X = ceil(P2BodyDist X + (const(size.head.pos.x)) )/20
type = VelSet    
triggerall = var(26) != 1
triggerall = time%3=0 
trigger1 = Facing = 1
trigger1 = pos x > ROOT,pos x ;> pos x  
trigger2 = Facing = -1
trigger2 =  pos x < ROOT,var(22);< pos x   
X = -6  

[State 3590, X];ParentDist Y 
type = Velset 
triggerall = var(26) != 1
triggerall = time%3=0 
trigger1 = Facing = 1
trigger1 =  pos x < ROOT,var(22);< pos x 
trigger2 = Facing = -1
trigger2 = pos x > ROOT,var(22) ;> pos x 
X = 6  
 
[State 3590]
type = NotHitBy
trigger1 = 1
value = SCA;, AA, AT
time = -1
 
 
[State 3590, hits]
type = ChangeState
trigger1 = time >= 165
trigger1 = movehit&&numtarget
trigger1 =! (target,time)&&target,movetype=H
value = 1352
ignorehitpause = 1

[State 3590, blocked]
type = ChangeState
trigger1 =(MoveContact) ;|| (Time > 301) 
value = 1353
ignorehitpause = 1 

[State 3590, justincase]
type = ChangeState 
trigger1 = time > 670 
trigger2 = var(23) = 520
value = 3591
ignorehitpause = 1 

[State 3590, blocked]
type = ChangeState 
trigger1 = roundstate!=2
value = 3595
ignorehitpause = 1 




;---------------------------------
;METROID EXIT
[Statedef 3591]
type=A
movetype=A
physics=N
ctrl=0
velset=-1,-3
sprpriority=9
anim=3550 

[State 3591]
type=AssertSpecial
trigger1=1
flag=noshadow
 
[State 0, VelAdd]
type = VelAdd
trigger1 = 1
x = -0.4*ceil( cos(-17*pi/70*time) ) ;ceil(60*cos(7*pi/140*time)-parent,pos x)
y = -0.4*ceil( sin(-5*pi/140*time) ) ;ceil(31*sin(5*pi/140*time)+var(22))


[State 3591, justincase]
type = destroyself
;trigger1 = numhelper(3560) = 0 
trigger1 = time > 1470 
 
;------------------------------------------------------------------------------------
;METROID WINS
[Statedef 3595]
type=A
movetype=A
physics=N
ctrl=0
velset=0,0
sprpriority=9
anim=3550 

[State 3590]
type=AssertSpecial
trigger1=1
flag=noshadow
    
[State 0, VelSet]
type = VelSet
trigger1 = pos x < - 5
x = 6 

[State 0, VelSet]
type = VelSet
trigger1 = pos x >  5
x = -6 
[State 0, VelSet]
type = VelSet
trigger1 = pos x = [-5,5] 
x = 0
[State 0, VarSet]
type = VarSet
triggerall = var(22) = 0
trigger1 = pos x = [-5,5] 
v = 22    ;fv = 10
value = ceil(pos y)
 
[State 3595, 1] 
type = Bindtoroot
trigger1 = var(22) != 0
pos = ceil(60*cos(7*pi/140*time)-root,pos x), ceil(31*sin(5*pi/140*time)+var(22))
ignorehitpause = 1
 
[State 3595, justincase]
type = destroyself
trigger1 = time > 670 


 
;---------------------------------
;METROID Intro
[Statedef 3599]
type=A
movetype=A
physics=N
ctrl=0
velset=0,0
sprpriority=-9
anim=191 

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT 
time = 470 

[State 3591]
type=AssertSpecial
trigger1=1
flag=noshadow

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim = 191
trigger1 = animtime = 0
value = 3550
 

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3550
trigger1 = vel x = 0
trigger1 = vel y = 0
x = -1 
y = -3
;ignorehitpause = 
;persistent = 

[State 0, VelAdd]
type = VelAdd
triggerall = anim = 3550
trigger1 = 1
trigger1 = vel x != 0
trigger1 = vel y != 0
x = 0.4*ceil( cos(-17*pi/70*time) ) ;ceil(60*cos(7*pi/140*time)-parent,pos x)
y = -0.4*ceil( sin(-5*pi/140*time) ) ;ceil(31*sin(5*pi/140*time)+var(22))


[State 3591, justincase]
type = destroyself
trigger1 = RoundState != [0,1]
trigger2 = time > 470 



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

;---------------------------------------------------------------------------
;Guard Push (Stand)
[Statedef 4000]
type    = S
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = 4000
sprpriority = 2

[State 4001, Virar]
type = Turn
triggerall = time = 0
trigger1 = P2Dist X < -5

[State 4000, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 4000, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 4000, a3]
type = Width
trigger1 = 1
value = 10,0

[State 4000, a4]
type = NotHitBy
trigger1 = !time
value = SCA
time = 25

[State 4020, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "Guard Push"
postype = P1
pos = -180,0
stateno = 4050
ownpal = 1
size.height = 1075
size.ground.back = 125
size.ground.front = 125


[State 4000, a6]
type = Explod
trigger1 = !time
anim = 8015
postype = p1
pos = 100,-255
scale = 3,3;0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1;
sprpriority = -7

[State 4000, a6]
type = Explod
trigger1 = !time
anim = 8016
postype = p1
pos = 100,-255
scale = 3,3;0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1;
sprpriority = 7

[State 4000, a7]
type = PlaySnd
trigger1 = !time
value = s3100,0
channel = 1

[State 4000, a8]
type = PlaySnd
trigger1 = !time
value = s5,0
channel = 0

[State 4000, a9]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1

;---------------------------------------------------------------------------
;Guard Push (Crouch)
[Statedef 4010]
type    = C
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = 4001
sprpriority = 2

[State 4001, Virar]
type = Turn
triggerall = time = 0
trigger1 = P2Dist X < -5

[State 4010, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 4010, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 4010, a3]
type = Width
trigger1 = 1
value = 10,0

[State 4010, a4]
type = NotHitBy
trigger1 = !time
value = SCA
time = 25

[State 4020, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "Guard Push"
postype = P1
pos = -180,0
stateno = 4050
ownpal = 1
size.height = 1075
size.ground.back = 125
size.ground.front = 125


[State 4010, a6]
type = Explod
trigger1 = !time
anim = 8015
postype = p1
pos = 70,-195
scale =3,3; 0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1
sprpriority = -7

[State 4010, a6]
type = Explod
trigger1 = !time
anim = 8016
postype = p1
pos = 70,-195
scale =3,3; 0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1
sprpriority = 7

[State 4010, a7]
type = PlaySnd
trigger1 = !time
value = 54,3
volume = 255
channel = 1

[State 4010, a8]
type = PlaySnd
trigger1 = !time
value = 50,0
channel = 0

[State 4010, a9]
type = ChangeState
trigger1 = !AnimTime
value = 11
ctrl = 1

;---------------------------------------------------------------------------
;Guard Push (air)
[Statedef 4020]
type    = A
movetype= I
physics = N
poweradd= 0
velset = 10,0
ctrl = 0
anim = 4002
sprpriority = 2

[State 4001, Virar]
type = Turn
triggerall = time = 0
trigger1 = P2Dist X < -5

[State 4020, a1]
type = VelMul
trigger1 = 1
x = 0.75

[State 4020, a2]
type = VelSet
trigger1 = Time = 10
x = 0

[State 4020, a3]
type = Width
trigger1 = 1
value = 10,0

[State 4020, a4]
type = NotHitBy
trigger1 = !time
value = SCA
time = 25

[State 4020, a5]
type = Helper
trigger1 = Time = 0
helpertype = Normal
name = "Guard Push"
postype = P1
pos = -180,0
stateno = 4050
ownpal = 1
size.height = 1075
size.ground.back = 125
size.ground.front = 125


[State 4020, a6]
type = Explod
trigger1 = !time
anim = 8015
postype = p1
pos = 85,-255
scale = 3,3;0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1
sprpriority = -7

[State 4020, a6]
type = Explod
trigger1 = !time
anim = 8016
postype = p1
pos = 85,-255
scale = 3,3;0.5,0.5
ownpal = 1
vel = 2,0
ignorehitpause = 1
sprpriority = 7

[State 4020, a7]
type = PlaySnd
trigger1 = !time
value = 54,3
volume = 255
channel = 1

[State 4020, a8]
type = PlaySnd
trigger1 = !time
value = 50,0
channel = 0

[State 4020, a9]
type = ChangeState
trigger1 = !AnimTime
value = 51
ctrl = 1

;---------------------------------------------------------------------------
;Guard Push (Helper)
[Statedef 4050]
type    = S
movetype= I
physics = N
poweradd= 0
ctrl = 0
anim = 4005
sprpriority = -4

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

[State 4050, a2]
type = VelSet
trigger1 = Time = [0,10]
x = 110

[State 4050, a3]
type = VelSet
trigger1 = Time = [11,13]
x = 100

[State 4050, a4]
type = VelSet
trigger1 = Time >= 14
x = 95

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

[State 4050, a6]
type = DestroySelf
trigger1 = Time >= 18

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

;---------------------------------------------------------------------------------------------
;Beginning of the super jump
[Statedef 7000]
type = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1 

[State 7000, ChangeState]
type = ChangeState
trigger1 = !AnimTime
value = 7001
ctrl = 1

;---------------------------------------------------------------------------------------------
;Super Jump
[Statedef 7001]
type = A
physics = A
ctrl = 1
anim = 7008
velset = 0, const(velocity.jump.y)*1.3;0,-14

[State 1400, Turn]
type = Turn
;triggerall = animelem = 1
trigger1 = P2Dist X < -5

[State 7001, VelAdd]
type = VelAdd
triggerall = Vel X >= -1.8
trigger1 = command = "holdback"
trigger1 = Anim != 7006
x = -0.1

[State 7001, VelAdd]
type = VelAdd
triggerall = Vel X <= 2
trigger1 = command = "holdfwd"
trigger1 = Anim != 7007
x = 0.25

[State 7001, VelSet]
type = VelSet
trigger1 = Anim = 7007
trigger1 = Time = [0,5]
x = 4

[State 7001, VelSet]
type = VelSet
trigger1 = Anim = 7006
trigger1 = Time = [0,5]
x = -3.5

[State 7001, ChangeAnim]
type = null;ChangeAnim
;trigger1 = Var(11) = 0
triggerall = command != "holdfwd"
triggerall = command != "holdback"
trigger1 = Time = [0,4]
value = 7008

[State 7001, ChangeAnim]
type = ChangeAnim
;trigger1 = Var(11) = 1
triggerall = command = "holdfwd"
trigger1 = Time = [0,4]
value = 7007

[State 7001, ChangeAnim]
type = ChangeAnim
;trigger1 = Var(11) = -1
triggerall = command = "holdback"
trigger1 = Time = [0,4]
value = 7006

[State -2, Gas]
type = Explod
triggerall = anim = 7008 
trigger1 = NumExplod(4441) = 0
trigger1 = animelem = 3
anim = 4441
ID = 4441
pos = floor(fvar(14)),floor(fvar(14))
postype = p1  ;p2,front,back,left,right
;facing =  ifelse(P2Dist X < -10,-1,1)
vfacing = 1
bindtime = -1 
removetime = 11
scale = fvar(14),fvar(14)
sprpriority = 0

[State -2, Gas]
type = Explod
triggerall = anim = 7007 
trigger1 = NumExplod(4441) = 0
trigger1 = animelem = 1
anim = 4442
ID = 4442
pos = floor(fvar(14)),floor(fvar(14))
postype = p1  ;p2,front,back,left,right
;facing =  ifelse(P2Dist X < -10,-1,1)
vfacing = 1
bindtime = -1 
removetime = 11
scale = fvar(14),fvar(14)
sprpriority = 0


[State 7001, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 9999,5

[State 7001, Explod]
type = Explod
trigger1 = !time
ID = 474
anim = 6669
postype = p1
pos = 12, 60
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2
scale = 1.20 - (time * 0.15), 1.54 - (time * 0.15) 

[State 7001, explod]
type = Explod
trigger1 = !time
ID = 474
anim = 6699
postype = p1
pos = 5, 60
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2
scale = 1.20 - (time * 0.15), 1.54 - (time * 0.15) 

[State 7001, explod]
type = Explod
trigger1 = !time
ID = 474
anim = 9016
postype = p1
pos = 0, 20
bindtime = 1
removetime = -2
ownpal = 1
sprpriority = 2
scale = 2, 2
 
[State 7001, Var Mute]
type = null;VarSet
trigger1 = !time
v = 12
value = 1

;---------------------------------------------------------------------------------------------
;Super Jump
[Statedef 7002]
type    = A
physics = A
ctrl = 1

[State 7005, Vel]
type = VelAdd
triggerall = Vel X >= -2
trigger1 = command = "holdback"
trigger1 = Anim != 43
x = -0.1

[State 7005, Vel]
type = VelAdd
triggerall = Vel X <= 2.5
trigger1 = command = "holdfwd"
trigger1 = Anim != 42
x = 0.25




;---------------------------------------------------------------------------------
;Liedown Roll fwd
[Statedef 7700]
type = C
;movetype = I
physics = N
poweradd = 0
;velset = 8,0
ctrl = 0
anim = 7700
sprpriority = -1

[State 100, 1]
type = VelSet 
trigger1 = animelem = 1 
x = const(velocity.run.fwd.x)   
persistent = 1

 
[State 100, 1]
type = VelSet
trigger1 = animelem = 14
x = 7
 
[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk


[State 1550]
type=Helper
triggerall = command = "a" || command = "b" || command = "c"  
trigger1 = (AnimElemTime (7) >= 0) && (AnimElemTime (14) < 0)
name="Bomb"
ID=1520
stateno=1520
pos=0,0
postype=p1
helpertype=normal
keyctrl=0
ownpal=1   

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

[State 7700, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 14
statetype = C       ;S,A,C,L
movetype = I        ;I,A,H
physics = C         ;A,C,S,N
;ignorehitpause = 
;persistent = 

[State 7700, Fim]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------------
;Liedown Roll back
[Statedef 7705]
type = C
;movetype = I
physics = N
poweradd = 0
ctrl = 0
anim = 7705
sprpriority = -1
velset = -8,0

[State 100, 1]
type = VelSet 
trigger1 = animelem = 1 
x = const(velocity.run.fwd.x)*-1  
persistent = 1

 
[State 100, 1]
type = VelSet
trigger1 = animelem = 14
x = -7
 
[State 100, 3] ;Prevent from turning
type = AssertSpecial
trigger1 = 1
flag = NoAutoTurn

[State 100, 2] ;Prevent run from canceling into walk
type = AssertSpecial
trigger1 = 1
flag = NoWalk


[State 1550]
type=Helper
triggerall = command = "a" || command = "b" || command = "c" 
trigger1 = (AnimElemTime (7) >= 0) && (AnimElemTime (14) < 0)
name="Bomb"
ID=1520
stateno=1520
pos=0,0
postype=p1
helpertype=normal
keyctrl=0
ownpal=1   

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

[State 7705, PosSet]
type = PosSet
trigger1 = Time >= 0
y = 0

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 14
statetype = C       ;S,A,C,L
movetype = I        ;I,A,H
physics = C         ;A,C,S,N
;ignorehitpause = 
;persistent = 

[State 7705, Fim]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

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


;---------------------------------------------------------------------------
;Carregue efeitos tiro
[Statedef 8049]
type = C
movetype = I
ctrl = 0
anim = 9991
sprpriority = 5


;-------------------------------------------------------
;=======================================================
[State 1200, bubble]
type = Explod  
triggerall = numexplod(22022) =0
trigger1 = time = 1
anim = 22022
ID = 22022
postype = P1
pos = floor(60* (parent, Fvar(14))),floor(-200* (parent, Fvar(14)))
scale = 1,1
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = -3
ownpal = 1
removetime = 122
[State 1200, bubble]
type = Explod
triggerall = numexplod(22026) =0
trigger1 = time = 1
anim = 22022
ID = 22026
postype = P1
pos = floor(60* (parent, Fvar(14))),floor(-200* (parent, Fvar(14)))
scale = 1,1
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 3
ownpal = 1
removetime = 122

[State 1200, ring]
type = Explod
triggerall = numexplod(22021) =0
trigger1 = time = 1
anim = 22021
ID = 22021
postype = P1
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
scale = 1,1
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 2
ownpal = 1
removetime = 122

[State 1200, ring]
type = Explod
triggerall = numexplod(22020) =0
trigger1 = time = 1
anim = 22020
ID = 22020
postype = P1
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
scale = 1,1
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 2
ownpal = 1
removetime = 122

[State 1200, orangespark01]
type = Explod
triggerall = numexplod(22024) =0
trigger1 = time = 1
anim = 22024;ifelse(random<250,22023,22024)
ID = 22024
postype = P1
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
scale = 1,1
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 9
ownpal = 1
removetime = 122

[State 1200, orangespark01]
type = Explod
triggerall = numexplod(22025) =0
trigger1 = time = 1
anim = 22025;ifelse(random<250,22023,22024)
ID = 22025
postype = P1
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
scale = 1,-1.01
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 9
ownpal = 1
removetime = 122

[State 1200, purple]
type = Explod
triggerall = numexplod(22023) =0
trigger1 = time = 1
anim = 9990
ID = 22023 
postype = P1
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
scale = 1,-1.01
;scale = (0.14*var(29)), (0.14*var(29))
sprpriority = 10
ownpal = 1
removetime = 122



;}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}

[State 0, ModifyExplod]
type = ModifyExplod  
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22020
anim = 22020
pos = floor(60*parent,Fvar(14)),floor(-200*parent,Fvar(14))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.17*parent,var(29),0.17*parent,var(29)
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 0, ModifyExplod]
type =  ModifyExplod 
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22021
anim = 22021
pos = floor(60*parent,Fvar(14)),floor(-200*parent,Fvar(14))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.17*parent,var(29),0.17*parent,var(29)
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1


[State 0, ModifyExplod]
type = ModifyExplod 
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22024
;anim = 22024
anim = ifelse(random<250,22023,22024)
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.17*parent,var(29),0.17*parent,var(29)
sprpriority = -1
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 0, ModifyExplod]
type = ModifyExplod 
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22025
;anim = 22024
anim =  ifelse(random<250,22023,22024)
pos = floor(60*(parent, Fvar(14))),floor(-200*(parent, Fvar(14)))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = -0.17*parent,var(29),-0.17*parent,var(29)
sprpriority = -1
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1


[State 0, ModifyExplod]
type = ModifyExplod  
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22023
anim = 9990
pos = floor(60* parent, Fvar(14)),floor(-200* parent, Fvar(14))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.47*parent,var(29),0.47*parent,var(29)
sprpriority = 10
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 0, ModifyExplod]
type = ModifyExplod  
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22022
anim = 22022
pos = floor(60* parent, Fvar(14)),floor(-200* parent, Fvar(14))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.17* parent, var(29),0.17* parent, var(29)
sprpriority = -1
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1

[State 0, ModifyExplod]
type = ModifyExplod  
trigger1 = parent, anim = [1200,1210]
trigger1 = 1
ID = 22026
anim = 22022
pos = floor(60* parent, Fvar(14)),floor(-200* parent, Fvar(14))
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = -1 
removetime = 122
scale = 0.17* parent, var(29),0.17* parent, var(29)
sprpriority = 3
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 1
ignorehitpause = 1


;=======================================================
;-------------------------------------------------------

[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22020)
trigger1 = root, stateno != 1200
trigger2 = parent, anim = 1220
id = 22020 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22021)
trigger1 = root, stateno != 1200
trigger2 = parent, anim = 1220
id = 22021 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22022)
trigger1 = root, stateno != 1200
trigger2 = parent, anim = 1220
id = 22022 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22023)
trigger1 = parent, stateno != 1200
trigger2 = parent, anim = 1220
id = 22023 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22024)
trigger1 = parent, stateno != 1200
trigger2 = parent, anim = 1220
id = 22024 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22025)
trigger1 = parent, stateno != 1200
trigger2 = parent, anim = 1220
id = 22025 
ignorehitpause = 1
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22026)
trigger1 = parent, stateno != 1200
trigger2 = parent, anim = 1220
id = 22026 
ignorehitpause = 1
;persistent = 



[State 0, DestroySelf]
type = DestroySelf
trigger1 = parent, stateno != 1200
ignorehitpause = 1
;persistent = 






;---------------------------------------------------------------------------
;Trilha de poeira
[Statedef 8050]
type = C
movetype = I
ctrl = 0
anim = 8050
sprpriority = 5


[State 0, VarSet]
type = VarSet
trigger1 = time = 0
v = 10    ;fv = 10
value = (parent, anim)*1
;ignorehitpause = 
;persistent = 


[State 8050, AssertSpecial]
type = AssertSpecial
trigger1 = 1 
flag = noshadow 

[State 1070, Trilha de poeira] 
type = Explod
trigger1 = Time = 0
anim = 8050
ID = 8050
pos = 0,0
postype = p1
sprpriority = -5
bindtime = -1
removetime = -1
shadow = 0,0,0
ownpal = 1
scale = 3,3

[State 8050, VelSet]
type = null;VelSet
trigger1 = Time = 0
trigger1 = parent, Stateno = 1000
x = 4

[State 8050, ChangeState]
type = ChangeState
trigger1 = FrontEdgeBodyDist <= -100
trigger2 = parent, anim != var(10);1210
;trigger3 = NumProjid(1010) < 1
value = 8051

;---------------------------------------------------------------------------
;Trilha de poeira - dissipando
[Statedef 8051]
type = C
movetype = I
ctrl = 0
anim = 8055
velset = 1,0
sprpriority = 5

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = anim != 3251
trigger1 = parent, anim = 1120
value = 3251
;elem = 1
;ignorehitpause = 
;persistent = 
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow 



[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time = 0 
id = 8050
;ignorehitpause = 
;persistent = 

[State 8051, DestroySelf]
type = DestroySelf
trigger1 = AnimTime = 0


;---------------------------------------------------------------------------
 
;=================================================================================

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

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

[Statedef -2]

[State Debug Display]
type = DisplayToClipboard
text = "%f var 22 = %f var 32 = %f %f %f"
params =  pos x, var(22), var(32), var(27), vel y;Pos X,Pos Y
;params = pos x,pos y,P2BodyDist X, P2BodyDist Y, var(7), var(9), var(8);Pos X,Pos Y
trigger1 = 1
trigger2 = time%1 = 0

;pots Lei-lei
[State -2, turnoffAI]
type=varset
trigger1=var(58)>0&&(roundstate!=2||!alive)
var(58)=-2
ignorehitpause=1
[State -2, AIvar]
type=varset
trigger1=var(58)=1
trigger2=var(59):=0
var(59)=1
ignorehitpause=1



[State -2, a]
type = VarSet
trigger1 =  1
var(22) = ceil(pos x)

[State -2, a]
type = VarSet
trigger1 =  1
var(32) = ceil(pos y)


[State -2, P2Pos Y]
type = VarSet
trigger1 =  1
var(9) = ceil( P2BodyDist Y+Pos Y)

[State -2, RunReset]
type = VarSet
triggerall = var(3) != 0
triggerall = stateno != [100,101]
triggerall = prevstateno != [100,101]
trigger1 =  statetype = S
trigger2 =  statetype = C
var(3) = 0

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

[state - 2, Samus scale] 
type = VarSet
trigger1 = fvar(14) = 0
fv = 14    ;fv = 10
value = Const(size.xscale)

[state - 2, P2groundfront] 
type = VarSet
trigger1 = movetype = A
trigger1 = time%1 = 0
fv = 16    ;fv = 10
value = p2bodydist x + const(size.ground.front) 



 
;---------------------------------------------------------------------------
[State 3333, RemoveExplod]
type = RemoveExplod
trigger1 = stateno != [2770,3900] 
id = 750
  
 
[State 3333, RemoveExplod]
type = RemoveExplod
trigger1 = stateno != [3000,3999]; || parent, stateno != 3500 ;[2770,3900]
ID = 3333
;-----------taken from [shinat]'s storm------------------------------------------
;-[ Floating ]-

[State -2, c]
type = VelSet
trigger1 = var(11)
trigger1 = MoveType != H
trigger1 = Vel Y >= 2.5
y = 2.5

[State -2, d]
type = CtrlSet
trigger1 = PrevStateNo = [600,699]
trigger1 = var(11)
;trigger1 = !var(12)
value = 0
persistent = 0

[State 50, VelAdd]
type = VelAdd
triggerall = var(3) = 0
triggerall = Vel X < 8.6
;triggerall = var(12)
triggerall = command = "holdfwd"
triggerall = command != "holdback"
trigger1 = StateNo = 50
trigger2 = StateNo = [600,699]
trigger3 = StateNo = [7000,7003]
trigger4 = StateNo = [850,860]
trigger4 = ctrl = 1
x = 1.55;const(velocity.walk.fwd.x)

[State 50, VelAdd]
type = VelAdd
triggerall = var(3) = 0
triggerall = Vel X > -8.6
;triggerall = var(12)
triggerall = command != "holdfwd"
triggerall = command = "holdback"
trigger1 = StateNo = 50
trigger2 = StateNo = [600,699]
trigger3 = StateNo = [7000,7003]
trigger4 = StateNo = [850,860]
trigger4 = ctrl = 1
x = -1.55;const(velocity.walk.fwd.x)*-1


[State 50, VelSet]
type = VelSet
triggerall = var(3) = 0
triggerall = command != "holdfwd"
triggerall = command = "holdback"
trigger1 = StateNo = 50
trigger1 = Vel X < -8.6
trigger2 = StateNo = [7000,7003]
x = -8.6  

[State 50, VelSet]
type = VelSet
triggerall = var(3) = 0
triggerall = Vel X > 8.6 
triggerall = command = "holdfwd"
triggerall = command != "holdback"
trigger1 = StateNo = 50 
trigger2 = StateNo = [7000,7003]
x = 8.6  

;--------------------------------------------
[State -2, Gas]
type = Explod
trigger1 = NumExplod(4444) = 0
trigger1 = var(11) = 1
;trigger1 = time%1 = 0
anim = 4444
ID = 4444
pos = floor(fvar(14)),floor(fvar(14))
postype = p1  ;p2,front,back,left,right
;facing =  ifelse(P2Dist X < -10,-1,1)
vfacing = 1
bindtime = -1 
removetime = -2 
scale = fvar(14),fvar(14)
sprpriority = -9 


[State -2, Gas hover]
type = RemoveExplod
trigger1 = var(11) != 1
trigger2 = var(11) = 1
trigger2 = anim != 44
id = 4444 
[State -2, Gas dash]
type = RemoveExplod
trigger1 = stateno != 100
trigger2 = command != "holdfwd" 
id = 4445
[State -2, Gas Sjump up]
type = RemoveExplod
trigger1 = anim != 7008 
id = 4441
[State -2, Gas Sjump fwd]
type = RemoveExplod
trigger1 = anim != 7007 
id = 4442
[State -2, Gas Sjump fwd]
type = RemoveExplod
trigger1 = anim != [1000,1009]
id = 1099



;-----------Edited from GGN's Ryu------------------------------------------------
;Soldats' Combo Counter
[State -2, Combo VarAdd]
type = VarAdd
trigger1 = (hitpausetime = 1) && (P2Movetype = H) && (MoveHit)
trigger2 = ProjHitTime(0) = 1
v = 21
value = 1
ignorehitpause = 1

[State -2, VarSet]
type = VarSet
trigger1 = P2Movetype != H
v = 21
value = 0 

[State -2, Clipboard]
type = null;DisplayToClipboard
trigger1 = 1
text = "Counter = %d"
params = Var(21)

;-----------Edited from GGN's Ryu------------------------------------------------
;Combo tira menos sangue
[State -2, AttackMulSet 1]
type = AttackMulSet
triggerall = stateno > 3000
trigger2 = hitdefattr = SCA, HA, HP
trigger1 = Var(21) >= 0
value = 1

[State -2, AttackMulSet 1]
type = AttackMulSet
triggerall = stateno < 3000
trigger1 = Var(21) <= 0
value = 1

[State -2, AttackMulSet 2]
type = AttackMulSet
triggerall = stateno < 3000
trigger1 = Var(21) = [1,4]  
value = 0.5

[State -2, AttackMulSet 3]
type = AttackMulSet
triggerall = stateno < 3000
trigger1 = Var(21) = [5,8]  
value = 0.3

[State -2, AttackMulSet 4]
type = AttackMulSet
triggerall = stateno < 3000
trigger1 = Var(21) > 8
value = 0.2

;---------------------------------------------------------------------------------
;Metroid Healing
[State -2, 3590] 
type = LifeAdd 
triggerall = var(23) < 520
triggerall = var(24) > 1
triggerall = var(24) < 310
triggerall = life < 1400
trigger1 = time%6 = 0  
value = 4
;Metroid Sits on Samus
[State -2, 3590]
type = VarAdd 
triggerall = var(23) > 0
trigger1 = var(23) < 520
v = 23
value = 1
;Metroid gives "310" energy when needed
[State -2, 3590]
type = VarAdd 
triggerall = life < 1400
triggerall = var(23) > 0
triggerall = var(23) < 520
triggerall = var(24) > 0
trigger1 = var(24) < 310
v = 24
value = 1

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22020) >=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22020 
ignorehitpause = 1

[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22021)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22021 
ignorehitpause = 1
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22022)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22022 
ignorehitpause = 1
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22023)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22023
ignorehitpause = 1
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22024)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22024
ignorehitpause = 1
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22025)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22025
ignorehitpause = 1
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(22026)>=1
trigger1 = stateno != 1200
trigger2 = anim = 1220
id = 22026
ignorehitpause = 1



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

[Statedef -3]

[State -3, Prevent Undergound Juggles] ;pots
type= targetbind
trigger1= movehit=1
trigger1= numtarget=1 && numenemy
trigger1= (target,time<=1) && (target,ID=enemynear,ID); this is just to prevent Simul issues as usual
trigger1= !(target,hitshakeover) && (target, hitfall) && (target, pos y>0)
pos= ceil(p2dist x), ceil(-pos y); keeps P2 at the same horizontal distance, but resets his Y position
ignorehitpause= 1

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = null;PlaySnd
triggerall = Time = 1
triggerall = vel y > 4
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 3 
[State -3, Landing Sound]
type = null;PlaySnd
triggerall = Time = 1
triggerall = vel y <= 4
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

; -10+random%21 that will be any value between -10 and 10 