; The Bopper's constants and state file.
; There are comments scattered through this file, so you may like to
; take a look if you are not one of the Warriors

[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1000
;attack power (more is stronger)
;攻撃ダメージ
attack = 100
;defensive power (more is stronger)
;体力パワー
defence = 100
;Percentage to increase defense everytime player is knocked down
fall.defence_up = 50
;Time which player lies down for, before getting up
liedown.time = 60
;Number of points for juggling
airjuggle = 2
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = 255
;Variables with this index and above will not have their values
;reset to 0 between rounds or matches. There are 60 int variables,
;indexed from 0 to 59, and 40 float variables, indexed from 0 to 39.
;If omitted, then it defaults to 60 and 40 for integer and float
;variables repectively, meaning that none are persistent, i.e. all
;are reset. If you want your variables to persist between matches,
;you need to override state 5900 from common1.cns.
IntPersistIndex = 58	;Set this to at most the index of your primary AI variable.
; Also, if your character overrides StateDef 5900, do make sure you clear
; at least var(58) there when !RoundsExisted.
FloatPersistIndex = 40

[Size]
xscale = .5           ;Horizontal scaling factor.
yscale = .5           ;Vertical scaling factor.
ground.back = 20     ;Player width (back, ground)
ground.front = 20    ;Player width (front, ground)
air.back = 20        ;Player width (back, air)
air.front = 20       ;Player width (front, air)
height = 60          ;Height of player (for opponent to jump over)
attack.dist = 160    ;Default attack distance
proj.attack.dist = 90 ;Default attack distance for projectiles
proj.doscale = 0     ;Set to 1 to scale projectiles too
head.pos = 0, -113   ;Approximate position of head
mid.pos = 0, -70    ;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  = 3      ;Walk forward
walk.back = -3     ;Walk backward
run.fwd  = 6, 0    ;Run forward (x, y)
run.back = -6,-7.7 ;Hop backward (x, y)
jump.neu = 0,-13.13    ;Neutral jumping velocity (x, y)
jump.back = -3.1    ;Jump back Speed (x, y)
jump.fwd = 3.1       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-13.13      ;.
airjump.back = -3.55      ;Air jump speeds (opt)
airjump.fwd = 3.5         ;.
air.gethit.groundrecover = -.15,-3.5  ;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,-4.5    ;Velocity offset for air recovery (x, y) **MUGEN 1.0**
air.gethit.airrecover.back = -1       ;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 = -2         ;Extra y-velocity for holding up during air recovery **MUGEN 1.0**
air.gethit.airrecover.down = 1.5      ;Extra y-velocity for holding down during air recovery **MUGEN 1.0**

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

[Quotes]
; Up to 100 victory quotes can be specified per language (victory0 - victory99)
victory1 = "What was more wrong here? Your confidence, or your intelligence?"
victory2 = "Christ, I could've fixed myself up supper this whole time. Why don't you go do that for me?"
victory3 = "Cry about it on IRC, bitch. I'll be reading it and laughing!"
victory4 = "Your face is going to look like a fucking Tim Burton movie by the time I'm completely done with you!"
victory5 = "Yes, but did you know that alexlexusisblack.mp4"
victory6 = "Shitty edit by day, actual character at night... I AM ALTER AMIBA."
victory7 = "You died as hopelessly as you lived."
victory8 = "I won't ever do what you want me to do, unless you want me to put a fucking gun in your mouth!"
victory9 = "Let this be a lesson to you: nobody ever wins in a dairy challenge!"
victory10 = "CvS-style that, motherfucker!"
victory11 = "You'll pay for the time I wasted on your sorry ass and a million times more!"
victory12 = "Now to go upload this to YouTube."
victory13 = "AY YAH LASSIE, I'LL FECK YER ARSE"
victory14 = "You're probably a racist too. Piece of SHIT!"
victory15 = "....surely you noticed a good bit of my win quotes are plagiarized?"
victory16 = "Infinitycat sucks. IKEMEN's stoopid."
victory17 = "Oh no, you did NOT just slap me out here in this here woods."
victory18 = "We try to do our very best at Amiba's!"
victory19 = "You did quite well for a corpse, my friend. Rest in peace."
victory20 = "Man, I'm all lightheaded now. You just suck THAT bad."
victory21 = "lemme take u 2 da movies shortay"
victory22 = "You don't deserve a winquote, so you get my date/time. 9:35 AM 1/10/2011"
victory23 = "I am fucking invincible. I bet that didn't occur to you before anyway!"
victory24 = "If only you knew the pain I carry within my netherregions....if only!"
victory25 = "Your eyes....it's like they're mocking me....I must close them!"
victory26 = "Aquapazza sucks and is a shitty-ass game."
victory27 = "Now THIS I can dig."
victory28 = "Idiot! I was made to humiliate you!"
victory29 = "Maybe life six feet under the ground will suit you much better...."
victory30 = "I can see it in your eyes. You don't know the secret behind big dick control, do you?"
victory31 = "No, you're no good... You aren't the opponent worth risking my life."
victory32 = "Don't ever try to get cocky with me again. Go to hell."
victory33 = "I have sinned... again..."
victory34 = "Ignorance is such a scary thing... It made you go against me!"
victory35 = "If you don't see there's no way out, just no way of gettin' round me....then you got it bad."
victory36 = "I'll smash you to the end of the universe if that's what you really want!"
victory37 = "The funny thing is, I don't even like video games."
victory38 = "Shall I show you the true battle? Could you imitate it? I wonder..."
victory39 = "Welcome to the wonderful world of 'You're not my friend anymore.' You're of the list forever. Have a nice day."
victory40 = "This just proves to me that you were a waste of my time, and not worth my trust. Goodbye."
victory41 = "I hope this is not Chris' blood."
victory42 = "I am on fire. And you literally will be too! Be proud!"



;---------------------------------------------------------------------------
; 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(9)  - 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(22) - one-time air techniques
; var(52) - AI considerator
; var(56) - used by the XOR-ed commands method to detect recent custom states.
; var(57) - the GameTime variable, required by the helper and XOR methods.
; var(58) - the primary AI variable.
; var(55)  - the simplifier variable, optional but helpful.
; var 40,41,42/47
; 40.0 CD
; 40.1 S.LP
; 40.2 S.HP
; 40.3 S.LK
; 40.4 S.HK
; 40.5 C.LP
; 40.6 C.HP
; 40.7 C.LK
; 40.8 C.HK
; 40.9 J.LP
; 41.0 J.HP
; 41.1 J.LK
; 41.2 J.HK
; 41.3 F.LK
; 41.4 Stock Photo Kick
; 41.5 I have nothing
; 41.6 Backander
; 41.7 Projectile
; 41.8
; 41.9
; 42.0 DF.LP
; 42.1 Backwallbounce
; 42.2 Backtrip
; 42.3 Backup
; 42.4 Backkick
; 42.5
; 42.6
; 42.7
; 42.8
; 42.9

;---------------------------------------------------------------------------
; KO Voice
[Statedef 179]
type = S
ctrl = 0
anim = 9741
velset = 0,0


[State WHAM Timer]
type = VarSet
trigger1 = 1
var(30) = parent,var(32)
ignorehitpause = 1
[State WHAM Timer]
type = VarSet
trigger1 = (parent,var(33)=0)
v = 32
value = 0
ignorehitpause = 1
[State WHAM Timer]
type = VarAdd
trigger1 = (parent,var(33)=1)
v = 32
value = 1
ignorehitpause = 1
;[State WHAM]
;type = PlaySnd
;trigger1 = var(32) = 1
;value = S5,4
;freqmul = 1.0
;ignorehitpause = 1

[State PERFECT]
type = PlaySnd
trigger1 = winko
trigger1 = roundstate = 3
trigger1 = parent,life = lifemax
value = S0,4
volume = 255
abspan = 0
ignorehitpause = 1
persistent = 0

[State 0, VarSet]
type = VarAdd
trigger1 = var(12) > 0
trigger1 = numexplod(947)
var(12) = -1
[State 0, VarSet]
type = VarSet
trigger1 = fvar(13) != 0
trigger1 = !numexplod(947)
fvar(13) = 0
[State 0, VarSet]
type = VarAdd
trigger1 = var(12) > 0
trigger1 = fvar(13) < .5
trigger1 = numexplod(947)
fvar(13) = 0.05
[State 0, VarSet]
type = VarAdd
trigger1 = fvar(13) > 0
trigger1 = numexplod(947)
trigger1 = var(12) <= 0
fvar(13) = -0.05
[State 0, VarSet]
type = VarSet
trigger1 = fvar(13) > .5
trigger1 = var(12) > 0
trigger1 = numexplod(947)
fvar(13) = .5

[State 0, VarSet]
type = VarSet
triggerall = !numhelper(3640)
trigger1 = !numexplod(947)
trigger1 = (p2movetype != H && p2stateno != [5000,5110]) || roundstate = 4
trigger1 = p2life - var(13) <= -380
var(12) = 150
[State Hihihihi]
type = PlaySnd
triggerall = !numhelper(3640)
trigger1 = !numexplod(947)
trigger1 =(p2movetype != H && p2stateno != [5000,5110]) || roundstate = 4
trigger1 = p2life - var(13) <= -380
value = S701,61
channel = 0
volume = 255
abspan = 0
ignorehitpause = 1
[State SOVIET DAMAGE]
type = Explod
triggerall = !numhelper(3640)
trigger1 = !numexplod(947)
trigger1 =(p2movetype != H && p2stateno != [5000,5110]) || roundstate = 4
trigger1 = p2life - var(13) <= -380
anim = 947
ID = 947
pos = 160,60
postype = left
bindtime = -1
;removetime = 150
removetime = -1
supermovetime = 65535
pausemovetime = 65535
scale = fvar(13),fvar(13)
sprpriority = 666
ontop = 1
ownpal = 1
ignorehitpause = 1
[State MAO]
type = ModifyExplod
trigger1 = numexplod(947)
ID = 947
pos = 160,60
supermovetime = 65535
pausemovetime = 65535
scale = fvar(13),fvar(13)
sprpriority = 666
ontop = 1
ownpal = 1
ignorehitpause = 1
[State REM]
type = RemoveExplod
trigger1 = numexplod(947)
trigger1 = fvar(13) <= 0
trigger1 = var(12) <= 0
id = 947
ignorehitpause = 1

[State remember p2 life]
type = VarSet
trigger1 = (p2movetype != H && p2stateno != [5000,5110]) || roundstate = 4
var(13) = p2life
ignorehitpause = 1


;---------------------------------------------------------------------------
; Jump Start
[Statedef 40]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
var(2) = 0
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "x"
var(2) = 600
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "y"
var(2) = 610
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "a"
var(2) = 630
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "b"
var(2) = 640
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "CD"
var(2) = 660
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "QCF_a" || command = "QCF_b"
var(2) = 1000

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0
[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(2) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = var(55) && (var(52) = 41 || var(52) = 44)
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger2 = var(55) && (var(52) = 42 || var(52) = 45)
sysvar(1) = -1
[State 40, 1]
type = VarSet
trigger1 = command = "SupahJump"
trigger1 = command != "ChargedSupahJump"
trigger2 = var(55) && (var(52) = [43,45])
sysvar(2) = 1
[State 40, 2]
type = VarSet
trigger1 = (prevstateno = [210,1199]) || (prevstateno = [1400,1410])
sysvar(4) = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = sysvar(2)
trigger1 = animtime = 0
value = S0,2
[State 0, AfterImage]
type = AfterImage
trigger1 = sysvar(2)
trigger1 = animtime = 0
time = 42
length = 15
palcolor = 40
paladd = 10,10,10
palmul = .74,.74,.74
timegap = 1
framegap = 4
trans = add

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, const(velocity.jump.neu.x), ifelse(sysvar(1)=1, const(velocity.jump.fwd.x), const(velocity.jump.back.x))) * ifelse(sysvar(2),2.2,1)
y = const(velocity.jump.y) * ifelse(sysvar(2),1.1,1)

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = const(velocity.runjump.fwd.x)

[State 40, 5] ; LAUNCHER
type = VelSet
triggerall = command != "holdback"
triggerall = prevstateno >= 200
trigger1 = numtarget
trigger1 = AnimTime = 0
;trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) != -1
trigger1 = sysvar(4) = 1
trigger1 = p2statetype = A
x = ifelse(abs(p2bodydist x / 10)>=3.5,ifelse(p2dist x>=0,3.5,-3.5),(p2bodydist x / 10))

[State 40, 1] ; Lol Buffer
type = Changestate
triggerall = command != "upper_what"
triggerall = animtime = 0
trigger1 = var(2) != 0
value = var(2)
ctrl = 0

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


;---------------------------------------------------------------------------
; Jump Land
[Statedef 52]
type    = S
physics = S
ctrl = 0
anim = 47
facep2 = 1

[State 52, 1]
type = VelSet
trigger1 = Time = 0
y = 0

[State 52, 2]
type = PosSet
trigger1 = Time = 0
y = 0

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

[State 52, Trip Guard]
type= changestate
trigger1= inguarddist
trigger1= ctrl && command="holdback"
value= 120

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

;---------------------------------------------------------------------------
; AirDash
[Statedef 110]
type    = A
physics = N
velset = 0,0
ctrl = 0
anim = 110

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 1
time = 30
length = 15
palcolor = 40
paladd = 10,10,10
palmul = .74,.74,.74
timegap = 1
framegap = 4
trans = add

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(22) = var(22) | floor(exp(1*ln(2)) + 0.5)

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 90, 3

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

[State 0, StateTypeSet]
type = Velset
trigger1 = animelem = 2
x = const(velocity.run.fwd.x)
y = -1.1
[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem = 3
value = 1
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 9
physics = A
[State 0, VelMul]
type = VelMul
trigger1 = animelemtime(9) >= 0
x = 0.97

;---------------------------------------------------------------------------
; AirDash
[Statedef 115]
type    = A
physics = N
velset = 0,0
ctrl = 0
anim = 115

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
time = 30
length = 15
palcolor = 40
paladd = 10,10,10
palmul = .74,.74,.74
timegap = 1
framegap = 4
trans = add

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(22) = var(22) | floor(exp(1*ln(2)) + 0.5)

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S701,60
channel = 0

[State 0, StateTypeSet]
type = Velset
trigger1 = time = 0
x = const(velocity.run.back.x)
y = -1.5
[State 0, CtrlSet]
type = CtrlSet
trigger1 = animelem = 3
value = 1
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
physics = A
[State 0, VelMul]
type = VelMul
trigger1 = animelemtime(5) >= 0
x = 0.97



;---------------------------------------------------------------------------
; Lose by Time Over
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 190, 2]
type = ChangeState
trigger1 = Time = 0
value = 171+random%3

;what the fuck
[Statedef 171]
type = S
ctrl = 0
anim = 170
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 15
volume = 255

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

;would you sign my petition
[Statedef 172]
type = S
ctrl = 0
anim = 171
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 2
value = 701, 25

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

;amiba's spine collapses
[Statedef 173]
type = S
ctrl = 0
anim = 172
velset = 0,0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 1
value = 701, 41

[State 2000, 1]
type = explod
trigger1 = Time = 0
anim = 172
pos = 160, 120
postype = left
sprpriority = -10
bindtime = -1
supermove = 1
ontop = 1
facing = 1

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

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


;---------------------------------------------------------------------------
; Win state decider
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 180]
type = S

[State 180, 1]
type = ChangeState
trigger1 = Time = 0
value = 181+random%9

;---------------------------------------------------------------------------
; Win pose 1 - Bow
; CNS difficulty: basic
; CNS レベル: 基本
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 650
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = animelemtime(4) >= 0
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 669, 0
;channel = 0
abspan = 0

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 43
value = 700, (random%10)
channel = 0
loop = 1
abspan = 0

; Win pose 2 - well that was fun
; CNS difficulty: basic
[Statedef 182]
type = S
ctrl = 0
anim = 182
velset = 0,0

[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(18) >= 0
trigger1 = animelemtime(21) < 0
scale = 1+(animelemtime(18)),1
ignorehitpause = 1
[State 0, Trans]
type = Trans
trigger1 = animelemtime(18) >= 0
trigger1 = animelemtime(21) < 0
trigger1 = (animelemtime(18)%4)=[0,1]
trans = add
ignorehitpause = 1
[State 0, Trans]
type = Trans
trigger1 = animelemtime(18) >= 0
trigger1 = animelemtime(21) < 0
trigger1 = (animelemtime(18)%4)=[2,3]
trans = add1
ignorehitpause = 1

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 400
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 16

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 18
value = 701, 17

; Win pose 3 - cyrus amiba
; CNS difficulty: basic
[Statedef 183]
type = S
ctrl = 0
anim = 183
velset = 0,0

[State 0, VarAdd]
type = VarSet
trigger1 = time = 0
var(0) = -150
[State 0, VarAdd]
type = VarAdd
trigger1 = time >= 170
var(0) = 12

[State 0, Explod]
type = Explod
trigger1 = time >= 170
trigger1 = var(0) <= 150
anim = 1830+random%12
ID = 1830
pos = var(0),0
postype = p1
facing = ifelse(random<500,1,-1)
vfacing = 1
bindtime = 1
removetime = -1
scale = .5,.5
sprpriority = -12
shadow = -1,-1,-1
ownpal = 1
removeongethit = 1

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 840
flag = RoundNotOver

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 24

; Win pose 4 - name's amiba. that's all you need to know.
; CNS difficulty: basic
[Statedef 184]
type = S
ctrl = 0
anim = 184
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 200
flag = RoundNotOver

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 28

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3

; Win pose 5 - overly defensive over a shitty-ass loli game
; CNS difficulty: basic
[Statedef 185]
type = S
ctrl = 0
anim = 1900
velset = 0,0

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

[State 191, Shake Screen]
type = EnvShake
trigger1 = Time = 0
time = 250    ;Time to shake screen
ampl = 8     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 220
flag = RoundNotOver

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 80
volume = 255

; Win pose 6 - necro storm
; CNS difficulty: basic
[Statedef 186]
type = S
ctrl = 0
anim = 186
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 250
flag = RoundNotOver

[State 0, Explod]
type = Explod
trigger1 = Time = 1
anim = 1860
ID = 1860
pos = -20,7
postype = p1
bindtime = -1
vfacing = 1
bindtime = 1
vel = 0,0
ownpal = 1
sprpriority = 1
shadow = 255,255,255
ignorehitpause = 1

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 1
value = 701, 39

[State 181, Sound]
type = PlaySnd
trigger1 = Time = 35
value = 701, 37

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 10
value = 701, 38

[State 181, Sound]
type = PlaySnd
trigger1 = AnimElem = 9
value = 100, 3

; Win pose 7 - Melvana is lazy if you haven't noticed
[Statedef 187]
type = S
ctrl = 0
anim = 187
velset = 1,0

[State 0, Hi-res lol]
type = AngleDraw
trigger1 = anim = 187
scale = 2, 2
ignorehitpause = 1

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 300
flag = RoundNotOver

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

[State 5120]
type = PlaySnd
trigger1 = Time = 0
value = 701, 42
channel = 0
loop = 1

; Win pose 8 - i feel like a pussy when i make an amiba winpose
[Statedef 188]
type = S
ctrl = 0
anim = 188
velset = 0,0

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 120
flag = RoundNotOver

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

[State 5120]
type = PlaySnd
trigger1 = Time = 0
value = 701, 43
channel = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fvar(0) = 0
[State 0, VarSet]
type = VarAdd
trigger1 = time
fvar(0) = 0.05
[State 0, Explod]
type = Explod
trigger1 = 1
anim = 1880
ID = 1880
pos = 160,120
postype = left
facing = 1
vfacing = 1
bindtime = 1
removetime = 1
scale = fvar(0),fvar(0)
sprpriority = -333
ownpal = 1
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = 0
[State 0, VarSet]
type = VarAdd
trigger1 = time
trigger1 = var(0) > -255
var(0) = -5
[State 0, BGPalFX]
type = BGPalFX
trigger1 = 1
time = 1
add = var(0),var(0),var(0)

; Subhuman music
; CNS difficulty: basic
[Statedef 189]
type = S
ctrl = 0
anim = 189
velset = 0,0

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

[State 181, 0]
type = AssertSpecial
trigger1 = Time < 260
flag = RoundNotOver
[State 181, 0]
type = AssertSpecial
trigger1 = 1
flag = nomusic

[State 181, Sound]
type = PlaySnd
trigger1 = (time%48)=0
trigger2 = (time%48)=24
value = 701, 69

[State 0, Explod]
type = Explod
trigger1 = (time%48)=0
trigger2 = (time%48)=24
anim = 1890
ID = 1890
pos = ifelse((time%48)=24,80,-80),0
postype = p1
facing = ifelse((time%48)=24,-1,1)
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = -2
shadow = -1,-1,-1
removeongethit = 1
ignorehitpause = 1

[State 181, Sound]
type = PlaySnd
triggerall = time >= 48
trigger1 = (time%48)=12
trigger2 = (time%48)=36
value = 701, 70

[State 0, Explod]
type = Explod
triggerall = time >= 48
trigger1 = (time%48)=12
trigger2 = (time%48)=36
anim = 1891
ID = 1891
pos = ifelse((time%48)=36,40,-40),-25
postype = p1
facing = ifelse((time%48)=36,-1,1)
vel = 0,-20
accel = 0,0.88
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = -4
shadow = -1,-1,-1
removeongethit = 1
ignorehitpause = 1

[State 181, Sound]
type = PlaySnd
triggerall = time >= 168
trigger1 = (time%48)=12
trigger2 = (time%48)=18
trigger3 = (time%48)=36
value = 701, 71

[State 0, Explod]
type = Explod
triggerall = time >= 168
trigger1 = (time%48)=12
trigger2 = (time%48)=18
trigger3 = (time%48)=36
anim = 1892
ID = 1892
pos = random%320,random%240
postype = left
facing = ifelse(random<500,-1,1)
vfacing = ifelse(random<500,-1,1)
vel = 0,0
bindtime = 1
removetime = -2
scale = .5,.5
sprpriority = 666
ontop = 1
shadow = 0,0,0
removeongethit = 1
ignorehitpause = 1

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 0
range = -200,200
ignorehitpause = 1
[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 1
range = -200,200
ignorehitpause = 1
[State 0, Null]
type = Null
trigger1 = 1
trigger1 = (fvar(0):=var(0))
trigger1 = (fvar(1):=var(1))
ignorehitpause = 1
[State 0, Explod]
type = ModifyExplod
trigger1 = numexplod(1892)
ID = 1892
pos = random%320,random%240
postype = left
facing = ifelse(random<500,-1,1)
vfacing = ifelse(random<500,-1,1)
bindtime = 1
scale = fvar(0)/100,fvar(1)/100

[State 0, EnvShake]
type = EnvShake
triggerall = time >= 168
trigger1 = (time%48)=12
trigger2 = (time%48)=18
trigger3 = (time%48)=36
time = 4
freq = 255
ampl = -8


;---------------------------------------------------------------------------
; PREINTRO
[Statedef 190]
type = S
ctrl = 0
velset = 0,0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = random%5

[State 190, 2]
type = ChangeState
trigger1 = p2name = "Jagi"
value = 19666

[State 190, 2] ;Go straight to intro.
type = ChangeState
trigger1 = Time = 0
value = ifelse(var(0)>=4,192+var(0),191+var(0))


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

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

[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

[State 191, Sound]
type = PlaySnd
trigger1 = AnimElem = 4
value = 666, (random%8)
volume = 255
channel = 1

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 16
value = 668,0
volume = 255

; Introduction #2 (solis)
; CNS difficulty: basic
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0

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

[State 192, 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

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701,6
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 35
value = 701,7
volume = 255
channel = 1

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 60,0
volume = 255

[State 191, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 9
trigger2 = AnimElem = 11
trigger3 = AnimElem = 13
trigger4 = AnimElem = 15
trigger5 = AnimElem = 17
trigger6 = AnimElem = 19
trigger7 = AnimElem = 21
trigger8 = AnimElem = 23
trigger9 = AnimElem = 25
trigger10 = AnimElem = 27
trigger11 = AnimElem = 29
trigger12 = AnimElem = 31
time = 4     ;Time to shake screen
ampl = 2     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

; Introduction #3 (amiba aho shokougun)
; CNS difficulty: basic
[Statedef 193]
type = S
ctrl = 0
anim = 193
velset = 0,0

[State 192, 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

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 1
value = 701,26
volume = 255
channel = 1

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701,27
volume = 255
channel = 1

[State 0, Explod]
type = Explod
trigger1 = Time = 1
anim = 1930
ID = 687
pos = -80,0
postype = p1
bindtime = -1
vfacing = 1
scale = .5, .5
bindtime = 1
vel = 0,0
ownpal = 1
sprpriority = 1
scale =
shadow = 255,255,255
ignorehitpause = 1

; piss-ass mac!
; CNS difficulty: basic
[Statedef 194]
type = S
ctrl = 0
anim = 194
velset = 0,0

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

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

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

[State 2000, 1]
type = explod
trigger1 = time = 0
anim = 1940
pos = 160, 120
postype = left
sprpriority = 6666666666
bindtime = -1
supermove = 1

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

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 0
value = 701,33
volume = 255
channel = 1

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 181
value = 701,34
volume = 255
channel = 1

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

; hard on's dick must die
; CNS difficulty: basic
[Statedef 196]
type = S
ctrl = 0
anim = 1978
velset = 0,0
sprpriority = 3

[State 191, Shake Screen]
type = EnvShake
trigger1 = AnimElem = 42
trigger2 = AnimElem = 47
time = 16     ;Time to shake screen
ampl = 2     ;Amount to shake
freq = 180   ;A frequency of 180 shakes the screen rapidly

[State 2000, 1]
type = explod
trigger1 = time = 0
anim = 1977
pos = 0, 0
postype = p1
sprpriority = 2
bindtime = -1
supermove = 1

[State 0, SprPriority]
type = SprPriority
trigger1 = animelem = 44
value = 0

[State 2000, 1]
type = explod
trigger1 = AnimElem = 42
anim = 1979
pos = -20, -95
postype = p1
sprpriority = 6666666666
bindtime = -1
supermove = 1

[State 2000, 1]
type = explod
trigger1 = AnimElem = 47
anim = 1979
pos = 0, 0
postype = p1
sprpriority = 6666666666
bindtime = -1
supermove = 1
scale = 5, 5


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

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 701,78
channel = 1
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 42
value = 701,44
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 43
value = 666,2
channel = 1
volume = 255

[State 191, Snd 1]
type = PlaySnd
trigger1 = AnimElem = 47
value = 701,ifelse(random<500,79,82)
channel = 1
volume = 255


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


; -----SPECIAL INTRO YOU FUCKING IDIOT---------
[Statedef 19666]
type = S
ctrl = 0
anim = 196
velset = 0,0

[State 181]
type = AssertSpecial
trigger1 = 1
flag = NoMusic

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

[State 191, 2]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = nofg

[State 2000, 1]
type = explod
trigger1 = time = 0
anim = 1960
pos = 160, 120
postype = left
sprpriority = 6666666666
bindtime = -1
supermove = 1

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

[State 191, Snd 1]
type = PlaySnd
trigger1 = Time = 0
value = 701,40
volume = 255

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


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

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = roundstate >= 3
var(48) = 1


[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S667,random%6
channel = 0

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

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

;---------------------------------------------------------------------------
; Stand Light Punch
; CNS difficulty: easy
[Statedef 200]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(40) & floor(exp(1*ln(2)) + 0.5) ,1,0)
velset = 0,0
ctrl = 0
anim = ifelse(anim=200,201,200)
poweradd = 20
sprpriority = 2
facep2 = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.95
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(1*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 20, 0
animtype = Light
guardflag = MA
hitflag = MAF
pausetime = 8-var(49), 7
sparkno = 0
sparkxy = -10, ifelse(anim=201,-115,-95)
hitsound = S50, 0
guardsound = S51, 0
ground.type = High
ground.slidetime = 13
ground.hittime  = 13
guard.velocity = -8
guard.ctrltime = 12
ground.velocity = -3
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -3,-8.8
air.hittime = 13
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 200
trigger1 = AnimElemTime(4) = 2
movetype = I

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

;---------------------------------------------------------------------------
; Standing strong punch
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(40) & floor(exp(2*ln(2)) + 0.5) ,1,0)
poweradd= 65
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x<=10&&anim!=410,215,210)
facep2 = 1

[State 210, 3]
type = ChangeAnim
trigger1 = anim = 215
trigger1 = AnimElemTime(3) > 0 && AnimElemTime(4) <= 0
trigger1 = movecontact
ignorehitpause = 1
persistent = 0
value = 215
elem = 4

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 210
trigger1 = time = 1
value = S5,12
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 215
trigger1 = time = 1
value = S701,50
channel = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) >= 0
trigger1 = animelemtime(6) < 0
x = 19.97314
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6) = 0
x = 0

[State 200, 1]
type = PlaySnd
trigger1 = anim = 210
trigger1 = animelem = 5
trigger2 = anim = 215
trigger2 = animelem = 2
value = 100, 3

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.85
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(2*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = anim = 210
trigger1 = AnimElem = 6
attr = S, NA
damage = 60, 0
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 2
sparkxy = -10, -90
hitsound = S50, 4
guardsound = S51, 0
ground.type = high
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -9
guard.ctrltime = 10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
[State 200, 1]
type = HitDef
trigger1 = anim = 215
trigger1 = AnimElem = 3
attr = S, NA
damage = 55, 0
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 12-var(49), 11
guard.pausetime = 4-var(49),0
sparkno = 2
sparkxy = -10, -70
hitsound = S50, 4
guardsound = S51, 0
ground.type = low
ground.slidetime = 19
ground.hittime  = 19
guard.velocity = 20
guard.ctrltime = 15
ground.velocity = -10
ground.cornerpush.veloff = -12
guard.cornerpush.veloff = 0
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
[State 0, PlayerPush]
type = PlayerPush
trigger1 = moveguarded
value = 0
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 210
trigger1 = animelem = 7
trigger2 = anim = 215
trigger2 = animelem = 4
movetype = I

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

;---------------------------------------------------------------------------
; Standing light kick
; CNS difficulty: easy
[Statedef 230]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(40) & floor(exp(3*ln(2)) + 0.5) ,1,0)
poweradd= 22
ctrl = 0
velset = 0,0
anim = ifelse(p2bodydist x<=25&&anim!=230&&anim!=215,230,235)
sprpriority = 2
facep2 = 1

[State 0, PosAdd]
type = PosAdd
triggerall = anim = 235
trigger1 = animelem = 5
trigger2 = animelem = 6
x = 10

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.89
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(3*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = anim = 230
trigger1 = AnimElem = 3
attr = S, NA
damage = 30
animtype = light
guardflag = L
hitflag = MAF
pausetime = 10-var(49), 9
sparkno = 0
sparkxy = -10, -30
hitsound = S50, 0
guardsound = S51, 0
ground.type = low
ground.slidetime = 20
ground.hittime = 20
guard.velocity = -8
guard.ctrltime = 10
ground.velocity = -6.5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
[State 200, 1]
type = HitDef
trigger1 = anim = 235
trigger1 = AnimElem = 4
attr = S, NA
damage = 50, 0
animtype = Medium
guardflag = MA
hitflag = MAF
pausetime = 10-var(49), 9
sparkno = 1
sparkxy = -10, -85
hitsound = S50, 5
guardsound = S51, 0
ground.type = High
ground.slidetime = 24
ground.hittime = 24
guard.velocity = -11
guard.ctrltime = 10
ground.velocity = -10
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = anim = 230
trigger1 = AnimElem = 4
trigger2 = anim = 235
trigger2 = AnimElem = 5
movetype = I

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 100, 2

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

;---------------------------------------------------------------------------
; Standing strong kick
; CNS difficulty: easy
[Statedef 240]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(40) & floor(exp(4*ln(2)) + 0.5) ,1,0)
poweradd= 65
ctrl = 0
velset = 0,0
anim = 240
sprpriority = 2
facep2 = 1

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

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 2
x = 10
[State 0, PosAdd]
type = PosAdd
trigger1 = animtime = 0
x = -10

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(4*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = S, NA
damage = 80, 0
animtype = up
guardflag = MA
hitflag = MAFD
pausetime = 12-var(49), 11
sparkno = 3
sparkxy = -10, -75
hitsound = S50, 1
guardsound = S51, 0
ground.type = High
ground.slidetime = 26
ground.hittime = 26
guard.velocity = -13
guard.ctrltime = 10
ground.velocity = 0,-14
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,-14
air.hittime = 20
down.velocity = 0,-16
fall = 1
fall.recovertime = 40
id = 240
nochainid = 240
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 5
movetype = I

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 100, 3

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

;---------------------------------------------------------------------------
; SLASH!
[Statedef 250]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(41) & floor(exp(3*ln(2)) + 0.5) ,1,0)
poweradd= 65
ctrl = 0
velset = 0,0
anim = 250
facep2 = 1

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

[State 200, 1]
type = PlaySnd
trigger1 = Time = 4
value = 100, 3

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(3*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, AllPalFX]
type = AllPalFX
trigger1 = movehit
time = 6
invertall = 1
color = 64
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(5) < 0
x = 16.7931 * ifelse(movecontact,2,1)
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
x = 0
[State 0, PlayerPush]
type = PlayerPush
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(5) < 0
trigger2 = movehit
value = 0
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
damage = 90,0
animtype = high
guardflag = MA
hitflag = MAF
pausetime = 0, 12
guard.pausetime = 0,8
sparkno = 12
sparkxy = -10, -76
hitsound = S701, 23
guardsound = S51, 0
ground.type = trip
ground.slidetime = 23
ground.hittime  = 23
guard.velocity = 12
guard.ctrltime = 10
ground.velocity = 9.6,-5.5
airguard.velocity = -1.9,-.8
air.type = trip
air.velocity = 9.6,-5.5
air.hittime = 20
fall = 1
fall.recovertime = 40
id = 123
yaccel = .5

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
movetype = I

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


;---------------------------------------------------------------------------
; FUCK YOU
[Statedef 260]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(40) & floor(exp(0*ln(2)) + 0.5) ,1,0)
poweradd= 65
ctrl = 0
velset = 0,0
anim = 260
facep2 = 1

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

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = 1
ignorehitpause = 1
persistent = 0
[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = 0
ignorehitpause = 1
persistent = 0
[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = 0
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) >= 0
trigger1 = animelemtime(7) < 0
x = 4
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(7) = 0
x = 0
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(12) >= 0
x = -2

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 9
attr = S, NA
damage = 123,0
animtype = diagup
guardflag = H
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 3
sparkxy = -10, -60
hitsound = S701, 45
guardsound = S51, 0
ground.type = low
ground.slidetime = 23
ground.hittime  = 23
guard.velocity = -9
guard.hittime = 40
ground.velocity = -5,-7.5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -5,-7.5
air.hittime = 20
fall = 1
fall.recovertime = 40
id = 123
yaccel = .5

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 10
movetype = I

[State 0, ]
type = PlaySnd
trigger1 = moveguarded
value = 0,1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = EnvColor
trigger1 = moveguarded
value = 255,255,255
time = 2
under = 1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = TargetState
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 264
ignorehitpause = 1
persistent = 0
[State 0, ]
type = HitAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 1
ignorehitpause = 1
persistent = 0

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

;---------------------------------------------------------------------------
; Ground hit slide
[Statedef 264]
type    = U
movetype= H
physics = N
ctrl = 0

[State 5000, 1] ;Anim for HIT_LIGHT to HIT_HARD
type = ChangeAnim2
trigger1 = !selfanimexist(ifelse(statetype=C,5920,5912))
trigger1 = gethitvar(hittime) > 16
value = ifelse(statetype=C,265,264)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
trigger1 = selfanimexist(ifelse(statetype=C,5920,5912))
value = ifelse(statetype=C,5920,5912)
ignorehitpause = 1

[State 5001, 1]
type = VelSet
trigger1 = Time = 0
x = -1
[State 5001, 1]
type = Velmul
trigger1 = Time = 0
x = 0.98

[State 5001, 4]
type = VelSet
trigger1 = gethitvar(hittime) <= 0
x = 0

[State 5001, 6]
type = SelfState
trigger1 = gethitvar(hittime) <= 0
value = ifelse(statetype=C,11,0)
ctrl = 1



;---------------------------------------------------------------------------
;Crouching light punch
; CNS difficulty: easy
; Description: Simple crouching attack. The HitDef's guardflag parameter
;     is set to "L", meaning that the move can only be guarded low
;     (crouching), and not by standing or jumping opponents.
;     Like for all light attacks, it's a good idea to keep the slidetime
;     and hittime parameters at a smaller number, so the opponent isn't
;     stunned for too long. For all crouching attacks you have to
;     remember to set the attr parameter to indicate that it is crouching
;     attack. In this case, "C, NA" stands for "crouching, normal attack".
;     The HitDef's priority is set at 3, instead of the default of 4,
;     so this attack has a lower priority than most others, meaning
;     KFM will get hit instead of trading hits with his opponent if
;     their attack collision boxes (Clsn1) intersect each other's Clsn2
;     boxes at the same time.
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = ifelse(var(40) & floor(exp(5*ln(2)) + 0.5) ,1,0)
poweradd= 15
ctrl = 0
anim = 400
sprpriority = 2
facep2 = 1

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

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.95
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(5*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage = 20, 0
animtype = light
guardflag = M
hitflag = MAF
pausetime = 8-var(49) , 7
guard.pausetime = 8-var(49), 7
sparkno = 1
sparkxy = -10, -77
hitsound = S50, 0
guardsound = S51, 0
ground.type = low
ground.slidetime = 16
ground.hittime  = 16
guard.velocity = -7
guard.ctrltime = 12
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -3,-8.8
air.hittime = 13
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 4
movetype = I

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

;---------------------------------------------------------------------------
;Crouching strong punch
; CNS difficulty: easy
; Description: This is a 2-hit move. It is done by having two HitDefs
;     triggered, one for each frame of animation that hits.
;     Notice how the first hit cannot be guarded by an opponent in the
;     air, because of the "M" in the guardflag, meaning it can only
;     be guarded "middle". The second hit has an "MA" guardflag, so
;     it can be guarded both on the ground and in the air.
; CNS レベル: 易
; 詳細: これは殴打が二発ある攻撃です。
; 殴打できるアニメーションの枚は一々HitDefを登録しています。
; 一発目の攻撃のHitDefにはguardflagが「M」（middle＝中段ガード）
; にセットされているので、相手は空中でガードできません。二発目
; の攻撃のguardflagは「MA」（middle+air＝中段＋空中ガード）で、
; 地上、空中でもガードすることができます。
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = ifelse(var(40) & floor(exp(6*ln(2)) + 0.5) ,1,0)
poweradd= 50
ctrl = 0
anim = 410
sprpriority = 2
facep2 = 1

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

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
x = 19.79314
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) = 0
x = 0

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 3
x = 4
[State 0, PosAdd]
type = PosAdd
trigger1 = animtime = 0
x = -4

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(6*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = C, NA
damage = 70, 0
animtype = hard
guardflag = M
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 2
sparkxy = -10, -97
hitsound = S50, 3
guardsound = S51, 0
ground.type = high
ground.slidetime = 25
ground.hittime  = 25
guard.velocity = -13
guard.ctrltime = 12
ground.velocity = -10
air.velocity = -3,-8.8
airguard.velocity = -1.9,-.8
air.type = low
air.hittime = 25
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 100, 3

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemtime(5) = 0
movetype = I

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

;---------------------------------------------------------------------------
; Double Punch
; CNS difficulty: easy
[Statedef 420]
type    = C
movetype= A
physics = C
juggle  = ifelse(var(47) & floor(exp(0*ln(2)) + 0.5) ,1,0)
velset = 0,0
ctrl = 0
anim = 420
poweradd = 50
sprpriority = 2
facep2 = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S701,63
channel = 0
lowpriority = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
statetype = S
physics = S
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
trigger2 = animelemtime(7) >= 0
trigger2 = animelemtime(8) < 0
x = 10
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) = 0
trigger2 = animelemtime(8) = 0
x = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.9
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = var(42) | floor(exp(0*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
trigger2 = AnimElem = 8
attr = S, NA
damage = 40, 0
animtype = medium
guardflag = MA
hitflag = MAF
pausetime = 8-var(49), 7
sparkno = 1
sparkxy = -10, -125
hitsound = S50, 4
guardsound = S51, 0
ground.type = High
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -6
guard.ctrltime = 12
ground.velocity = -6
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,ifelse(animelemtime(7)>=0,-9,-6)
air.hittime = 13
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
trigger2 = animelem = 7
value = 100, 2

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElemTime(9) = 0
movetype = I

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


;---------------------------------------------------------------------------
;Crouching light kick
; CNS difficulty: easy
[Statedef 430]
type    = C
movetype= A
physics = C
juggle  = ifelse(var(40) & floor(exp(7*ln(2)) + 0.5) ,1,0)
poweradd= 22
ctrl = 0
anim = 430
sprpriority = 2
facep2 = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.95
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(7*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = C, NA
damage = 24, 0
animtype = light
guardflag = L
hitflag = MAF
pausetime = 8-var(49), 7
sparkno = 0
sparkxy = -10, 0
hitsound = S50, 0
guardsound = S51, 0
ground.type = low
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -10
guard.ctrltime = 12
ground.velocity = -6
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -3,-8.8
air.hittime = 13
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

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

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 4
movetype = I

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

;---------------------------------------------------------------------------
;Crouch Strong Kick
; CNS difficulty: easy
; Description: This move uses "Trip" for the "ground.type" parameter in
;     its HitDef. It's a special type that puts the opponent in a tripped
;     animation as he falls. Also, the hitflag parameter in the HitDef
;     is set to "MAFD". The "D" indicates that a downed opponent can be
;     hit by the attack.
; CNS レベル: 易
; 詳細:
[Statedef 440]
type    = C
movetype= A
physics = C
juggle  = ifelse(var(40) & floor(exp(8*ln(2)) + 0.5) ,1,0)
poweradd= 70
ctrl = 0
anim = 440
sprpriority = 2
facep2 = 1

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

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(8*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = PlaySnd
trigger1 = Time = 1
value = 100, 3

[State 440, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 50
hitflag = MAFD
guardflag = L
pausetime = 12-var(49),12
sparkno = 1
sparkxy = -5,-10
hitsound = S50, 1
guardsound = S51, 0
ground.type = Trip
ground.slidetime = 10
ground.hittime = 20
guard.ctrltime = 10
ground.velocity = -2.4,-9.5
air.velocity = -2.4,-9.5
guard.velocity = -7
fall = 1
yaccel = ifelse(!var(19),.66,.6)
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = AnimElem = 4
movetype = I

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

;---------------------------------------------------------------------------
;Jump Light Punch
; CNS difficulty: easy
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = ifelse(var(40) & floor(exp(9*ln(2)) + 0.5) ,1,0)
;juggle  = 2
poweradd= 11
ctrl = 0
anim = 600
sprpriority = 2

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.92
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = numtarget
trigger1 = time = 1
trigger1 = (prevstateno = [600,649]) || (prevstateno = 221)
trigger1 = p2statetype = A
trigger1 = p2movetype = H
;x = ifelse(abs(p2bodydist x / 8)>=4,4,abs(p2bodydist x / 8))
x = ifelse(abs(p2bodydist x / 8)>=3,ifelse(p2bodydist x>0,3,-3),(p2bodydist x / 8))
y = -8
[State 0, VelSet]
type = VelMul
trigger1 = prevstateno >= 200
trigger1 = abs(vel x) >= 3
trigger1 = (p2statetype != A) || (p2movetype != H)
x = 0.83
[State 0, VelSet]
type = VelAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
y = -1.5
ignorehitpause = 1
persistent = 0

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(40) = var(40) | floor(exp(9*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage = 20-(10*(prevstateno=[200,640])), 0
animtype = light
guardflag = HA
hitflag = MAF
pausetime = 8-var(49), 7
sparkno = 0
sparkxy = -10, -70
hitsound = S50, 0
guardsound = S51, 0
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.ctrltime  = 5
guard.velocity = -10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
ground.cornerpush.veloff = (-13*(prevstateno=[200,640]))
guard.cornerpush.veloff = (-13*(prevstateno=[200,640]))
air.cornerpush.veloff = 0

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


;---------------------------------------------------------------------------
;Jump Strong Punch
; CNS difficulty: easy
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = ifelse(var(41) & floor(exp(0*ln(2)) + 0.5) ,1,0)
;juggle  = 4
poweradd= 65
ctrl = 0
anim = 610
sprpriority = 2

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = ifelse(command="holdfwd",1,ifelse(command="holdback",-1,0))
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(1) = ifelse(command="holddown",1,ifelse(command="holdup",-1,0))

[State 0, VelSet]
type = VelAdd
trigger1 = animelem = 2
x = 1.5 * var(0)
y = -0.9 * var(1)
ignorehitpause = 1
persistent = 0

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

[State 0, VelSet]
type = VelSet
trigger1 = numtarget
trigger1 = time = 1
trigger1 = (prevstateno = [600,649]) || (prevstateno = 221)
trigger1 = p2statetype = A
trigger1 = p2movetype = H
;x = ifelse(abs(p2bodydist x / 8)>=4,4,abs(p2bodydist x / 8))
x = ifelse(abs(p2bodydist x / 8)>=3,ifelse(p2bodydist x>0,3,-3),(p2bodydist x / 8))
y = -8
[State 0, VelSet]
type = VelMul
trigger1 = prevstateno >= 200
trigger1 = abs(vel x) >= 3
trigger1 = (p2statetype != A) || (p2movetype != H)
x = 0.83
[State 0, VelSet]
type = VelAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
y = -1.5
ignorehitpause = 1
persistent = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.82
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(0*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = A, NA
damage = 60-(10*(prevstateno=[200,640])), 0
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 1
sparkxy = -10, -55
hitsound = S50, 1
guardsound = S51, 0
ground.type = low
ground.slidetime = 18
ground.hittime  = 18
guard.velocity = -9
guard.ctrltime  = 5
ground.velocity = -9+(-5*(prevstateno=[200,640]))
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
ground.cornerpush.veloff = (-24*(prevstateno=[200,640]))
guard.cornerpush.veloff = (-24*(prevstateno=[200,640]))
air.cornerpush.veloff = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
movetype = I

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 3
value = 100, 3


;---------------------------------------------------------------------------
;Jump Light Kick
; CNS difficulty: easy
[Statedef 630]
type    = A
movetype= A
physics = A
juggle  = ifelse(var(41) & floor(exp(1*ln(2)) + 0.5) ,1,0)
;juggle  = 3
poweradd= 20
ctrl = 0
anim = 630
sprpriority = 2

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.85
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = numtarget
trigger1 = time = 1
trigger1 = (prevstateno = [600,649]) || (prevstateno = 221)
trigger1 = p2statetype = A
trigger1 = p2movetype = H
;x = ifelse(abs(p2bodydist x / 8)>=4,4,abs(p2bodydist x / 8))
x = ifelse(abs(p2bodydist x / 8)>=3,ifelse(p2bodydist x>0,3,-3),(p2bodydist x / 8))
y = -8
[State 0, VelSet]
type = VelMul
trigger1 = prevstateno >= 200
trigger1 = abs(vel x) >= 3
trigger1 = (p2statetype != A) || (p2movetype != H)
x = 0.83
[State 0, VelSet]
type = VelAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
y = -1.5
ignorehitpause = 1
persistent = 0

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(1*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = A, NA
damage = 40-(18*(prevstateno=[200,640])), 0
animtype = medium
guardflag = HA
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 1
sparkxy = -10, -20
hitsound = S50, 4
guardsound = S51, 0
ground.type = High
ground.slidetime = 12
ground.hittime  = 12
guard.ctrltime  = 5
guard.velocity = -10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
ground.cornerpush.veloff = (-13*(prevstateno=[200,640]))
guard.cornerpush.veloff = (-13*(prevstateno=[200,640]))
air.cornerpush.veloff = 0

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


;---------------------------------------------------------------------------
;Jump Strong Kick
; CNS difficulty: easy
[Statedef 640]
type    = A
movetype= A
physics = A
juggle  = ifelse(var(41) & floor(exp(2*ln(2)) + 0.5) ,1,0)
;juggle  = 4
poweradd= 65
ctrl = 0
anim = 640
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S701,47+random%2
channel = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = numtarget
trigger1 = time = 1
trigger1 = (prevstateno = [600,649]) || (prevstateno = 221)
trigger1 = p2statetype = A
trigger1 = p2movetype = H
;x = ifelse(abs(p2bodydist x / 8)>=4,4,abs(p2bodydist x / 8))
x = ifelse(abs(p2bodydist x / 8)>=3,ifelse(p2bodydist x>0,3,-3),(p2bodydist x / 8))
y = -8
[State 0, VelSet]
type = VelMul
trigger1 = prevstateno >= 200
trigger1 = abs(vel x) >= 3
trigger1 = (p2statetype != A) || (p2movetype != H)
x = 0.83
[State 0, VelSet]
type = VelAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
y = -1.5
ignorehitpause = 1
persistent = 0

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(2*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 4
attr = A, NA
damage = 70-(20*(prevstateno=[200,640])), 0
animtype = hard
guardflag = HA
hitflag = MAF
pausetime = 12-var(49), 11
sparkno = 1
sparkxy = -10, -55
hitsound = S50, 5
guardsound = S51, 0
ground.type = low
ground.slidetime = 18
ground.hittime  = 18
guard.ctrltime  = 5
guard.velocity = -10
ground.velocity = -5+(-5*(prevstateno=[200,640]))
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-11.9
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
ground.cornerpush.veloff = (-18*(prevstateno=[200,640]))
guard.cornerpush.veloff = (-18*(prevstateno=[200,640]))
air.cornerpush.veloff = 0

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

;---------------------------------------------------------------------------
; BIG DICK
; CNS difficulty: easy
[Statedef 660]
type    = A
movetype= A
physics = N
poweradd= 65
ctrl = 0
anim = 660
sprpriority = 2
facep2 = 1

[State 0, VelAdd]
type = VelAdd
trigger1 = time = 0
y = -2
[State 0, VelAdd]
type = VelMul
trigger1 = time
x = 0.99

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 1
value = S701,3
channel = 0
[State 0, VelAdd]
type = VelAdd
trigger1 = time
y = 0.99

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.8
ignorehitpause = 1

[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = A, NA
damage = 90, 0
animtype = diagup
guardflag = H
hitflag = MAFPD
pausetime = 12-var(49), 11
sparkno = 3
sparkxy = -10, -25
hitsound = S701,4
guardsound = S51, 0
ground.type = High
ground.slidetime = 26
ground.hittime = 26
guard.velocity = -13
guard.ctrltime  = 10
ground.velocity = -5,-13.97
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -5,-13.97
air.hittime = 20
fall = 1
fall.recover = 0
id = 123
yaccel = .88

[State 200, 7]
type = ChangeState
trigger1 = vel y > 0
trigger1 = vel y + pos y >= 10
value = 5100

; MY GOD AMIBA'S OPPONENT WATCH OUT
[Statedef 700]
type    = A
movetype= A
physics = N
velset = 22,22
ctrl = 0
anim = 700
sprpriority = 5
poweradd = -1000

[State 200, 1]
type = HitDef
trigger1 = time = 1
attr = S, HP
damage = 100, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 0, 12
guard.pausetime = 0, 0
sparkno = 3
sparkxy = 0, 0
hitsound = S50,2
guardsound = S51,0
ground.type = High
ground.slidetime = 14
guard.hittime = 18
guard.velocity = -15
ground.hittime  = 25
ground.velocity = -5,12
airguard.velocity = -5,-6
air.type = High
air.velocity = -5,12
air.hittime = 25
ground.cornerpush.veloff = 0
air.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
fall = 1
fall.recover = 0
id = 700
nochainid = 700
yaccel = 0.5
sprpriority = 5
getpower = 0

[State 0, ParentVarSet]
type = ParentVarSet
trigger1 = time = 0
fvar(13) = ((parent,fvar(13)) * 0.25)

[State WallBounce]
type = TargetState
trigger1 = numtarget(700)
trigger1 = movehit = 1
trigger1 = !(target(700),ishelper)
value = 3055
ID = 700
ignorehitpause = 1
persistent = 0

[State 0, VarSet]
type = VarAdd
trigger1 = vel y + pos y >= 0
trigger2 = var(0)
var(0) = 1
[State 0, VarSet]
type = PosSet
trigger1 = var(0)
y = 0
ignorehitpause = 1
[State 0, VarSet]
type = VelSet
trigger1 = var(0)
x = 0
y = 0
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = var(0) = 1
trigger2 = var(0) = 31
value = S701,58

[State 0, VarRandom]
type = VarRandom
trigger1 = 1
v = 2
range = 1,100
[State 0, VarSet]
type = VarSet
trigger1 = 1
fvar(2) = var(2)

[State 0, Explod]
type = Explod
trigger1 = var(0) = [1,31]
anim = 701
pos = 0-random%250,0-random%150
postype = p1
facing = ifelse(random<500,1,-1)
vfacing = ifelse(random<500,1,-1)
bindtime = 1
removetime = -2
scale = fvar(2)/100,fvar(2)/100
sprpriority = random%20
ownpal = 1
ignorehitpause = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = var(0) = 31
time = 8
freq = 255
ampl = -8
[State 0, Explod]
type = Explod
trigger1 = var(0) = 31
anim = 701
pos = -50,-100
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 2,2
sprpriority = 25
ownpal = 1
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = var(0) = 31
anim = 702
pos = -50,-100
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 2,2
sprpriority = 23
ownpal = 1
ignorehitpause = 1


[State 0, DestroySelf]
type = DestroySelf
trigger1 = var(0) >= 31


; Roll
[Statedef 710]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
anim = 710
ctrl = 0
sprpriority = -1
facep2 = 1

[State 0, AfterImage]
type = AfterImage
trigger1 = time = 0
;time = 1
;length = 20
;palcolor = 256
;palinvertall = 0
;palbright = 30,30,30
;palcontrast = 120,120,220
;palpostbright = 0,0,0
;paladd = 10,10,25
;palmul = .65,.65,.75
;timegap = 1
;framegap = 4
;trans = "add" ;"none","add1","sub"
[State 0, AfterImageTime]
type = AfterImageTime
trigger1 = time
time = 2
ignorehitpause = 1


[State 0, PowerAdd]
type = PowerAdd
trigger1 = prevstateno >= 120
trigger1 = prevstateno != 195
trigger1 = time = 0
value = -500
[State -2, PalFX]
type = PalFX
trigger1 = prevstateno >= 120
trigger1 = prevstateno != 195
trigger1 = time < 7
time = 1
add = 255,255,255
sinadd = 0,0,0
invertall = 0
color = 256
ignorehitpause = 1
persistent = 2

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = (command = "holdback") || (var(52) = 711)

[State 0, Turn]
type = Turn
triggerall = var(0) = 1
trigger1 = animelem = 2
trigger2 = animelem = 7
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(7) < 0
x = 5
[State 0, VelSet]
type = VelMul
trigger1 = animelemtime(7) >= 0
trigger1 = animelemtime(9) < 0
x = 0.9
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(9) = 0
x = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S667,2
channel = 0
[State 0, PlayerPush]
type = PlayerPush
trigger1 = abs(vel x)>=2
value = 0
ignorehitpause = 1
[State 0, HitBy]
type = HitBy
trigger1 = animelemtime(9) < 0
value = SCA,NT,ST,HT
time = 1

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

;---------------------------------------------------------------------------
; Classic Jump Start
[Statedef 720]
type    = S
physics = S
anim = 40
ctrl = 0
sprpriority = 1

[State 40, 1]
type = VarSet
trigger1 = Time = 0
var(2) = 0
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "x"
var(2) = 600
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "y"
var(2) = 610
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "a"
var(2) = 630
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "b"
var(2) = 640
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "CD"
var(2) = 660
[State 40, 1]
type = VarSet
triggerall = command != "upper_what"
trigger1 = !var(55)
trigger1 = command = "QCF_a" || command = "QCF_b"
var(2) = 1000

[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0
[State 40, 1]
type = VarSet
trigger1 = Time = 0
sysvar(2) = 0

[State 40, 2]
type = VarSet
trigger1 = command = "holdfwd"
trigger2 = var(55) && (var(52) = 41 || var(52) = 44)
sysvar(1) = 1

[State 40, 3]
type = VarSet
trigger1 = command = "holdback"
trigger2 = var(55) && (var(52) = 42 || var(52) = 45)
sysvar(1) = -1
[State 40, 2]
type = VarSet
trigger1 = (prevstateno = [210,1199]) || (prevstateno = [1400,1410])
sysvar(4) = 1

[State 40, 4]
type = VelSet
trigger1 = AnimTime = 0
x = ifelse(sysvar(1)=0, 0, ifelse(sysvar(1)=1, 2.5, -2.55))
y = -12

[State 40, 5]
type = VelSet
trigger1 = AnimTime = 0
trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) = 1
x = 4

[State 40, 5] ; LAUNCHER
type = VelSet
triggerall = command != "holdback"
triggerall = prevstateno >= 200
trigger1 = numtarget
trigger1 = AnimTime = 0
;trigger1 = prevstateno = 100 ;RUN_FWD
trigger1 = sysvar(1) != -1
trigger1 = sysvar(4) = 1
trigger1 = p2statetype = A
x = ifelse(abs(p2bodydist x / 15)>=3.5,ifelse(p2dist x>=0,3.5,-3.5),(p2bodydist x / 15))

[State 40, 1] ; Lol Buffer
type = Changestate
triggerall = command != "upper_what"
triggerall = animtime = 0
trigger1 = var(2) != 0
value = var(2)
ctrl = 0

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

;---------------------------------------------------------------------------
; Jump Up
[Statedef 721]
type    = A
physics = N

[State Dah Blue Danube]
type = PlaySnd
trigger1 = time = 0
trigger2 = time = 12
value = S701,69
freqmul = 0.65
[State Dah Blue Danube]
type = PlaySnd
trigger1 = time = 24
value = S701,69
freqmul = 0.82
[State Dah Blue Danube]
type = PlaySnd
trigger1 = time = 36
trigger2 = time = 48
value = S701,69
freqmul = 1
[State Dah Blue Danube]
type = PlaySnd
trigger1 = time = 72
trigger2 = time = 84
value = S701,69
freqmul = 2
[State Dah Blue Danube]
type = PlaySnd
trigger1 = time = 108
trigger2 = time = 120
value = S701,69
freqmul = 1.7

[State 50, 1]
type = VarSet
trigger1 = Time = 0
sysvar(1) = 0

[State 50, 2]
type = ChangeAnim
trigger1 = Time = 0
value = ifelse((vel x)=0, 41, ifelse((vel x)>0, 42, 43))

[State 50, 3]
type = ChangeAnim
trigger1 = Vel y > -2
trigger1 = SelfAnimExist(anim + 3)
persistent = 0
value = Anim + 3

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = 0.44
[State 0, VelAdd]
type = VelAdd
trigger1 = command = "holdfwd"
trigger1 = vel x < 2.5
x = 0.1
[State 0, VelAdd]
type = VelAdd
trigger1 = command = "holdback"
trigger1 = vel x > -2.55
x = -0.1

[State 0, ChangeState]
type = ChangeState
trigger1 = vel y > 0
trigger1 = vel y + pos y >= 0
value = 52
ctrl = 0



;---------------------------------------------------------------------------
;Kung Fu Throw - Attempt
; CNS difficulty: medium-advanced
; Description: Throws are not difficult to make, although then can be
;     tedious at times. Throw attempt states have a HitDef of a
;     special format. The key parameters in a throw are p1stateno
;     and p2stateno. If the HitDef successfully connects, then
;     the attacker will change to the state number specified by
;     p1stateno, and the opponent will be change to the state
;     number assigned to p2stateno. The special thing about p2stateno
;     is that the opponent will be temporarily brought into the
;     attacker's state file. In this case, no matter who the
;     opponent is, he will be taken to state 820 of this file (kfm.cns)
;     and remain here until the end of the throw (look at his debug
;     information when he is being thrown; the text changes to yellow
;     to mean that he is in another player's state file).
[Statedef 800]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sprpriority = 1
p1facing = 1
p2facing = 1
p1stateno = 810
;p2stateno = 820
guard.dist = 0
fall = 1

[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 = S
ctrl = 0
anim = 810
sprpriority = 2
velset = 0,0

[State 0, Width]
type = Width
trigger1 = time = 0
value = 80,80
ignorehitpause = 1

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 820

[State 210, 2]
type = PlaySnd
trigger1 = time = 6
value = 701, 8
channel = 0

[state 0,0]
type = screenbound
trigger1 = 1
value = 0

[state 0,0]
type = velset
trigger1 = time <= 14
x = 7.5
y = 0

;[state 0,0]
;type = veladd
;trigger1 = time = [5,15]
;x = -0.2

[state 0,0]
type = velset
trigger1 = time = [16,22]
x = -4.6

[state 0,0]
type = velset
trigger1 = time = 23
x = 0

[state 0,reverse]
type = varset
trigger1 = time = 1
var(27) = 1

[state 0,reverse]
type = varset
trigger1 = var(41) = 0
trigger1 = time = 1
fvar(5) = fvar(5)*0.3
persistent = 0

[State 210, 2]
type = PlaySnd
trigger1 = time = 4
value = 200, 32
channel = 0

[State 0, 1]
type = TargetBind
trigger1 = time = 1
pos = 30,0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 10
value = ceil(-100 * fvar(13))
kill = 1
[State 0, Explod]
type = Explod
trigger1 = animelem = 10
anim = F3
pos = -40,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 999
ontop = 1
ownpal = 1

[State 0, VarSet]
type = VarSet
trigger1 = animtime = 0
fvar(13) = fvar(13) * 0.5

[State 0, Turn]
type = Turn
trigger1 = animtime = 0

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


;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw
; (a custom gethit state)
; Description: This is the state that the opponent changes to after being
;     hit by KFM's throw HitDef. The important thing here is to use a
;     ChangeAnim2 controller. The difference between ChangeAnim2 and
;     ChangeAnim is that ChangeAnim2 changes the player's animation to
;     an action in the AIR file of the attacker (in this case, kfm.air),
;     whereas ChangeAnim always changes the player to an action in his
;     own AIR file. Look at Action 820 in kfm.air for some extra
;     comments.
[Statedef 820]
type    = A
movetype= H
physics = S
ctrl = 0
sprpriority = 1
velset =0,0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
sysvar(0) = 0

[state 0,0]
type = screenbound
trigger1 = time <= 36
value = 0

[state 0,0]
type = posadd
trigger1 = time <= 18
x = 2

[state 0,0]
type = changeanim
trigger1 = time = 36
value = 5070

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = time = 36
physics = N
ignorehitpause = 1
[state 0,0]
type = velset
trigger1 = time = 36
x = 11
y = -7.6
[state 0,0]
type = veladd
trigger1 = time > 36
y = 0.45

[state 0,0]
type = turn
trigger1 = time = 0
trigger1 = facing = enemy,facing

[state 0,0]
type = changeanim2
trigger1 = time = 0
value = 820

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

[state 0,0]
type = envshake
trigger1 = time = 35
time = 10

[state 0,0]
type = selfstate
trigger1 = time >= 36
trigger1 = vel y > 0
trigger1 = vel y + pos y >= 0
value = 5100


;---------------------------------------------------------------------------
;Thrown by Kung Fu Throw - thrown into the air
; (a custom gethit state)
; Description: This state has the opponent flying through the air and
;     falling down onto the ground. The SelfState controller sets the
;     opponent back using to his own state file when he his the ground.
;     Controllers 821,2 and 821,3 allow the opponent to recover by
;     hitting his recovery command when he is falling.
[Statedef 821]
type    = A
movetype= H
physics = N
velset = 2.8,-7
poweradd = 40

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

[State 821, 2] ; Recover near ground (use ChangeState)
type = ChangeState
triggerall = Vel Y > 0
triggerall = Pos Y >= -20
triggerall = alive
triggerall = CanRecover
trigger1 = Command = "recovery"
value = 5200 ;HITFALL_RECOVER

[State 821, 4] ;Hit ground
type = SelfState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 5100 ;Hit ground

[Statedef 830]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
ctrl = 0
anim = 800
sprpriority = 2

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = S, NT
hitflag = M-
priority = 1, Miss
sparkno = -1
sprpriority = -1
p1facing = 1
p2facing = 1
p1stateno = 840
;p2stateno = 820
guard.dist = 0
fall = 1

[State 800, 2]
type = ChangeState
Trigger1 = AnimTime = 0
value = 0
ctrl = 1


[Statedef 840]
type    = S
movetype= A
physics = S
ctrl = 0
anim = 840
sprpriority = -1
velset = 0,0

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 850

[State 810, Bind 1]
type = TargetBind
trigger1 = AnimElemtime(2) < 0
pos = 28, -76

[State 810, Bind 2]
type = TargetBind
trigger1 = AnimElemtime(2) >= 0
trigger1 = AnimElemtime(3) < 0
pos = 11, -83

[State 810, Bind 3]
type = TargetBind
trigger1 = AnimElemtime(3) >= 0
trigger1 = AnimElemtime(4) < 0
pos = 2, -83

[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElemtime(4) >= 0
trigger1 = AnimElemtime(5) < 0
pos = 1, -83

[State 810, Bind 4]
type = TargetBind
trigger1 = AnimElem = 5
pos = 1, 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S0,3
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S701,77
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S701,44
[State 0, HitAdd]
type = HitAdd
trigger1 = animelem = 5
value = 1
[State 0, TargetState]
type = TargetState
trigger1 = animelem = 5
value = 3055
[State 0, Explod]
type = Explod
trigger1 = animelem = 5
anim = F3
pos = 0,-80
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 999
ontop = 1
ownpal = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 5
time = 8
freq = 255
ampl = -8

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 5
value = ceil(-100 * fvar(13))
kill = 1

[State 0, VarSet]
type = VarSet
trigger1 = animtime = 0
fvar(13) = fvar(13) * 0.5


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

[Statedef 850]
type    = A
movetype= H
physics = N
ctrl = 0
sprpriority = 1
velset =0,0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
sysvar(0) = 0

[state 0,0]
type = screenbound
trigger1 = 1
value = 0
movecamera = 0,0

[state 0,0]
type = changeanim2
trigger1 = time = 0
value = 850

[state 0,0]
type = selfstate
trigger1 = animtime = 0
value = 5100

;---------------------------------------------------------------------------
; Air Throw
[Statedef 860]
type    = A
movetype= A
physics = N
ctrl = 0
anim = 860
;velset = 0,0
sprpriority = 2

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 3
movetype = I
physics = A

[State 800, 1]
type = HitDef
Trigger1 = Time = 0
attr = A, NT
animtype = up
hitflag = AF
priority = 2, Miss
sparkno = -1
sprpriority = 0
p1facing = 1
p2facing = 1
p1stateno = 870
guard.dist = 0
fall = 1
fall.recover = 0
;fall.damage = 125
id = 870
numhits = 0

;----------------------------------------------------------------------
[Statedef 870]
type = A
movetype= A
physics = N
anim = 870
velset = 0,0
poweradd = 60

[State 810, Bind 4]
type = TargetState
trigger1 = time = 0
value = 880

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S701,74
channel = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = S701,75

[State 810, Bind 1]
type = TargetBind
trigger1 = animelemtime(2) < 0
pos = -2, -95

[State 810, Bind 2]
type = TargetBind
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(3) < 0
pos = -2, -93

[State 810, Bind 3]
type = TargetBind
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
pos = -2, -90

[State 810, Bind 4]
type = TargetBind
trigger1 = animelemtime(4) >= 0
trigger1 = animelemtime(6) < 0
pos = -2, -88

[State 810, Bind 4]
type = TargetBind
trigger1 = animelem = 6
pos = 2, -88

[State 0, HitAdd]
type = HitAdd
trigger1 = numtarget(870)
trigger1 = target,stateno = 881
value = 1
ignorehitpause = 1
persistent = 0
[State COLLISION DAMAGE]
type = TargetLifeAdd
trigger1 = numtarget(870)
trigger1 = target,stateno = 881
value = ceil(-100 * (fvar(13)))
;value = -85
persistent = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = numtarget(870)
trigger1 = target,stateno = 881
value = S701,76
abspan = 0
persistent = 0

[State 0, VarSet]
type = VarSet
trigger1 = animelem = 12
fvar(13) = fvar(13) * 0.4

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 12
statetype = A
movetype = I
physics = A

;---------------------------------------------------------------------------
;
[Statedef 880]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

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

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 880
[State 0, AngleDraw]
type = AngleDraw
trigger1 = animelemtime(4) >= 0
trigger1 = animelemtime(8) < 0
scale = 1+(animelemtime(4)),1
ignorehitpause = 1
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 8
x = 44
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = animelemtime(8) >= 0
trigger1 = frontedgedist <= 20
value = 881

[Statedef 881]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 1027, Spark]
type = Explod
trigger1 = Time = 0
anim = F72
pos = 0, floor (screenpos y) - 10
postype = front
sprpriority = 3
[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 8
freq = 255
ampl = -6

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

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
x = 20 - frontedgedist
ignorehitpause = 1
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 2
x = 0 - const(size.mid.pos.y)
y = 0 + (const(size.mid.pos.y)/2)
ignorehitpause = 1
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 881
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
y = 24
persistent = 0
[State 0, VelSet]
type = VelAdd
trigger1 = animelemtime(2) >= 0
y = .8
persistent = 0

[State 0, SelfState]
type = Changestate
trigger1 = vel y > 0
trigger1 = vel y + pos y > 0
value = 882

;---------------------------------------------------------------------------
; THIS PARTY'S GETTING BOUNCY!
[Statedef 882]
type    = A
movetype= H
physics = N

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
sysvar(0) = 1

[State COLLISION DAMAGE]
type = EnvShake
trigger1 = time = 0
time = 12
freq = 255
ampl = -7
[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0 || !hitshakeover
trigger1 = !selfanimexist(5101)
value = 5100
[State 5100, 3]
type = ChangeAnim
trigger1 = time = 0 || !hitshakeover
trigger1 = selfanimexist(5101)
value = 5101

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0
[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0
[State 5100, 8]
type = Explod
trigger1 = Time = 1
anim = F62
pos = 0, 0
sprpriority = -2
supermovetime = 65535
pausemovetime = 65535
scale = 1,1

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, 2
[State 5100, 11]
type = PosFreeze
trigger1 = 1
[State 5100, 12]
type = Selfstate
trigger1 = AnimTime = 0
value = 5110

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20


;Stock Photo Girl Attack
; CNS difficulty: easy
[Statedef 1000]
type    = A
movetype= A
physics = N
juggle  = ifelse(var(41) & floor(exp(4*ln(2)) + 0.5) ,1,0)
poweradd= 10
;velset = 9,-3
velset = 8,0
ctrl = 0
anim = 1000
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = (time%3)=0
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(4) < 0
helpertype = normal
name = "Incredribly Stupid Puns"
ID = 1009
stateno = 1009
pos = -13,-61
postype = p1
ownpal = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(4*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 90, 7

[State 630, 1]
type = PlaySnd
trigger1 = Time = 1
value = 701, 32
channel = 0

[State 630, 2]
type = HitDef
trigger1 = Time = 0
attr = A, SA
damage = 65
guardflag = H
priority = 3
pausetime = 0,0
guard.pausetime = 8-var(49),8
sparkno = 3
sparkxy = -5,-70
hitsound   = s701,44
guardsound = S51,0
ground.type = High
ground.slidetime = 6
ground.hittime  = 10
ground.velocity = -9
air.velocity = -2,-3
air.hittime = 14
fall.recovertime = 40
fall = 1
kill = 0

[State 200, 7]
type = ChangeState
trigger1 = !movereversed
trigger1 = movehit
trigger1 = numtarget
trigger1 = !(target,ishelper)
value = 1001
ctrl = 0

[State 0, VelMul]
type = VelMul
trigger1 = animelemtime(4) >= 0
x = 0.92

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 6
y = 10
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
movetype = I
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 6
statetype = A
physics = A
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = moveguarded
value = 1008
ctrl = 0

;Oops
[Statedef 1008]
type    = A
movetype= I
physics = N
;velset = 9,-3
velset = -1.8,-13.13
ctrl = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
physics = A
ignorehitpause = 1

[State 0, Gravity]
type = Gravity
trigger1 = animelemtime(5) < 0

[State 0, SelfState]
type = SelfState
trigger1 = animelemtime(5) < 0
trigger1 = vel y > 0
trigger1 = vel y + pos y >= 20
value = 5100



[Statedef 1001]
type    = A
movetype= A
physics = N
velset = 8,0
ctrl = 0
anim = 1001
sprpriority = 2

[State 0, Helper]
type = Helper
trigger1 = (time%3)=0
helpertype = normal
name = "Incredribly Stupid Puns"
ID = 1009
stateno = 1009
pos = -13,-61
postype = p1
ownpal = 1


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

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 1005

[State 0, TargetBind]
type = TargetBind
trigger1 = 1
time = 1
pos = 80,-71
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = frontedgedist < 75
value = 1002
ctrl = 0

[Statedef 1002]
type    = A
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = 1002
sprpriority = 2

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 12
freq = 255
ignorehitpause = 1

[State 0, ScreenBound]
type = ScreenBound
trigger1 = animelemtime(3) < 0
value = 1
movecamera = 0,1
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S50,2
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = F72
pos = frontedgedist + 3,-71
postype = p1
facing = -1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 666
ontop = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 1006
[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = time = 0
value = ceil(-65 * fvar(13))
kill = 1
[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2) < 0
time = 1
pos = 80,-71
ignorehitpause = 1
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 2
statetype = A
movetype = I
physics = A
ignorehitpause = 1
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 2
x = -6.5
y = -8.5
[State 0, VelMul]
type = VelMul
trigger1 = animelemtime(2) >= 0
x = 0.97
[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 4
y = 10
ignorehitpause = 1


; UGH
[Statedef 1005]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

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

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

[State 0, SelfState]
type = SelfState
trigger1 = time
trigger1 = !gethitvar(isbound)
value = 5050

; UGH
[Statedef 1006]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1
value = (animelemtime(4) >= 0)
movecamera = 0,1
ignorehitpause = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 4
y = 0 - const(size.mid.pos.y)
ignorehitpause = 1
[State 0, VelSet]
type = VelSet
trigger1 = animelem = 4
x = 2.2
y = -9.3
[State 0, VelSet]
type = VelAdd
trigger1 = animelemtime(4) >= 0
y = 0.66
[State 0, VelSet]
type = VelMul
trigger1 = animelemtime(4) >= 0
x = 0.97
[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = time = 0
value = 1006
[State 0, SelfState]
type = SelfState
trigger1 = time
trigger1 = vel y > 0
trigger1 = vel y + pos y >= 20
value = 5100

; More stupid puns
[Statedef 1009]
type    = S
movetype= I
physics = N
velset = 0,0
ctrl = 0
anim = 1009
sprpriority = -9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = 1
value = 1009
elem = 1
[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 1
range = -80,-5
[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 2
range = -30,30
[State 0, VarRandom]
type = VarRandom
trigger1 = time = 0
v = 3
range = 1,4
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fvar(1) = var(1)
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fvar(2) = var(2)
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
fvar(3) = var(3)

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
[State 0, Trans]
type = Trans
trigger1 = 1
trans = add
[State 0, VelSet]
type = VelSet
trigger1 = time = 0
x = (fvar(1)/10)
y = (fvar(2)/10)
[State 0, VarAdd]
type = VarAdd
trigger1 = time != 0
fvar(10) = 0 - (fvar(3)/100)
[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
scale = 1+fvar(10),1+fvar(10)
[State 0, VelMul]
type = VelMul
trigger1 = 1
x = 0.98
y = 0.98
[State 0, DestroySelf]
type = DestroySelf
trigger1 = fvar(10) <= -1


;---------------------------------------------------------------------------
; lol
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(41) & floor(exp(5*ln(2)) + 0.5) ,1,0)
poweradd= 55
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, Width]
type = Width
trigger1 = animelemtime(3) > 0
trigger1 = animelemtime(5) < 0
value = 6,0
ignorehitpause = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(5*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(5) < 2
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
ignorehitpause = 1

[State 1000, 1]
type = PlaySnd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 4
trigger3 = AnimElem = 5
trigger4 = AnimElem = 6
value = 701, 20

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 4
x = 20

[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 5
x = 39

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
damage = 105, 10
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 15-var(49), 15
sparkno = 3
sparkxy = -10, -90
hitsound = S701, 20
guardsound = S51, 0
ground.type = high
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -12
guard.ctrltime = 15
ground.velocity = -5,-9
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -5,-9
air.hittime = 20
fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(5) = 2
movetype = I

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

;---------------------------------------------------------------------------
; lol
[Statedef 1110]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(41) & floor(exp(5*ln(2)) + 0.5) ,1,0)
poweradd= 55
velset = 0,0
anim = 1110
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, Width]
type = Width
trigger1 = animelemtime(3) > 0
trigger1 = animelemtime(6) < 0
value = 6,0
ignorehitpause = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(5*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelemtime(3) >= 0
trigger1 = animelemtime(6) < 2
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
ignorehitpause = 1

[State 1000, 1]
type = PlaySnd
trigger1 = AnimElem = 4
trigger2 = AnimElem = 5
trigger3 = AnimElem = 6
trigger4 = AnimElem = 7
value = 701, 20

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 4
x = 20
[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 5
x = 20
[State 1000, 3]
type = PosAdd
trigger1 = AnimElem = 6
x = 39

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 6
attr = S, SA
damage = 130, 10
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 15-var(49), 15
sparkno = 3
sparkxy = -10, -90
hitsound = S701, 20
guardsound = S51, 0
ground.type = high
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -12
guard.ctrltime = 15
ground.velocity = -5,-9
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -5,-9
air.hittime = 20
fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelemtime(6) = 2
movetype = I

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

; A Back'ander
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(41) & floor(exp(6*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) >= 0
trigger1 = animelemtime(5) < 0
x = 9
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6) >= 0
trigger1 = animelemtime(9) < 0
x = -1
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
trigger2 = animelemtime(9) = 0
x = 0

[State 0, Helper]
type = Helper
trigger1 = animelem = 4
helpertype = normal
name = "Reflector"
ID = 1201
stateno = 1201
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(6*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 701, 29
channel = 0
volume = 255

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3
volume = 255

[State 1210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 70, 9
;priority  = 5
guardflag = MA
pausetime = 12-var(49),12
sparkxy = 0,-65
hitsound   = s701,45
guardsound = S51,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -14,-4.5
air.velocity = -14,-4.5
airguard.velocity = -12,-4.5
id = 1210
nochainid = 1210
ground.cornerpush.veloff = -19 ;To push far away when p2 is in corner
guard.velocity = -12
guard.ctrltime = 15
yaccel = .3
;p2stateno = 1215
p2facing = 1

[State this method is superior]
type = TargetState
trigger1 = numtarget(1210)
trigger1 = var(21) = 1
trigger1 = !(target(1210),ishelper)
value = 1215
ID = 1210
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
movetype = I

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

; A Back'ander
[Statedef 1210]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(41) & floor(exp(6*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1210
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(5) < 0
x = ifelse(animelemtime(4)>=0,9,2)
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6) >= 0
trigger1 = animelemtime(9) < 0
x = -2
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
trigger2 = animelemtime(9) = 0
x = 0


[State 0, Helper]
type = Helper
trigger1 = animelem = 4
helpertype = normal
name = "Reflector"
ID = 1201
stateno = 1201
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(6*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 1
value = 701, 29
channel = 0
volume = 255

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 4
value = 100, 3
volume = 255

[State 1210, 2]
type = HitDef
trigger1 = Time = 0
attr = S, SA
animtype  = Hard
damage    = 80, 9
;priority  = 5
guardflag = H
pausetime = 12-var(49),12
sparkxy = 0,-65
hitsound   = s701,45
guardsound = S51,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -14,-4.5
air.velocity = -14,-4.5
airguard.velocity = -12,-4.5
id = 1210
nochainid = 1210
ground.cornerpush.veloff = -19 ;To push far away when p2 is in corner
guard.velocity = -12
guard.ctrltime = 15
yaccel = .3
;p2stateno = 1215
p2facing = 1

[State this method is superior]
type = TargetState
trigger1 = numtarget(1210)
trigger1 = var(21) = 1
trigger1 = !(target(1210),ishelper)
value = 1215
ID = 1210
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
movetype = I

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

;Reflective Part
[Statedef 1201]
type = A
movetype = A
physics = N
ctrl = 0
velset = 0, 0
ownpal = 1
anim = 1201
sprpriority = 4
;juggle = 10
[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
ignorehitpause = 1
[State 7001, Assert]
type = AssertSpecial
trigger1 = 1
flag = noshadow
flag2 = invisible
ignorehitpause = 1
[State 0, ReversalDef]
type = ReversalDef
;trigger1 = !numtarget(3058)
trigger1 = !time
trigger2 = movecontact >= 40
reversal.attr = SCA,NP,SP,HP
id = 3058
nochainid = 3058
priority = 7,hit
pausetime = 0,0
;sparkno = S1500
hitsound = -1
;p1stateno =
;p2stateno = 3058
;ignorehitpause =
;persistent =
numhits = 0
[State 0, TargetState]
type = TargetState
trigger1 = numtarget(3058)
trigger1 = target(3058),ishelper
value = 1202
ID = 3058
ignorehitpause = 1
[State 0, TargetDrop]
type = TargetDrop
trigger1 = numtarget(3058)
trigger1 = movecontact >= 30
keepone = 0
ignorehitpause = 1

[State 1005, Bad End]
type=destroyself
trigger1 = parent,stateno != 1200
trigger1 = parent,stateno != 1210
trigger2 = animtime = 0
ignorehitpause=1

; FUCK
[Statedef 1203]
type = A
movetype = H
physics = N
ctrl = 0
velset = -6,-9

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = time = 0
value = 5030
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 5030
trigger1 = animtime = 0
value = ifelse(selfanimexist(5035),5035,5050)
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 5035
trigger1 = animtime = 0
value = 5050

[State 0, LifeSet]
type = LifeAdd
trigger1 = time = 0
value = -180

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = 0.5

[State 0, SelfState]
type = SelfState
trigger1 = vel y + pos y >= 0
value = 5100


; CRAP
[Statedef 1202]
type = A
movetype = A
physics = N
ctrl = 0

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT
time = 15
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = !ishelper
value = 1203
ctrl = 0

[State 0, Turn]
type = Turn
trigger1 = time = 0
[State 0, VelMul]
type = VelMul
trigger1 = time = 0
x = -1.3
[State 0, VelMul]
type = VelAdd
trigger1 = time = 1
x = 0.5

[State 210, 1]
type = HitDef
trigger1 = time = 1
attr = S, HP
damage = floor(150*ifelse(root,var(56),1.25,1)),5
animtype = Hard
air.animtype = diagup
guardflag = MA
hitflag = MAF
priority = 6, Hit
sparkno = 3
sparkxy = 0, 0
hitsound = 5,4
guardsound = 6,0
ground.type = High
pausetime = 2,12
guard.pausetime = 0,11
ground.slidetime = 17
ground.hittime = 17
guard.hittime = 17
guard.slidetime = 17
guard.ctrltime = 24
ground.velocity =  -2, -14
guard.velocity = -18
air.type = High
air.velocity =-2, -14
air.hittime = 13
air.juggle = 0
getpower = 0,0
givepower = 16,16
fall = 1
air.fall = 1
p1sprpriority = 4
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0
yaccel = 0.5
fall.recovertime = 64
fall.envshake.time = 12
fall.envshake.freq = 180
fall.envshake.ampl = -6
affectteam = F
id = 3058
nochainid = 3058


[State 0, DestroySelf]
type = DestroySelf
trigger1 = pos x != [-300,300]
trigger2 = movecontact
trigger3 = time >= 200
trigger3 = animtime = 0



;---------------------------------------------------------------------------
; Hit by power move (shaking)
[Statedef 1215]
type    = A
movetype= H ;Get hit
physics = N

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
sysvar(0) = 0

[State 940, 0]
type = VelSet
trigger1 = Time = 0
x = 0
y = 0
z = 0

;[State 940, 1]
;type = NotHitBy
;trigger1 = 1
;value = SCA
;Time = 1

[State 940, 2]
type = PosAdd
trigger1 = Time = 0
y = -20

[State 940, 3]
type = ChangeAnim
Trigger1 = Time >= 0
value = 5030

[State 940, 4]
type = ChangeState
trigger1 = HitShakeOver = 1
value = 1216

; Hit by power move (flying)
[Statedef 1216]
type    = A
movetype= H ;Get hit
physics = N

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

;[State 941, 0]
;type = NotHitBy
;trigger1 = 1
;value = SCA
;Time = 1

[State 941, 1]
type = ChangeAnim
Trigger1 = Time = 0
value = ifelse(SelfAnimExist(5052),5052,5050)

[State 5071, 1]
type = HitVelSet
trigger1 = Time = 0
x = 1
y = 1

[State 5071, 2]
type = VelAdd
trigger1 = 1
y = GetHitVar(yaccel)

[State 941, 5]
type = ChangeState
trigger1 = backedgedist <= 5
value = 1217

[State 943, 5]
type = SelfState
trigger1 = Pos Y > 10
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

; Hit by power move (hitting the wall)
[Statedef 1217]
type    = A
movetype= H ;Get hit
physics = N

[State 942, 0]
type = PlaySnd
Trigger1 = Time = 0
value = F5, 4

[State 942, 1]
type = PosAdd
trigger1 = Time = 0
y = -20

[State 942, 2]
type = ChangeAnim
Trigger1 = Time = 0
value = 5070

[State 942, 3]
type = VelSet
trigger1 = Time = 0
x = 2
y = -3.5

[State 942, 4]
type = EnvShake
Trigger1 = Time = 0
time = 20
ampl = -4
freq = 90
phase = 90

[State 942,19]
type = GameMakeAnim
trigger1 = Time = 0
value = 72
pos = -10, -50

[State 942, 6]
type = ChangeState
trigger1 = Time = 10
value = 1218

; Hit by power move (falling to the ground)
[Statedef 1218]
type    = A
movetype= H ;Get hit
physics = N

[State 943, 0]
type = ChangeAnim
Trigger1 = Time = 0
value = 5090

[State 943, 1]
type = VelAdd
trigger1 = Time >= 0
y = .55

[State 943, 5]
type = SelfState
trigger1 = Pos Y > 10
trigger1 = Vel Y > 0
value = 5100
ctrl = 0

;---------------------------------------------------------------------------
; Pyron Projectile
[Statedef 1300]
type    = S
movetype= A
physics = S
poweradd= 60
velset = 0,0
anim = 1300
ctrl = 0
sprpriority = 2
facep2 = 1

[State ProRation]
type = VarSet
trigger1 = ProjHitTime(1300)
fvar(13) = fvar(13) * 0.5
ignorehitpause = 1
persistent = 0

[State Neo-Juggle-System-Flag]
type = VarSet
trigger1 = ProjHitTime(1300)
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(7*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 1010, 1]
type = PlaySnd
trigger1 = anim != 1305
trigger1 = AnimElem = 3
value = 701, 18

[State 1000, Axe Tossin]
type = Projectile
trigger1 = anim != 1305
trigger1 = AnimElem = 3
projid = 1300
projanim = 1301
projhitanim = 1302
;projremanim = 689
sparkno = -1
guard.sparkno = -1
projpriority = 1
projshadow = -1
offset = 40, -76
velocity = 4
attr = S, SP
damage   = 100
animtype = hard
guardflag = MA
hitflag = MAFDP
pausetime = 0,10
hitsound   = S701,19
sparkxy = 100, -200
guardsound = 6,0
ground.type = Low
ground.slidetime = 28
ground.hittime  = 28
guard.velocity = -10
guard.ctrltime = 15
ground.velocity = -8
air.animtype = Back
air.velocity = -4,-12.9
down.velocity = -4,-12.9
down.hittime = 30
down.bounce = 0
air.fall = 1
fall.recovertime = 40
yaccel = .88
air.juggle  = ifelse(var(41) & floor(exp(7*ln(2)) + 0.5) ,1,0)


[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !numprojid(1300)
trigger1 = anim != 1305
trigger1 = AnimTime = 0
value = 1305

[State 1010, 8]
type = ChangeState
trigger1 = anim = 1305
trigger1 = AnimTime = 0
value = 0
ctrl = 1

[Statedef 1310]
type    = S
movetype= A
physics = S
poweradd= 60
velset = 0,0
anim = 1300
ctrl = 0
sprpriority = 2
facep2 = 1

[State ProRation]
type = VarSet
trigger1 = ProjHitTime(1300)
fvar(13) = fvar(13) * 0.5
ignorehitpause = 1
persistent = 0

[State Neo-Juggle-System-Flag]
type = VarSet
trigger1 = ProjHitTime(1300)
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(41) = var(41) | floor(exp(7*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0


[State 1010, 1]
type = PlaySnd
trigger1 = anim != 1305
trigger1 = AnimElem = 3
value = 701, 18

[State 1000, Axe Tossin]
type = Projectile
trigger1 = anim != 1305
trigger1 = AnimElem = 3
projid = 1300
projanim = 1301
projhitanim = 1302
;projremanim = 689
sparkno = -1
guard.sparkno = -1
projpriority = 1
projshadow = -1
offset = 40, -76
velocity = 6
attr = S, SP
damage   = 146
animtype = hard
guardflag = MA
hitflag = MAFDP
pausetime = 0,10
hitsound   = S701,19
sparkxy = 100, -200
guardsound = 6,0
ground.type = Low
ground.slidetime = 28
ground.hittime  = 28
guard.velocity = -10
guard.ctrltime = 15
ground.velocity = -4,-12.9
air.animtype = Back
air.velocity = -4,-12.9
down.velocity = -4,-12.9
down.hittime = 30
down.bounce = 0
fall = 1
fall.recovertime = 40
yaccel = .88
air.juggle  = ifelse(var(41) & floor(exp(7*ln(2)) + 0.5) ,1,0)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !numprojid(1300)
trigger1 = anim != 1305
trigger1 = AnimTime = 0
value = 1305

[State 1010, 8]
type = ChangeState
trigger1 = anim = 1305
trigger1 = AnimTime = 0
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; ...
[Statedef 1400]
type    = S
movetype= I
physics = S
poweradd= 65
ctrl = 0
velset = 0,0
anim = 1400
facep2 = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 72
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S90,9
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S40,0

[State 0, HitBy]
type = HitBy
trigger1 = abs(vel x)>=4
value = SCA,NT,ST,HT,HA
time = 2
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(4) < 0
x = -12
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) = 0
x = 0

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

;---------------------------------------------------------------------------
; ...
[Statedef 1410]
type    = S
movetype= I
physics = S
poweradd= 65
ctrl = 0
velset = 0,0
anim = 1410
facep2 = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 701, 72
channel = 0
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = S90,9
[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 4
value = S40,0

[State 0, HitBy]
type = HitBy
trigger1 = abs(vel x)>=4
value = SCA,NT,ST,HT,HA
time = 2
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(4) < 0
x = -12
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) = 0
x = 0

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

; Followup
[Statedef 1401]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(42) & floor(exp(1*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1401
ctrl = 0
sprpriority = 2

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

[State 0, HitBy]
type = HitBy
trigger1 = abs(vel x)>=8
value = SCA,NT,ST,HT,HA
time = 2
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = var(42) | floor(exp(1*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(5) < 0
x = 32
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
x = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 90, 8
volume = 255

[State 1210, 2]
type = HitDef
trigger1 = animelem = 5
attr = S, SA
animtype  = Hard
damage    = 125, 0
;priority  = 5
guardflag = M
pausetime = 12-var(49),12
sparkxy = 0,-100
hitsound   = s50,1
guardsound = S51,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -14,-4.5
air.velocity = -14,-4.5
airguard.velocity = -12,-4.5
ground.cornerpush.veloff = -19 ;To push far away when p2 is in corner
guard.velocity = -12
guard.ctrltime = 15
yaccel = .3
id = 1401
nochainid = 1401
;p2stateno = 1215
p2facing = 1

[State this method is superior]
type = TargetState
trigger1 = numtarget(1401)
trigger1 = var(21) = 1
trigger1 = !(target(1401),ishelper)
value = 1215
ID = 1401
ignorehitpause = 1

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 6
movetype = I

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

; Followup
[Statedef 1402]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(42) & floor(exp(3*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1402
ctrl = 0
sprpriority = 2

[State 0, Width]
type = Width
trigger1 = animelemtime(3) <= 0
value = 6,0
ignorehitpause = 1

[State 0, HitBy]
type = HitBy
trigger1 = abs(vel x)>=8
value = SCA,NT,ST,HT,SA,HA
time = 2
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = var(42) | floor(exp(3*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(3) < 0
x = 39
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3) = 0
x = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 100, 2

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 123, (random%2)
channel = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
damage = 45, 0
animtype = hard
guardflag = MA
hitflag = MAF
pausetime = 8-var(49), 7
sparkno = 1
sparkxy = -10, -125
hitsound = S50, 4
guardsound = S51, 0
ground.type = High
ground.slidetime = 25
ground.hittime  = 25
guard.velocity = -6
guard.ctrltime = 15
ground.velocity = -6
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1,-9
air.hittime = 13
air.fall = 1
fall.recovertime = 40
id = 1402
yaccel = .88
;fall = 1

[State 1000, Axe Tossin]
type = Projectile
trigger1 = AnimElem = 3
projid = 1234
projanim = 123+random%3
;projhitanim = 1302
;projremanim = 689
sparkno = -1
guard.sparkno = -1
projpriority = 1
projshadow = -1
projremove = 0
projheightbound = -300,1
offset = 40, -76
velocity = 0, -16
attr = S, SP
damage   = 50
animtype = hard
guardflag = MA
hitflag = AFDP
pausetime = 10,10
scale = .50, .50
projscale = .50,.50
hitsound   = S701,19
sparkxy = 100, -200
guardsound = 6,0
ground.type = Low
ground.slidetime = 28
ground.hittime  = 28
guard.velocity = -10
guard.ctrltime = 15
ground.velocity = -4
air.animtype = Back
air.velocity = -2,-12.9
down.velocity = -2,-12.9
down.hittime = 30
down.bounce = 0
air.fall = 1
fall.recovertime = 40
yaccel = .88
air.juggle  = ifelse(var(42) & floor(exp(3*ln(2)) + 0.5) ,1,0)
fall = 1



[State 0, ]
type = PlaySnd
trigger1 = moveguarded
value = 0,1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = EnvColor
trigger1 = moveguarded
value = 255,255,255
time = 2
under = 1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = TargetState
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 264
ignorehitpause = 1
persistent = 0
[State 0, ]
type = HitAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 1
ignorehitpause = 1
persistent = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
movetype = I

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

; Followup
[Statedef 1403]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(42) & floor(exp(4*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1403
ctrl = 0
sprpriority = 2

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

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = var(42) | floor(exp(4*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(3) < 0
x = 32
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(3) = 0
x = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 100, 3

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 3
attr = S, SA
damage = 90, 0
animtype = up
guardflag = HA
hitflag = MAFD
pausetime = 12-var(49), 11
sparkno = 3
sparkxy = -10, -75
hitsound = S50, 1
guardsound = S51, 0
ground.type = High
ground.slidetime = 26
ground.hittime = 26
guard.velocity = -13
guard.ctrltime = 10
ground.velocity = 0,-14
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,-14
air.hittime = 20
down.velocity = 0,-16
fall = 1
fall.recovertime = 40
id = 240
nochainid = 240
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 4
movetype = I

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

; Followup
[Statedef 1404]
type    = S
movetype= A
physics = S
juggle  = ifelse(var(42) & floor(exp(2*ln(2)) + 0.5) ,1,0)
poweradd= 60
velset = 0,0
anim = 1404
ctrl = 0
sprpriority = 2

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

[State 0, HitBy]
type = HitBy
trigger1 = abs(vel x)>=8
value = SCA,ST,HT,HA
time = 2
ignorehitpause = 1

[State Neo-Juggle-System-Flag]
type = VarSet
;trigger1 = !(var(40) & floor(exp(1*ln(2)) + 0.5) )
trigger1 = movehit = [1,2]
trigger1 = numtarget
trigger1 = (target,statetype = A) || (target,statetype = L)
var(42) = var(42) | floor(exp(2*ln(2)) + 0.5)
ignorehitpause = 1
persistent = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(2) >= 0
trigger1 = animelemtime(5) < 0
x = 32
[State 0, VelSet]
type = VelMul
trigger1 = animelemtime(5) >= 0
trigger1 = animelemtime(7) < 0
x = 0.96
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(7) = 0
x = 0

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 90, 8
[State 1210, 1]
type = PlaySnd
trigger1 = AnimElem = 5
value = f7, 0

[State 440, 3]
type = HitDef
trigger1 = animelem = 5
attr = C, SA
damage    = 100
hitflag = MAFD
guardflag = L
pausetime = 12-var(49),12
sparkno = 2
sparkxy = -5,-10
hitsound = S50, 1
guardsound = S51, 0
ground.type = Trip
ground.slidetime = 10
ground.hittime = 20
guard.ctrltime = 10
ground.velocity = -2.4,-9.5
air.velocity = -2.4,-9.5
guard.velocity = -7
fall = 1
yaccel = ifelse(!var(19),.66,.6)
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 5
statetype = C
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 7
statetype = L
movetype = I
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 8
statetype = C
[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 11
statetype = S


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

;---------------------------------------------------------------------------
; Uwaraba Smash
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3000
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelemtime(6) < 0
value = SC,NA,SA,NP,SP,NT
time = 2
ignorehitpause = 1

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6) < 0
x = 9
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(6) = 0
x = 5

[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = time = 0
pos = 27, -104
sound = s701, 21
poweradd = -1000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -50
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -40
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -30

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
attr = S, HA
animtype  = Hard
damage    = 70, 4
priority  = 5
hitflag = MAFDPG
guardflag = H
pausetime = 15-var(49),26
sparkxy = -10,var(3)
getpower = 0
hitsound   = s701,20
guardsound = S51,0
hitflag = MAFDP
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,0
air.velocity = 0,-1
air.fall = 1
guard.velocity = -10
ground.cornerpush.veloff = 0
fall.recover = 0

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
attr = S, HA
animtype  = Hard
damage    = 100, 4
priority  = 5
guardflag = H
pausetime = 15-var(49),15
sparkxy = -10,-20
hitflag = MAFDPG
hitsound   = s701,20
getpower = 0
guardsound = S51,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,3.5
air.velocity = 0,3
fall = 1
guard.velocity = -10
ground.cornerpush.veloff = 0
fall.recover = 0
id = 3050
p2facing = 1

[State WallBounce]
type = TargetState
trigger1 = numtarget(3050)
trigger1 = var(21) = 1
trigger1 = !(target(3050),ishelper)
value = 3055
ID = 3050
ignorehitpause = 1

[State 3000, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2000, 0
channel = 0
volume = 255

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 90, 9
volume = 255

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

;---------------------------------------------------------------------------
; Uwaraba Smash
[Statedef 3050]
type    = A
movetype= A
physics = N
juggle  = 0
velset = 9,-3
anim = 3050
ctrl = 0
sprpriority = 2

[State 0, NotHitBy]
type = NotHitBy
trigger1 = animelemtime(6) < 0
value = SC,NA,SA,NP,SP,NT
time = 2
ignorehitpause = 1

[State 0, StateTypeSet]
type = VelAdd
trigger1 = animelemtime(6) < 0
trigger1 = pos y != 0
y = 1.1397
[State 0, StateTypeSet]
type = VelAdd
trigger1 = animelemtime(6) >= 0
trigger1 = animelemtime(13) < 0
trigger1 = pos y != 0
y = 0.99
[State 0, StateTypeSet]
type = VelSet
trigger1 = animelemtime(13) < 0
trigger1 = vel y + pos y >= 0
y = 0
[State 0, StateTypeSet]
type = PosSet
trigger1 = animelemtime(13) < 0
trigger1 = vel y + pos y >= 0
y = 0
[State 0, StateTypeSet]
type = Velmul
trigger1 = animelemtime(13) < 0
x = 0.92
[State 0, StateTypeSet]
type = VelSet
trigger1 = animelem = 7
y = -10

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1
[State 0, StateTypeSet]
type = VelAdd
trigger1 = var(21) = 1
y = -1
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = time = 0
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = time = 0
pos = 27, -104
sound = s701, 21
poweradd = -1000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -50
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -40
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(2) = -1
var(3) = -30

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
attr = A, HA
animtype  = Hard
damage    = 70, 4
priority  = 5
guardflag = H
pausetime = 15-var(49),6
sparkxy = -10,var(3)
getpower = 0
hitsound   = s701,20
hitflag = MAFDP
guardsound = S51,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,0
air.velocity = 0,-1
air.fall = 1
guard.velocity = -10
ground.cornerpush.veloff = 0
id = 3050
fall.recover = 0
p2facing = 1

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
attr = A, HA
animtype  = Hard
damage    = 100, 4
priority  = 5
guardflag = H
pausetime = 15-var(49),6
sparkxy = -10,-20
hitflag = MAFDPG
hitsound   = s701,20
getpower = 0
guardsound = S51,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,3.5
air.velocity = 0,3
fall = 1
guard.velocity = -10
ground.cornerpush.veloff = 0
id = 3050
fall.recover = 0
p2facing = 1

[State WallBounce]
type = TargetState
trigger1 = numtarget(3050)
trigger1 = var(21) = 1
trigger1 = !(target(3050),ishelper)
value = 3055
ID = 3050
ignorehitpause = 1

[State 3000, 1]
type = PlaySnd
trigger1 = Time = 1
value = 2000, 0
volume = 255

[State 3000, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 90, 9
volume = 255

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 13
movetype = I
physics = A

;---------------------------------------------------------------------------
; THIS PARTY'S GETTING BOUNCY!
[Statedef 3055]
type    = A
movetype= H
physics = N

[State COLLISION DAMAGE]
type = EnvShake
trigger1 = time = 0
time = 12
freq = 255
ampl = -7
[State 5100, Var] ;Save fall velocity
type = VarSet
trigger1 = Time = 0
sysvar(1) = floor(vel y)
[State 5100, 2] ;Hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0 || !hitshakeover
trigger1 = !selfanimexist(5101)
value = 5100
[State 5100, 3]
type = ChangeAnim
trigger1 = time = 0 || !hitshakeover
trigger1 = selfanimexist(5101)
value = 5101

[State 5100, 4]
type = PosSet
trigger1 = Time = 0
y = 0
[State 5100, 5]
type = VelSet
trigger1 = Time = 0
y = 0
[State 5100, 6] ;Reduce speed
type = VelMul
trigger1 = Time = 0
x = 0.75

[State 5100, 8]
type = Explod
trigger1 = Time = 1
anim = F62
pos = 0, 0
sprpriority = -2
supermovetime = 65535
pausemovetime = 65535
scale = 1,1

[State 5100, 10]
type = PlaySnd
trigger1 = Time = 1
value = F7, 2
[State 5100, 11]
type = PosFreeze
trigger1 = 1
[State 5100, 12]
type = ChangeState
trigger1 = AnimTime = 0
value = 3056

[State 5100, 13]
type = ForceFeedback
trigger1 = Time = 0
waveform = sinesquare
ampl = 128,-3,-.2,.005
time = 20

;---------------------------------------------------------------------------
; HIT_BOUNCE (bounce into air)
[Statedef 3056]
type    = A
movetype= H
physics = N

[State 5101, 1] ;Coming hit ground anim (normal)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim != [5101,5109]
trigger2 = !SelfAnimExist(5160 + (anim % 10))
value = 5160
[State 5101, 2] ;Coming hit ground anim (for hit up)
type = ChangeAnim
triggerall = time = 0
trigger1 = anim = [5101,5109]
trigger1 = SelfAnimExist(5160 + (anim % 10))
value = 5160 + (anim % 10)

[State 5101, 3]
type = VelSet
trigger1 = Time = 0
x = -1
y = ifelse(alive,-19.693741,-64)
[State 5101, 5] ;Acceleration
type = VelAdd
trigger1 = 1
y = .99

[State 5101, 6] ;Hit ground
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 6
type = SelfState
value = 5110



;---------------------------------------------------------------------------
; Barack Obama
; CNS difficulty: medium
[Statedef 3100]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 3100
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = timerfreeze

[State 0, Helper]
type = Helper
triggerall = ProjHitTime(3100)
trigger1 = winko
helpertype = normal
name = "LOL"
ID = 3109
stateno = 3109
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1
persistent = 0

[State ProRation]
type = VarSet
;triggerall = numprojid(3100)
triggerall = ProjHitTime(3100)
trigger1 = animelemtime(6) = 10
trigger2 = animelemtime(6) = 51
trigger3 = animelemtime(6) = 86
trigger4 = animelemtime(6) = 102
trigger5 = animelemtime(6) = 139
trigger6 = animelemtime(6) = 161
fvar(13) = fvar(13) * 0.75
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = animelem = 2
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = animelem = 2
pos = 3, -111
sound = s701, 21
poweradd = -1000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype  = Hard
damage    = 50, 4
priority  = 5
guardflag = MA
pausetime = 5-var(49),40
guard.pausetime = 5,12
hitsound   = s701,20
hitflag = MAFDP
getpower = 0
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = 0,3.5
air.velocity = 0,3
kill = 0

[State 3050, Super B]
type = AfterImage
trigger1 = AnimElem = 2
time = 2

[State 3050, 1]
type = PlaySnd
trigger1 = AnimElem = 6
value = 701, 10
volume = 255
channel = 0

[State 191, Shake Screen]
type = EnvShake
trigger1 = animelemtime(6) = 84
time = 12
ampl = 6
freq = 180
[State 191, Shake Screen]
type = EnvShake
trigger1 = animelemtime(6) = 124
time = 26
ampl = 6
freq = 180
[State 191, Shake Screen]
type = EnvShake
trigger1 = animelemtime(6) = 164
time = 22
ampl = 6
freq = 180
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(6) = 84
var(0) = 5
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(6) = 124
var(0) = 26
[State 0, VarSet]
type = VarSet
trigger1 = animelemtime(6) = 164
var(0) = 22
[State WHAT THE FUCK]
type = Helper
trigger1 = animelemtime(6) = 84
trigger2 = animelemtime(6) = 124
trigger3 = animelemtime(6) = 164
helpertype = normal
name = "WHAT"
ID = 3101
stateno = 3101
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 1000, Axe Tossin] ;You need to run, the killer is me
type = Projectile
trigger1 = animelemtime(6) = 11
trigger2 = animelemtime(6) = 52
trigger3 = animelemtime(6) = 87
trigger4 = animelemtime(6) = 103
trigger5 = animelemtime(6) = 140
projid = 3100
projanim = 3101
projhitanim = 3102
getpower = 0
;projremanim = 689
sparkno = -1
guard.sparkno = -1
projpriority = 1
projshadow = -1
offset = 10, 0
velocity = 20
attr = S, HP
damage   = 65,5
animtype = hard
guardflag = MA
hitflag = MAFDP
pausetime = 0,60
guard.pausetime = 0,0
hitsound   = S701,19
guardsound = S701,17
ground.type = Low
ground.slidetime = 28
ground.hittime  = 28
guard.ctrltime = 15
guard.velocity = -10
ground.velocity = -7
air.velocity = -4,-7
down.velocity = -4,-7
down.hittime = 30
down.bounce = 0
air.fall = 1
fall.recovertime = 40
yaccel = .5
kill = 0

[State 1000, Axe Tossin]
type = Projectile
trigger1 = animelemtime(6) = 162
projid = 3100
projanim = 3101
projhitanim = 3102
;projremanim = 689
sparkno = -1
guard.sparkno = -1
projpriority = 1
projshadow = -1
offset = 10, 0
velocity = 20
attr = S, HP
damage   = 65,5
animtype = diagup
guardflag = MA
hitflag = MAFDP
pausetime = 0,20
guard.pausetime = 0,0
hitsound   = S701,19
guardsound = S701,17
ground.type = low
ground.slidetime = 28
ground.hittime  = 28
guard.ctrltime = 15
guard.velocity = -10
ground.velocity = -4,-16.93
air.velocity = -4,-16.93
down.velocity = -4,-16.93
down.hittime = 30
down.bounce = 0
yaccel = .9
fall = 1
fall.recovertime = 40

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

;---------------------------------------------------------------------------
; FLASH
[Statedef 3101]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 9741
ctrl = 0

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

[State 0, Null]
type = Null
trigger1 = 1
trigger1 = (var(10):=random%100)
trigger1 = (var(11):=random%100)
[State 0, Null]
type = Null
trigger1 = 1
trigger1 = (fvar(10):=var(10))
trigger1 = (fvar(11):=var(11))

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
var(0) = parent,var(0)
[State 0, PalFX]
type = AllPalFX
trigger1 = time < var(0)
time = 1
mul = random%512,random%512,random%512
invertall = random%2
color = random%255
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time < var(0)
anim = 3120+random%10
ID = 3120
pos = random%320,random%240
postype = left
facing = ifelse(random<500,-1,1)
vfacing = ifelse(random<500,-1,1)
bindtime = 1
removetime = -1
pausemovetime = 65535
supermovetime = 65535
scale = fvar(10)/100,fvar(11)/100
sprpriority = 123
ontop = 1
removeongethit = 1
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = time >= var(0)
id = 3120

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(3120)
trigger1 = time > var(0)

;---------------------------------------------------------------------------
; LOL
[Statedef 3109]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 9741
ctrl = 0

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 280
movetime = 280
anim = -1
sound = -1
darken = 0
p2defmul = 1
pausebg = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 280
freq = 255
ampl = -32
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = nomusic
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S701,49

[State 0, Null]
type = Null
trigger1 = 1
trigger1 = (var(10):=random%100)
trigger1 = (var(11):=random%100)
[State 0, Null]
type = Null
trigger1 = 1
trigger1 = (fvar(10):=var(10))
trigger1 = (fvar(11):=var(11))

[State 0, PalFX]
type = AllPalFX
trigger1 = 1
time = 2
add = -256+random%512,-256+random%512,-256+random%512
mul = random%512,random%512,random%512
invertall = random%2
color = random%255
ignorehitpause = 1
[State 0, PalFX]
type = BGPalFX
trigger1 = 1
time = 2
mul = random%512,random%512,random%512
invertall = random%2
color = random%255
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time < 548
anim = 3120+random%10
ID = 3120
pos = random%320,random%240
postype = left
facing = ifelse(random<500,-1,1)
vfacing = ifelse(random<500,-1,1)
bindtime = 1
removetime = -1
pausemovetime = 65535
supermovetime = 65535
scale = fvar(10)/100,fvar(11)/100
sprpriority = 123
ontop = 1
removeongethit = 1
ignorehitpause = 1

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = (time%28) = 0
trigger3 = time >= 280
id = 3120

[State 0, DestroySelf]
type = DestroySelf
trigger1 = !numexplod(3120)
trigger1 = time > 280


[Statedef 3200]
type    = A
movetype= A
physics = N
velset = -3,-20
anim = 3200
ctrl = 0
sprpriority = 2
facep2 = 1

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

[State ProRation]
type = VarSet
trigger1 = var(21) = 1
fvar(13) = fvar(13) * 0.25
ignorehitpause = 1

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

[State 0, Gravity]
type = Gravity
trigger1 = 1
[State 0, Helper]
type = Helper
trigger1 = animelem = 9
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = animelem = 9
pos = 8, -124
sound = s701, 21
poweradd = -2000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 3050, 1]
type = PlaySnd
trigger1 = Time = 0
value = 5, 2
channel = 1

[State 0, VelSet]
type = VelSet
trigger1 = animelem = 11
x = 14
y = 14
ignorehitpause = 1

[State 3050, 1]
type = PlaySnd
trigger1 = animelem = 11
value = 2000, 2
channel = 1

[State 3050, 1]
type = PlaySnd
trigger1 = animelem = 11
value = 100, 3

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
ignorehitpause = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = movehit = 1
flag = nobardisplay
flag2 = noBG
flag3 = noFG
ignorehitpause = 1
[State 0, EnvColor]
type = EnvColor
trigger1 = movehit = 1
value = 16,32,166
time = 1
under = 1
ignorehitpause = 1
[State 0, PalFX]
type = PalFX
trigger1 = movehit = 1
time = 1
color = 0
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = movehit = 1
anim = 3205
ID = 3205
pos = floor(screenpos x),120
postype = let
facing = 1
vfacing = 1
bindtime = -1
removetime = 1
pausemovetime = 65535
supermovetime = 65535
scale = .5,.5
sprpriority = -666
ontop = 0
ownpal = 1
removeongethit = 1
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = movehit = 1
anim = 3206+random%6
ID = 3206
pos = 160,120
postype = let
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
pausemovetime = 65535
supermovetime = 65535
scale = .5,.5
sprpriority = 666
ontop = 1
ownpal = 1
ignorehitpause = 1
removeongethit = 1
persistent = 0
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = movehit > 1
trigger1 = numexplod(3206)
id = 3206
[State 3050, 2]
type = HitDef
trigger1 = animelem = 11
attr = A, HA
animtype  = Hard               ;Make p2 use "Up" type animation on hit
damage    = 400, 12
getpower  = 0
priority  = 5
guardflag = HA
pausetime = 61-var(49),60
guard.pausetime = 8,8
sparkno = 3
sparkxy = 0,0
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 24
ground.hittime  = 24
ground.velocity = -5,-4
ground.cornerpush.veloff = -15 ;To push far away when p2 is in corner
guard.velocity = -9
air.velocity = -5,-4
airguard.velocity = -3.5,-4.5
guard.velocity = -12
guard.hittime = 60
fall = 1
fall.recover = 0             ;Prevent p2 from recovering
;fall.damage = 0             ;p2 will take 70 damage on hitting the ground
fall.envshake.ampl = 6       ;Parameters for shaking the screen on fall
fall.envshake.freq = 178
fall.envshake.time = 15
yaccel = 20
palfx.time = 60
palfx.color = 0

[State 0, ]
type = PlaySnd
trigger1 = moveguarded
value = 0,1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = EnvColor
trigger1 = moveguarded
value = 255,255,255
time = 2
under = 1
ignorehitpause = 1
persistent = 0
[State 0, ]
type = TargetState
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 264
ignorehitpause = 1
persistent = 0
[State 0, ]
type = HitAdd
trigger1 = moveguarded
trigger1 = p2statetype != A
value = 1
ignorehitpause = 1
persistent = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = vel y > 0
trigger1 = pos y >= 0
value = 3201
ctrl = 0

[Statedef 3201]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 3201
ctrl = 0
sprpriority = 2

[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = numexplod(3206)
id = 3206
ignorehitpause = 1
[State 0, PlayerPush]
type = PlayerPush
trigger1 = p2movetype = H
value = 0
ignorehitpause = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = time = 0
x = 15

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = F61
pos = 0,0
postype = p1
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
pausemovetime = 65535
pausemovetime = 65535
scale = 1,1
sprpriority = 2
ontop = 1
ownpal = 1
ignorehitpause = 1

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S40,0

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

;---------------------------------------------------------------------------
; Die hard
[Statedef 3300]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3300
ctrl = 0
sprpriority = 2
facep2 = 1

[State 3000, 1]
type = PlaySnd
trigger1 = Time = 1
value = 701, 64
channel = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(4) >= 0
trigger1 = animelemtime(5) < 0
x = 24.93741
[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(5) = 0
x = 0

[State 0, Helper]
type = Helper
trigger1 = animelem = 2
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = animelem = 2
movetime = 3
pos = 6, -96
sound = s701, 21
poweradd = -3000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 5
attr = S, HA
getpower = 0
damage = 123,0
animtype = diagup
guardflag = H
hitflag = MAF
pausetime = 0,0
guard.pausetime = 12-var(49) , 11
sparkno = -1
sparkxy = -10, -60
hitsound = S701, 45
guardsound = S51, 0
ground.type = low
ground.slidetime = 23
ground.hittime  = 23
guard.velocity = -9
guard.ctrltime = 10
ground.velocity = -10,-7.5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -10,-7.5
air.hittime = 20
fall = 1
fall.recovertime = 40
kill = 0
id = 123
yaccel = .5

[State 200, 7]
type = ChangeState
trigger1 = !movereversed
trigger1 = movehit
trigger1 = numtarget
trigger1 = !(target,ishelper)
value = 3310
ctrl = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 6
movetype = I

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

; Duke Nukem Forever as it should have been
[Statedef 3310]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 9741

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 3320

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noBG
flag3 = noFG
ignorehitpause = 1
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
;flag = nokosnd
flag = nokoslow
flag2 = nomusic
flag3 = globalnoshadow
ignorehitpause = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S701,14
abspan = 0

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 3349
ID = 3349
pos = 160,120
postype = left
bindtime = -1
removetime = 636
supermovetime = 65535
pausemovetime = 65535
scale = 1,1
sprpriority = 950
ontop = 1
ownpal = 1
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 3301
ID = 7004770340
pos = 239,84 - (const(size.head.pos.y)*2)
postype = left
facing = -1
vfacing = 1
vel = 2,0
accel = -0.0357142857142857,0
bindtime = 1
removetime = 56
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 943
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = F3
pos = 160,120
postype = left
facing = 1
vfacing = 1
vel = 0,0
bindtime = 1
removetime = -2
supermovetime = 65535
pausemovetime = 65535
scale = 2,2
sprpriority = 999
ignorehitpause = 1
[State 0, Explod]
type = Explod
triggerall = (gametime%9)=0
trigger1 = time = [90,130]
trigger2 = time = [200,304]
anim = F2
pos = 160,120
postype = left
facing = 1
vfacing = 1
vel = 0,0
random = 64,64
bindtime = 1
removetime = -2
supermovetime = 65535
pausemovetime = 65535
scale = 1,1
sprpriority = 999
ignorehitpause = 1
[State 0, HitAdd]
type = HitAdd
triggerall = (gametime%9)=0
trigger1 = time = [78,304]
value = 1
ignorehitpause = 1
[State 0, LifeAdd]
type = TargetLifeAdd
triggerall = (gametime%9)=0
trigger1 = time = [78,304]
value = ceil(-11 * fvar(13))
kill = 0
[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 3340
ID = 3340
pos = 160,120
postype = left
bindtime = -1
removetime = 636
supermovetime = 65535
pausemovetime = 65535
scale = 1,1
sprpriority = 940
ontop = 0
ownpal = 1
ignorehitpause = 1

[State 0, ChangeState]
type = ChangeState
trigger1 = time >= 636
value = 3311
ctrl = 0

[Statedef 3311]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
anim = 3311

[State 0, TargetBind]
type = TargetBind
trigger1 = time = 0
pos = 40,0
[State 0, TargetBind]
type = TargetState
trigger1 = time = 0
value = 3321

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = S701,45
[State 0, HitAdd]
type = HitAdd
trigger1 = animelem = 5
value = 1
[State 0, TargetState]
type = TargetState
trigger1 = animelem = 5
value = 3055
[State 0, Explod]
type = Explod
trigger1 = animelem = 5
anim = F3
pos = 40,-50
postype = p1  ;p2,front,back,left,right
facing = 1
vfacing = 1
bindtime = 1
removetime = -2
scale = 1,1
sprpriority = 999
ontop = 1
ownpal = 1
[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 5
time = 8
freq = 255
ampl = -8

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 5
value = ceil(-100 * fvar(13))
kill = 1

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


[Statedef 3320]
type    = A
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, Explod]
type = Explod
trigger1 = time = 0
anim = 5007
ID = 7004770340
pos = 139,70 - (const(size.head.pos.y)*2)
postype = left
facing = 1
vfacing = 1
vel = -2,1
accel = 0.0357142857142857,-0.0178571428571429
bindtime = 1
removetime = 56
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 942
ignorehitpause = 1
[State 0, ModifyExplod]
type = ModifyExplod
trigger1 = time = 30
ID = 7004770340
vel = 0,0
accel = 0,0
[State 0, Explod]
type = Explod
trigger1 = time = 90
anim = 5002
ID = 7004770340
pos = 120,60 - (const(size.head.pos.y)*2)
postype = left
facing = 1
vfacing = 1
vel = 2,0
accel = -0.05,0
bindtime = 1
removetime = 40
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 942
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 200
anim = 5001
ID = 7004770340
pos = 160,100 - (const(size.head.pos.y)*6)
postype = left
facing = 1
vfacing = 1
vel = -0.2,0.2
accel = 0,0
bindtime = 1
removetime = 40
supermovetime = 65535
pausemovetime = 65535
scale = 6*const(size.xscale),6*const(size.yscale)
sprpriority = 942
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 240
anim = 5002
ID = 7004770340
pos = 160,80 - (const(size.head.pos.y)*2)
postype = left
facing = 1
vfacing = 1
vel = 0,0
accel = 0,0
bindtime = 1
removetime = 60
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 942
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 300
anim = 5007
ID = 7004770340
pos = 160,80 - (const(size.head.pos.y)*2)
postype = left
facing = 1
vfacing = 1
vel = 0,0
accel = 0,0
bindtime = 1
removetime = 24
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 942
ignorehitpause = 1
[State 0, Explod]
type = Explod
trigger1 = time = 420
anim = 5300
ID = 7004770340
pos = 120,70 - (const(size.head.pos.y)*2)
postype = left
facing = 1
vfacing = 1
vel = 0,0
accel = 0,0
bindtime = 1
removetime = 172
supermovetime = 65535
pausemovetime = 65535
scale = 2*const(size.xscale),2*const(size.yscale)
sprpriority = 942
ignorehitpause = 1

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

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

[State 0, SelfState]
type = SelfState
trigger1 = time > 636
value = 5110

[Statedef 3321]
type    = S
movetype= H
physics = N
velset = 0,0
ctrl = 0

[State 0, ChangeAnim2]
type = ChangeAnim
trigger1 = time = 0
value = 5300

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

[State 0, SelfState]
type = SelfState
trigger1 = time > 636
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; FINAL KO
[Statedef 3600]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3600
ctrl = 0
sprpriority = 2
facep2 = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8
value = S90,9
[State 3000, 1]
type = PlaySnd
trigger1 = animelem = 5
value = 701, ifelse(random<500,73,54)
channel = 0

[State 0, Helper]
type = Helper
trigger1 = animelem = 5
helpertype = normal
name = "SuperBG"
ID = 3900
stateno = 3900
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
[State 3000, Super A]
type = SuperPause
trigger1 = animelem = 5
pos = 8, -80
movetime = 6
sound = s701, 21
poweradd = -3000
darken = 0
p2defmul = 1
endcmdbuftime = 8

[State 0, NotHitBy]
type = HitBy
trigger1 = animelemtime(9) >= 0
trigger1 = animelemtime(11) < 0
value = SCA,NT,ST,HT
time = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 11
x = p2bodydist x - 35
ignorehitpause = 1
persistent = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 11
attr = S, HA
getpower = 0
damage = 50, 0
animtype = hard
guardflag = M
hitflag = MAF
pausetime = 20-var(49), 19
guard.pausetime = 12-var(49), 11
sparkno = 3
sparkxy = -10, -90
hitsound = S50, 1
guardsound = S51, 0
ground.type = high
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -9
guard.ctrltime = 10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
kill = 0
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, 7]
type = ChangeState
trigger1 = !movereversed
trigger1 = movehit
trigger1 = numtarget
trigger1 = !(target,ishelper)
value = 3605
ctrl = 0

[State 0, StateTypeSet]
type = StateTypeSet
trigger1 = animelem = 12
movetype = I

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

;---------------------------------------------------------------------------
; FINAL KO
[Statedef 3605]
type    = S
movetype= A
physics = S
juggle  = 0
velset = 0,0
anim = 3605
ctrl = 0
sprpriority = 2

[State 3000, 1]
type = PlaySnd
trigger1 = time = 0
value = 701, 55+random%3
channel = 0

[State 0, VelSet]
type = VelSet
trigger1 = animelemtime(28) < 0
x = 2

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = roundstate = 2
trigger1 = animtime = 0
value = -65535
kill = 1
absolute = 1
ignorehitpause = 1

[State 0, Helper]
type = Helper
trigger1 = movehit
trigger1 = winko
helpertype = normal
name = "SUPER KO"
ID = 3640
stateno = 3640
pos = 0,0
postype = p1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1
persistent = 0

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = timerfreeze

[State 0, TargetState]
type = TargetState
trigger1 = time = 0
value = 3606
[State 0, TargetBind]
type = TargetBind
trigger1 = time = 0
time = 1
pos = ifelse(p2dist x>55,55,ifelse(p2dist x<30,30,p2dist x)),0
[State -2, P2 Facing]
type= targetfacing
trigger1= time = 0
value= -1
ignorehitpause= 1

[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,AA,AP,AT

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 6
trigger2 = AnimElem = 9
trigger3 = AnimElem = 14
attr = S, HA
getpower = 0
damage = 50, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 27-var(49), 27
guard.pausetime = 8,8
sparkno = 3
sparkxy = -10, -90
hitsound = S50, 6
guardsound = S51, 0
ground.type = high
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -9
guard.ctrltime = 10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
kill = 0
envshake.time = 8
envshake.freqmul = 255
envshake.ampl = -4
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 21
attr = S, HA
getpower = 0
damage = 80, 0
animtype = hard
guardflag =
hitflag = MAF
pausetime = 27-var(49), 27
guard.pausetime = 8,8
sparkno = 3
sparkxy = -10, -90
hitsound = S50, 6
guardsound = S51, 0
ground.type = low
ground.slidetime = 31
ground.hittime  = 31
guard.velocity = -9
guard.ctrltime = 10
ground.velocity = -5
airguard.velocity = -1.9,-.8
air.type = low
air.velocity = -1,-8.8
air.hittime = 20
air.fall = 1
fall.recovertime = 40
id = 123
yaccel = .88
kill = 0
envshake.time = 8
envshake.freqmul = 255
envshake.ampl = -4
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 28
attr = S, HA
damage = 100, 0
getpower = 0
animtype = up
guardflag =
hitflag = MAFD
pausetime = 30-var(49), 30
sparkno = 3
sparkxy = -10, -100
hitsound = S50, 1
guardsound = S51, 0
ground.type = High
ground.slidetime = 26
ground.hittime = 26
guard.velocity = -13
guard.ctrltime = 10
ground.velocity = 0,-16
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = 0,-16
air.hittime = 20
down.velocity = 0,-16
fall = 1
fall.recover = 0
id = 240
nochainid = 240
yaccel = .88
kill = 0
envshake.time = 8
envshake.freqmul = 255
envshake.ampl = -8
ground.cornerpush.veloff = 0
guard.cornerpush.veloff = 0
air.cornerpush.veloff = 0

[State 0, VarSet]
type = VarSet
;trigger1 = animelem = 33
trigger1 = time = 0
fvar(13) = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 34
value = S701,53
[State 0, Helper]
type = Helper
trigger1 = animelem = 34
helpertype = normal
name = "Charge"
ID = 3609
stateno = 3609
pos = 0,0
postype = p1
facing = 1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1

[State 3000, 1]
type = PlaySnd
trigger1 = animelem = 33
value = 701, 51
channel = 0
[State 3000, Super A]
type = SuperPause
trigger1 = animelem = 34
pos = 27, -104
time = 80
movetime = 80
anim = -1
sound = -1
poweradd = -3000
darken = 0
p2defmul = 1
endcmdbuftime = 8
[State 0, Offset]
type = Offset
trigger1 = animelemtime(34) >= 0
x = random%3 * ifelse(random<500,1,-1)
y = random%3 * ifelse(random<500,1,-1)

[State 1000, 5] ;Opponent near
type = HitDef
trigger1 = AnimElem = 36
attr = S, HA
animtype  = Hard
damage    = 666, 5
priority  = 5
guardflag =
pausetime = 0,2
guard.pausetime = 12-var(49),12
sparkno = S 701
sparkxy = -10,-118
hitflag = MAFDPG
hitsound   = s701,58
getpower = 0
guardsound = 6,0
ground.type = Low
ground.slidetime = 0
ground.hittime  = 17
ground.velocity = -12,3.5
air.velocity = -12,3
fall = 1
guard.velocity = -10
ground.cornerpush.veloff = 0

[State 0, Helper]
type = Helper
trigger1 = animtime = -1
trigger1 = movehit
trigger1 = target,alive
trigger1 = !winko
helpertype = normal
name = "Nope.avi"
ID = 3660
stateno = 3660
pos = 0,0
postype = p1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1
persistent = 0

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

;---------------------------------------------------------------------------
; Reset the oponent just in case
[Statedef 3606]
type    = S
movetype= H
physics = S
velset = 0,0

[State 0, HitFallSet]
type = HitFallSet
trigger1 = time = 0
value = 0

[State 0, PosSet]
type = VelSet
trigger1 = time = 0
y = 0
[State 0, PosSet]
type = PosSet
trigger1 = time = 0
y = 0

[State 5000, 1]
type = ChangeAnim
trigger1 = Time = 0
value = 5012
[State 5000, 1]
type = ChangeAnim
trigger1 = anim = 5012
trigger1 = animTime = 0
value = 5017

[State 5000, 6]
type = SelfState
trigger1 = time >= 60
value = 0
ctrl = 1

;---------------------------------------------------------------------------
; FINAL KO
[Statedef 3609]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
anim = 3609
sprpriority = -3

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = noshadow
[State 0, Trans]
type = VarAdd
trigger1 = 1
fvar(0) = 0.02
[State 0, Trans]
type = Trans
trigger1 = 1
trans = add
[State 0, BindToParent]
type = BindToParent
trigger1 = 1
time = 1
pos = -13,-88
[State 0, AngleDraw]
type = AngleDraw
trigger1 = 1
value = time*2
scale = fvar(0),fvar(0)
[State 0, BGPalFX]
type = BGPalFX
trigger1 = time
time = 1
add = 0-time,0-time,0-time

[State 0, DestroySelf]
type = DestroySelf
trigger1 = numhelper(3640)
trigger2 = time >= 130



[Statedef 3640]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
anim = 9741
ctrl = 0

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 240
movetime = 240
anim = -1
sound = -1
pos = 0,0
darken = 0
p2defmul = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noBG
flag3 = noFG
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = nokosnd
flag3 = nomusic

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
channel = -1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = time = 0
value = S701,52
volume = 255
abspan = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 1
freq = 0
ampl = 0
[State 0, EnvColor]
type = EnvColor
trigger1 = time = 0
value = 255,255,255
time = 2
ignorehitpause = 1

[State 0, Explod]
type = Explod
trigger1 = time = 2
anim = 3640
ID = 3640
pos = 160,0
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 280
pausemovetime = 65535
supermovetime = 65535
scale = 1,1
sprpriority = 65535
ontop = 1
ownpal = 1
[State 0, DestroySelf]
type = DestroySelf
trigger1 = time > 282

; NOPE
[Statedef 3660]
type    = S
movetype= I
physics = N
juggle  = 0
velset = 0,0
anim = 9741
ctrl = 0

[State 0, HitAdd]
type = HitAdd
trigger1 = time = 0
value = 0 - enemynear,gethitvar(hitcount)
ignorehitpause = 1

[State 0, SuperPause]
type = SuperPause
trigger1 = time = 0
time = 655355
movetime = 65535
anim = -1
sound = -1
pos = 0,0
darken = 0
p2defmul = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = numexplod(3660)
trigger1 = var(2) = 5
trigger1 = fvar(0) > 0
value = S702,random%16
channel = random%16
abspan = 0
volume = 255
volumescale = 150
ignorehitpause = 1
[State 0, PlaySnd]
type = PlaySnd
triggerall = numexplod(3660)
trigger1 = var(2) = 5
trigger1 = fvar(0) > 0
value = S701,random%72
channel = random%16
abspan = 0
volume = 255
volumescale = 150
ignorehitpause = 1

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nobardisplay
flag2 = noBG
flag3 = noFG
[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = 1
flag = nokoslow
flag2 = nokosnd
flag3 = nomusic

[State 0, StopSnd]
type = StopSnd
trigger1 = time = 0
trigger2 = !numexplod(3660)
trigger2 = var(3) = 1
trigger2 = var(2) = 5
trigger2 = fvar(0) >= 8
channel = -1

[State 0, EnvShake]
type = EnvShake
trigger1 = time = 0
time = 1
freq = 0
ampl = 0
[State 0, EnvColor]
type = EnvColor
trigger1 = 1
value = 255,255,255
time = 2
ignorehitpause = 1
[State 0, PalFX]
type = PalFX
trigger1 = 1
time = 1
mul = var(0),var(0),var(0)
ignorehitpause = 1

[State 0, Timer up]
type = VarAdd
trigger1 = !numexplod(3660)
trigger2 = var(0) = [1,4]
var(5) = 1

[State 0, Training mode?]
type = VarSet
triggerall = var(5) = 50
trigger1 = power >= powermax
trigger1 = (enemynear,power) >= (enemynear,powermax)
var(3) = 1
[State 0, Simul mode?]
type = VarSet
trigger1 = var(5) = 59
trigger1 = enemynear, teammode = simul
var(2) = 6


[State 0, VarSet]
type = VarAdd
trigger1 = var(1) = 0
trigger1 = var(0) < 254
var(0) = 2
[State 0, VarSet]
type = VarAdd
trigger1 = time
trigger1 = var(0) >= 254
trigger1 = var(1) = [0,119]
var(1) = 1
[State 0, VarSet]
type = VarAdd
trigger1 = var(2) != 5
trigger1 = var(1) >= 120
trigger1 = var(0) > 0
var(0) = -2
[State 0, VarSet]
type = VarAdd
trigger1 = var(2) = 5
trigger1 = var(1) >= 120
fvar(0) = 0.2
[State 0, RemoveExplod]
type = RemoveExplod
triggerall = numexplod(3660)
triggerall = var(1) >= 120
trigger1 = var(0) = 0
trigger2 = var(2) = 5
trigger2 = fvar(0) >= 8
id = 3660
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(5) = 59
trigger2 = (var(3) = 1) && (var(5) = 159)
trigger3 = (var(3) = 1) && (var(5) = 259)
trigger4 = (var(3) = 1) && (var(5) = 600)
trigger5 = (var(3) = 1) && (var(5) = 700)
var(0) = 0
[State 0, VarSet]
type = VarSet
trigger1 = var(5) = 59
trigger2 = (var(3) = 1) && (var(5) = 159)
trigger3 = (var(3) = 1) && (var(5) = 259)
trigger4 = (var(3) = 1) && (var(5) = 600)
trigger5 = (var(3) = 1) && (var(5) = 700)
var(1) = 0
[State 0, Trn]
type = VarSet
trigger1 = (var(3) = 1) && (var(5) = 59)
var(2) = 1
[State 0, Trn]
type = VarSet
trigger1 = (var(3) = 1) && (var(5) = 159)
var(2) = 2
[State 0, Trn]
type = VarSet
trigger1 = (var(3) = 1) && (var(5) = 259)
var(2) = 3
[State 0, Trn]
type = VarSet
trigger1 = (var(3) = 1) && (var(5) = 600)
var(2) = 4
[State 0, Trn]
type = VarSet
trigger1 = (var(3) = 1) && (var(5) = 700)
var(2) = 5
[State 0, Explod]
type = Explod
triggerall = !numexplod(3660)
trigger1 = var(5) = 60
trigger2 = var(5) = 160
trigger3 = var(5) = 260
trigger4 = var(5) = 601
trigger5 = var(5) = 701
anim = 3660+var(2)
ID = 3660
pos = 160,120
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
pausemovetime = 65535
supermovetime = 65535
scale = .5,.5
sprpriority = 65535
ontop = 1
[State 0, Explod]
type = ModifyExplod
triggerall = numexplod(3660)
trigger1 = var(2) = 5
trigger1 = fvar(0) > 0
ID = 3660
pos = 160,120
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
pausemovetime = 65535
supermovetime = 65535
random = 64,64
scale = .5+fvar(0),.5+fvar(0)
sprpriority = 65535
ontop = 1


[State 0, SuperPause]
type = SuperPause
triggerall = !numexplod(3660)
trigger1 = var(3) != 1
trigger1 = var(5) >= 61
trigger2 = var(3) = 1
trigger2 = var(2) = 5
trigger2 = fvar(0) >= 8
time = 0
movetime = 0
anim = -1
sound = -1
pos = 0,0
darken = 0
p2defmul = 1
[State 0, DestroySelf]
type = DestroySelf
triggerall = !numexplod(3660)
trigger1 = var(3) != 1
trigger1 = var(5) >= 61
trigger2 = var(3) = 1
trigger2 = var(2) = 5
trigger2 = fvar(0) >= 8

;---------------------------------------------------------------------------
; Super BG
[Statedef 3900]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 9741
ctrl = 0

[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = parent,stateno=[3100,3199]
var(1) = 1
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = parent,stateno=[3200,3299]
var(1) = 2
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = parent,stateno=[3300,3399]
var(1) = 3
[State 0, VarSet]
type = VarSet
trigger1 = time = 0
trigger1 = parent,stateno=[3600,3699]
var(1) = 4

[State 0, VarAdd]
type = VarAdd
trigger1 = fvar(0) < 1
fvar(0) = 0.05
[State 0, VarAdd]
type = VarSet
trigger1 = fvar(0) > 1
fvar(0) = 1
[State 0, VarAdd]
type = VarAdd
trigger1 = time
trigger1 = var(0) > -255
var(0) = -5
[State 0, VarAdd]
type = VarSet
trigger1 = time = 30
var(0) = 255

[State 2000, 1]
type = explod
trigger1 = time = 0
id = 3900
anim = 3900+var(1)
pos = 160, 120
postype = left
facing = 1
sprpriority = -10
bindtime = -1
removetime = 30
supermovetime = 65535
scale = 1,fvar(0)
[State 2000, 1]
type = modifyexplod
trigger1 = time
trigger1 = numexplod(3900)
id = 3900
scale = 1,fvar(0)
[State 0, BGPalFX]
type = BGPalFX
trigger1 = 1
time = 1
add = var(0),var(0),var(0)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = time > 30
trigger1 = var(0) <= 0



; (Credit to ANMC, Bagaliao, and FlowaGirl for the basic helper method concept.)
;
;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(1) - First tick button activation prevention.
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Persistent direction command detection enabler (due to 2002.04.14).
; var(9) - AutoTurn bug fixer.
; var(10)- Post-custom state buffered dir detection disabler.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(58) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9741]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9741, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9741, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = 2

[State 9741, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(3):=0
var(2) = (var(3):=1)+(var(4):=0)

[State 9741, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)
trigger1 = !(var(4):=0)

[State 9741, DirTurnOnAI]
type = ParentVarSet
triggerall = !(var(3) || var(9))
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = !(var(4):=1)
var(58) = var(4)

[State 9741, DirTurnOffAI]
type = ParentVarSet
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = var(4):=0

[State 9741, ButtonTurnOnAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
var(58) = 1

[State 9741, ButtonTurnOffAI]
type = ParentVarSet
triggerall = !var(2)
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9741, UnPauseCheck]
type = VarSet
triggerall = var(2)
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(2) = 2
trigger8 = var(2):=0
var(2) = 2

[State 9741, Goodbye]
type = DestroySelf
triggerall = var(1):=1
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

[State 9741, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "Var(2) = %d, ParentVar(57) = %d, GameTime = %d, Var(3) = %d"
params = var(2), (Parent,var(57)), GameTime, var(3)

;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick activation prevention
; var(2) - Used for pause/superpause and custom state check, basically.
; var(3) - (Super/)Pause & custom state-triggered dir detection disabler.
; var(4) - Hitpause check.
; var(5) - No button on previous tick.
; var(6) - Any dir on this tick.
; var(7) - Any button on this tick.
; var(8) - Matching partner button detected.
; var(9) - AutoTurn bug fixer.
; var(10)- Buffered dir detection disabler.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(58) - Parent's primary AI variable.
;
; The code in this state is mostly simply copy/pasteable.
; But if you're using different indices for the parent's variables,
; or if you change your character's basic commands' names, you'll
; of course need to change the code in this state accordingly.

[StateDef 9742]
type = S
movetype = I
physics = N
anim = 9741
ctrl = 0

[State 9742, Safety]; Just in case your opponent is very poorly coded.
type = SelfState
trigger1 = !IsHelper
value = 5050

[State 9742, UglyHack]
type = VarSet
trigger1 = !var(1)
var(2) = var(3):=2

[State 9742, PauseCheck]
type = VarSet
trigger1 = GameTime > Parent,var(57)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2
trigger4 = Parent,var(58)
trigger5 = var(1)
trigger5 = var(3):=0
var(2) = var(3):=1

[State 9742, Facing]
type = Turn
trigger1 = var(9):=(Facing != Parent,Facing)

[State 9742, ParentDirCheck]
type = VarSet
trigger1 = Parent,command = "holdfwd"
trigger2 = Parent,command = "holdback"
trigger3 = Parent,command = "holdup"
trigger4 = Parent,command = "holddown"
trigger5 = var(6):=0
var(6) = 1

[State 9742, BufferCheck]
type = VarSet
trigger1 = var(3) || var(4) || var(10)
var(10) = var(6)

[State 9742, ParentButtonCheck]
type = VarSet
trigger1 = Parent,command = "a"
trigger2 = Parent,command = "b"
trigger3 = Parent,command = "c"
trigger4 = Parent,command = "x"
trigger5 = Parent,command = "y"
trigger6 = Parent,command = "z"
trigger7 = Parent,command = "start"
trigger8 = var(7):=0
var(7) = 1

[State 9742, SameButtonCheck]
type = VarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = NumPartner
trigger1 = Parent,command = "a"
trigger1 = Partner,command = "a"
trigger2 = Parent,command = "b"
trigger2 = Partner,command = "b"
trigger3 = Parent,command = "c"
trigger3 = Partner,command = "c"
trigger4 = Parent,command = "x"
trigger4 = Partner,command = "x"
trigger5 = Parent,command = "y"
trigger5 = Partner,command = "y"
trigger6 = Parent,command = "z"
trigger6 = Partner,command = "z"
trigger7 = Parent,command = "start"
trigger7 = Partner,command = "start"
trigger8 = var(8):=0
var(8) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(6)
trigger1 = !(var(9) || var(10))
var(58) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(58)
trigger1 = command = "holdfwd"
trigger1 = Parent,command = "holdfwd"
trigger2 = command = "holdback"
trigger2 = Parent,command = "holdback"
trigger3 = command = "holdup"
trigger3 = Parent,command = "holdup"
trigger4 = command = "holddown"
trigger4 = Parent,command = "holddown"
var(58) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5) && var(7)
trigger1 = !(var(2) || var(8))
var(58) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !(var(2) || var(8))
trigger1 = command = "a"
trigger1 = Parent,command = "a"
trigger2 = command = "b"
trigger2 = Parent,command = "b"
trigger3 = command = "c"
trigger3 = Parent,command = "c"
trigger4 = command = "x"
trigger4 = Parent,command = "x"
trigger5 = command = "y"
trigger5 = Parent,command = "y"
trigger6 = command = "z"
trigger6 = Parent,command = "z"
trigger7 = command = "start"
trigger7 = Parent,command = "start"
var(58) = -1

[State 9742, UnPauseCheck]
type = VarSet
triggerall = var(2)
triggerall = !var(4)
trigger1 = var(7)
trigger2 = var(2) = 2
trigger2 = var(2):=0
var(2) = 2

[State 9742, Goodbye]
type = DestroySelf
trigger1 = Parent,var(58)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6) || var(7)
trigger2 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = var(1):=1
var(5) = !var(7)

[State 9742, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "Var(2) = %d, ParentVar(57) = %d, GameTime = %d, Var(3) = %d"
params = var(2), (Parent,var(57)), GameTime, var(3)

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

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

[StateDef -2]

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 5 || anim = 6
trigger1 = animelemtime(1) = 1
value = S701,62
channel = 0
lowpriority = 1
[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 5300
value = S701,81
channel = 5
lowpriority = 1
[State 0, StopSnd]
type = StopSnd
trigger1 = anim != 5300
channel = 5
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = var(22)
trigger1 = statetype != A
var(22) = 0
[State 0, VarSet]
type = VarSet
trigger1 = stateno = 45
trigger1 = prevstateno = 640
var(22) = var(22) | floor(exp(0*ln(2)) + 0.5)

[State IntroSkip]
type = VarAdd
trigger1 = var(29) < 5
trigger1 = roundstate = 2
var(29) = 1
[State IntroSkip]
type = StopSnd
trigger1 = var(29) = 1
channel = 1
ignorehitpause = 1


[State -3]
type = PlaySnd
triggerall = alive
trigger1 = (stateno = 5000) || (stateno = 5010) || (stateno = 5020) || (stateno = 5070)
trigger1 = time = 0
trigger2 = (stateno != 5000) && (stateno != 5010) && (stateno != 5020) && (stateno != 5070)
trigger2 = stateno != [120,160]
trigger2 = gethitvar(damage)
value = 702, random%16
volume = 255
channel = 0

; Within StateDef -2, none of your own AI-related code should be placed
; above these next two controllers.

[State P2Soundcode nope]
type = VarSet
trigger1 = 1
v = 33
value = 0
ignorehitpause = 1
[State P2Soundcode WHAM]
type = VarSet
trigger1 = (numtarget)
trigger1 = (target,stateno = 1027)
trigger1 = (target,time = 1)
trigger1 = (target,movetype = H)
v = 33
value = 1
ignorehitpause = 1

[State Limiter]
type = VarSet
trigger1 = stateno = 40
trigger2 = statetype = A
trigger2 = movecontact
trigger3 = p2stateno = [120,169]
var(8) = 12

[State Limiter]
type = VarAdd
trigger1 = var(8) > 0
var(8) = -1

[State 0, Helper]
type = Helper
trigger1 = !numhelper(179)
helpertype = normal
name = "Misc Stuff"
ID = 179
stateno = 179
pos = 0,0
postype = p1
ownpal = 1
supermovetime = 65535
pausemovetime = 65535
ignorehitpause = 1


[State ANTI-MINDGAME-GUARD]
type = VarAdd
triggerall = var(50) < 120
trigger1 = p2movetype = A
trigger1 = stateno = [120,169]
var(50) = 1
ignorehitpause = 1
[State ANTI-MINDGAME-GUARD]
type = VarSet
triggerall = var(50) > 0
trigger1 = stateno = [150,155]
trigger1 = time = 1
var(50) = ceil(var(50)*0.8)
ignorehitpause = 1
[State ANTI-MINDGAME-GUARD]
type = VarAdd
triggerall = var(50) > 0
triggerall = (gametime%3)=0
trigger1 = p2movetype != A
trigger2 = stateno != [120,169]
var(50) = -1
ignorehitpause = 1
[State ANTI-MINDGAME-TH]
type = VarSet
trigger1 = numenemy
trigger1 = var(55)
trigger1 = !numhelper(3209)
var(51) = (enemynear,HitDefAttr = SCA,AT) || (var(50) > 20) || ((abs(enemynear,animtime) <= enemynear,moveguarded ))
ignorehitpause = 1
[State ANTI-MINDGAME-TH]
type = VarSet
trigger1 = numenemy
trigger1 = var(55)
trigger1 = numhelper(3209)
var(51) = (enemynear,HitDefAttr = SCA,AT) || (var(50) > 20) || ((abs(enemynear,animtime) <= enemynear,moveguarded )) || (helper(3209),stateno=3208)
ignorehitpause = 1

[State -2, P2 Facing]
type= targetfacing
trigger1= movecontact=1 && numtarget=1
trigger1= !(target,hitshakeover) && !(target,hitfall) && (target,time<=1)
value= ifelse(p2dist x>=0, -1, 1)
ignorehitpause= 1

[State -2, Neo-Juggle-System-Reset]
type = VarSet
triggerall = var(40)
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = (target,statetype != A) && (target,statetype != L)
var(40) = 0
ignorehitpause = 1
[State -2, Neo-Juggle-System-Reset]
type = VarSet
triggerall = var(41)
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = (target,statetype != A) && (target,statetype != L)
var(41) = 0
ignorehitpause = 1
[State -2, Neo-Juggle-System-Reset]
type = VarSet
triggerall = var(42)
trigger1 = !numtarget
trigger2 = numtarget
trigger2 = (target,statetype != A) && (target,statetype != L)
var(42) = 0
ignorehitpause = 1
[State -2, Neo-Juggle-System copy]
type = VarSet
;triggerall = var(42)
trigger1 = time = 1
trigger2 = !numtarget
trigger3 = numtarget
trigger3 = (target,statetype != A) && (target,statetype != L)
var(47) = var(42)
ignorehitpause = 1
[State 0, Neo-Juggle-System-Debug]
type = DisplayToClipboard
trigger1 = var(36)
text = "NJS Flags = %d | %d"
params = var(40),var(41)
ignorehitpause = 1

[State Prevent the prorator from going too low]
type = VarSet
trigger1 = fvar(13) < 0.15
fvar(13) = 0.15
ignorehitpause = 1
[State Prorator Reset]
type = VarSet
trigger1 = !numenemy
trigger2 = p2movetype != H || (!enemynear,gethitvar(hitcount))
trigger2 = !movehit || movereversed
trigger3 = p2stateno = 5120
fvar(13) = 1
ignorehitpause = 1
[State 0, AttackMulSet]
type = AttackMulSet
trigger1 = 1
time = 2
;value = ifelse(p2movetype!=H,ifelse(var(20)=1,1.25,1),1 - ifelse(fvar(15)>.75,.75,fvar(15)))
value = ( ifelse((stateno=[3000,3900]), 0.25+(fvar(13)*0.75) ,fvar(13))  )
ignorehitpause = 1



[State -2, StopAI]
type = VarSet
triggerall = var(58) > 0 && !IsHelper
trigger1 = RoundState != 2
trigger2 = !Alive
var(58) = -2
IgnoreHitPause = 1

; This controller is optional.  It allows you treat the AI flag as a boolean
; value rather than an integer value, letting you trigger your AI directives
; with "var(0)" instead of "var(58)>0", and letting you make moves usable only
; by humans by using "!var(0)" instead of "var(58)<1", thus slightly improving
; the size and efficiency of your code.
; Another benefit is that it makes it much easier for users to disable your AI,
; if they so choose.
[State -2, Simplifier]
type = VarSet
triggerall = !IsHelper
trigger1 = var(58) = 1
trigger2 = var(55):=0
var(55) = 8
IgnoreHitPause = 1

[State -2, Movehitoner]
type = VarSet
trigger1 = 1
var(21) = ifelse(movehit=1,var(21)+1,0)
ignorehitpause = 1

[State 0, VarSet]
type = VarSet
trigger1 = time = 1
trigger1 = movetype = A
var(38) = floor(p2bodydist x)
ignorehitpause = 1
[State 0, VarSet]
type = VarSet
trigger1 = time = 1
trigger1 = movetype = A
var(39) = floor(p2bodydist y)
ignorehitpause = 1


[State -2, DTC]
type = DisplayToClipboard
trigger1 = 1
text = "var(58) = %d, var(0) = %d, RoundState = %d, IsHomeTeam = %d, var(57) = %d"
params = var(58), var(0), RoundState, IsHomeTeam, var(57)
IgnoreHitPause = 1

[State -2, ATC]
type = AppendToClipboard
trigger1 = 1
text = "\nx = %d, y = %d, pro = %f, %f"
params = floor(p2bodydist x), floor(p2bodydist y),fvar(13),((enemynear, vel x))
IgnoreHitPause = 1

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

[Statedef -3]

[State -3, Prevent Undergound Juggles]
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)
trigger1 =!(target,stateno =[5080,5150])
pos= ceil(p2dist x), ceil(-pos y); keeps P2 at the same horizontal distance, but resets his Y position
ignorehitpause= 1

[State -3, Variable Height]
type= playerpush
triggerall= statetype=A && movetype!=H && numenemy
triggerall= p2bodydist x = [-(enemynear,const(size.ground.back) + enemynear,const(size.ground.front)), 0]; checks if both characters are within each other's width
trigger1= p2statetype=S
trigger1= p2dist y >= (enemynear,const(size.height) - 22)
trigger2= p2statetype=C
trigger2= p2dist y >= (enemynear,const(size.height) - 48)
trigger3= p2statetype=L
trigger3= p2dist y >= 11
value= 0
ignorehitpause= 1


;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


; Kamek and Luchini appear to have been the first ones to use the IsHomeTeam AI
; activation concept.
; Feel free to move this controller to your character's intro state for slightly
; better efficiency.
[State -3, SetAI]
type = VarSet
triggerall = Alive && !IsHelper
triggerall = IsHomeTeam
trigger1 = TeamSide = 2
trigger2 = MatchNo > 1
var(58) = 1

[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(58) && !IsHelper
trigger1 = !NumHelper(9742)
trigger1 = Alive && RoundState = 2
trigger1 = NumPartner
trigger1 = Partner,SelfAnimExist(9741)
HelperType = normal
name = "AI Helper (Simul Version)"
ID = 9742
pos = 9999999,99999
StateNo = 9742
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

; If you want to use the Guard mode, Dummy mode, Distance, or Button jam dummy
; control options in Training mode without activating the dummy's AI while
; working on the character, then all you need to do is temporarily disable
; this controller.  Or, if you want to permanently disable this controller in
; Training mode, then you could use the Training mode detection code available
; from my site ( http://www.mugenguild.net/~winane/ ), and then just add a
; "(var(59)&63)>30" triggerall to this controller.
; Alternatively, you can just set "Dummy control" to "Manual", press a P2 button
; to kill the AI helper, and then set dummy control back to "Cooperative".  (In
; fact, setting dummy control to manual isn't even necessary, if you press the
; P2 button prior to the first time you pause.)
[State -3, AI Helper]
type = Helper
triggerall = !var(58) && !IsHelper
triggerall = !NumHelper(9741)
triggerall = Alive && RoundState = 2
trigger1 = !NumPartner
trigger2 = !(Partner,SelfAnimExist(9741))
HelperType = normal
name = "AI Helper"
ID = 9741
pos = 9999999,99999
StateNo = 9741
KeyCtrl = 1
PauseMoveTime = 2147483647
SuperMoveTime = 2147483647

[State -3, TurnBackOnAI]
type = VarSet
trigger1 = var(58) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(58) = 1

; This method works somewhat in Linux Mugen version 2002.04.14,
; whereas the old humanly-impossible commands method does not.
; It is very important that this controller NOT be moved to State -2.
; Note that this part won't work nearly as well if AI.Cheat is turned off
; in mugen.cfg.
[State -3, XOR]
type = VarSet
triggerall = var(58)!=1 && !IsHelper
triggerall = !var(56)
triggerall = var(57) = GameTime-1
trigger1 = command = "a" ^^ command = "a2"
trigger2 = command = "b" ^^ command = "b2"
trigger3 = command = "c" ^^ command = "c2"
trigger4 = command = "x" ^^ command = "x2"
trigger5 = command = "y" ^^ command = "y2"
trigger6 = command = "z" ^^ command = "z2"
trigger7 = command = "start" ^^ command = "start2"
trigger8 = command = "holda" ^^ command = "holda2"
trigger9 = command = "holdb" ^^ command = "holdb2"
trigger10 = command = "holdc" ^^ command = "holdc2"
trigger11 = command = "holdx" ^^ command = "holdx2"
trigger12 = command = "holdy" ^^ command = "holdy2"
trigger13 = command = "holdz" ^^ command = "holdz2"
trigger14 = command = "holdstart" ^^ command = "holdstart2"
trigger15 = command = "holdfwd" ^^ command = "holdfwd2"
trigger16 = command = "holdback" ^^ command = "holdback2"
trigger17 = command = "holdup" ^^ command = "holdup2"
trigger18 = command = "holddown" ^^ command = "holddown2"
trigger19 = command = "recovery" ^^ command = "recovery2"
;Add more as desired. (See my notes in the CMD.)
var(58) = 1

; These next two controllers must be placed here, after the above XOR
; VarSet controller and before the below GameTime VarSet controller.
[State -3, fiXOR]
type = VarAdd
trigger1 = var(56) > 0 && !IsHelper
var(56) = -1

[State -3, fuXOR]
type = VarSet
trigger1 = var(57) < GameTime-1 && !IsHelper
var(56) = 31
IgnoreHitPause = 1

; It is very important that this controller NOT be moved to State -2, as putting
; it there would defeat the entire purpose of the controller, allowing the
; helper method to erroneously set the AI variable.
; And within State -3, don't put any ChangeState controllers before this
; controller, lest you unnecessarily delay your character's AI activation.
[State -3, GameTimeVar]
type = VarSet
trigger1 = !IsHelper
var(57) = GameTime
IgnoreHitPause = 1

; Within StateDef -3, none of your own AI-related code should come after the code
; provided here (and putting it before the code is also generally a bad idea).
; It's better to use State -1 (or, in special circumstances, State -2) instead.


