
[Data]
;Amount of life to start with
;体力ゲージの初期値
life = 1000
;attack power (more is stronger)
;攻撃ダメージ
attack = 100
;defensive power (more is stronger)
;体力パワー
defence = 200
;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 = 15
;Default hit spark number for HitDefs
sparkno = 2
;Default guard spark number
guard.sparkno = 40
;1 to enable echo on KO
KO.echo = 0
;Volume offset (negative for softer)
volume = -50
;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 = 60
FloatPersistIndex = 40

[Size]
xscale = 1           ;Horizontal scaling factor.
yscale = 1           ;Vertical scaling factor.
ground.back = 30     ;Player width (back, ground)
ground.front = 30    ;Player width (front, ground)
air.back = 12        ;Player width (back, air)
air.front = 12       ;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 = -5, -90   ;Approximate position of head
mid.pos = -5, -60    ;Approximate position of midsection
shadowoffset = 0     ;Number of pixels to vertically offset the shadow
draw.offset = 0,0    ;Player drawing offset in pixels (x, y)

[Velocity]
walk.fwd  = 1.8      ;Walk forward
walk.back = -1.8     ;Walk backward
run.fwd  = 4.6, 0    ;Run forward (x, y)
run.back = -4.5,-4.8 ;Hop backward (x, y)
jump.neu = 0,-9.7    ;Neutral jumping velocity (x, y)
jump.back = -2.55    ;Jump back Speed (x, y)
jump.fwd = 2.5       ;Jump forward Speed (x, y)
runjump.back = -2.55,-8.1 ;Running jump speeds (opt)
runjump.fwd = 4,-8.1      ;.
airjump.neu = 0,-8.1      ;.
airjump.back = -2.55      ;Air jump speeds (opt)
airjump.fwd = 2.5         ;.

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

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


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

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = 5150
elem = 19

[State 0, Explod]
type = Explod
trigger1 = anim = 5150 && animelem = 22
anim = f 120
pos = 40,0
sprpriority = 3

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 5150 && animelem = 22
time = 12
ampl = -10

[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

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

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = time < 200
flag = roundnotover

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

;energia
[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 199
pos = 0,0
bindtime = -1
sprpriority = 0
removetime = -1
ownpal = 1
persistent = 0

;explosion loca
[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 3040
pos = -5,-100
bindtime = -1
sprpriority = 0
scale = 3,3
ownpal = 1
persistent = 0

[State 0, Explod]
type = Explod
trigger1 = animelem = 3
anim = 182
bindtime = -1
sprpriority = 5
persistent = 0
removetime = -1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 6,13
volume = 200
freqmul = 1.7
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 3
value = 6,14
volume = -50
loop = 1
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 3
time = 12
ampl = -10
persistent = 0

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

[State 0, ChangeState]
type = ChangeState
triggerall = TeamMode = Single
triggerall = enemynear, TeamMode = Single
triggerall = matchno >= 7
trigger1 = P2name = "ananzi"
trigger2 = P2name = "animus"
trigger3 = P2name = "Shar-makai"
trigger4 = P2name = "hashi"
trigger5 = P2name = "noroko"
trigger6 = P2name = "peketo"
value = 192
ctrl = 0

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

;ojos
[State 0, Explod]
type = Explod
trigger1 = animelem = 1
anim = 191
ID = 191
pos = -1,0
bindtime = -1
sprpriority = 3
persistent = 0

;energia
[State 0, Explod]
type = Explod
trigger1 = animelem = 1
anim = 199
ID = 199
pos = 0,0
bindtime = -1
sprpriority = 0
removetime = -1
ownpal = 1

;explosion loca
[State 0, Explod]
type = Explod
trigger1 = animtime = 0
anim = 3040
pos = -5,-100
bindtime = -1
sprpriority = 0
scale = 3,3
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,14
volume = -50
channel = 14
loop = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animtime = 0
value = 6,13
volume = 200
freqmul = 2.0

[State 0, EnvShake]
type = EnvShake
trigger1 = animtime = 0
time = 12
ampl = -12

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

;---------------------------------------------------------------------------
; patada
[Statedef 200]
type    = S
movetype= A
physics = S
juggle  = 1
velset = 0,0
ctrl = 0
sprpriority = 2

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 6,ifelse(random<500,4,8)
freqmul = 0.6+(random/3333.3)
volume = 200
channel = 12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 20 && time !=0
value = 6,3
freqmul = 0.9+(random/3333.3)
volume = 150
channel = 12

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 2 && time != 0
value = 20
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 200
value = 200

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 22 && time != 0
attr = S, NA                     ;Attribute: Standing, Normal Attack
damage = 65, 0                   ;Damage that move inflicts, guard damage
animtype = heavy                 ;Animation type: Light, Medium, Heavy, Back (def: Light)
guardflag = MA                   ;Flags on how move is to be guarded against
hitflag = MAF                    ;Flags of conditions that move can hit
priority = 4, Hit                ;Attack priority: 0 (least) to 7 (most), 4 default
;Hit/Miss/Dodge type (Def: Hit)
pausetime = 12, 12                 ;Time attacker pauses, time opponent shakes
sparkno = 2                      ;Spark anim no (Def: set above)
sparkxy = -10, -60               ;X-offset for the "hit spark" rel. to p2,
;Y-offset for the spark rel. to p1
hitsound = 5, 4                  ;Sound to play on hit
guardsound = 6, 0                ;Sound to play on guard
ground.type = High               ;Type: High, Low, Trip (def: Normal)
ground.slidetime = 5             ;Time that the opponent slides back
ground.hittime  = 10             ;Time opponent is in hit state
ground.velocity = -7,-1             ;Velocity at which opponent is pushed
airguard.velocity = -1,-3
air.type = High                  ;Type: High, Low, Trip (def: same as ground.type)
air.velocity = -7,-1           ;X-velocity at which opponent is pushed,
air.hittime = 12                 ;Time before opponent regains control in air
;fall = 1
envshake.time = 12
envshake.ampl = 10

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

;---------------------------------------------------------------------------
;Rayo
[Statedef 1000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && prevstateno != 5000 && random < 500
value = 5,3
freqmul = 0.9+(random/3333.3)
volume = 100
channel = 11

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && prevstateno != 5000
value = 6,ifelse(random<500,4,8)
freqmul = 0.8+(random/3333.3)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && prevstateno != 5000
value = 6,9
volume = 100
channel = 13

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 2 && time != 0
value = 110
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 1000
value = 1000

[State 0, Explod]
type = Explod
trigger1 = animelem = 8 && numexplod(1005)=0
anim = 1005
ID = 1005
pos = 0,0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
supermovetime = -1

[State 0, Width]
type = Width
trigger1 = animelem = 33
value = 40,0

[State 0, Helper]
type = Helper
trigger1 = animelem = 33 && numhelper(1010)=0
name = "rayo"
ID = 1010
stateno = 1010
pos = -5,0
ownpal = 1

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

;---------------------------------------------------------------------------
;Rayo (helper)
[Statedef 1010]
type    = S
movetype= A
physics = n
velset = 0,0
ctrl = 0
sprpriority = 5
anim = 1010

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,1
volume = 200
freqmul = 1.0+(random/3333.3)

[State 0, SprPriority]
type = SprPriority
trigger1 = movecontact
value = 6
ignorehitpause = 1

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

;ondaza
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 62
sprpriority = 6
ownpal = 1
pos = 290,0
facing = ifelse(random<500,1,-1)
scale =2,2

;ondita
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 61
sprpriority = 0
ownpal = 1
pos = 290,0
scale = 3,3

;ondita
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 61
sprpriority = 0
ownpal = 1
pos = 290,0
scale = 2,2

[State 0, BGPalFX]
type = BGPalFX
trigger1 = !time
time = 20
add = 50,-100,-100
sinadd = -50,100,100,60

[State 0, BindToParent]
type = BindToParent
trigger1 = 1
pos = -5,0
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 12
ampl = -8

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, SP
animtype  = up
damage    = 120,10
guardflag = MA
priority = 4
pausetime = 5,10
sparkno = 2
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -3,-16
air.velocity = -3,-16
airguard.velocity = -1,-3
fall = 1
yaccel = 0.7
palfx.time = 30
palfx.add = 100,-150,-150
fall.envshake.time = 10
fall.envshake.ampl = 7
envshake.time = 12
envshake.ampl = -10

[State 0, Explod]
type = null;Explod
trigger1 = movehit
anim = 1011
ID = 1011
pos = (enemynear, pos x),-40
;postype = p1  ;p2,front,back,left,right
sprpriority = 6
ownpal = 1
ignorehitpause = 1
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = animtime = 0
trigger2 = parent, stateno = 5005

;---------------------------------------------------------------------------
;agarre 1
[Statedef 1100]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2 && time != 0
value = 5,ifelse(random<500,0,1)
freqmul = 0.9+(random/3333.3)
channel = 11
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 6,ifelse(random<500,4,8)
freqmul = 1.0+(random/3333.3)
volume = 100
channel = 12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 24
value = 6,3
freqmul = 1.5+(random/3333.3)
volume = 100
channel = 12

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 2 && prevstateno != 5000
value = 80
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 1100
value = 1100

[State 3300, hit]
type = hitdef
trigger1 = animelem = 24 && time != 0
trigger1 = !movecontact && !movereversed
attr = S,HA
damage = 0,0
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4,Hit
guard.pausetime = 0,10
sparkno = -1
guard.sparkno = 40
sparkxy = 0,-60
hitsound = -1,-1
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-10,0
air.type=Low
air.velocity=-5,-5
id = 1100
ground.cornerpush.veloff = 1
air.cornerpush.veloff = 1
p2facing = 1
hitonce = 1

[State 3300, p2state]
type=targetstate
trigger1= movehit && numtarget(1100)
ID=1100
value=1120

[State 3300, p1state]
type=changestate
trigger1= movehit && numtarget(1100)
value=1110

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

;---------------------------------------------------------------------------
;agarre 1 - P1
[Statedef 1110]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
sprpriority = 3
anim = 1110

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1,1
volume = 200
freqmul = 0.7+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 6,ifelse(random<500,4,8)
freqmul = 0.8+(random/3333.3)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 0,2
freqmul = 0.8+(random/3333.3)

[State 0, Width]
type = Width
trigger1 = !time
value = 100,0

;spark
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 1
pos = 110, -90
ontop = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 10
ampl = -6

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(1)>=0
trigger1 = animelemtime(2)<0
time = 1
id = 1100
pos = 110,-83

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2)>=0
trigger1 = animelemtime(3)<0
time = 1
id = 1100
pos = 93,-122

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(3)>=0
trigger1 = animelemtime(4)<0
time = 1
id = 1100
pos = 82,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(4)>=0
trigger1 = animelemtime(5)<0
time = 1
id = 1100
pos = 78,-161

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(5)>=0
trigger1 = animelemtime(6)<0
time = 1
id = 1100
pos = 76,-157

[State 0, Explod]
type = Explod
trigger1 = animelem = 5
anim = 1111
ID = 1111
sprpriority = 5
removetime = 50

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 5
value = 6,6
volume = 100

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 5
time = 50
ampl = -2

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 6
time = 15
ampl = -12

;blanco
[State 3900, 1]
type = Explod
trigger1 = animelem = 6
anim = 1112
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State 0, TargetState]
type = TargetState
trigger1 = animelem = 6 && numtarget(1100)
value = ifelse(target(1100),life>180,1121,1130)
ID = 1100

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 6
value = -180

;sangre
[State 1010, 9]
type = explod
trigger1 = animelem = 6
anim = f ifelse(random<500,7004,7005)
pos = 76,-150
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)

;sangre
[State 1010, 9]
type = explod
trigger1 = animelem = 6 && numtarget(1100)
anim = f 7008
pos = 76,ifelse((target(1100),anim=91231),-120,-170)
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)

;sangre
[State 1010, 9]
type = explod
trigger1 = animelem = 6 && numtarget(1100)
anim = f 7003
pos = 76,ifelse((target(1100),anim=91231),-120,-170)
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)

;sangre
[State 1010, 9]
type = explod
trigger1 = animelemtime(5)=20 && numtarget(1100)
anim = 3033
pos = 76,ifelse((target(1100),anim=91231),-120,-170)
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)

;efecto sangre
[State 0, Explod]
type = Explod
trigger1 = animelem = 6 && numtarget(1100)
anim = 3040
pos = 76,ifelse((target(1100),anim=91231),-120,-170)
facing = ifelse(random<500,1,-1)
vfacing = ifelse(random<500,1,-1)
scale = 1.5,1.5
ontop = 1
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8 && random < 600
value = 5,2
channel = 11

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = 6,7
freqmul = 1.0+(random/3333.3)
volume = 100

;sangre manchitas
[State 3900, 1]
type = Explod
trigger1 = animelem = 6 && target(1100),stateno = 1130
anim = 3032
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State 1000, 7]
type = ChangeState
trigger1 = Animtime = 0
trigger2 = numtarget(1100)=0 && animelemtime(5)<0
value = 0
ctrl = 1

;---------------------------------------------------------
;agarre 1 - P2-1
[Statedef 1120]
type = S
movetype = H
ctrl = 0
velset = 0, 0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6320

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && anim != 6320
value = 1120
ignorehitpause = 1

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = anim = 1120
trigger1 = !time
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,ifelse(name = "noroko", 200,20))
freqmul = 0.9+(random/3333.3)

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

;Generated by Fighter Factory PalFX Editor
[State 0, PalFXWiz]
type = PalFX
trigger1 = time = 65
time = 60
add = 0,0,0
mul = 256,256,256
sinadd = 150,-150,-150,140

;---------------------------------------------------------------------------
;agarre 1 p2 2 vuela
[Statedef 1121]
type    = A
movetype= H
physics = N
velset = ifelse(prevstateno=3021,-6,-10),-3
poweradd = 0

[State 0, PalFX]
type = PalFX
trigger1 = !time
time = 1
add = 0,0,0

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
x = ifelse(prevstateno=1320,-73,0)
y = ifelse(prevstateno=1320,180,80)

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

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6321

[State 820, 1]
type = ChangeAnim2
Trigger1 = !time && anim != 6321
value = 1121

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = anim = 1121
trigger1 = !time
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,ifelse(name = "noroko", 200,20))
freqmul = 0.9+(random/3333.3)

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

;---------------------------------------------------------------------------
;agarre 1 p2 muere
[Statedef 1130]
type    = A
movetype= H
physics = N
poweradd = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = !selfanimexist(91231)
trigger2 = name = "peketo" && var(10)=1
value = 1121
ctrl = 0

1121
[State 0, PalFX]
type = PalFX
trigger1 = !time
time = 1
add = 0,0,0

[State 820, 1]
type = ChangeAnim
Trigger1 = !time
value = 91231

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
y = 50

[State 821, 1] ;Gravity
type = VelAdd
Trigger1 = anim = 91231
y = .32

[State 821, 4] ;Hit ground
type = changestate
trigger1 = Vel Y > 0
trigger1 = Pos Y >= -10 && anim = 91231
value = 5150 ;Hit ground

;----------------------------
;cachos de carne y hueso
[Statedef 3050]
type    = A
movetype= I
physics = N
poweradd= 0
ctrl = 0
sprpriority = ifelse(random<250,0,3)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time
value = ifelse(random<500,3050,3052)
elem = ifelse(random<500,1,2)

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = ifelse(random<500,-0.5-(random/250.0),0.5+(random/250.0))
y =-1.5-(random/333.3)

[State 210, Width]
type = veladd
trigger1 = anim = 3050
trigger2 = anim = 3052
y = .3

[State 0, PlaySnd]
type = PlaySnd
trigger1 = pos Y >= -3 && vel y > 0
value = 12,ifelse(random<250,0,1)
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3051
trigger2 = anim = 3053
value = 12,ifelse(random<250,0,1)
freqmul = 0.9+(random/2500.0)
persistent = 0

[State 220, 3]
type = velset
trigger1 = pos Y >= -3 && vel y > 0
y = -3.8-(random/1000.0)
persistent = 0

[State 220, 3]
type = velset
trigger1 = pos Y >= -3 && vel y > 0
x = (vel x)/2
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3050
trigger1 = pos Y >= -3 && vel y > 0
value = 3051

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 3052
trigger1 = pos Y >= -3 && vel y > 0
value = 3053

[State 0, VelSet]
type = VelSet
trigger1 = anim = 3051
trigger2 = anim = 3053
x = 0
y = 0

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3051
trigger2 = anim = 3053
y = ceil(-4+(random/333.3))
persistent = 0

[State 0, Turn]
type = Turn
triggerall = random < 500
trigger1 = anim = 3051
trigger2 = anim = 3053
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
triggerall = vel x != 0
trigger1 = backedgedist <= -20
trigger2 = frontedgedist <= -20

;---------------------------------------------------------------------------
;teleport
[Statedef 1200]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1
anim = 1200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,2
freqmul = 1.0+(random/3333.3)

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 1
value = 20
ignorehitpause = 1

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

;tele 1
[State 0, Explod]
type = Explod
trigger1 = !time
anim = 1201
ID = 1201
bindtime = 5
sprpriority = 3
ownpal = 1

[State 0, PosAdd]
type = PosAdd
trigger1 = animelem = 6
x = 180

[State 0, Turn]
type = Turn
trigger1 = animelem = 6
trigger1 = P2Dist x < 0

;tele 2
[State 0, Explod]
type = Explod
trigger1 = animelemtime(6)=4
anim = 1202
ID = 1202
bindtime = -1
sprpriority = 3
ownpal = 1

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

;---------------------------------------------------------------------------
;agarre 2
[Statedef 1300]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2 && time != 0
value = 5,ifelse(random<500,0,1)
freqmul = 0.9+(random/3333.3)
channel = 11
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 6,ifelse(random<500,4,8)
freqmul = 1.0+(random/3333.3)
volume = 100
channel = 12

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 24
value = 6,3
freqmul = 1.5+(random/3333.3)
volume = 100
channel = 12

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 2 && prevstateno != 5000
value = 80
ignorehitpause = 1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 1100
value = 1100

[State 3300, hit]
type = hitdef
trigger1 = animelem = 24 && time != 0
trigger1 = !movecontact && !movereversed
attr = S,HA
damage = 0,0
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4,Hit
guard.pausetime = 0,10
sparkno = -1
guard.sparkno = 40
sparkxy = 0,-60
hitsound = -1,-1
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-10,0
air.type=Low
air.velocity=-5,-5
id = 1300
ground.cornerpush.veloff = 1
air.cornerpush.veloff = 1
p2facing = 1
hitonce = 1

[State 3300, p2state]
type=targetstate
trigger1= movehit && numtarget(1300)
ID=1300
value=1320

[State 3300, p1state]
type=changestate
trigger1= movehit && numtarget(1300)
value=1310

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

;---------------------------------------------------------------------------
;agarre 2 - P1
[Statedef 1310]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
sprpriority = 3
anim = 1310

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 6,ifelse(random<500,4,8)
freqmul = 0.8+(random/3333.3)
volume = 100

[State 0, Width]
type = Width
trigger1 = !time
value = 100,0

;spark
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 1
pos = 110, -90
ontop = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
time = 12
ampl = -14

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(1)>=0
trigger1 = animelemtime(2)<0
trigger2 = animelemtime(8)>=0
trigger2 = animelemtime(9)<0
trigger3 = animelemtime(15)>=0
trigger3 = animelemtime(16)<0
trigger4 = animelemtime(22)>=0
trigger4 = animelemtime(23)<0
time = 1
id = 1300
pos = 110,-83

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(2)>=0
trigger1 = animelemtime(3)<0
trigger2 = animelemtime(9)>=0
trigger2 = animelemtime(10)<0
trigger3 = animelemtime(16)>=0
trigger3 = animelemtime(17)<0
trigger4 = animelemtime(23)>=0
trigger4 = animelemtime(24)<0
time = 1
id = 1300
pos = 93,-122

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(3)>=0
trigger1 = animelemtime(4)<0
trigger2 = animelemtime(10)>=0
trigger2 = animelemtime(11)<0
trigger3 = animelemtime(17)>=0
trigger3 = animelemtime(18)<0
trigger4 = animelemtime(24)>=0
trigger4 = animelemtime(25)<0
time = 1
id = 1300
pos = 57,-211

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(4)>=0
trigger1 = animelemtime(5)<0
trigger2 = animelemtime(11)>=0
trigger2 = animelemtime(12)<0
trigger3 = animelemtime(18)>=0
trigger3 = animelemtime(19)<0
trigger4 = animelemtime(25)>=0
trigger4 = animelemtime(26)<0
time = 1
id = 1300
pos = 0,-257

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(5)>=0
trigger1 = animelemtime(6)<0
trigger2 = animelemtime(12)>=0
trigger2 = animelemtime(13)<0
trigger3 = animelemtime(19)>=0
trigger3 = animelemtime(20)<0
trigger4 = animelemtime(26)>=0
trigger4 = animelemtime(27)<0
time = 1
id = 1300
pos = -3,-257

[State 0, TargetBind]
type = TargetBind
trigger1 = animelemtime(6)>=0
trigger1 = animelemtime(8)<0
trigger2 = animelemtime(13)>=0
trigger2 = animelemtime(15)<0
trigger3 = animelemtime(20)>=0
trigger3 = animelemtime(22)<0
time = 1
id = 1300
pos = 62,-3

[State 0, TargetState]
type = TargetState
trigger1 = animelem = 27
value = 1121
ID = 1300

[State 0, Explod]
type = Explod
trigger1 = animelem = 6
anim = 1311
ID = 1311
bindtime = -1
sprpriority = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
trigger4 = animelem = 27
value = 6,3
freqmul = 1.2+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
trigger4 = animelem = 27
value = 0,3
freqmul = 0.8+(random/2000.0)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 14
trigger3 = animelem = 21
value = 10,10
freqmul = 0.8+(random/2000.0)
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 7
trigger2 = animelem = 14
trigger3 = animelem = 21
value = 10,1
freqmul = 0.7+(random/2000.0)
volume = -50

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 6
value = 5,6
channel = 11


[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 6
trigger2 = animelem = 13
value = -60
kill = 0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = animelem = 20
value = -60

;sangre
[State 1010, 9]
type = explod
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
anim = f 7009
pos = 80,0
postype = p1
sprpriority = 3
facing = ifelse(random<500,1,-1)

;sangre
[State 1010, 9]
type = explod
triggerall = random < 500
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
anim = 1312
pos = 100,0
postype = p1
sprpriority = 3
facing = ifelse(random<500,1,-1)

;ondita
[State 0, Explod]
type = Explod
trigger1 = animelem = 6
trigger2 = animelem = 13
trigger3 = animelem = 20
anim = f 61
sprpriority = 0
ownpal = 1
pos = 80,0
scale = 2,2

;ondaza
[State 0, Explod]
type = Explod
trigger1 = animelem = 20
anim = f 62
sprpriority = 0
ownpal = 1
pos = 80,0

[State 1000, 7]
type = ChangeState
trigger1 = AnimTime = 0
trigger2 = numtarget(1300)=0 && animelemtime(5)<0
value = 0
ctrl = 1


;---------------------------------------------------------
;agarre 2 - P2-1
[Statedef 1320]
type = S
movetype = H
ctrl = 0
velset = 0, 0
sprpriority = 2

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6322

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && anim != 6322
value = 1320
ignorehitpause = 1

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = anim = 1320
trigger1 = !time
trigger2 = animelem = 2
trigger3 = animelem = 6
trigger4 = animelem = 10
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,ifelse(name = "noroko", 200,20))
freqmul = 0.9+(random/3333.3)

[State 0, ScreenBound]
type = ScreenBound
trigger1 = 1;time < 25
value = 1
movecamera = 1,0

;---------------------------------------------------------------------------
;ORB
[Statedef 1500]
type    = A
movetype= I
sprpriority = 7
anim = 1501

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = anim = 1501 && animtime = 0
value = 1500

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

[State 0, Turn]
type = Turn
trigger1 = facing != root, facing

;velsets
;-------

[State 0, VelAdd]
type = VelAdd
trigger1 = RootDist X <=-40
x = -.46

[State 0, VelAdd]
type = VelAdd
trigger1 = RootDist X >40
x = .46

[State 0, VelAdd]
type = VelAdd
trigger1 = RootDist y <=80
y = -.2

[State 0, VelAdd]
type = VelAdd
trigger1 = RootDist y >80
y = .2

;frenos
[State 0, VelSet]
type = VelSet
trigger1 = vel x > 8
x = 8

;frenos
[State 0, VelSet]
type = VelSet
trigger1 = vel x < -8
x = -8

[State 0, PosAdd]
type = PosAdd
trigger1 = root, anim = 20
x = 2

[State 0, PosAdd]
type = PosAdd
trigger1 = root, anim = 21
x = -2

[State 0, SprPriority]
type = SprPriority
trigger1 = 1
value = ifelse(vel x > 0,3,0)

[State 0, DestroySelf]
type = DestroySelf
trigger1 = ishelper(1501) && root,power < 500
trigger2 = ishelper(1502) && root,power < 1000
trigger3 = ishelper(1503) && root,power < 1500
trigger4 = ishelper(1504) && root,power < 2000


;---------------------------------------------------------------------------
;clones (hypermove)
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1
poweradd = 0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2 && time != 0
value = 6,ifelse(random<500,4,8)
freqmul = 0.7+(random/3333.3)
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2 && time != 0
value = 5,5
channel = 11
volume = 100

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 24 && time != 0
value = 6,5
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2 && time != 0
trigger2 = animelem = 24 && time != 0
value = 0,3
freqmul = 0.8+(random/3333.3)

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 3000
value = 3000
ignorehitpause = 1

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 1
value = -1000

[State 0, afterimage]
type = AfterImage
trigger1 = animelem = 1
time = -1
FrameGap = 2
length = 7
paladd = 50,10,10
PalContrast = 200,0,0
PalBright = 0,-180,-180
TimeGap = 1
PalColor = 0
Trans = add
palmul = .65,.65,.65

[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = -1
add = 30,-30,-30
mul = 256,256,256
sinadd = 100,-20,-20,5
color = 256
ignorehitpause = 1

[State 0, PalFXWiz]
type = PalFX
trigger1 = animelemtime(26)>=1
time = 1
add = 0,0,0
ignorehitpause = 1

[State 170, 1]
type = NotHitBy
trigger1 = animelemtime(24)>=0
trigger1 = animelemtime(26)<0
value = SCA
time = 1

[State 3300, hit]
type = hitdef
trigger1 = animelem = 24
trigger1 = !movecontact && !movereversed
attr = S,HA
damage = 0,0
animtype = Hard
guardflag = M
hitflag = MAF
priority = 4,Hit
guard.pausetime = 0,10
sparkno = -1
guard.sparkno = 40
sparkxy = 0,-60
hitsound = -1,-1
guardsound = 6,0
ground.type=High
ground.slidetime=18
ground.hittime=18
ground.velocity=-10,0
air.type=Low
air.velocity=-5,-5
getpower=0
givepower=0
id = 3000
ground.cornerpush.veloff = 1
air.cornerpush.veloff = 1
p2facing = 1
hitonce = 1

[State 3300, p2state]
type=targetstate
trigger1= movehit && numtarget(3000)
ID=3000
value=3020

[State 3300, p1state]
type=changestate
trigger1= movehit && numtarget(3000)
value=3010

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

;---------------------------------------------------------------------------
;hyper 1 - P1-1
[Statedef 3010]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 3010

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 1,1
volume = 200
freqmul = 0.8+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
trigger2 = animelem = 8
value = 6,ifelse(random<500,4,8)
freqmul = 0.9+(random/3333.3)
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 2
value = 0,1
freqmul = 0.9+(random/3333.3)

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8
value = 0,3
freqmul = 0.9+(random/3333.3)

[State 0, Width]
type = Width
trigger1 = !time
value = 100,0

[State 0, VarSet]
type = VarSet
trigger1 = !time && numtarget(3000)
var(14)=ifelse(target,name = "peketo",1,ifelse(target,name = "ananzi",2,ifelse(target,name = "animus",3,ifelse(target,name = "shar-makai",4,ifelse(target,name = "hashi",5,ifelse(target,name = "noroko",6,7))))))

;spark
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 2
pos = 110, -90
ontop = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 12
ampl = -8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3010 && animelem = 6
value = 6,10
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3010 && animelem = 7
value = 6,7
volume = 150
freqmul = 0.8

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3010 && animelem = 7
value = 6,7
volume = 0
freqmul = 1.0

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(1)>=0
trigger1 = animelemtime(2)<0
time = 1
id = 3000
pos = 110,-83

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(2)>=0
trigger1 = animelemtime(3)<0
time = 1
id = 3000
pos = 93,-122

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(3)>=0
trigger1 = animelemtime(4)<0
time = 1
id = 3000
pos = 82,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(4)>=0
trigger1 = animelemtime(5)<0
time = 1
id = 3000
pos = 67,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(5)>=0
trigger1 = animelemtime(6)<0
time = 1
id = 3000
pos = 57,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(6)>=0
trigger1 = animelemtime(8)<0
time = 1
id = 3000
pos = 47,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(8)>=0
trigger1 = animelemtime(9)<0
time = 1
id = 3000
pos = 57,-164

[State 0, TargetBind]
type = TargetBind
trigger1 = anim = 3010
trigger1 = animelemtime(9)>=0
trigger1 = animelemtime(10)<0
time = 1
id = 3000
pos = 67,-164

[State 0, Explod]
type = Explod
trigger1 = anim = 3010
trigger1 = animelemtime(6)=10 && numexplod(1005)=0
anim = 1005
ID = 1005
pos = 0,0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3010 && animelemtime(6)=30
value = 6,11
freqmul = 0.8
volume = 150

;sangre
[State 1010, 9]
type = explod
triggerall = anim = 3010
trigger1 = animelemtime(6)>=30
trigger1 = animelemtime(7)<0
trigger1 = time % 8 = 0
trigger2 = animelemtime(6)=30
anim = f ifelse(random<200,7003,ifelse(random<250,7004,ifelse(random<333,7005,ifelse(random<500,7008,7009))))
pos = 50,-124
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)
ownpal = 1
random = 7,15

;sangre chorrea
[State 0, Explod]
type = Explod
triggerall = anim = 3010
trigger1 = animelemtime(6)>=40
trigger1 = animelemtime(6)<=90
trigger1 = time % 21 = 0
trigger2 = animelemtime(6)=40
anim = 3030
pos = 50,-124
sprpriority = 1
facing = ifelse(random<500,1,-1)
ownpal = 1

;sangre final
[State 1010, 9]
type = explod
triggerall = anim = 3010
trigger1 = animelem = 7
anim = f 7008
pos = 50,-124
postype = p1
sprpriority = 6
facing = ifelse(random<500,1,-1)
ownpal = 1
scale = 1.5,1.5

;sangre charco
[State 1010, 9]
type = explod
triggerall = anim = 3010
trigger1 = animelemtime(6)=80
anim = 3031
pos = 50,6
postype = p1
sprpriority = 0
ownpal = 1
removetime = -1

[State 0, EnvShake]
type = EnvShake
triggerall = anim = 3010
trigger1 = animelem = 7
trigger2 = animtime = 0
time = 10
ampl = -12

;necronomicon
[State 3900, 1]
type = Explod
triggerall = anim = 3010
trigger1 = animelemtime(6)=30
anim = 3034
postype = left
pos = 160,120
bindtime = -1
ontop = 1
ownpal = 1

;sangre manchitas
[State 3900, 1]
type = Explod
triggerall = anim = 3010
trigger1 = animelem = 7
anim = 3032
postype = left
bindtime = -1
ontop = 1
ownpal = 1

;efecto sangre
[State 0, Explod]
type = Explod
triggerall = anim = 3010
trigger1 = animelem = 7
anim = 3040
pos = 50,-124
facing = ifelse(random<500,1,-1)
vfacing = ifelse(random<500,1,-1)
scale = 1.5,1.5
ontop = 1
ownpal = 1

;blanco
[State 3900, 1]
type = Explod
triggerall = anim = 3010
trigger1 = animelem = 7
anim = 1112
postype = left
bindtime = -1
ontop = 1
ownpal = 1

[State 0, PalFXWiz]
type = PalFX
triggerall = anim = 3010
trigger1 = animelem=7
time = 1
add = 0,0,0
ignorehitpause = 1

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = anim = 3010
trigger1 = animelemtime(6)>=30
trigger1 = animelemtime(7)<0
trigger1 = time % 3 = 0
value = -6
kill=0

[State 0, TargetLifeAdd]
type = TargetLifeAdd
trigger1 = anim = 3010
trigger1 = animelem = 7
value = -6

[State 0, TargetState]
type = TargetState
trigger1 = anim = 3010
trigger1 = animelemtime(6)=30
value = 3021
ID = 3000

;muere
[State 0, TargetState]
type = TargetState
trigger1 = anim = 3010
trigger1 = animelem = 7
trigger1 = target(3000),life<=0
value = 5150
ID = 3000

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = target(3000),stateno = 5150
value = 1110
elem = 6
persistent = 0

;Ojos final
[State 0, Explod]
type = Explod
trigger1 = anim = 3010
trigger1 = animelem = 7
anim = 1006
sprpriority = 3
ownpal = 1

;cachos de carne
;---------------

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

;cacho
[State 0, Helper]
type = Helper
trigger1 = anim = 1110 && animelem = 6
pos = ceil(66+(random/50)),ceil(-100-(random/25))
stateno = 3050
facing = ifelse(random<500,1,-1)

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

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

;no muere
[State 0, TargetState]
type = TargetState
trigger1 = anim = 3010
trigger1 = animelem = 10
value = 1121
ID = 3000

;cthulhu
[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3010
trigger1 = animelem = 10
value = 10,11
channel = 10
loop = 1
volume = -60

;tele 1
[State 0, Explod]
type = Explod
triggerall = anim = 3010
trigger1 = animelem = 15
anim = 1201
ID = 1201
bindtime = 5
sprpriority = 3
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3010
trigger1 = animelem = 15
value = 6,2
freqmul = 1.0+(random/3333.3)
volume = 100

[State 0, EnvShake]
type = EnvShake
triggerall = anim = 3010
trigger1 =animelem = 20
time = 30
ampl = -3

;sangre charco
[State 1010, 9]
type = explod
triggerall = anim = 3010
trigger1 = animelem=20
anim = 3033
pos = 50,6
sprpriority = 6
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
triggerall = anim = 3010
trigger1 = animtime=0
value = 10,8
freqmul = 0.8+(random/3333.3)
volume = 200

;clon
[State 0, Helper]
type = Helper
triggerall = anim = 3010
trigger1 = animtime=0
helpertype = player
name = "clon"
ID = ifelse(var(14)=1,3100,ifelse(var(14)=2,3101,ifelse(var(14)=3,3102,ifelse(var(14)=4,3103,ifelse(var(14)=5,3104,ifelse(var(14)=6,3105,3100+(random/200)))))))
stateno = 3104
pos = 50,20
ownpal = 1

;clon
[State 0, Helper]
type = Helper
triggerall = anim = 3010
trigger1 = animtime=0
helpertype = player
name = "clon"
ID = ifelse(var(14)=1,3100,ifelse(var(14)=2,3101,ifelse(var(14)=3,3102,ifelse(var(14)=4,3103,ifelse(var(14)=5,3104,ifelse(var(14)=6,3105,3100+(random/200)))))))
stateno = 3104
pos = 50,20
ownpal = 1

;clon
[State 0, Helper]
type = Helper
triggerall = anim = 3010
trigger1 = animtime=0
helpertype = player
name = "clon"
ID = ifelse(var(14)=1,3100,ifelse(var(14)=2,3101,ifelse(var(14)=3,3102,ifelse(var(14)=4,3103,ifelse(var(14)=5,3104,ifelse(var(14)=6,3105,3100+(random/200)))))))
stateno = 3104
pos = 50,20
ownpal = 1

[State 1000, 7]
type = ChangeState
triggerall = anim = 3010
trigger1 = AnimTime = 0
value = 3011
ctrl = 0

;---------------------------------------------------------------------------
;hyper 1 - P1-2
[Statedef 3011]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
sprpriority = 2
anim = 3011

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

[State 0, ScreenBound]
type = ScreenBound
trigger1 = anim = 3011
value = 0
movecamera = 0,0

[State 0, PosAdd]
type = PosAdd
trigger1 = !time
x = -3000

[State 1000, 7]
type = Changeanim
trigger1 = var(19)>=3
value = 1200
elem = 6

[State 0, VarSet]
type = VarSet
trigger1 = anim = 1200
var(19)=0

[State 0, PosAdd]
type = Posset
trigger1 = anim = 1200 && animelem = 6
x = -100
y = 0

[State 0, Turn]
type = Turn
trigger1 = anim = 1200 && animelem = 6
trigger1 = P2Dist x < 0

;tele 2
[State 0, Explod]
type = Explod
trigger1 = anim = 1200 && animelemtime(6)=4
anim = 1202
ID = 1202
bindtime = -1
sprpriority = 3
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 1200 && animelemtime(6)=4
value = 6,2
freqmul = 1.0+(random/3333.3)
volume = 100

[State 0, StopSnd]
type = StopSnd
trigger1 = anim = 1200
channel = 10

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

;---------------------------------------------------------
;hyper 1 - P2-1
[Statedef 3020]
type = S
movetype = H
ctrl = 0
velset = 0, 0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6320

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && anim != 6320
value = 1120
ignorehitpause = 1

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
triggerall = anim = 1120
trigger1 = !time
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,ifelse(name = "noroko", 200,20))
freqmul = 0.9+(random/3333.3)

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

;---------------------------------------------------------
;hyper 1 - P2-2
[Statedef 3021]
type = S
movetype = H
ctrl = 0
velset = 0, 0

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = !time
trigger1 = name = "peketo" && var(10)=1
value = 6323

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = !time && anim != 6323
value = 3020
ignorehitpause = 1

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

[State 0, PalFXWiz]
type = PalFX
trigger1 = !time
time = 300
add = 50,-150,-150
mul = 256,256,256
color = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 10
ampl = -12

[State 0, EnvShake]
type = EnvShake
trigger1 =time = 8
time = 300
ampl = -3

;ES Peketo DF
[State 700, 10]
type = Changeanim
trigger1 = anim = 6323 && animtime = 0
trigger1 = name = "peketo" && var(10)=1
value = 6320

[State 0, ChangeAnim2]
type = ChangeAnim2
trigger1 = anim = 3020 && animtime = 0
value = 1120
ignorehitpause = 1

[State 0, target sufre sound]
type = PlaySnd
triggerall = Authorname = "Andres Borghi"
trigger1 = !time && anim = 3020
trigger2 = anim = 1120 && animelem = 1
value = 11,ifelse(random<333,1,ifelse(random<500,2,3))
channel = 15
volume = ifelse(name = "shar-makai",-70,ifelse(name = "noroko", 200,20))
freqmul = 0.9+(random/3333.3)

[State 0, PalFXWiz]
type = PalFX
trigger1 = anim = 1120 && animelem = 1
time = 1
add = 0,0,0

;-----------------------------------------------------------------
;-----------------------------------------------------------------
;CLON
;-----------------------------------------------------------------
;-----------------------------------------------------------------
; clon sangriento - JUMP
[Statedef 3104]
type    = A
movetype= I
physics = N
ctrl = 0
anim = ifelse(ishelper(3100),3104,ifelse(ishelper(3101),3124,ifelse(ishelper(3102),3144,ifelse(ishelper(3103),3164,ifelse(ishelper(3104),3184,3204)))))
velset = -1+(random/200.0),-6-(random/300.0)

[State 0, afterimage]
type = AfterImage
trigger1 = !time
time = -1
FrameGap = 2
length = 10
paladd = 50,10,10
PalContrast = 100,0,0
PalBright = 0,-180,-180
TimeGap = 1
PalColor = 0
Trans = add
palmul = .65,.65,.65

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

[State 0, VelAdd]
type = VelAdd
trigger1 = anim = 3104
trigger2 = anim = 3124
trigger3 = anim = 3144
trigger4 = anim = 3164
trigger5 = anim = 3184
trigger6 = anim = 3204
y = .35

;peketo
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3104
value = 3105

;ananzi
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3124
value = 3125

;animus
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3144
value = 3145

;shar-makai
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3164
value = 3165

;hashi
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3184
value = 3185

;noroko
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3204
value = 3205

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
y = 0

[State 0, Velset]
type = velset
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
y = 0
x = 0

[State 0, MakeDust]
type = MakeDust
triggerall = animelem = 1
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
spacing = 1

;aterrizan menos Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3185
trigger5 = anim = 3205
value = 12,0
volume = 50
freqmul = 0.9+(random/3333.3)

;aterriza Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3165
value = 12,0
volume = 50
freqmul = 0.5+(random/3333.3)

;aterriza Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3165
value = 10,10
freqmul = 0.6+(random/3333.3)

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1

[State 0, ChangeState]
type = ChangeState
triggerall = animtime = 0
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
value = 3100
ctrl = 0

;-----------------------------------------------------------------
; clon sangriento - normal stance
[Statedef 3100]
type    = S
movetype= I
physics = n
velset = 0,0
ctrl = 0
sprpriority = 3
anim = ifelse(ishelper(3100),3100,ifelse(ishelper(3101),3120,ifelse(ishelper(3102),3140,ifelse(ishelper(3103),3160,ifelse(ishelper(3104),3180,3200)))))

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

;movimiento horizontal
;---------- ----------
[State 0, VelSet]
type = VelSet
triggerall = roundstate = 2
trigger1 = p2dist x >= 40 && vel x <= 0 && random < 20
trigger2 = backedgedist < 0
trigger3 = p2dist x <= -50 && vel x >= 0
x = 1.8

[State 0, VelSet]
type = VelSet
triggerall = roundstate = 2
trigger1 = p2dist x <= 50 && random < 50  && vel x >= 0
trigger2 =frontedgedist < 0
x = -1.5

[State 0, VelSet]
type = VelSet
trigger1 = p2dist x <= 40
trigger1 = p2dist x >= 60 && random < 100
trigger2 = roundstate = 3
x = 0

;peketo
;------

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3100)
triggerall = vel x > 0
trigger1= anim!= 3102 && anim!= 3101
trigger2 = anim = 3101 && animtime = 0
value = 3102

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3100)
triggerall = vel x < 0
trigger1 = anim!= 3103 && anim!= 3101
trigger2 = anim = 3101 && animtime = 0
value = 3103

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3100)
trigger1= anim!= 3100 && anim!= 3101
trigger1 = vel x = 0
trigger2 = anim = 3101 && animtime = 0
value = 3100

;turn
[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = ishelper(3100)
trigger1 = P2Dist x < 0
value = 3101

;ananzi
;------

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3101)
triggerall = vel x > 0
trigger1= anim!= 3122 && anim!= 3121
trigger2 = anim = 3121 && animtime = 0
value = 3122

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3101)
triggerall = vel x < 0
trigger1 = anim!= 3123 && anim!= 3121
trigger2 = anim = 3121 && animtime = 0
value = 3123

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3101)
trigger1= anim!= 3120 && anim!= 3121
trigger1 = vel x = 0
trigger2 = anim = 3121 && animtime = 0
value = 3120

;turn
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3101)
trigger1 = P2Dist x < 0
value = 3121

[State 0, PlaySnd]
type = PlaySnd
triggerall = ishelper(3101)
triggerall = (anim = 3122)||(anim = 3123)
trigger1 = animelem = 2
trigger2 = animelem = 5
value = 12,0
freqmul = 0.8+(random/3333.3)
volume = -70

;animus
;------

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3102)
triggerall = vel x > 0
trigger1= anim!= 3142 && anim!= 3141
trigger2 = anim = 3141 && animtime = 0
value = 3142

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3102)
triggerall = vel x < 0
trigger1 = anim!= 3143 && anim!= 3141
trigger2 = anim = 3141 && animtime = 0
value = 3143

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3102)
trigger1= anim!= 3140 && anim!= 3141
trigger1 = vel x = 0
trigger2 = anim = 3141 && animtime = 0
value = 3140

;turn
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3102)
trigger1 = P2Dist x < 0
value = 3141

[State 0, PlaySnd]
type = PlaySnd
triggerall = ishelper(3102)
triggerall = (anim = 3142)||(anim = 3143)
trigger1 = animelem = 3
trigger2 = animelem = 6
value = 12,0
freqmul = 0.8+(random/3333.3)
volume = -70

;Shar-makai
;----------

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3103)
triggerall = vel x > 0
trigger1= anim!= 3162 && anim!= 3161
trigger2 = anim = 3161 && animtime = 0
value = 3162

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3103)
triggerall = vel x < 0
trigger1 = anim!= 3163 && anim!= 3161
trigger2 = anim = 3161 && animtime = 0
value = 3163

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3103)
trigger1= anim!= 3160 && anim!= 3161
trigger1 = vel x = 0
trigger2 = anim = 3161 && animtime = 0
value = 3160

;turn
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3103)
trigger1 = P2Dist x < 0
value = 3161

;Hashi
;-----

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3104)
triggerall = vel x > 0
trigger1= anim!= 3182 && anim!= 3181
trigger2 = anim = 3181 && animtime = 0
value = 3182

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3104)
triggerall = vel x < 0
trigger1 = anim!= 3183 && anim!= 3181
trigger2 = anim = 3181 && animtime = 0
value = 3183

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3104)
trigger1= anim!= 3180 && anim!= 3181
trigger1 = vel x = 0
trigger2 = anim = 3181 && animtime = 0
value = 3180

;turn
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3104)
trigger1 = P2Dist x < 0
value = 3181

[State 0, PlaySnd]
type = PlaySnd
triggerall = ishelper(3104)
triggerall = anim = 3182
trigger1 = animelem = 3
trigger2 = animelem = 8
value = 12,0
freqmul = 0.8+(random/3333.3)
volume = -70

[State 0, PlaySnd]
type = PlaySnd
triggerall = ishelper(3104)
triggerall = anim = 3183
trigger1 = animelem = 2
trigger2 = animelem = 6
value = 12,0
freqmul = 0.8+(random/3333.3)
volume = -70

;Noroko
;------

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3105)
triggerall = vel x > 0
trigger1= anim!= 3202 && anim!= 3201
trigger2 = anim = 3201 && animtime = 0
value = 3202

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3105)
triggerall = vel x < 0
trigger1 = anim!= 3203 && anim!= 3201
trigger2 = anim = 3201 && animtime = 0
value = 3203

[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3105)
trigger1= anim!= 3200 && anim!= 3201
trigger1 = vel x = 0
trigger2 = anim = 3201 && animtime = 0
value = 3200

;turn
[State 0, ChangeAnim]
type = ChangeAnim
triggerall = ishelper(3105)
trigger1 = P2Dist x < 0
value = 3201

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

[State 0, Turn]
type = Turn
triggerall = animelem = 1
trigger1 = anim = 3101
trigger2 = anim = 3121
trigger3 = anim = 3141
trigger4 = anim = 3161
trigger5 = anim = 3181
trigger6 = anim = 3201

;ataques
;-------

[State 34]
type = ChangeState
triggerall = roundstate = 2
triggerall = (p2statetype!=L) && random <40
trigger1 = p2dist x <= 100
trigger2 = p2dist x <= -100
value = ifelse(random<250,3107,ifelse(random<333,3108,ifelse(random<500,3109,3110)))

;detalles
;--------

;mantiene la vida siempre alto
;porque lo que marca su energia
;es una variable y no la vida real
[State 0, LifeSet]
type = LifeSet
trigger1 = !time
value = 3000

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;se va
[State 0, ChangeState]
type = null;ChangeState
trigger1 = roundstate = 2 && root, var(10)=0
value = 3501

;winpose KO
[State 0, ChangeState]
type = null;ChangeState
trigger1 = root, stateno = 183
value = 183

;lose
[State 0, ChangeAnim]
type = null;ChangeState
triggerall = anim != 170
trigger1 = root, stateno = 170
trigger2 = root, anim = 3491 && roundstate = 4
value = 170
persistent = 0

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

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

;muere al ganar el round
;-----------------------

[State 0, VarAdd]
type = VarAdd
trigger1 = roundstate !=2
var(13)=1

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = var(13)>=60
trigger1 = random < 100
trigger2 = var(13)>=80
value = 3011

[State 0, EnvShake]
type = EnvShake
trigger1 = anim = 3011
time = 8
ampl = -12

[State 0, Explod]
type = Explod
trigger1 = anim = 3011
anim = f 7008
pos = 0,-50
facing = ifelse(random<500,1,-1)
ontop = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = anim = 3011
anim = 3040
pos = 0,-50
facing = ifelse(random<500,1,-1)
vfacing = ifelse(random<500,1,-1)
scale = 1.5,1.5
ontop = 1
ownpal = 1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 3011
value = 10,9
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))
volume = 100

[State 0, ParentVarAdd]
type = ParentVarAdd
trigger1 = anim = 3011
var(19)=1
persistent = 0

[State 0, DestroySelf]
type = DestroySelf
trigger1 = anim = 3011

;-----------------------------------------------------------------
; clon sangriento - HIT
[Statedef 3106]
type    = A
movetype= H
physics = N
ctrl = 0
anim = ifelse(ishelper(3100),3106,ifelse(ishelper(3101),3126,ifelse(ishelper(3102),3146,ifelse(ishelper(3103),3166,ifelse(ishelper(3104),3186,3206)))))
sprpriority = 2

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

[State 0, VelSet]
type = VelSet
trigger1 = !time
x = -1-(random/700)
y = -3-(random/500.0)

[State 0, VelAdd]
type = VelAdd
trigger1 = 1
y = .4

;peketo
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3106
value = 3105

;ananzi
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3126
value = 3125

;animus
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3146
value = 3145

;shar-makai
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3166
value = 3165

;hashi
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3186
value = 3185

;noroko
[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3206
value = 3205

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
y = 0

[State 0, Velset]
type = velset
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
y = 0
x = 0

[State 0, MakeDust]
type = MakeDust
triggerall = animelem = 1
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
spacing = 1

;aterrizan menos Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3185
trigger5 = anim = 3205
value = 12,0
volume = -50
freqmul = 0.9+(random/3333.3)

;aterriza Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3165
value = 12,0
volume = 50
freqmul = 0.5+(random/3333.3)

;aterriza Shar
[State 0, PlaySnd]
type = PlaySnd
triggerall = animelem = 1
trigger1 = anim = 3165
value = 10,10
freqmul = 0.6+(random/3333.3)

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

[State 0, ChangeState]
type = ChangeState
triggerall = animtime = 0
trigger1 = anim = 3105
trigger2 = anim = 3125
trigger3 = anim = 3145
trigger4 = anim = 3165
trigger5 = anim = 3185
trigger6 = anim = 3205
value = 3100
ctrl = 0

;life
;----

[State 0, varadd]
type = varadd
trigger1 = gethitvar(damage)
var(18) = gethitvar(damage)
persistent = 0

[State 0, EnvShake]
type = EnvShake
trigger1 = var(18)>=130
time = 8
ampl = -12

[State 0, Explod]
type = Explod
trigger1 = var(18)>=130
anim = f 7008
pos = 0,-50
facing = ifelse(random<500,1,-1)
ontop = 1
ownpal = 1

[State 0, Explod]
type = Explod
trigger1 = var(18)>=130
anim = 3040
pos = 0,-50
facing = ifelse(random<500,1,-1)
vfacing = ifelse(random<500,1,-1)
scale = 1.5,1.5
ontop = 1
ownpal = 1

[State 0, ParentVarAdd]
type = ParentVarAdd
trigger1 = var(18)>=130
var(19)=1

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && var(18)>=130
value = 10,9
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))
volume = 100

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && random <600 && var(18)<130
value = 10,ifelse(random<500,3,4)
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))

;---------------------------------------------------------------------------
; clon sangriento - ataque 1 (LP)
[Statedef 3107]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = ifelse(ishelper(3100),3107,ifelse(ishelper(3101),3127,ifelse(ishelper(3102),3147,ifelse(ishelper(3103),3167,ifelse(ishelper(3104),3187,3207)))))
juggle = 15

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

;PEKETO
;------

[State 200, 1]
type = HitDef
trigger1 = ishelper(3100)
trigger1 = AnimElem = 3
attr = S, NA
damage = 17, 0
animtype = Light
guardflag = MA
hitflag = MAF
Priority = 3, Hit
pausetime = 6,6
sparkno = 0
sparkxy = -10, -56
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;ANANZI
;------

[State 200, 1]
type = HitDef
trigger1 = ishelper(3101)
trigger1 = !time
attr = S, NA
damage = 17, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 7, 7
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;ANIMUS
;------

[State 200, 1]
type = HitDef
trigger1 = ishelper(3102)
trigger1 = AnimElem = 2
attr = S, NA
damage = 17
animtype = Light
guardflag = MA
hitflag = MAF
Priority = 3, Hit
pausetime = 8, 8
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;SHAR-MAKAI
;----------

[State 200, 1]
type = HitDef
trigger1 = ishelper(3103)
trigger1 = AnimElem = 2
attr = S, NA
damage = 17, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;HASHI
;-----

[State 200, 1]
type = HitDef
trigger1 = ishelper(3104)
trigger1 = AnimElem = 2
attr = S, NA
damage = 17, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 12
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;NOROKO
;------

[State 200, 1]
type = HitDef
trigger1 = ishelper(3105)
trigger1 = AnimElem = 3
attr = S, NA
damage = 17, 0
animtype = Light
guardflag = MA
hitflag = MAF
priority = 3, Hit
pausetime = 8, 8
sparkno = 0
sparkxy = -10, -76
hitsound = 5, 0
guardsound = 6, 0
ground.type = High
ground.slidetime = 5
ground.hittime  = 10
ground.velocity = -4
airguard.velocity = -1.9,-.8
air.type = High
air.velocity = -1.4,-3
air.hittime = 12

;----

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 1 && random < 400
value = 10, ifelse(random<333,5,ifelse(random<500,6,7))
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 0
freqmul = 0.9+(random/3333.3)

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

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

;---------------------------------------------------------------------------
; clon sangriento - ataque 2 (HP)
[Statedef 3108]
type    = S
movetype= A
physics = s
velset = 0,0
ctrl = 0
anim = ifelse(ishelper(3100),3108,ifelse(ishelper(3101),3128,ifelse(ishelper(3102),3148,ifelse(ishelper(3103),3168,ifelse(ishelper(3104),3188,3208)))))
juggle = 15

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

;PEKETO
;------

[State 210, 2]
type = HitDef
trigger1 = ishelper(3100)
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 50
guardflag = MA
pausetime = 7,7
sparkno = -1
guard.sparkno = 40
sparkxy = -15,-72
hitsound   = s 10,ifelse(random<500,1,2)
guardsound = 6,0
ground.type = High
ground.slidetime = 10
ground.hittime  = 20
ground.velocity = -5.5
air.velocity = -2.5,-4
envshake.time = 6
Priority = 3, Hit

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

;sangre
[State 1010, 9]
type = explod
trigger1 = ishelper(3100)
trigger1 = movehit
anim = f ifelse(random<500,7004,7005)
persistent = 0
pos = 75,-70
postype = p1
ignorehitpause = 1
sprpriority = 6
bindtime = 10
ownpal = 1
facing = ifelse(random<500,1,-1)

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3100)
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)

;ANANZI
;------

[State 210, 2]
type = HitDef
trigger1 = ishelper(3101)
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Heavy
damage    = 50
guardflag = MA
pausetime = 6,12
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4
envshake.time = 7
envshake.ampl = 5
priority = 3, Hit

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3101)
trigger1 = animelem = 5
value = 0,2
freqmul = 0.9+(random/3333.3)

;ANIMUS
;------

[State 0, VelSet]
type = VelSet
trigger1 = ishelper(3102)
trigger1 = animelem = 3
x = 7

[State 210, 2]
type = HitDef
trigger1 = ishelper(3102)
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage = 50
guardflag = MA
pausetime = 10,12
sparkno = 1
sparkxy = -10,-70
hitsound = 5, 2
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 40
ground.velocity = -1.6,-5
air.velocity = -1.6,-5
envshake.time = 4
yaccel = .28
Priority = 3, Hit

[State 210, 3]
type = ChangeAnim
trigger1 = ishelper(3102)
trigger1 = AnimElemTime(4) > 0 && AnimElemTime(5) <= 0
trigger1 = movecontact
ignorehitpause = 1
persistent = 0
value = 3148
elem = 6

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3102)
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)

;SHAR-MAKAI
;----------

[State 210, 2]
type = HitDef
trigger1 = ishelper(3103)
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 50
guardflag = MA
pausetime = 7,10
sparkno = 7009
sparkxy = -10,-70
hitsound   = s 10,ifelse(random<500,1,2)
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6.5
air.velocity = -6.5,-4
envshake.time = 7
envshake.ampl = 7
Priority = 3, Hit

[State 1010, 9]
type = explod
trigger1 = ishelper(3103)
trigger1 = Movehit = 1
anim = f 7003
pos = 70,-80
sprpriority = 6
ignorehitpause = 1
ownpal = 1
persistent = 0
scale = 1.2,1.2

[State 1010, 9]
type = explod
trigger1 = ishelper(3103)
trigger1 = Movehit = 1
anim = f 7003
pos = 70,-80
sprpriority = 6
ignorehitpause = 1
ownpal = 1
persistent = 0
facing = -1

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3103)
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3103)
trigger1 = animelem = 5
value = 10,0
freqmul = 0.9+(random/3333.3)
volume = 100

;HASHI
;-----

[State 210, 2]
type = HitDef
trigger1 = ishelper(3104)
trigger1 = AnimElem = 5
attr = S, NA
animtype  = Heavy
damage    = 50
guardflag = MA
pausetime = 7,10
sparkno = 7005
sparkxy = -20,-80
hitsound   = s 10,ifelse(random<500,1,2)
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5.5
air.velocity = -2.5,-4
envshake.time = 7
envshake.ampl = 5
priority = 3, Hit

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3104)
trigger1 = animelem = 3
value = 0,2
freqmul = 0.9+(random/3333.3)

;NOROKO
;------

[State 210, 2]
type = HitDef
trigger1 = ishelper(3105)
trigger1 = AnimElem = 3
attr = S, NA
animtype  = Medium
damage    = 50
guardflag = MA
pausetime = 8,8
sparkno = 300
sparkxy = 10,-86
hitsound   = s 10,ifelse(random<500,1,2)
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -2,-6
air.velocity = -2.5,-4
fall = 1
envshake.time = 8
envshake.ampl = 7
priority = 3, Hit

;sangre
[State 191]
type = Explod
trigger1 = ishelper(3105)
trigger1 = movehit
anim = f 7009
postype = p1
pos = 75, -86
sprpriority = 3
ignorehitpause = 1
persistent = 0

;sangre
[State 191]
type = Explod
trigger1 = ishelper(3105)
trigger1 = movehit
anim = f 7004
postype = p1
pos = 75, -86
sprpriority = 3
ignorehitpause = 1
persistent = 0

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = ishelper(3105)
trigger1 = animelemtime(3)=1 && movecontact
value = 3208
elem = 4
ignorehitpause = 1

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3105)
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)

;----

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && random <600
value = 10,ifelse(random<500,3,4)
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))

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

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

;---------------------------------------------------------------------------
; clon sangriento - ataque 3 (LK)
[Statedef 3109]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = ifelse(ishelper(3100),3109,ifelse(ishelper(3101),3129,ifelse(ishelper(3102),3149,ifelse(ishelper(3103),3169,ifelse(ishelper(3104),3189,3209)))))
juggle = 15

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

;PEKETO
;------

[State 230, 2]
type = HitDef
trigger1 = ishelper(3100)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 6,6
sparkno = 0
sparkxy = 0,-37
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5
Priority = 3, Hit

;ANANZI
;------

[State 230, 2]
type = HitDef
trigger1 = ishelper(3101)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 9,11
sparkno = 0
sparkxy = -10,-57
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5
priority = 3, Hit

;ANIMUS
;------

[State 230, 2]
type = HitDef
trigger1 = ishelper(3102)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage = 20
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-37
hitsound = 5, 1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -5
air.velocity = -2.5,-3.5
Priority = 3, Hit

;SHAR-MAKAI
;----------

[State 240, 2]
type = HitDef
trigger1 = ishelper(3103)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 8,8
sparkno = 1
sparkxy = -10,-40
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2
Priority = 3, Hit

;HASHI
;-----

[State 230, 2]
type = HitDef
trigger1 = ishelper(3104)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-37
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 12
ground.velocity = -5
air.velocity = -2.5,-3.5
priority = 3, Hit

;NOROKO
;------

[State 230, 2]
type = HitDef
trigger1 = ishelper(3105)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 20
guardflag = MA
pausetime = 12,12
sparkno = 0
sparkxy = -10,-17
hitsound   = 5,1
guardsound = 6,0
ground.type = Low
ground.slidetime = 10
ground.hittime  = 11
ground.velocity = -5
air.velocity = -2.5,-3.5
priority = 3, Hit

;------

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && random <600
value = 10,ifelse(random<500,3,4)
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))

[State 200, 1]
type = PlaySnd
trigger1 = animelem = 2
value = 0, 1
freqmul = 0.9+(random/3333.3)

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

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

;---------------------------------------------------------------------------
; clon sangriento - ataque 4 (HK)
[Statedef 3110]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
anim = ifelse(ishelper(3100),3110,ifelse(ishelper(3101),3130,ifelse(ishelper(3102),3150,ifelse(ishelper(3103),3170,ifelse(ishelper(3104),3190,3210)))))
juggle = 15

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

;PEKETO
;------

[State 0, VelSet]
type = VelSet
trigger1 = ishelper(3100)
trigger1 = animelem = 2
x = 2.5
y = -3.7

[State 0, veladd]
type = veladd
trigger1 = ishelper(3100)
trigger1 = anim = 3110 && animelemtime(2)>=0
y = .3

[State 210, 1]
type = PlaySnd
trigger1 = ishelper(3100)
trigger1 = Time = 2
value = 0, 4
freqmul = 0.9+(random/3333.3)

[State 210, 1]
type = PlaySnd
trigger1 = ishelper(3100)
trigger1 = animelem = 7
value = 0, 2
freqmul = 0.9+(random/3333.3)

[State 640, 3]
type = HitDef
trigger1 = ishelper(3100)
trigger1 = Animelem = 4
attr = A, NA
animtype  = Medium
damage    = 56
guardflag = MA
sparkno = 1
sparkxy = -20,-35
hitsound   = 5,2
pausetime = 5,5
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -8,-5
air.velocity = -6.2,-5
fall = 1
envshake.time = 6
envshake.ampl = 6
Priority = 3, Hit

[State 0, ChangeState]
type = Changeanim
trigger1 = pos y >= -4 && vel Y > 0 && anim = 3110
value = 3105

[State 0, PosSet]
type = PosSet
trigger1 = anim = 3105
y = 0

[State 0, Velset]
type = velset
trigger1 = anim = 3105
y = 0
x = 0

[State 0, MakeDust]
type = MakeDust
triggerall = animelem = 1
trigger1 = anim = 3105
spacing = 1

;ANANZI
;------

[State 240, 2]
type = HitDef
trigger1 = ishelper(3101)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 5,5
sparkno = 1
sparkxy = -10,-70
hitsound   = 5,3
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -8
air.velocity = -8,-3.2
fall = 1
envshake.time = 7
envshake.ampl = 5
priority = 3, Hit

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

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3101)
trigger1 = animelem = 4
value = 0,3
freqmul = 0.9+(random/3333.3)

;ANIMUS
;------

[State 240, 2]
type = HitDef
trigger1 = ishelper(3102)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage = 57
guardflag = MA
pausetime = 7,10
sparkno = 1
sparkxy = -10,-60
hitsound = 5, 2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5,-1
air.velocity = -6.2,-3.2
envshake.time = 4
Priority = 3, Hit

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3102)
trigger1 = animelem = 4
value = 0,3
freqmul = 0.9+(random/3333.3)

;SHAR-MAKAI
;----------

[State 240, 2]
type = HitDef
trigger1 = ishelper(3103)
trigger1 = !time
attr = S, NA
animtype  = Medium
damage = 57
guardflag = MA
sparkno = -1
sparkxy = -10,-60
hitsound   = s 10,ifelse(random<500,1,2)
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -4,-4
air.velocity = -2.2,-3.2
fall = 1
pausetime = 7,7
envshake.time = 7
envshake.ampl = 8
Priority = 3, Hit

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = ishelper(3103)
trigger1 = anim = 3170 && movecontact && animelemtime(16)=1
value = 3170
elem = 17
ignorehitpause = 1
persistent = 0

;sangre
[State 1010, 9]
type = explod
trigger1 = ishelper(3103)
trigger1 = Movehit
anim = f 7008
persistent = 0
pos = 90,-80
sprpriority = 6
ownpal = 1
ignorehitpause = 1

;sangre
[State 1010, 9]
type = explod
trigger1 = ishelper(3103)
trigger1 = Movehit
anim = f 7003
persistent = 0
pos = 85,-80
sprpriority = 6
ownpal = 1
ignorehitpause = 1
facing = -1

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3103)
trigger1 = animelem = 2
value = 0,1
freqmul = 0.9+(random/3333.3)

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3103)
trigger1 = animelem = 16
value = 0,3
freqmul = 0.9+(random/3333.3)

;HASHI
;-----

[State 240, 2]
type = HitDef
trigger1 = ishelper(3104)
trigger1 = animelem = 5
attr = S, NA
animtype  = Heavy
damage    = 57
guardflag = MA
pausetime = 7,10
sparkno = ifelse(random<500,0,1)
sparkxy = -10,-60
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2
envshake.time = 7
envshake.ampl = 5
priority = 3, Hit

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3104)
trigger1 = animelem = 2
value = 0,2
freqmul = 0.9+(random/3333.3)

;NOROKO
;------

[State 240, 2]
type = HitDef
trigger1 = ishelper(3105)
trigger1 = Time = 0
attr = S, NA
animtype  = Medium
damage    = 57
guardflag = MA
pausetime = 6,12
sparkno = 1
sparkxy = -10,-10
hitsound   = 5,2
guardsound = 6,0
ground.type = Low
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -6
air.velocity = -2.2,-3.2
envshake.time = 7
envshake.ampl = 5
priority = 3, Hit

[State 200, 1]
type = PlaySnd
trigger1 = ishelper(3105)
trigger1 = animelem = 3
value = 0,3
freqmul = 0.9+(random/3333.3)

;----

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && random <600
value = 10,ifelse(random<500,3,4)
channel = 21
freqmul = ifelse(ishelper(3103)=1,0.5+(random/2500.0),0.8+(random/2500.0))

[State 200, 7]
type = ChangeState
triggerall = AnimTime = 0
trigger1 = anim = 3105
trigger2 = anim = 3130
trigger3 = anim = 3150
trigger4 = anim = 3170
trigger5 = anim = 3190
trigger6 = anim = 3210
value = 3100

;hit custom
[State -3, HitOverride]
type = HitOverride
trigger1 = 1
slot = 0
attr = SCA, AA,AP,AT
stateno = 3106
time = -1
ignorehitpause=1

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1
ignorehitpause=1

;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
;hyper rayo (hypermove)
[Statedef 3500]
type    = S
movetype= I
physics = S
juggle  = 4
velset = 0,0
ctrl = 0
sprpriority = 1
poweradd = 0

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

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time && prevstateno != 5000
value = 5,4
volume = 150
channel = 11

[State 0, ChangeAnim]
type = ChangeAnim
trigger1 = !time && anim != 3500
value = 3500
ignorehitpause = 1

;bgpalfx helper
[State 0, Helper]
type = Helper
trigger1 = animelem = 1 && numhelper(3501)=0
name = "bgplafx"
ID = 3501
stateno = 3501

[State 0, PowerAdd]
type = PowerAdd
trigger1 = animelem = 1
value = -2000

[State 0, PalFXWiz]
type = PalFX
trigger1 = !time && animelemtime(73)<0
time = -1
add = 30,-30,-30
mul = 256,256,256
sinadd = 100,-20,-20,5
color = 256
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 20
time = 50
ampl = -2

[State 0, Explod]
type = Explod
trigger1 = animelem = 10 && numexplod(1005)=0
anim = 1005
ID = 1005
pos = 0,0
bindtime = -1
removetime = -1
sprpriority = 3
ownpal = 1
supermovetime = -1

[State 0, Explod]
type = Explod
trigger1 = animelem = 22 && numexplod(3505)=0
anim = 3505
ID = 3505
bindtime = -1
sprpriority = 3
ownpal = 0
supermovetime = -1

[State 0, PalFX]
type = PalFX
trigger1 = animelem = 73 && time != 0
time = 1
add = 0,0,0

[State 0, PlaySnd]
type = PlaySnd
trigger1 = animelem = 8 && time !=0
value = 6,12
channel = 9
freqmul = 1.0
volume = 200

[State 0, Helper]
type = Helper
trigger1 = animelem = 73 && numhelper(3510)=0
name = "hyper_rayo"
ID = 3510
stateno = 3510
pos = -5,0
ownpal = 1

;lineas nucleares
[State 3900, 1]
type = Explod
trigger1 = numhelper(3511)=1 && helper(3511), animelem = 9
anim = 3514
bindtime = -1
sprpriority = 10
ownpal = 1


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

;---------------------------------------------------------------------------
;bg palfx (helper)
[Statedef 3501]
type    = S
movetype= I
physics = n
ctrl = 0
anim = 3011

[State 0, BGPalFX]
type = BGPalFX
trigger1 = !time
time = 300
add = 0,0,0
sinadd = -100,-100,-100,200
persistent = 0

[State 0, BGPalFX]
type = BGPalFX
trigger1 = time >= 60
time = 1
add = -100,-100,-100
ignorehitpause = 1

[State 0, BGPalFX]
type = BGPalFX
trigger1 = root, stateno = 5005
trigger2 = numhelper(3511)=1 && helper(3511),animelem= 33
trigger3 = root, stateno = 5150
time = 1
add = 0,0,0
ignorehitpause = 1

[State 0, DestroySelf]
type = DestroySelf
trigger1 = root, stateno = 5005
trigger2 = numhelper(3511)=1 && helper(3511),animelem= 32
trigger3 = root, stateno = 5150
ignorehitpause = 1

;---------------------------------------------------------------------------
;Hyper Rayo (helper)
[Statedef 3510]
type    = S
movetype= a
physics = n
velset = 0,0
ctrl = 0
sprpriority = 5
anim = 3510

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,1
volume = 150
freqmul = 1.7+(random/3333.3)

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

;ondaza
[State 0, Explod]
type = null;Explod
trigger1 = !time
anim = f 62
sprpriority = 6
ownpal = 1
pos = 205,0

;ondita
[State 0, Explod]
type = Explod
trigger1 = !time
trigger2 = animelem = 9
anim = f 61
sprpriority = 0
ownpal = 1
pos = 205,0
scale = 3,3

;ondita
[State 0, Explod]
type = Explod
trigger1 = !time
anim = f 61
sprpriority = 0
ownpal = 1
pos = 205,0
scale = 2,2

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

[State 210, 2]
type = HitDef
trigger1 = !time
attr = S, SP
animtype  = up
damage    = 90,10
guardflag = MA
pausetime = 0,10
sparkno = 2
sparkxy = -10,-70
hitsound   = 5,2
guardsound = 6,0
ground.type = high
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = 0,-8
air.velocity = 0,-8
fall = 1
yaccel = 0.4
palfx.time = 30
palfx.add = 100,-150,-150
fall.envshake.time = 10
fall.envshake.ampl = 7
envshake.time = 12
envshake.ampl = -10
fall.recover = 0


[State 0, BindToParent]
type = BindToParent
trigger1 = animelemtime(8)<0
pos = -5,0
ignorehitpause = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 12
ampl = -10

[State 0, Helper]
type = Helper
trigger1 = animtime = 0
name = "columna"
ID = 3511
stateno = 3511
pos = 205,-10
ownpal = 1

[State 0, EnvShake]
type = EnvShake
trigger1 = animelem = 9
time = 100
ampl = -10

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

;---------------------------------------------------------------------------
;Hyper Columna (helper)
[Statedef 3511]
type    = S
movetype= A
physics = n
velset = 0,0
ctrl = 0
sprpriority = 5
anim = 3511

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,13
volume = 200

[State 0, PlaySnd]
type = PlaySnd
trigger1 = !time
value = 6,13
volume = 200
freqmul = 1.6

[State 0, PosSet]
type = PosSet
trigger1 = !time && frontedgedist <-20
x = ifelse(facing=1,180,-180)

[State 0, SprPriority]
type = SprPriority
trigger1 = movecontact
value = 6
ignorehitpause = 1

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

[State 0, EnvShake]
type = EnvShake
trigger1 = !time
time = 100
ampl = 10

;blanco
[State 3900, 1]
type = Explod
trigger1 = animelem = 9
anim = 3512
postype = left
bindtime = -1
sprpriority = 9
ownpal = 1
scale = 1.5,1.5

;niebla
[State 3900, 1]
type = Explod
trigger1 = animtime = 0
anim = 3513
postype = left
bindtime = -1
sprpriority = 4
ownpal = 1
scale = 1.2,1.2

[State 210, 2]
type = HitDef
trigger1 = time % 3 = 0
attr = S, SP
animtype  = up
damage    = 14,5
guardflag = MA
pausetime = 0,10
sparkno = -1
sparkxy = -10,-70
hitsound   = 5,ifelse(random<333,0,ifelse(random<555,1,2))
guardsound = 6,0
ground.type = high
ground.slidetime = 12
ground.hittime  = 13
ground.velocity = -3,-30
air.velocity = -3,-30
fall = 1
yaccel = 0.5
palfx.time = 20
palfx.add = 100,-150,-150
fall.envshake.time = 10
fall.envshake.ampl = 7
fall.recover = 0
sprpriority = 9


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

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

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

[statedef -2]

;[E]
; ai stuff
; Within StateDef -2, none of your own AI-related code should be placed
; above these next two controllers.

[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(59):=0
var(59) = 1	; Another option is to replace 1 with something like MatchNo, if
		; you want to design your AI to have varying levels of difficulty.
IgnoreHitPause = 1
;------------------------------------------------
;------------------------------------------------
;------------------------------------------------

[State -2,no guard]
type = AssertSpecial
trigger1 = 1
flag = nostandguard
flag2 = nocrouchguard
flag3 = noairguard

;inmune a throws
[State -3, NotHitBy]
type = NotHitBy
trigger1 = 1
value = ,AT
time = 1

[State -3, HitOverride]
type = HitOverride
trigger1 = stateno != 3100
trigger1 = stateno != 3101
trigger1 = stateno != 3102
trigger1 = stateno != 3103
trigger1 = stateno != 3104
trigger1 = stateno != 3105
trigger1 = stateno != 3106
trigger1 = stateno != 3107
trigger1 = stateno != 3108
slot = 0
attr = SCA, AA,AP
stateno = ifelse(stateno = 5005,5005,5000)
time = 1
ignorehitpause = 1

;numero de state previo al HIT
[State 0, VarSet]
type = VarSet
trigger1 = stateno != 5000 && stateno != 5005
v = 15
value = stateno
ignorehitpause = 1

;numero de animelm previo al HIT
[State 0, VarSet]
type = VarSet
trigger1 = stateno != 5000 && stateno != 5005
v = 17
value = animelemno(0)
ignorehitpause = 1

;sonido standing
[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 0 && animelem = 15
value = 6,ifelse(random<500,4,8)
freqmul = 0.9+(random/3333.3)
volume = 100

;sonido camina
[State 0, PlaySnd]
type = PlaySnd
trigger1 = anim = 20 && animelem = 2
trigger2 = anim = 21 && animelem = 2
value = 1,ifelse(random<500,2,3)
freqmul = 0.8+(random/2000.0)
channel = 20
loop = 1
volume = 100

;pre rayo
[State 0, StopSnd]
type = StopSnd
trigger1 = anim = 1000 && animelem = 33
trigger2 = stateno = 5005
channel = 13
ignorehitpause = 1

;pre rayo HYPER
[State 0, StopSnd]
type = StopSnd
trigger1 = numhelper(3510)!=0
trigger2 = stateno = 5005
channel = 9
ignorehitpause = 1

;poder intro sonido
[State 0, StopSnd]
type = StopSnd
trigger1 = stateno != 191
trigger1 = stateno != 192
channel = 14
ignorehitpause = 1

;caminar
[State 0, StopSnd]
type = StopSnd
trigger1 = anim != 20 && anim != 21
channel = 20
ignorehitpause = 1

;remove OJOS
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno = 5005
trigger2 = anim != 1000 && anim != 3010 && anim != 3500
trigger3 = anim = 1000 && animelem = 33
trigger4 = anim = 3010 && animelem = 7
trigger5 = anim = 3500 && animelem = 73
id = 1005
ignorehitpause = 1

;remove VENAS
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno = 5005
trigger2 = anim != 3500
trigger3 = anim = 3500 && animelem = 73
id = 3505
ignorehitpause = 1

;remove ENERGIA INTRO
[State 0, RemoveExplod]
type = RemoveExplod
trigger1 = stateno != 191
trigger1 = stateno != 192
id = 199
ignorehitpause = 1

[State 0, AfterImageTime]
type = AfterImageTime
triggerall = !ishelper(3100)
triggerall = !ishelper(3101)
triggerall = !ishelper(3102)
triggerall = !ishelper(3103)
triggerall = !ishelper(3104)
triggerall = !ishelper(3105)
trigger1 = anim != 3000 && anim != 3500
trigger2 = anim = 3000 && animelemtime(26)>=0
time = 0

;bgpal para hyper
[State 0, BGPalFX]
type = BGPalFX
trigger1 = stateno = 3010
trigger2 = stateno = 3011
time = 1
add = -100,-100,-100
color = 150
ignorehitpause = 1

;width clones
[State 0, Width]
type = Width
trigger1 = ishelper(3100)
trigger2 = ishelper(3120)
trigger3 = ishelper(3140)
trigger4 = ishelper(3160)
trigger5 = ishelper(3180)
trigger6 = ishelper(3200)
value = -15,-15

;muere BACKUP
[State 0, ChangeState]
type = ChangeState
trigger1 = life = 0 && stateno != 5150
value = 5150
ctrl = 0
ignorehitpause = 1

;ORB 1
[State 0, Helper]
type = null;Helper
trigger1 = numhelper(1501)=0 && power >=500
name = "orb1"
ID = 1501
stateno = 1500
pos = ifelse(random<500,100,-100),ceil(0-(random/7))
postype = p1
ownpal = 1

;ORB 2
[State 0, Helper]
type = null;Helper
trigger1 = numhelper(1502)=0 && power >=1000
name = "orb2"
ID = 1502
stateno = 1500
pos = ifelse(random<500,100,-100),ceil(0-(random/7))
postype = p1
ownpal = 1

;ORB 3
[State 0, Helper]
type = null;Helper
trigger1 = numhelper(1503)=0 && power >=1500
name = "orb3"
ID = 1503
stateno = 1500
pos = ifelse(random<500,100,-100),ceil(0-(random/7))
postype = p1
ownpal = 1

;ORB 14
[State 0, Helper]
type = null;Helper
trigger1 = numhelper(1504)=0 && power >=2000
name = "orb4"
ID = 1504
stateno = 1500
pos = ifelse(random<500,100,-100),ceil(0-(random/7))
postype = p1
ownpal = 1

;---

[State 0, AssertSpecial]
type = AssertSpecial
trigger1 = !(enemynear, Authorname = "Andres Borghi")
flag = invisible

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

[statedef -3]

;[E]
;ai stuff

;[StateDef -3]
;
; 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 or the XOR 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.

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

;[E]
; ai activation

;***************************************************************************
; ST
;***************************************************************************

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


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

