; Blank'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]
;Amount of life to start with
life = 1000
;attack power (more is stronger)
attack = 100
;defensive power (more is stronger)
defence = 110
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 60
;Time which player lies down for, before getting up
liedown.time = 50
;Number of points for juggling
airjuggle = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 0




;Variables with this index and above will not have their values
;reset to 0 between rounds or matches. There are 60 int variables,
;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
;If omitted, then it defaults to 60 and 40 for integer and float
;variables repectively, meaning that none are persistent, i.e. all
;are reset. If you want your variables to persist between matches,
;you need to override state 5900 from common1.cns.
IntPersistIndex = 58
FloatPersistIndex = 40

[Size]
xscale = 0.5           ;Horizontal scaling factor.
yscale = 0.5          ;Vertical scaling factor.
ground.back = 15     ;Player width (back, ground)
ground.front = 16    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;Player width (front, air)
height = 70          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 1     ;Set to 1 to scale projectiles too
head.pos = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 2.6      ;Walk forward
walk.back = -2.2     ;Walk backward
run.fwd  = 4.9, 0    ;Run forward (x, y)
run.back = -4.5,-3.5 ;Hop backward (x, y)
jump.neu = 0,-7.4    ;Neutral jumping velocity (x, y)
jump.back = -3.25    ;Jump back Speed (x, y)
jump.fwd = 3.2       ;Jump forward Speed (x, y)
runjump.back = -3.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

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



[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "Can I go home now?"
victory2 = "That fight didn't drain much of my battery."
victory3 = "I look familiar because you have seen me on TV."
victory4 = "Beast Boy could turn into a rabbit and still beat you with both hands tied behind his back!"
victory5 = "I need to recharge."
victory6 = "Is that all you got?"
victory7 = "I knew the Master of Games was behind this!"




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


;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
[Statedef 170]
type = S
ctrl = 0
anim = ifelse(facing=1,170, 10170)
velset = 0,0

[State 170, Explodshoulder]
type = Explod
trigger1 =time=1
anim =477
ID =377
pos = -14,-60
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 8
vel = 0,0
accel = 0,0
removetime = -50
supermovetime = 0
pausemovetime = 0
scale = .4,.4
sprpriority = 0
ontop = 1
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =
;supermove = 0
;pausemove = 0



[State 170, Explodarm]
type = Explod
trigger1 =time=1
anim =477
ID =378
pos = 16,-43
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 8
vel = 0,0
accel = 0,0
removetime = -50
supermovetime = 0
pausemovetime = 0
scale = .4,.4
sprpriority = 0
ontop = 0
ownpal = 1
removeongethit = 0
;ignorehitpause =
;persistent =
;supermove = 0
;pausemove = 0


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







;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
[Statedef 180]
type = S

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

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
[Statedef 181]
type = S
ctrl = 0
anim = 181 ;remember to change this
velset = 0,0
persistent=0

[State 181, PlaySnd]
type = PlaySnd
trigger1 =1
value = S4,1
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0
;abspan =
ignorehitpause =1
persistent =0




[State 181, 1]
type = NotHitBy
trigger1 = 1
value = SCA
time = 1
persistent=0
;---------------------------------------------------------------------------
; Introduction
; CNS difficulty: basic
[Statedef 191]
type = S
ctrl = 0
anim =191;ifelse(facing=1,191,190); change too
velset = 0,0

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

[State 191, VelSet]
type = VelSet
trigger1 =roundState !=0
trigger1=animelemtime(7)=5
y = -5
persistent =1


[State 191, jump]
type = Explod
trigger1 =roundState !=0
trigger1=animelemtime(8)=1
anim =ifelse(facing = 1, 5210,15040)
ID =35
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 50
vel = 0,0
accel = 0,1
random = 0,0
removetime = 40
scale = .5,.5
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0


[State 191, VelSet];stopper
type = VelSet
trigger1 =roundState !=0
trigger1=animelemtime(7)=25
y = 0
persistent =1



[State 190, PosSet]
type = PosSet
trigger1 =roundState !=0
trigger1=animelemtime(8)=28
y = 0



[State 191, Explod2]
type = Explod
trigger1 =roundState !=0
trigger1=animelemtime(7)=1
anim =192
ID =34
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .3,.3
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 1
removeongethit = 0


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

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

; You can delete the following two controllers if you're building your own
; character using KFM. These are the wood pieces that KFM kicks.

; You can delete the following two controllers if you're building your own
; character using KFM. These play back the sounds of the wood block being
; broken.


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

[State 195, Explod]
type = Explod
trigger1 = time=1
anim =3001
ID =33
pos = 25,-85
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 25
removetime = 25
scale = 0.3,0.3
ontop = 1
removeongethit = 0



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

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

;----------------------------------->>>>>>>>>>>>
;---------------------------------------------------------------------------
; jump punch:Done and working
; CNS difficulty: easy
[Statedef 76]
type    = A                     ;State-type: S-stand, C-crouch, A-air, L-liedown
movetype= A                      ;Move-type: A-attack, I-idle, H-gethit
physics = A                      ;Physics: S-stand, C-crouch, A-air
juggle  = 2                      ;Number of air juggle points move takes
velset = 3,2                     ;Set velocity (x,y) (Def: no change)
ctrl = 0                         ;Set ctrl (Def: no change)
anim = ifelse(facing = 1, 77,76)                        ;Change animation (Def: no change)
poweradd = 20                    ;Power to add (Def: 0)
sprpriority = 2                  ;Set p1's sprite layering priority to 2 (in front)


[State 76, snd];growl
type = PlaySnd
trigger1 =AnimElem = 1
value = S17, 0




[State 76, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA                     ;Attribute: Standing, Normal Attack
damage = ifelse(var(1)=3,60,ifelse(var(1)=2,55,ifelse(var(1)=1,50,40))),20                  ;Damage that move inflicts, guard damage
animtype = Medium                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = L                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 6, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
                                  ;Hit/Miss/Dodge type (Def: Hit)
pausetime = 7, 8                 ;Time attacker pauses, time opponent shakes
sparkno = S905                    ;Spark anim no (Def: set above)
sparkxy = -5,-5             ;X-offset for the "hit spark" rel. to p2,
                                  ;Y-offset for the spark rel. to p1
hitsound = S7, 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 = 8             ;Time that the opponent slides back
ground.hittime  = 15             ;Time opponent is in hit state
ground.velocity = -7             ;Velocity at which opponent is pushed
airguard.velocity = -1.9,-.8     ;Guard velocity in air (def: (air.xvel*1.5, air.yvel/2))
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -3.4,-8           ;X-velocity at which opponent is pushed,
;p1getp2facing=1                                  ;Y-velocity at which opponent is pushed
air.hittime = 25                 ;Time before opponent regains control in air
air.cornerpush.veloff =3.4




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

;-----------------------------------^^^^^^^^^^^^-----------------------------------
; Standing strong punch: Done and working
; CNS difficulty: easy
; Note the width controller. It makes KFM's push box larger, so he doesn't
; stand so close to the opponent. Hit Ctrl-C and look at the red bar at his
; feet.
; The sprpriority for this state is at -1, instead of the usual 2 for
; attacks. This makes KFM appear behind the opponent initially.
; The SprPriority controller in [State 210, 4] brings KFM to the front when
; his arm has swung over.
; To stop KFM from pausing in his swing frame, there is a ChangeAnim in
; [State 210, 3] that detects if the hit has come in contact with the
; opponent during that frame, and switches to the next animation element
; (notice the elem=6 parameter). If you don't see what I mean, try commenting
; out that controller, then hit someone with this attack.
[Statedef 201]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 40
ctrl = 0
velset = 2,0
anim = ifelse(facing = 1, 201,202)
sprpriority = 2



[State 201, 1]
type = PlaySnd
trigger1 = Time = 2  ;change sound
value = 0, 4


[State 201, snd];growl
type = PlaySnd
trigger1 =time=1
value = S16, 2



[State 201, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = ifelse(var(1)=3,55,ifelse(var(1)=2,35,ifelse(var(1)=1,25,20)))
guardflag = MA
pausetime = 12,12
sparkno = S4606
sparkxy = -0,5
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -5.5
air.velocity = -2.5,-4

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

;----------------------------------^^^^^^^^^^-----------------------------------
; Knee: Done; and working
[Statedef 213]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 22
ctrl = 0
velset = 3,0
anim = ifelse(facing=1,213,214)
sprpriority = 2

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

[State 213, 2]
type = HitDef
trigger1 =  AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = ifelse(var(1)=3,58,ifelse(var(1)=2,38,ifelse(var(1)=1,28,23)))
guardflag = M
pausetime = 10,12
sparkno = S956
sparkxy = -17,-45
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 8
ground.hittime  = 15
ground.velocity = -5,3
air.velocity = -2.5,4.5

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

;----------------------------------^^^^^^^^^^^----------------------------------
;standing sonic cannon:Will not offset beam correctly.But does do damage.
[StateDef 250]
type = S
movetype= A
physics = S
juggle  = 8
velset = 0,0
ctrl = 0
;corrected anim time to match projectile.
anim =ifelse(facing = 1, 250,251)
poweradd = -30
sprpriority = 2

[State 250, PlaySnd]
type = PlaySnd
trigger1 = animelem=2
value = S4,0
volume = 0
channel = 8
;lowpriority = -1
freqmul = 1.0
ignorehitpause = 0
persistent = 0


[State 250, StopSnd]
type = StopSnd
trigger1=animtime = 0
trigger2 = movetype = H
channel = 8
ignorehitpause =1
persistent =1



[State 250, 1]
type = Projectile
trigger1 = AnimElem = 3
projanim = 309 ; beam
sparkno = S310 ;explosion
sparkxy =-15+ floor(p2dist X), 0
projpriority = 1
projheightbound = -240, 100
projedgebound = 150
projscreenbound = 100
;Added this
projremove = 0
projremovetime =30
projshadow = -1
;Please note i have changed the position in the .sff file, i have then used the
;offset viewer to position the beam. Halved to match with your scaling.
offset = 46,-52
velocity = 0
attr = S, SP
damage   = ifelse(var(1)=3,115,ifelse(var(1)=2,95,ifelse(var(1)=1,85,80))),15
animtype = heavy
guardflag = L
hitflag = MAFP
pausetime = 1,3
hitsound   = 5,2
guardsound = S6,0
ground.type = Low
ground.slidetime = 30
ground.hittime  = 31
ground.velocity = -7
air.animtype = Back
air.velocity = -4,-8
air.juggle = 3
air.fall = 1
down.velocity = -4,-7
down.hittime = 30
down.bounce = 0
fall=1
;added this as well.
persistent = 0

;Altered this, you need better control of things
[State 250, 2]
type = ChangeAnim
trigger1 = animtime = 0
value=ifelse(facing = 1, 263,255)
persistent = 0

;Altered this
[State 250, 3]
type = Changestate
trigger1 = anim = 263 || anim = 255
trigger1 = animtime = 0
value = 0
ctrl=1








;------------------------------^^^^^^^^^^^^^^^^-------------------------------
;jumping sonic cannon STATUS: this could be fixed. by using N physics and moving
;cyborg up then simulate gravity.
;beam won't do damage. TEST AGAIN!!!
;Beam hits, i can correct the jump stuff if you like but you're going to need to
;decide how it's actually meant to work, i'd just freeze him in midair, that's the
;normal method. Play as Cyclops in XmvSF if you want to see this sort of thing
;in action.
[StateDef 260]
type = A
movetype= A
physics = N     ;Added this
anim = ifelse(facing = 1, 260,262)
ctrl = 0
velset = 0,-5  ;And this; I changed the velocity to up.
poweradd=-30
sprpriority = 2

[State 260, VelSet for x] ;direction control exe
type = Varset
trigger1 =time=1
value=ifelse(command = "holdfwd" && Pos Y <=-2,sysvar(1)=1,ifelse(command = "holdback" && Pos Y <=-2,sysvar(1)=-1,sysvar(1)=0))
persistent =1
;---------->>> end control
[State 260, VelSet];  gravity
type = VelSet
trigger1 =time=25
y = 6
;ignorehitpause =
persistent =0


[State 260, stop];stop gravity
type = VelMul
trigger1 =(Pos Y >=0)&&(time>=46)
x = 0
y = 0
ignorehitpause =1


[State 260, Changestate]
type = ChangeState
trigger1 =(Pos Y >=0)&&(time>=47)
persistent =0
value = 0
ctrl = 1

;start of helpter
[State 260, Helper]
type = Helper
trigger1=time=8; triger and frame
helpertype=normal
stateno = 309; state of the beem animation
ID=52
pos = -428,68
postype=p1
facing = 1
removeongethit = 1
priority  = 2


[State 260, PlaySnd]
type = PlaySnd
trigger1 = animelem=2
value = S4,0
volume = 0
channel = 8
;lowpriority = -1
freqmul = 1.0
ignorehitpause = 0
persistent = 0



[State 260, StopSnd]
type = StopSnd
trigger1=animtime = 0
trigger2 = movetype = H
channel = 8
ignorehitpause =1
persistent =1

;--------------
[StateDef 309] ; Beam helpter's statedef
type = A
movetype= A
physics = N
;velset = 0,0
ctrl = 0
anim =309
poweradd = -40
juggle = 8

[State 309,1] ;helper hitdef
type =HitDef
trigger1=time=4
damage   =ifelse(var(1)=3,115,ifelse(var(1)=2,95,ifelse(var(1)=1,85,80))),ifelse(var(1)=3,65,ifelse(var(1)=2,55,ifelse(var(1)=1,45,40)))
animtype = heavy
Attr = A, SP   ;This is why it does no damage, you didn't have it.
guardflag = LA
hitflag = MAFP
pausetime = 1,3
hitsound   = 5,2
sparkno = S310 ;explosion
sparkxy =-15+ floor(p2dist X), 0
guardsound = S6,0
ground.type = Low
ground.slidetime = 27
ground.hittime  = 25
ground.velocity = -7
air.animtype = Back
air.velocity = -4,-7
air.juggle = 3
air.fall = 1
down.velocity = -4,-6
down.hittime = 30
down.bounce = 1
priority  = 2

;This is why the offset malfunctions, defaults to 0,0, Have added pos, please take note
[State 309, Bind]
type = BindToParent
time= 44
Trigger1 = IsHelper(52)
pos = 24,-65
ignorehitpause =1

;change when hitting the ground vel y>0 && posy >=0
[State 309, DestroySelf]
type = DestroySelf
trigger1 =time=44
ignorehitpause =1
persistent =1


;-------------------^^^^^^^^^^^^^^^^^^^^^-----------------------------------

;Cyber Stomp (Psudo super according to Battle Blitz) STATUS:Done and working
[StateDef 295]
type = S
movetype= A
physics = N
juggle  = 8
velset = 0,0
ctrl = 0
anim = ifelse(facing = 1, 250,251)
poweradd = 40


[State 295, AfterImage]
type = AfterImage
trigger1 = time=2
time = 30
length = 20
palcolor = 256
palinvertall = 1
palbright = 30,35,40
palcontrast = 120,150,200
palpostbright = 3,0,0
paladd = 5,10,25
palmul = .65,.60,.75
timegap = 1
framegap = 2
trans = add



[state 295, changeanim] ;air jump animation
type = changeanim
trigger1 = time=1
value =ifelse(facing = 1, 377,378)

[State 295, 1]   ;set velocity upwards
type = VelAdd
trigger1 = time=2
triggerall =(Pos Y =0)
y = -12
x = 2


[state 295,2]
type=ChangeAnim
value =ifelse(facing=1,259,258)  ;change to jump animation
trigger1 = time=15

[State 295, 4]   ;set velocity downwards
type=VelSet
x=6
y=12
trigger1 =time=20 || Pos Y <= -400
trigger1=Pos Y <=-1
ignorehitpause =1
persistent=1

[State 295, VelMul];floor fly stop
type = VelMul
trigger1 =(Pos Y >=0)&&(time>=4)
x = 0
y = 0
ignorehitpause =1

[state 295,6] ;change to jump animation
type=ChangeAnim
value =ifelse(facing=1,259,258)
trigger1 = animelem=6

[state 295,7]   ;change to crouching attack
type=ChangeAnim
value =ifelse(facing = 1, 295,294)
trigger1 =time=25


[State 295, 8]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Heavy
damage    = ifelse(var(1)=3,90,ifelse(var(1)=2,70,ifelse(var(1)=1,60,55))),ifelse(var(1)=3,45,ifelse(var(1)=2,30,ifelse(var(1)=1,20,15)))
guardflag = M
pausetime = 10,20
;sparkno = s909
;sparkxy = 0,19; fix
hitsound   = S14,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 9
ground.hittime  = 22
ground.velocity = -4,-6
air.velocity = -2.5,-8.5
fall = 1
fall.xvelocity = 4
air.fall = 1
down.bounce = 1
persistent =0


[State 295, Explod];hitspark
type = Explod
trigger1 =time=25
anim =909
;ID =
pos = 0,15
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 15
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
scale = .7,.7
sprpriority = 0
ontop = 1
ownpal = 1
removeongethit = 1
ignorehitpause =0
persistent =0







[State 295, 9] ;change to standing animation
type = ChangeState
trigger1 = Time = 50
value = 0
ctrl = 1





;---------------------------^^^^^^^^^^^^^^^^^^^^^------------------------------
;Upper-cut  : Done and working
[Statedef 381]
type    = C
movetype= A
physics = C
juggle  = 4
poweradd= 20
ctrl = 0
velset = 0,0
anim = ifelse(facing = 1, 381,382)
sprpriority = 2

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


[State 381, snd];growl
type = PlaySnd
trigger1 = Time = 1
value = S16, 2


[State 381, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = ifelse(var(1)=3,65,ifelse(var(1)=2,45,ifelse(var(1)=1,35,30)))
guardflag = L
pausetime = 12,12
sparkno = S4606
sparkxy = -10,20
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 9
ground.hittime  = 10
ground.velocity = -2.5,-5
air.velocity = -1.5,-5
air.hittime = 13
guard.slidetime =7

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

;---------------------------^^^^^^^^^^^^^^^^^^^^^------------------------------
;Pulse bomb: Done
[StateDef 549]
type = S
movetype= A
physics = S
juggle  = 8
velset = 0,0
ctrl = 0
anim = ifelse(facing = 1, 250,251)
poweradd = 50


[State 549, PlaySnd]
type = PlaySnd
trigger1 =animelem=4
value = S9,0
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
ignorehitpause = 1

[State 549, PlaySnd];explosion
type = PlaySnd
trigger1 = time=48
value = S12,0
volume = 0
channel = -1
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0



[State 549, 1]
type = Projectile
trigger1 = AnimElem = 4
projanim = 344 ; bomb
projhitanim = 450 ;explosion
projpriority = 1
projheightbound = -240, 100
projedgebound = 100
projscreenbound = 100
projremovetime =69
projshadow = -1
offset = 55,-47
velocity = 7,1
attr = S, SP
damage   = ifelse(var(1)=3,110,ifelse(var(1)=2,90,ifelse(var(1)=1,80,75))),50
animtype = heavy
guardflag = L
hitflag = MAFP
pausetime = 1,3
sparkxy = 500,500
guardsound = S6,0
ground.type = Low
ground.slidetime = 25
ground.hittime  = 25
ground.velocity = -18
air.animtype = Back
air.velocity = 4,-6
air.juggle = 3
air.fall = 1
down.velocity = 4,-5
down.hittime = 30
down.bounce = 1
persistent =0


[State 549, 2]
type = ChangeAnim
trigger1 = Time =30
value=ifelse(facing = 1, 263,255)
persistent =0

[State 549, 3]
type = Changestate
trigger1 =  Time=50
value = 0
ctrl=1

;--------------------------^^^^^^^^^^^^^^^^^^^^^^-----------------------------
;Tow Stomp:  vs him, his clsn's aren't big enough, you need to rework them
;I have edited the red box, you need to correct ALL the blue ones, they should
;go to floor level.
;
[Statedef 418]
type    = S
movetype= A
physics = S
juggle  = 0
poweradd= 10
ctrl = 0
anim = ifelse(facing=1,418,419)
sprpriority = 2

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

[State 418, 2]
type = HitDef
trigger1 = animelem = 2              ;You aren't IN anim 1, course it won't work
attr = S, NA
damage    = 20
animtype  = Medium
hitflag = MAF
guardflag = L
pausetime = 12,12
sparkno = s4606
sparkxy = -5,60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -2,4

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

;---------------------------^^^^^^^^^^^^^^^^^^^^^------------------------------

;Power Up:Done and working
[Statedef 3030];Transformation
type = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = ifelse(facing = 1, 434,15025)

[State 3030];Varset
type=varset
trigger1=power <=999
var(1)=1

[State 3030];Varset
type=varset
trigger1=power >=1000
var(1)=2

[State 3030];Varset
type=varset
trigger1=power >=2000
var(1)=3

[State 3030, PowerAdd]
type = PowerAdd
triggerall=P2BodyDist X > 40
triggerall =power<powermax && command = "hold_x" && command = "hold_y"
trigger1=(time%2)
value =3+(time/15)
ignorehitpause =0
persistent =1

[State 3030, sound]
type = PlaySnd
triggerall=P2BodyDist X > 40
trigger1= Time=1 || time=110|| time=220 ||time=330
value = S3, 0
ignorehitpause =0
persistent =1
channel = 3


[State 3030, StopSnd]
type = StopSnd
trigger1=command != "hold_x" || command != "hold_y"
channel = 3
ignorehitpause =1
persistent =1



[State 3030, Explod]
type = Explod
triggerall=P2BodyDist X > 40
trigger1=Time=1 || time= 85 ||time=170 ||time=225
anim =ifelse(facing=1,3030,3031)
ID =35
pos = 0,0
postype = p1  ;p2,front,back,left,right
bindtime = 150
scale = 0.5,0.5
ontop = 1
removeongethit = 1
persistent =1



[State 3030, RemoveExplod]
type = RemoveExplod
trigger1 =command != "hold_x" || command != "hold_y"
trigger2 = anim =0
id =35
ignorehitpause =1
persistent =1

[State 3030, 1]
type = CtrlSet
trigger1 =command != "hold_x" || command != "hold_y"
trigger2 = anim=0
value = 1

[State 3030,2];Changestate
type=changestate
trigger1 =command != "hold_x" || command != "hold_y"
value=0;back to standing state
ctrl = 1

;---~~~~~~~~~~~~~~~~~~~~~~XXXXXXXXXXXXXXXXXXXXXXXXXXX~~~~~~~~~~~~~~~--->><<
;                                  SUPERS
;________________________________________________________________________

;Sonic Cannon 100% (Super according to the show when pluged in to T-tower):Done
[StateDef 400]
type = S
movetype= A
physics = S
juggle  = 8
velset = 0,0
ctrl = 0
;extension of anim to fit projectile removetime
anim = ifelse(facing = 1, 250,251)
poweradd = -1000

[State 667, superEx]
type = Explod
trigger1 =time=1
anim =1999
;ID =22
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .5,.5
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =
supermove = 999
pausemove = 999
persistent =0


[State 400, SuperPause]
type=SuperPause
trigger1=time=1
time=25
sound=0
darken=1
unhittable=1

[State 400, EnvShake]
type = EnvShake
trigger1 = AnimElem = 2
time = 15
freq = 60
ampl = -9
phase = 90
ignorehitpause =1
persistent =0

[State 400, PlaySnd]
type = PlaySnd
trigger1 = AnimElem = 3
value = S15,0
volume = 0
channel = 4
freqmul = 1.0
loop = 0
pan = 0
persistent = 0
ignorehitpause =0


[State 3030, StopSnd]
type = StopSnd
trigger1=animtime = 0
trigger2 = movetype = H
channel = 4
ignorehitpause =1
persistent =1


;Corrected all sorts of stuff here. You had problems with alignment and timing.
;Please note new alignment in .sff as well as .air. I have altered the second changeanim here
;i have also altered the timing of the animation itself.
[State 400, 1]
type = Projectile
attr = S, HA
trigger1 = AnimElem = 3
projanim = 404 ; beam
sparkno = S451 ;explosion
sparkxy =-15+ floor(p2dist X), 10
projpriority = 1
projheightbound = -240, 100
projedgebound = 150
projscreenbound = 100
projremovetime = 29
projremove = 0
projshadow = -1
offset = 45,-50
velocity = 0
attr = S, SP
damage   = ifelse(var(1)=3,460,ifelse(var(1)=2,400,ifelse(var(1)=1,0,370))),ifelse(var(1)=3,190,ifelse(var(1)=2,160,ifelse(var(1)=1,20,140)))
animtype = heavy
guardflag = L
hitflag = MAFP
pausetime = 3,5
hitsound   = 5,2
guardsound = S6,0
ground.type = Low
ground.slidetime = 35
ground.hittime  = 25
ground.velocity = -20
air.animtype = Back
air.velocity = -8,-6
air.juggle = 7
air.fall = 1
down.velocity = -4,-9
down.hittime = 30
down.bounce = 1
persistent =0
fall = 1

[State 400, 2]
type = ChangeAnim
trigger1 = animtime = 0
value=ifelse(facing = 1, 263,255)
persistent = 0

[State 400, 3]
type = Changestate
trigger1 = anim = 263 || anim = 255
trigger1 = animtime = 0
value = 0
ctrl=1

;--------------____________________-------------------______________--------



;Call'in Raven
[Statedef 666]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= -2000
ctrl = 0
velset = 0,0
anim =0 ;ifelse(facing = 1, 381,382)
sprpriority = 2


[State 667, superEx]
type = Explod
trigger1 =time=1
anim =1999
;ID =22
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .5,.5
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =
supermove = 999
pausemove = 999
persistent =0









[State 666, SuperPause]
type = SuperPause
trigger1 =time=1
time =ifelse(parent,life>450,160,197);0)
;anim =
;sound = S10,0
pos = 0,0
move = 0
movetime = 0
darken = 1
p2defmul = 0
poweradd = 0
unhittable = 1
;supermovetime =1
;pausemovetime = 1
;endcmdbuftime = (winmugen only)
;pausebg =  (winmugen only)
ignorehitpause =1
persistent =0




[State 666, Helper];calling Raven
type = Helper
trigger1 =time=1;3
helpertype = normal ;player
name ="Raven"
ID =62
stateno =667
pos = 0,0
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 0
;pausemove = 0
;size.xscale (.5)
;size.yscale (.5)
;size.shadowoffset (int)
ignorehitpause =1
persistent =0



[State 666, 4];give back control
type = ChangeState
trigger1 = Time = 15
value =0
ctrl = 1


;------------- Helper Raven
[statedef 667]
type=S
;type = A
movetype= A
physics=S
sprpriority = 2
Anim=665; circle and black fire intro


[State 667, PosSet];spawn infront of cyborg
type = PosSet
trigger1 =time=1
x = ifelse(facing=1,parent,pos x + 60,ifelse(facing=-1,parent,pos x - 60,0))
y = 0
ignorehitpause =1
persistent =1





[State 667, Explod1];Raven as explod
type = Explod
trigger1 =time=26
anim =661
ID =22
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .5,.5
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =
supermove = 999
pausemove = 999
persistent =0


[State 667, RemoveExplod];remove standing
type = RemoveExplod
trigger1 =time=82
id =22
ignorehitpause =1
persistent =0




[State 667, Explod0];intro glow
type = Explod
trigger1 =time=20
anim =666
ID =23
pos = 0,0
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .5,.5
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 0
removeongethit = 0
;ignorehitpause =
;persistent =
supermove = 999
pausemove = 999
persistent =0

[State 667, RemoveExplod];remove glow
type = RemoveExplod
trigger1 =time=70
id =23
ignorehitpause =1
persistent =1



[State 667, Changeanim];running
type = Changeanim
trigger1 =time=80
value = 662
elem=1
ignorehitpause =1
persistent =0

;------------------------------------------------
; helth dependent part
;-----------------------------------------------


[State 667, VelSet];set up target homing
type = VelAdd
trigger1 = p2dist X>= 70 && time>80 && parent,life>450 ;trigger for good life
x = 1.5
y = 0
ignorehitpause =1
persistent =1






[State 667, VelSet2];set up target homing;
type = VelAdd
trigger1=p2dist X>= 220 && time>80 && parent,life<450 ;trigger for bad life
x = 1.3
y = 0
ignorehitpause =1
persistent =1



;-------------------------------Raven attacks------------------------------
[State 667, ChangeAnim2];attacking kick for good health
type = Changeanim
trigger1 =time>80&& Vel X = 0 && parent,life>450
value = 663
ignorehitpause =1
persistent =0

[State 667, HitDef]
type = HitDef
trigger1 =time>80&& Vel X = 0 && parent,life>450
attr = S, NA
animtype  = Medium
damage    = ifelse(var(1)=3,165,ifelse(var(1)=2,145,ifelse(var(1)=1,135,130)))
guardflag = H
pausetime = 12,12
sparkno = S4606
sparkxy = -10,20
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 9
ground.hittime  = 10
ground.velocity = -4.5,-2
air.velocity = -1.5,-5
air.hittime = 13
guard.slidetime =7
persistent =0
ignorehitpause =1

;------------------------------------------------------------------------------
;                    Helth dependent Area
;-----------------------------------------------------------------------------




[State 667, ChangeAnim];change to telik
type = ChangeAnim
trigger1 =time>80&& Vel X = 0 && parent,life<450
value = 669
elem = 1
ignorehitpause =1
persistent =0



[State 667, PlaySnd]
type = PlaySnd
trigger1 =time>70&& Vel X = 0 && parent,life<450
value = S12,1
volume = 2
channel = -1
;lowpriority = -1
freqmul = 1.0
;abspan =
ignorehitpause =1
persistent =0







[State 667, ChangeAnim2];exit bad
type = ChangeAnim
triggerall=stateno=667
trigger1 =movecontact && parent,life<450 && time>160
trigger2=time>125
value = 664
elem = 1
ignorehitpause =1
persistent =0




[State 667, ChangeAnim3];exit good
type = ChangeAnim
triggerall=stateno=667
trigger1=anim=663 && movecontact && parent,life>450
trigger2=time=120
value = 664
elem = 1
ignorehitpause =1
persistent =0




[State 667, Explod4];exit circle
type = Explod
triggerall=Anim = 664
trigger1 =animelemtime(2)=20
anim =667
ID =24
pos = -5,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = 1.7,1.7
sprpriority = 0
ontop =1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause =1
persistent =0
supermove = 999
pausemove = 999


[State 667, RemoveExplod];remove exit circle
type = RemoveExplod
triggerall=Anim = 664
trigger1=animelemtime(4)=3
id =24
ignorehitpause =1
persistent =1



[State 667, Explod2];exit spark
type = Explod
triggerall=Anim = 664
trigger1  =animelemtime(1)=4
anim =668
ID =25
pos = -5,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime =0
pausemovetime = 0
scale = .6,.6
sprpriority = 0
ontop = 1
shadow = 0,0,0
ownpal = 0
removeongethit = 0
ignorehitpause =1
persistent =0
supermove = 999
pausemove = 999


[State 667, RemoveExplod];remove spark
type = RemoveExplod
triggerall=Anim = 664
trigger1=animelemtime(4)=3
id =25
ignorehitpause =1
persistent =1


[State 667, DestroySelf]
type = DestroySelf
trigger1 =Time = 152
ignorehitpause =1
persistent =1

;-----------------------------helper projectiles----------------
[State 667, Helper]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 6
helpertype = normal ;player
ID =70
stateno =701
pos = 50,-10
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0




[State 667, Helper2]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 7
helpertype = normal ;player
ID =72
stateno =702
pos = 70,-25
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0




[State 667, Helper3]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 7
helpertype = normal ;player
ID =73
stateno =703
pos = 90,-50
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0
size.xscale =0.25
size.yscale= 0.25



[State 667, Helper4]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 9
helpertype = normal ;player
ID =74
stateno =704
pos = 110,-75
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0



[State 667, Helper8]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 8
helpertype = normal ;player
ID =78
stateno =708
pos = 130,-95
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0
size.xscale =0.3
size.yscale= 0.3

[State 667, Helper6]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 8
helpertype = normal ;player
ID =76
stateno =706
pos = -110,-75
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0


[State 667, Helper7]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 6
helpertype = normal ;player
ID =77
stateno =707
pos = -90,-50
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0
size.xscale =0.3
size.yscale= 0.3



[State 667, Helper5]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 9
helpertype = normal ;player
ID =75
stateno =705
pos = -70,-25
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 999
pausemovetime = 999
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0
size.xscale =0.20
size.yscale= 0.20


[State 667, Helper9]
type = Helper
trigger1 =parent,life<450 && anim=669 &&AnimElemTime(1) = 7
helpertype = normal ;player
ID =79
stateno =709
pos = -50,-10
postype = p1    ;p2,front,back,left,right
facing = 1
keyctrl = 0
ownpal = 0
supermovetime = 1
pausemovetime = 1
;supermove = 999
;pausemove = 999
ignorehitpause =1
persistent =0


;-----------------------------ojbects------------------------------------



[statedef 701]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=701

[State 701, velset]
Type = velset
trigger1=time=14
x = 4.5
y=0.2

[State 701, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 701, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[statedef 702]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=702

[State 702, velset]
Type = velset
trigger1=time=14
x = 4.3
y=0.4

[State 702, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 702, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[statedef 703]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=703

[State 703, velset]
Type = velset
trigger1=time=16
x = 4.6
y=0.3


[State 703, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 703, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[statedef 704]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=704

[State 704, velset]
Type = velset
trigger1=time=13
x = 5.5
y=0.1


[State 704, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 704, DestroySelf]
type = DestroySelf
trigger1 =time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[statedef 705]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=705

[State 705, velset]
Type = velset
trigger1=time=13
x = 5.2
y=0.6


[State 705, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 705, DestroySelf]
type = DestroySelf
trigger1 =time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[statedef 706]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=706


[State 706, velset]
Type = velset
trigger1=time=14
x = 5.1
y=0.2

[State 706, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 706, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[statedef 707]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=707

[State 707, velset]
Type = velset
trigger1=time=15
x = 5.3
y=0.1


[State 707, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 707, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

[statedef 708]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=708

[State 708, velset]
Type = velset
trigger1=time=12
x = 5.8
y=0.2


[State 708, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 708, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[statedef 709]
type=U
movetype=A
physics=N
juggle = 0
poweradd= 3
sprpriority = 2
anim=709


[State 709, velset]
Type = velset
trigger1=time=10
x = 5.5
y=0.1

[State 709, HitDef]
type = HitDef
trigger1 = vel X!=0
attr = S,NA        ;SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
hitflag = MAF        ;HLAFD+-
guardflag = MA         ;HLA
animtype = medium          ;light,medium,hard,back,up,diagup
air.animtype = medium
damage = ifelse(var(1)=3,75,ifelse(var(1)=2,61,50)),34
pausetime = 0 ,0
sparkno = S3000
guard.sparkno = S3100
sparkxy = 0,0
hitsound = S1,0
guardsound = S2,0
ground.type = High      ;Low,Trip,None
ground.slidetime = 4
ground.hittime = 2
air.hittime = 10
ground.velocity = 0,0
air.velocity = 0,0
sprpriority = 2
p1getp2facing = 0
fall = 0
fall.yvelocity = -4.5
fall.recover = 1
fall.recovertime = 4
fall.damage = 0
air.fall = 1
envshake.time = 2
fall.envshake.time = 0
ignorehitpause =1
persistent =0

[State 709, DestroySelf]
type = DestroySelf
trigger1 = time>100
ignorehitpause =1
persistent =0


;`````````````````````````````````````````````````````````````````````````````````````



;--------------____________________-------------------______________--------

;Deus Ex Heal (Super according to the show):Done
[statedef 2020]
type=U
movetype=I
physics=N
juggle = 0
poweradd= -3000
sprpriority = 2
anim=5

[State 2020, superEx]
type = Explod
trigger1 =time=1
anim =1999
;ID =22
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 60
vel = 0,0
accel = 0,0
random = 0,0
removetime = -2
supermovetime = 0
pausemovetime = 0
scale = .5,.5
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =
supermove = 999
pausemove = 999
persistent =0



[State 2020, EnvShake]
type = EnvShake
trigger1 =time=1
time = 9
freq = 90
ampl = -5
phase = 100
ignorehitpause =1
persistent =1

[State 2020, 2OS]
type=varset
trigger1=(prevstateno=2020||stateno=2020)
v=2
value=1
ignorehitpause =1
persistent=1

[State 2020, 1]
type=varset
trigger1 =(prevstateno=2020||stateno=2020)
v = 5
value = 770

[State 2020,Changestate]
type = ChangeState
trigger1 = animtime = 0
value = 0
ctrl = 1



[State 2020, RemoveExplod stand]
type = RemoveExplod
trigger1 =statetype=L
id =292
ignorehitpause =1
persistent =1

[State 2020, RemoveExplod LayRight]
type = RemoveExplod
trigger1 =statetype!=L ;&& facing!=1
id =293
ignorehitpause =1
persistent =1






;------------------------->
[statedef -2]




[State -2, RemoveExplod stand]
type = RemoveExplod
trigger1 =statetype=L
id =292
ignorehitpause =1
persistent =1

[State -2, RemoveExplod LayRight]
type = RemoveExplod
trigger1 =statetype!=L
id =293
ignorehitpause =1
persistent =1






[State -2, 3]
type = varadd
trigger1 =(prevstateno=2020||stateno=2020)
v=5
value = -1
ignorehitpause =1
persistent=1

[State -2, LifeAdd]
type = LifeAdd
triggerall=var(5)!=0
trigger1 = var(2)=1
value = 2
ignorehitpause =1
persistent =0



[State -2, PlaySnd]
type = PlaySnd
triggerall=var(5)!=0
trigger1 =var(2)=1
value = S16,0
volume = -1
channel = 2
;lowpriority = -1
freqmul = 1.0
loop = 0
pan = 0
ignorehitpause =1
persistent =1

[State -2, StopSnd]
type = StopSnd
triggerall=var(5)=0
trigger1 = var(2)=1
channel = 2
ignorehitpause =1
persistent =1



[State -2, glow stand]
type = Explod
triggerall=!numexplod(292);SO2's code
trigger1=var(5)!=0  && statetype!=L
time = life < lifemax
anim =946
ID =292
pos = 0,-10
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 999999
removetime =999
scale = .5,.3
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =0




[State -2, glow stand Lay]
type = Explod
triggerall=!numexplod(293);SO2's code
trigger1=var(5)!=0  && statetype=L
time = life < lifemax
anim =947
ID =293
pos = 0,-10
postype = p1  ;p2,front,back,left,right
facing = -1
vfacing = ifelse(facing=1,-1,ifelse(facing=-1,1,1))
bindtime = 999999
removetime =999
scale = .5,.3
sprpriority = 0
ontop = 0
shadow = 0,0,0
ownpal = 1
removeongethit = 0
ignorehitpause =1
persistent =0






[State -2, AfterImage]
type = AfterImage
trigger1=time=1
triggerall =var(5)!=0
time =10
length = 20
palcolor = 256
palcolor = 256
palinvertall = 0
palbright = 30,35,40
palcontrast = 120,150,200
palpostbright = 3,0,0
paladd = 5,10,25
palmul = .65,.50,.75
timegap = 1
framegap = 2
trans = add
ignorehitpause =1
persistent =1


[State -2, stop]
type = varset
trigger1 =life = lifemax
v=5
value = 0
ignorehitpause =1
persistent =1



;________________________________________________________________________
;---~~~~~~~~~~~~~~~~~~~~~~XXXXXXXXXXXXXXXXXXXXXXXXXXX~~~~~~~~~~~~~~~--->><<
;                                     END
;________________________________________________________________________
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~--->><<
;__________________________________________________________________________



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

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

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

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

[Statedef -3]

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, Landing Sound]
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = 40, 0

;This controller plays a sound everytime KFM lands from a jump, or
;from his back-dash.
[State -3, running Sound];works
type = PlaySnd
triggerall =stateno=100 ||stateno=21 ||stateno=20
trigger1 =AnimElem = 2
trigger2 =AnimElem = 4
;trigger3 =AnimElem = 5
;trigger4 =AnimElem = 7
value = S5, 0


[State -3, land];works
type = PlaySnd
triggerall = Time = 1
trigger1 = stateno = 52 ;Jump land
trigger2 = stateno = 106 ;Run-back land
value = S15, 1
volume = 5





[State -3, dead]
type = PlaySnd
triggerall =!Alive && Life = 0
trigger1 = time=1
value = S14,0
channel = 0
persistent =0
;-------------------------------------------

[State 295, PosSet];glitch fix
type = PosSet
triggerall=prevstateno!=294 && stateno!=294
trigger1=statetype != A
trigger1=time=1
y = 0
ignorehitpause =1
persistent =1


