;Constantes for Kame

[Data]
life = 900           
attack = 90          
defence = 80         
fall.defence_up = 50  
liedown.time = 60    
airjuggle = 15        
sparkno = 2        
guard.sparkno = 40  
KO.echo = 0           
volume = 0            

[Size]
xscale = 0.9           
yscale = 0.9            
ground.back = 15      
ground.front = 15     
air.back = 12         
air.front = 12      
z.width = 3          
height = 60	      
attack.width = 4,4    
attack.dist = 160   
proj.attack.dist = 90  
proj.doscale = 0     

[Velocity]
walk.fwd  = 2.2       
walk.back = -2.1     
run.fwd  = 4.6, 0    
run.back = -4.5,-3.8  
jump.neu = 0,-8.1    
jump.back = -2.55    
jump.fwd = 2.5        
runjump.back = -2.55,-8.1  
runjump.fwd = 4,-8.1      
airjump.neu = 0,-8.1       
airjump.back = -2.55,-8.1  
airjump.fwd = 2.5,-8.1     

[Movement]
airjump.num = 1       
airjump.height = 35   
yaccel = .43          
stand.friction = .85   
crouch.friction = .82  

;---------------------------------------------------------------------------
; LOSE (Time over)
[Statedef 170]
type = S
ctrl = 0
anim = 170
velset = 0,0,0

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

;---------------------------------------------------------------------------
; WIN
[Statedef 180]
type = S

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

[State 180]
type = PlaySnd
trigger1 = AnimElem = 1
value = 497, 0

;---------------------------------------------------------------------------
; WIN1
[Statedef 181]
type = S
ctrl = 0
anim = 181
velset = 0,0,0

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

[State 181]
type = PlaySnd
trigger1 = AnimElem = 1
value = 497, 0

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

[State 190, begin]
type = AssertSpecial
trigger1 = time = [0,205]
flag = intro

[State 190, 3]
type = changestate
trigger1 = animtime = 100
value = 0
ctrl = 0

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

; INTRO versus Others
[Statedef 191]
type = S
ctrl = 0
anim = 191
velset = 0,0,0

[State 190, begin]
type = AssertSpecial
trigger1 = time = [0,205]
flag = intro

[State 190, 3]
type = changestate
trigger1 = animtime = 60
value = 0
ctrl = 0

;--------------------------------------------------------
; INTRO versus Vegita
[Statedef 192]
type = S
ctrl = 0
anim = 192
velset = 0,0,0

[State 190, begin]
type = AssertSpecial
trigger1 = time = [0,205]
flag = intro

[State 190, 3]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 0

;---------------------------------------------------------------------------
;CROUCH_A
[Statedef 400]
type    = C
movetype= A
physics = C
juggle  = 6
poweradd= 15
ctrl = 0
anim = 400

[State 400, 2]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 23
animtype  = Light
getpower  = 10
givepower = 8
hitflag = MAFD
guardflag = L
pausetime = 10,12
sparkxy = -2,-41
hitsound   = 5,0
guardsound = 6,0
ground.type = Low
ground.slidetime = 4
ground.hittime  = 15
ground.velocity = -4
air.velocity = -1.3,-3
down.velocity = -4,0
down.hittime = 20

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

[State 400, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235, 0

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

;---------------------------------------------------------------------------
;CROUCH_B
[Statedef 410]
type    = C
movetype= A
physics = C
juggle  = 7
poweradd= 70
ctrl = 0
anim = 410

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

[State 410, 3]
type = HitDef
trigger1 = Time = 0
attr = C, NA
damage    = 62
getpower  = 40
givepower = 40
hitflag = MAFD
guardflag = L
pausetime = 12,12
sparkxy = -5,-10
sparkno = 1
hitsound   = 5,2
guardsound = 6,0
ground.type = Trip
ground.slidetime = 10
ground.hittime  = 15
ground.velocity = -1.5   
air.velocity = -1.2,-3
guard.velocity = -5
fall = 1

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

;---------------------------------------------------------------------------
;JUMP_A
[Statedef 600]
type    = A
movetype= A
physics = A
juggle  = 2
poweradd= 11
ctrl = 0
anim = 600

[State 600, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = A, NA
damage    = 12
getpower  = 10
givepower = 10
guardflag = HA
priority = 3
pausetime = 7,8
sparkxy = -10,-58
hitsound   = 5,0
guardsound = 6,0
ground.type = High
ground.slidetime = 5
ground.hittime  = 5
ground.velocity = -4
air.velocity = -1.3,-3

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

[State 600]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0,10

[State 600, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 50

;---------------------------------------------------------------------------
;JUMP_B
[Statedef 610]
type    = A
movetype= A
physics = A
juggle  = 3
poweradd= 55
ctrl = 0
anim = 610

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

[State 610, 3]
type = HitDef
trigger1 = Time = 0
attr = A, NA
damage    = 70
getpower  = 50
givepower = 25
guardflag = HA
priority = 3
pausetime = 9,10
sparkxy = -10,-51
hitsound   = 5,2
guardsound = 6,0
ground.type = High
ground.slidetime = 9
ground.hittime  = 9
ground.velocity = -4
air.velocity = -1.3,-3

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

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

; Special2
[Statedef 1800]
type    = S
movetype= A
physics = S
velset = 0,0,0
poweradd = -2000
juggle = 0
ctrl = 0
anim = 1800

;[State 1800, supsnd]
;type = PlaySnd
;trigger1 = AnimElem = 1
;value = F20, 0

[State 3000, Super]
type = Explod
trigger1 = animelem = 6
anim = 9990
pos = -390,-125
postype = p1
sprpriority = -2
supermove = 1
bindtime = 1

[State 1800, 2]
type = SuperPause
trigger1 = AnimElem = 6
pos = -15,-41
anim = 31

;[State 3000, aura]
;type = Explod
;trigger1 = Time = 3
;id = 950
;anim = 951
;pos = 0,0
;bindtime = -1
;sprpriority = 6
;removetime = 30
;supermove = 1

;[State 1705, ball]
;type = Explod
;trigger1 = Time = 30
;anim = 3002
;pos = 30,-51
;bindtime = -1
;sprpriority = 4
;removetime = 30
;supermove = 1

[State 1705, raio]
type = Projectile
trigger1 = AnimElem = 8
projanim = 1805
projhits = 25
projmisstime = 2
projshadow = -1
projpriority = 4
projremovetime = 50
projid = 1705
;velocity = 0.001,0.001
offset = 52,-63
attr = S, HP
damage   = 25,0
animtype = heavy
guardflag = MA
hitflag = MAFP
pausetime = 0,2
hitsound   = 5,2
sparkno = 0                   ;Spark image group and no (Def: set above)
sparkxy = -500,-500   
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5   
fall = 1
air.animtype = Back
air.velocity = -5,-8
air.juggle = 1
down.velocity = -10
down.hittime = 30
down.bounce = 0
;PalFX
palfx.time = 23
palfx.add = 50,30,130

[State 1800, 7]
type = PlaySnd
trigger1 = AnimElem = 1
value = 1700, 1

[State 1800, 8]
type = PlaySnd
trigger1 = AnimElem = 6
value = 1700, 0

[State 1800, envshake]
type = EnvShake
trigger1 = AnimElem = 8;Time = 60
time = 70

[State 1800, end]
type = ChangeState
trigger1 = Time = 120 ;115
value = 0
ctrl = 1

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

[State 195, 1]
type = PlaySnd
trigger1 = AnimElem = 2
trigger2 = AnimElem = 4
value = 497,0

[State 195, 2]
type = CtrlSet
trigger1 = AnimElem = 1
value = 1

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

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

; Definicion de Teleport A
[statedef 7500]
type = S
Movetype = I
Physics = S
Anim = 7500
ctrl = 0

[state 7500, sonido]
type = playsnd
trigger1 = animelem = 1
value = 1898,0 

[state 7500,1]
type = posadd
trigger1 = animelem = 4
x = -100

[state 7500,2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1


;---------------------------------------------------------------------------
; Definicion de Teleport B
[statedef 7510]
type = S
Movetype = I
Physics = S
Anim = 7500
ctrl = 0

[state 7510, sonido]
type = playsnd
trigger1 = animelem = 1
value = 1898,0

[state 7510,1]
type = posadd
trigger1 = animelem = 4
x = -250

[state 7510,2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Definicion de Teleport X
[statedef 7520]
type = S
Movetype = I
Physics = S
Anim = 7500
ctrl = 0

[state 7520, sonido]
type = playsnd
trigger1 = animelem = 1
value = 1898,0

[state 7520,1]
type = posadd
trigger1 = animelem = 4
x = 100

[state 7520,2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1
;---------------------------------------------------------------------------
; Definicion de Teleport Y
[statedef 7530]
type = S
Movetype = I
Physics = S
Anim = 7500
ctrl = 0

[state 7530, sonido]
type = playsnd
trigger1 = animelem = 1
value = 1898,0

[state 7530,1]
type = posadd
trigger1 = animelem = 4
x = 350

[state 7530,2,a]
type = turn
trigger1 = time = 36
value = 1

[state 7530,2]
type = changestate
trigger1 = animtime = 0
value = 0
ctrl = 1





[Statedef 1202]
type    = A
movetype= A
physics = A
juggle  = 0
poweradd= 0
ctrl = 0
anim = 181

[State 210, 3]
type = VelAdd
trigger1 = AnimElem = 1
trigger1 = AnimElem <= 2
x = -0.3

[State 210, 3]
type = VelSet
trigger1 = AnimElem = 3
x = 0

[State 3021, 3]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = Pos Y < 0
value = 1900

[State 210, 3]
type = ChangeState
trigger1 = time = 60
value = 1203

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

; STAND_A
[Statedef 200]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
velset = 0,0                 
ctrl = 0                     
anim = 200                   
poweradd = 60                

[State 200, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     
damage    = 30                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                                           
pausetime = 7,8                  
numhits = 1                      
sparkno = 0                   
sparkxy = -10,-35             
hitsound = 5,0                  
guardsound = 6,0                
ground.type = High                 
ground.slidetime = 5             
ground.hittime  = 11             
ground.velocity = -4             
airguard.velocity = -1.9         
air.velocity = -1.3,-3  

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

[State 200, 4]
type = ChangeState
trigger1 = AnimTime = 0
value = 0
ctrl = 1
sparkxy = -10,-50

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

[Statedef 201]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
velset = 0,0                  
ctrl = 0                    
anim = 201                   
poweradd = 20                  

[State 201, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     
damage    = 20                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                                           
pausetime = 7,8                  
numhits = 1                      
sparkno = 0                   
sparkxy = -10,-35             
hitsound = 5,0                  
guardsound = 6,0                
ground.type = High                 
ground.slidetime = 5             
ground.hittime  = 11             
ground.velocity = -4             
airguard.velocity = -1.9         
air.velocity = -1.3,-3           

[State 201, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235,0

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

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

; STAND_A
[Statedef 202]
type    = S                      
movetype= A                      
physics = S                      
juggle  = 1                      
velset = 0,0                  
ctrl = 0                    
anim = 202                   
poweradd = 20                  

[State 202, 1]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA                     
damage    = 25                   
animtype = Light                 
guardflag = MA                   
hitflag = MAF                    
priority = 3, Hit                                           
pausetime = 7,8                  
numhits = 1                      
sparkno = 0                   
sparkxy = -10,-35             
hitsound = 5,0                  
guardsound = 6,0                
ground.type = High                 
ground.slidetime = 5             
ground.hittime  = 11             
ground.velocity = -4             
airguard.velocity = -1.9         
air.velocity = -1.3,-3           

[State 202, 1]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235,0

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

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

; STAND_B
[Statedef 210]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
ctrl = 0
velset = 0,0,0
anim = 210

[State 210, 1] ;Uncomment if you want to play a sound
type = null; PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 210, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 50
guardflag = MA
pausetime = 11,11
sparkxy = -10,-70
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2.2,-3.2

[State 210]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235,1

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

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

; STAND_B
[Statedef 211]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
ctrl = 0
velset = 0,0,0
anim = 211

[State 211, 1] ;Uncomment if you want to play a sound
type = null; PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 211, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 55
guardflag = MA
pausetime = 11,11
sparkxy = -10,-70
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2.2,-3.2

[State 211]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235,1

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

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

; STAND_B
[Statedef 212]
type    = S
movetype= A
physics = S
juggle  = 4
poweradd= 60
ctrl = 0
velset = 0,0,0
anim = 212

[State 212, 1] ;Uncomment if you want to play a sound
type = null; PlaySnd
trigger1 = Time = 2
value = 0, 3

[State 212, 2]
type = HitDef
trigger1 = AnimElem = 2
attr = S, NA
animtype  = Medium
damage    = 45
guardflag = MA
pausetime = 11,11
sparkxy = -10,-35
hitsound   = 5,1
guardsound = 6,0
ground.type = High
ground.slidetime = 12
ground.hittime  = 15
ground.velocity = -5
air.velocity = -2.2,-3.2

[State 212]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1235,1

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

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

; SuperMove
[Statedef 3000]
type    = S
movetype= A
physics = S
juggle  = 4
velset = 0,0
anim = 3000
ctrl = 0

[State 3000, Super A]
type = SuperPause
trigger1 = Time = 2
pos = 0, -60
anim = 30

[State 3000, Super B]
type = PlaySnd
trigger1 = Time = 2
value = F20, 0 ;Play fight sound of super

[State 3000, Super C]
type = PowerAdd
trigger1 = Time = 2
value = -1000

[State 3000, Super D]
type = AfterImage
trigger1 = Time = 2
time = 2

[State 3000, Super E]
type = AfterImageTime
trigger1 = Time = [2,68]
time = 2

[State 3000, Super F] ;Invunerable to normal and special attacks for a bit
type = NotHitBy
trigger1 = Time = 2
value = , NA, SA, AT
time = 12

[State 3000, 1]
type = HitDef
trigger1 = AnimElem = 1
attr = S, HA
animtype  = Hard
damage    = 72,4
getpower  = 0
priority  = 6
guardflag = MA
pausetime = 15,15
sparkxy = -10,-60
hitsound   = 5,4
guardsound = 6,0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 22
ground.velocity = -6
air.velocity = -3,-3
fall.animtype = Hard
fall = 1

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

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

;Power up 
[Statedef 730]
type = S
movetype = I
physics = S
anim = 730
velset = 0
ctrl = 0

[state 730, tishok]
type = explod
trigger1 = time = 0
trigger1 = pos Y >= 0
anim = F61
pos = -3,0
postype = P1
ownpal = 1
sprpriority = -1
removetime = 12
bindtime = -1

[State 730, 1]
type = ChangeState
trigger1 = AnimTime = 0
value = 735

;[state 730,3]
;type = playsnd
;trigger1 = time = 1
;value = S730,0

[state 730, 4]
type = explod
trigger1 = time = 0
trigger1 = pos Y < 0 
id = 733 
anim = 731
pos = -73,-150
removetime = -1
postype = p1
bindtime = -1

[state 730, 4]
type = explod
trigger1 = time = 0
trigger1 = pos Y >= 0
id = 731 
anim = 731
pos = -60,-150
removetime = -1
postype = p1
bindtime = -1

[State 735,stopbas]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) = 0
trigger2 = Pos Y > 0
x = 0
y = 0

[State 735, Stophaut]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) = 0
trigger2 = Pos Y < -200
x = 0
y = 0

[state 730, 5]
type = statetypeset
trigger1 = Pos Y < 0
value = A

; Power up
[Statedef 735]
type = S
movetype = I
physics = S

[State 735, 1]
type = ChangeState
trigger1 = command != "holda"
trigger2 = command != "holdb"
value = 740

[state 735,son,]
type = playsnd
trigger1 = time = 0
value = S730,1

[State 735,stopbas]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) = 0
trigger2 = Pos Y > 0
x = 0
y = 0

[State 735, Stophaut]
type = VelSet
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) = 0
trigger2 = Pos Y < -200
x = 0
y = 0

[State 735, 18]
type = changeanim
trigger1 = statetype = A
value = 736

[state 735, 5]
type = statetypeset
trigger1 = Pos Y < 0
value = A

[State 735, 18]
type = changeanim
trigger1 = statetype = S
trigger1 = numexplod(733) = 0
value = 735

[State 735,shake] 
type = EnvShake
trigger1 = Pos Y >= 0
trigger1 = TimeMod = 4,0
time = 4
ampl = 4
freq = 127

[State 735, 2]
type = PowerAdd
trigger1 = Time = [0,25]
value = 3

[state 735,Clignote]
type = PalFX
trigger1 = Time > 0
trigger1 = TimeMod = 12,0
time = 2
add = 64,64,64

[state 735, terrequitourne]
type = explod
trigger1 = time = 0
trigger1 = pos Y >= 0
trigger1 = numexplod(732) = 0 
id = 732
anim = 732
pos = -55,-23
removetime = -1
sprpriority = 15
postype = p1
bindtime = -1

[State 735,fuwaVar1]
type = VarSet
triggerall = Pos Y < 0
trigger1 = command != "holdfwd"
trigger1 = command != "holdback"
trigger1 = command != "holdup"
trigger1 = command != "holddown"
trigger1 = Var(2) != 2
trigger2 = Var(2)= 2
trigger2 = Vel Y >= 2.4
v = 2
value = 1

[State 735,fuwaVar2]
type = VarSet
triggerall = Pos Y < 0
trigger1 = Var(2) = 1
trigger1 = Vel Y <= -2.4
v = 2
value = 2

[State 735,fuwaUp]
type = VelAdd
triggerall = Pos Y < 0
trigger1 = Var(2) = 1
y = -0.3

[State 735,fuwaDown]
type = VelAdd
triggerall = Pos Y < 0
trigger1 = Var(2) = 2
y = 0.3

[State 735,fuwaEnd]
type = VelSet
triggerall = Var(2) != 0
triggerall = Pos Y < 0
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
y = 0

[State 735,fuwaEndVar]
type = VarSet
triggerall = Pos Y < 0
trigger1 = command = "holdfwd"
trigger2 = command = "holdback"
trigger3 = command = "holdup"
trigger4 = command = "holddown"
v = 2
value = 0

[State 735, 2]
type = ChangeState
trigger1 = Power >= 3000
value = 741

[State 735, 3]
type = ChangeState
trigger1 = Time = 25
value = 735

; Power up (end)
[Statedef 740]
type = S
movetype = I
physics = S
anim = 740

[state 740, 6]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = Pos Y < 0
value = 1500

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

[state 740, 5]
type = statetypeset
trigger1 = Pos Y < 0
value = A

; Power up (maxed out)
[Statedef 741]
type = S
movetype = I
physics = S
anim = 740

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

[state 741, 5]
type = statetypeset
trigger1 = Pos Y < 0
value = A

[state 741, 6]
type = ChangeState
trigger1 = AnimTime = 0
trigger1 = Pos Y < 0
value = 1500

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


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

;FIREBALL_A

;Energy Dan (left)
[Statedef 1000]
type    = S
movetype= A
physics = S
velset = 0,0,0
juggle = 4
ctrl = 0
anim = 1000

[State 1000, Ha!]
type = PlaySnd
trigger1 = AnimElem = 2
value = 1000,0

[State 1000, dan]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1009
projshadow = -1
projpriority = 4
projremovetime = 100
projid = 1001
velocity = 5
accel = .2
offset = 28,-56
attr = S, SP
damage   = 30,8
animtype = hard
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,3
sparkno = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.animtype = Low
air.velocity = -1,-1
air.juggle = 2

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

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

;Triple FIREBALL
[Statedef 1097]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
anim = 1097
velset = 0

[State 1097, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 7

[State 1097, dan]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1009
projshadow = -1
projpriority = 4
projremovetime = 100
projid = 1001
velocity = 6
accel = .2
offset = 40,-51
attr = S, SP
damage   = 30,8
animtype = hard
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,3
sparkno = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.animtype = Low
air.velocity = -1,-1
air.juggle = 2

[State 1097, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 1098
ctrl = 1

;------------------------------------------
;Triple FIREBALL 1
[Statedef 1098]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
anim = 1098
velset = 0

[State 1098, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 7

[State 1098, dan]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1009
projshadow = -1
projpriority = 4
projremovetime = 100
projid = 1001
velocity = 6
accel = .2
offset = 39,-51
attr = S, SP
damage   = 30,8
animtype = hard
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,3
sparkno = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.animtype = Low
air.velocity = -1,-1
air.juggle = 2

[State 1098, 6]
type = ChangeState
trigger1 = AnimTime = 0
value = 1499
ctrl = 1

;------------------------------------------
;Triple FIREBALL 2
[Statedef 1499]
type    = S
movetype= A
physics = S
poweradd= 100
ctrl = 0
anim = 1499
velset = 0

[State 1499, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0, 7

[State 1499, dan]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1009
projshadow = -1
projpriority = 4
projremovetime = 100
projid = 1001
velocity = 6
accel = .2
offset = 40,-51
attr = S, SP
damage   = 30,8
animtype = hard
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,3
sparkno = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.animtype = Low
air.velocity = -1,-1
air.juggle = 2

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

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

;FIREBALL_b
[Statedef 1099]
type    = S
movetype= A
physics = S
velset = 0,0,0
juggle = 4
ctrl = 0
anim = 1099

[State 1099, Ha!]
type = PlaySnd
trigger1 = AnimElem = 2
value = 0,7

[State 1099, dan]
type = Projectile
trigger1 = AnimElem = 2
projanim = 1005
projhitanim = 1009
projshadow = -1
projpriority = 4
projremovetime = 100
projid = 1001
velocity = 6
accel = .2
offset = 41,-51
attr = S, SP
damage   = 30,8
animtype = hard
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,3
sparkno = -1
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5
air.animtype = Low
air.velocity = -1,-1
air.juggle = 2

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

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

;Kamehame-ha
[Statedef 1700]
type    = S
movetype= A
physics = S
velset = 0,0,0
poweradd = -1000
juggle = 0
ctrl = 0
anim = 1700

;[State 1700, ?]
;type = PosFreeze
;trigger1 = time >= 0

;[State 1700, supsnd]
;type = PlaySnd
;trigger1 = AnimElem = 1
;value = F20, 0

[State 3000, Super]
type = Explod
trigger1 = animelem = 1
anim = 9990
pos = -390,-125
postype = p1
sprpriority = -2
supermove = 1
bindtime = 1

[State 1700, 2]
type = SuperPause
trigger1 = AnimElem = 1
pos = 2,-36
anim = 31

;[State 3000, aura]
;type = Explod
;trigger1 = Time = 3
;id = 950
;anim = 951
;pos = 0,0
;bindtime = -1
;sprpriority = 6
;removetime = 30
;supermove = 1

;[State 1700, ball]
;type = Explod
;trigger1 = Time = 30
;anim = 3002
;pos = 30,-51
;bindtime = -1
;sprpriority = 4
;removetime = 30
;supermove = 1

[State 1700, raio]
type = Projectile
trigger1 = AnimElem = 17
projanim = 1705
projhits = 20
projmisstime = 3
projshadow = -1
projpriority = 4
projremovetime = 70
projid = 1705
;velocity = 0.001,0.001
offset = 30,-59
attr = S, HP
damage   = 13,7
animtype = heavy
guardflag = MA
hitflag = MAFP
pausetime = 0,3
hitsound   = 5,2
sparkno = 0                   ;Spark image group and no (Def: set above)
sparkxy = -500,-500   
guardsound = 6,0
ground.type = Low
ground.slidetime = 15
ground.hittime  = 15
ground.velocity = -5   
fall = 1
air.animtype = Back
air.velocity = -5,-8
air.juggle = 1
down.velocity = -10
down.hittime = 30
down.bounce = 0
;PalFX
palfx.time = 23
palfx.add = 50,30,130

[State 1700, 6]
type = PlaySnd
trigger1 = AnimElem = 8
value = 1700, 0

[State 1700, envshake]
type = EnvShake
trigger1 = AnimElem = 17;Time = 60
time = 70

[State 1700, end]
type = ChangeState
trigger1 = Time = 135
value = 0
ctrl = 1


;------------------
; AI Activation Helper State - Primary Version
; (Credit to YongMing for the basic HitPause bugfix concept.)
;
; var(16) - 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(16)
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(59) = 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(59) = 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(59) = 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(59) = -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(16):=1
trigger1 = Parent,var(59)
trigger2 = !(Parent,Alive)
trigger3 = RoundState != 2


;------------------
; AI Activation Helper State - Compatibly Partnered Version
;
; var(1) - First tick dir 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.
; parent's var(57) - Parent's GameTime var, for pause and custom state check.
; parent's var(59) - 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 = 0

[State 9742, PauseCheck]
type = VarSet
trigger1 = (GameTime>Parent,var(57))
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)
trigger4 = Parent,var(59)
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, 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(15):=0)
var(15) = 1

[State 9742, DirTurnOnAI]
type = ParentVarSet
trigger1 = var(1)
trigger1 = var(6)
trigger1 = !var(3)
trigger1 = !var(4)
trigger1 = !var(9)
var(59) = 1

[State 9742, DirTurnOffAI]
type = ParentVarSet
triggerall = var(6)
triggerall = !var(3)
triggerall = Parent,var(59)
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(59) = 0

[State 9742, ButtonTurnOnAI]
type = ParentVarSet
trigger1 = var(5)
trigger1 = var(7)
trigger1 = !var(2)
trigger1 = !var(15)
var(59) = 1

[State 9742, ButtonTurnOffAI]
type = ParentVarSet
triggerall = var(7)
triggerall = !var(2)
triggerall = !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(59) = -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(59)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)

[State 9742, HitPauseCheck]
type = VarSet
trigger1 = var(6)
trigger2 = var(7)
trigger3 = !(Parent,HitPauseTime)
var(4) = Parent,HitPauseTime

[State 9742, Delay]
type = VarSet
trigger1 = (var(1):=1)
var(5) = !var(7)


;------------------
; XOR Method's HitPauseTime Helper State

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

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

[State 9743, HitPauseTime]
type = VarSet
trigger1 = !(Parent,HitPauseTime)
trigger2 = (GameTime>Parent,var(57))
var(1) = Parent,HitPauseTime

[State 9742, Goodbye]
type = DestroySelf
trigger1 = (Parent,var(59) = 1)
trigger2 = !(Parent,Alive)
trigger3 = (RoundState != 2)


[Statedef -3]
; These next two controllers must be placed here, after the above CPU
; VarSet controller and before the below GameTime VarSet controller.
[State -3, Reset]
type = VarAdd
trigger1 = var(56) > 0 && !IsHelper
var(56) = -1

[State -3, Delay]
type = VarSet
trigger1 = var(57) < GameTime-1 && !IsHelper
var(56) = 31
IgnoreHitPause = 1

[Statedef -3]
[State -3, AI Helper - Compatibly Partnered Version]
type = Helper
trigger1 = !var(59) && !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(59) && !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(59) = -2 && !IsHelper
trigger1 = Alive && RoundState = 2
var(59) = 1

; It is very important that this controller NOT be moved to State -2, as putting
; it there would defeat the entire purpose of the controller, allowing the
; helper method to erroneously set the AI variable.
; And within State -3, don't put any ChangeState controllers before this
; controller, lest you unnecessarily delay your character's AI activation.
[State -3, GameTimeVar]
type = VarSet
trigger1 = !IsHelper
var(57) = GameTime
IgnoreHitPause = 1

