; Thanks to Falchion22 for this code
;------------------------------| AI Code Combo|-----------------------------
;---------------------------------------------------------------------------
; STAND_LIGHT_PUNCH
[Statedef 10000]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd = 5
ctrl = 0
velset = 0,0,0
anim = 200

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

[State 200, 1b]
type = PlaySnd
trigger1 = Time = 1
trigger1 = Random < 500
value = 1, 0

[State 200, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Light
damage    = 15,2
guardflag = MA
pausetime = 14,14
getpower = 20,10
givepower = 10,5
sparkxy = -32,-37
sparkno = 0
hitsound   = S2,0
guardsound = 6,0
ground.type = High
ground.slidetime = 14
ground.hittime  = 14
ground.velocity = -2
air.velocity = -2,-.75

[State 200, 7]
type = ChangeState
trigger1 = movecontact && animelem = 2, >= 3
value = 10002
ctrl = 0

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

;---------------------------------------------------------------------------
; STAND LIGHT KICK
[Statedef 10002]
type = S
movetype = A
physics = S
anim = 220
poweradd = 20
juggle = 8
velset = 0
ctrl = 0

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

[State 220, 2]
type = PlaySnd
trigger1 = AnimElem = 3
trigger1 = Random < 500
value = 1,0

[State 220, 3]
type = HitDef
trigger1 = AnimElem = 3
attr = S, NA
animtype = Light
damage = 15,2
guardflag = M
getpower = 25, 12
givepower = 12, 6
pausetime = 10,10
sparkxy = -20,-45
hitsound = S2,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 5
ground.hittime = 15
ground.velocity = -4
air.velocity = -1.3,-1

[State 200, 7]
type = ChangeState
trigger1 = movecontact && animelem = 3, >= 3
value = 10004
ctrl = 0

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

;---------------------------------------------------------------------------
; STAND STRAIGHT KICK
[Statedef 10004]
type = S
movetype = A
physics = S
anim = 230
poweradd = 30
ctrl = 0
velset = 0

[State 230, 2]
type = PlaySnd
trigger1 = AnimElem = 4
value = 0,1

[State 230, 3]
type = PlaySnd
trigger1 = AnimElem = 5
trigger1 = Random < 500
value = 1,1

[State 230, 4]
type = HitDef
trigger1 = AnimElem = 5
attr = S, NA
animtype = Medium
damage = 25,3
getpower = 32, 16
givepower = 16, 8
guardflag = M
pausetime = 12,12
sparkno = 1
sparkxy = -32,-29
hitsound = S2,1
guardsound = 6,0
ground.type = High
ground.slidetime = 20
ground.hittime = 23
ground.velocity = -7.5
air.velocity = -3.5,-3

[State 200, 7]
type = ChangeState
trigger1 = movecontact && animelem = 5, >= 3
value = 10050
ctrl = 0

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

;---------------------------------------------------------------------------
; Mortal Wolf Attack (weak - ground)
[Statedef 10020]
type = S
movetype = I
physics = S
juggle = 4
ctrl = 0
anim = 1040
poweradd = 50

[State 1040, 0]
type = PlaySnd
trigger1 = Time = 0
value = 1,1
volume = 0
channel = 0

[State 1040, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 10021

;------------------------------------------------------------------------
; Mortal Wolf Attack (weak - air and attack)
[Statedef 10021]
type = A
movetype = A
physics = N
ctrl = 0
anim = 1041

[State 1041, Pos]
type = PosSet
trigger1 = Time = 0
y = -0.1

[State 1041, Pos]
type = PosAdd
trigger1 = Time = 0
y = -10

[State 1041, Vel]
type = VelSet
trigger1 = Time = 1
x = 3.5
y = -5

[State 1041, Brake]
type = VelAdd
trigger1 = Time >= 8
x = -.4

[State 1041, Brake Finish]
type = VelSet
trigger1 = Vel X <= 0
x = 0

[State 1041, Gravity]
type = VelAdd
trigger1 = Time >= 6
y = .5

[State 1041,Attack]
type = PlaySnd
trigger1 = AnimElem = 1
volume = 0
value = 1000,1

[State 1021, Hit]
type = HitDef
trigger1 = AnimElem = 1
attr = A, SA
damage = 70, 8
animtype = Medium
getpower = 10, 5
givepower = 5, 2
guardflag = MA
pausetime = 8,8
sparkxy = -23,-57
hitsound = S2,3
guardsound = 6,0
ground.type = High
ground.slidetime = 13
ground.hittime = 20
ground.velocity = -3,-5
guard.velocity = -3
air.velocity = -3.2,-5
palfx.time = 12
palfx.add = 255, 255, 255
palfx.mul = 255, 255, 255
fall = 1
air.fall = 1
air.juggle = 15

[State 1041, TransState]
type = ChangeAnim
trigger1 = AnimTime >= 16
value = 1042
persistent = 0

[State 1041, end1]
type = ChangeState
trigger1 = MoveContact = 1
value = 1043
ctrl = 0

[State 1041, end2]
type = ChangeState
triggerall = MoveContact = 0
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1042
ctrl = 0

;---------------------------------------------------------------------------
; Weak Cartwheel (ground)
[Statedef 10030]
type = S
movetype = A
physics = S
anim = 1020
poweradd = 50
velset = 0
ctrl = 0

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

[State 1020, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 2

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

;---------------------------------------------------------------------------
; Weak Cartwheel (in the air)
[Statedef 10031]
type = A
movetype = A
physics = N
anim = 1021

[State 1021, 0]
type = PosSet
trigger1 = Time = 0
y = -0.01

[State 1021, 1]
type = PlaySnd
trigger1 = Time = 0
value = 1020,0
channel = 1

[State 1020, 1]
type = VelSet
trigger1 = AnimElem = 1
x = 2.5
y = -2

[State 1021, 2]
type = VelSet
trigger1 = AnimElem = 2
y = 0

[State 1021, 4]
type = VelAdd
trigger1 = Time > 2
trigger1 = Time < 11
x = .5

[State 1021, 5]
type = VelAdd
trigger1 = Time >= 11
x = -.15
y = .4

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
animtype = medium
damage = 35, 6
guardflag = HA
pausetime = 12,12
getpower = 20,10
givepower = 10,5
sparkxy = -33,-40
sparkno = 1
hitsound = S2,1
guardsound = S1000,2
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6.5,-.5
air.velocity = -5.75,-.75
airguard.velocity = -5,-1

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
animtype = medium
damage = 50,7
guardflag = HA
pausetime = 12,12
getpower = 20,10
givepower = 10,5
sparkxy = -25,-43
sparkno = 1
hitsound = S2,2
guardsound = S1000,2
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6.5,-.5
air.velocity = -5.75,-.75
airguard.velocity = -5,-1
fall = 1

[State 1021, 7]
type = PosAdd
trigger1 = AnimElem = 2
x = 4

[State 1021, 8]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1022

;---------------------------------------------------------------------------
; Great Cartwheel (ground)
[Statedef 10040]
type = S
movetype = A
physics = S
anim = 1020
poweradd = 100
velset = 0
ctrl = 0

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

[State 1020, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 2

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

;---------------------------------------------------------------------------
; Great Cartwheel (in the air)
[Statedef 10041]
type = A
movetype = A
physics = N
anim = 1021

[State 1021, 0]
type = PosSet
trigger1 = Time = 0
y = -0.01

[State 1021, 1]
type = PlaySnd
trigger1 = Time = 0
value = 1020,0
channel = 1

[State 1020, 1]
type = VelSet
trigger1 = AnimElem = 1
x = 4
y = -2.5

[State 1021, 2]
type = VelSet
trigger1 = AnimElem = 2
y = 0

[State 1021, 4]
type = VelAdd
trigger1 = Time > 2
trigger1 = Time < 11
x = .5

[State 1021, 5]
type = VelAdd
trigger1 = Time >= 11
x = -.15
y = .4

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 2
attr = A, SA
animtype = medium
damage = 35,5
guardflag = HA
pausetime = 12,12
getpower = 30,15
givepower = 15,7
sparkxy = -24,-56
sparkno = 1
hitsound = S2,1
guardsound = S1000,2
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6.5,-.5
air.velocity = -5.75,-.75
airguard.velocity = -5,-1

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 3
attr = A, SA
animtype = medium
damage = 35,5
guardflag = HA
pausetime = 12,12
getpower = 30,15
givepower = 15,7
sparkxy = -33,-40
sparkno = 1
hitsound = S2,2
guardsound = S1000,2
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6.5,-.5
air.velocity = -5.75,-.75
airguard.velocity = -5,-1

[State 1021, 6]
type = HitDef
trigger1 = AnimElem = 4
attr = A, SA
animtype = hard
damage = 45,8
guardflag = HA
pausetime = 12,12
getpower = 30,15
givepower = 15,7
sparkxy = -25,-43
sparkno = 1
hitsound = S2,3
guardsound = S1000,2
ground.slidetime = 18
ground.hittime = 18
ground.velocity = -6.5,-.5
air.velocity = -5.75,-.75
airguard.velocity = -5,-1
fall = 1

[State 1021, 7]
type = PosAdd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 3
trigger3 = AnimElem = 4
persistent = 1
x = 4

[State 1021, 8]
type = ChangeState
trigger1 = Vel Y > 0
trigger1 = Pos Y >= 0
value = 1022

;---------------------------------------------------------------------------
; MAGIC OF CAPOEIRA (sequence 1)
[Statedef 10050]
type = S
movetype = A
physics = N
ctrl = 0
anim = 1000
poweradd = 50
velset = 0,0

[State 1000, 0]; Voice
type = PlaySnd
trigger1 = Time = 0
value = 1,1
volume = 0
channel = 0

[State 1000, 0b]; Roll
type = PlaySnd
trigger1 = AnimElem = 3
value = 1000,0
volume = 0
channel = 1

[State 1000, 1]
type = VelSet
trigger1 = AnimElem = 3
x = 4
y = 0

[State 1000, 2]
type = PosAdd
trigger1 = AnimElem = 3
trigger2 = AnimElem = 4
trigger3 = AnimElem = 5
x = 3

[State 1000, 3]
type = VelAdd
trigger1 = Time >= 12
x = -.1 

[State 1000, 3b]
type = HitDef
trigger1 = AnimElem = 5
attr = S, SA
animtype = Hard
getpower = 20, 10
givepower = 10, 5
damage = 35, 13
pausetime = 5, 22
sparkno = 2
sparkxy = -15,-5
hitsound = S2,2
guardsound = S1000,2
ground.type = High
ground.slidetime = 32
ground.hittime = 28
ground.velocity = 1.5
air.velocity = -2,-2.5

[State 1000, Command]
type = ChangeState
trigger1 = movecontact && animelem = 10, = 1
value = 10051

[State 1000, end!!]
type = ChangeState
trigger1 = AnimTime = 0
value = 11
ctrl = 1

;---------------------------------------------------------------------------
; MAGIC OF CAPOEIRA (follow-up 1)
[Statedef 10051]
type = S
movetype = A
physics = N
ctrl = 0
anim = 1001
poweradd = 50
velset = 0,0

[State 1001, 0]
type = PlaySnd
trigger1 = Time = 0
value = 1,0
volume = 0
channel = 0

[State 1001, 0b]
type = PlaySnd
trigger1 = AnimElem = 2
value = 40,1
volume = 0
channel = 1

[State 1001, 2a]
type = PosAdd
trigger1 = AnimElem = 2
x = -11

[State 1001, 2a]
type = PosAdd
trigger1 = AnimElem = 3
x = -18

[State 1001, 2a]
type = PosAdd
trigger1 = AnimElem = 6
x = -20

[State 1001, 2a]
type = PosAdd
trigger1 = AnimElem = 7
x = -15

[State 1001, 3b]
type = HitDef
trigger1 = AnimElem = 2
attr = S, SA
animtype = Hard
getpower = 20, 10
givepower = 10, 5
damage = 40, 15
guardflag = M
pausetime = 5,11
sparkno = 2
sparkxy = -16,-33
hitsound = S2,2
guardsound = S1000,2
ground.type = High
ground.slidetime = 37
ground.hittime = 48
ground.velocity = 6.5
air.velocity = -4,6.5

[State 1001, Command]
type = ChangeState
trigger1 = movecontact && animelem = 7, >= 1
value = 10052

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

;---------------------------------------------------------------------------
; MAGIC OF CAPOEIRA (follow-up 2)
[Statedef 10052]
type = S
movetype = A
physics = S
ctrl = 0
anim = 1002
poweradd = 50
velset = 0,0

[State 1002, 0]
type = PlaySnd
trigger1 = Time = 0
value = 1,2
volume = 0
channel = 0

[State 1002, Pos]
type = PosAdd
trigger1 = AnimElem = 3
x = 14

[State 1002, 0b]; Wind
type = PlaySnd
trigger1 = AnimElem = 5
value = 1000,1
volume = 0
channel = 1

[State 1002, Hit]
type = HitDef
trigger1 = AnimElem = 6
attr = S, SA
animtype  = Hard
damage    = 40,8
getpower  = 10
givepower = 5
priority  = 5
guardflag = MA
pausetime = 8,7
sparkxy = -30,-50
hitsound   = S2,3
guardsound = S1000,2
ground.type = Low
ground.slidetime = 20
ground.hittime  = 20
ground.velocity = -8,-7
guard.velocity = -7
air.velocity = -8,-7
airguard.velocity = -5, -4
fall = ifelse(p2name = "Mercedes Benz",0, 1)
p2stateno = ifelse(p2name = "Mercedes Benz",0, 1003)

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

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