; Definition file for Omega Zero
; Contains all the filenames needed for the character

;--------------------
;[Player Information]
;--------------------
[Info]
name = "Omega Zero"	   ;Name of character
displayname = "Omega" 	   ;Name of character to display
versiondate = 2006.12.25   ;Version date of character
mugenversion = 2001.04.14  ;Version of M.U.G.E.N character works on
author = "N-Mario"	   ;Character author name
pal.defaults = 1,2,3,7,8,9 ;Default palettes in order of preference

;--------------------
;[Common Files] 
;--------------------
[Files]
cmd      = ozero-ai.def	;Command set
cns      = ozero-ai.def	;Constants
stcommon = common1.cns	;Common states
sprite   = sprite.sff	;Sprite
anim     = animation.air;Animation
sound    = sound.snd	;Sound

;--------------------
;[States] 
;--------------------
st	= common.cns	;Common
st2     = states.cns	;States
st3     = states-s.cns	;Special Moves
st4     = states-h.cns	;Hyper Moves
st5     = helpers.cns	;Helpers
st6	= ozero-ai.def	;Override

;--------------------
;[Palettes] (can have up to 12)
;--------------------
pal1    = palette/omega.act
pal2    = palette/omega.act
pal3    = palette/omega.act
pal4    = palette/omega.act
pal5    = palette/omega.act
pal6    = palette/omega.act
pal7    = palette/shadow.act
pal8    = palette/shadow.act
pal9    = palette/shadow.act
pal10   = palette/shadow.act
pal11   = palette/shadow.act
pal12   = palette/shadow.act

;---------------------------------------------------------------------------
; Omega Zero's constants.
; Format (case insensitive):
;  [groupname]
;  constname = value
;----------------------------------------
[Data]
life = 2000		;Amount of life to start with
power = 3000		;Amount of power
attack = 100		;attack power (more is stronger)
defence = 100		;defensive power (more is stronger)
fall.defence_up = 50	;Percentage to increase defense everytime player is knocked down
liedown.time = 20	;Time which player lies down for, before getting up
airjuggle = 20		;Number of points for juggling
sparkno = 2		;Default hit spark number for HitDefs
guard.sparkno = 40	;Default guard spark number
KO.echo = 0		;1 to enable echo on KO
volume = 200		;Volume offset (negative for softer)
IntPersistIndex = 60	;Variables with this index and above will not have their values
FloatPersistIndex = 40  ;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.

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

[Velocity]
walk.fwd  = 3		;Walk forward
walk.back = -3		;Walk backward
run.fwd  = 6, 0		;Run forward (x, y)
run.back = -6,-3	;Hop backward (x, y)
jump.neu = 0,-8		;Neutral jumping velocity (x, y)
jump.back = -3		;Jump back Speed (x, y)
jump.fwd = 3		;Jump forward Speed (x, y)
runjump.back = -5,0	;Running jump speeds (opt)
runjump.fwd = 5,0	;.
airjump.neu = 0,-8	;.
airjump.back = -2	;Air jump speeds (opt)
airjump.fwd = 2		;.

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

;---------------------------------------------------------------------------
;-| Button Remapping |-----------------------------------------------------
; This section lets you remap the player's buttons (to easily change the
; button configuration). The format is:
;   old_button = new_button
; If new_button is left blank, the button cannot be pressed.
[Remap]
x = x
y = y
z = z
a = a
b = b
c = c
s = s

;-| Default Values |-------------------------------------------------------
[Defaults]
; Default value for the "time" parameter of a Command. Minimum 1.
command.time = 30

; Default value for the "buffer.time" parameter of a Command. Minimum 1,
; maximum 30.
command.buffer.time = 1

;-| Super Motions |--------------------------------------------------------
; 7-Slash Sabre Combo
[Command]
name = "7sabre"
command = x, x, F, a, z
time = 40

; Reverse Ultimate Raging Omega Slash Combo
[Command]
name = "omegasabre"
command = z, a, B, x, x
time = 40

;-| Special Motions |------------------------------------------------------


;-| Double Tap |-----------------------------------------------------------
[Command]
name = "FF"     ;Required (do not remove)
command = F, F
time = 10

[Command]
name = "BB"     ;Required (do not remove)
command = B, B
time = 10

;-| 2/3 Button Combination |-----------------------------------------------
[Command]
name = "recovery" ;Required (do not remove)
command = x+y
time = 1

[Command]
name = "recovery"
command = y+z
time = 1

[Command]
name = "recovery"
command = x+z
time = 1

[Command]
name = "recovery"
command = a+b
time = 1

[Command]
name = "recovery"
command = b+c
time = 1

[Command]
name = "recovery"
command = a+c
time = 1

;-| Dir & Button |---------------------------------------------------------
[Command]
name = "back_x"
command = /$B,x
time = 1

[Command]
name = "back_y"
command = /$B,y
time = 1

[Command]
name = "back_z"
command = /$B,z
time = 1

[Command]
name = "down_x"
command = /$D,x
time = 1

[Command]
name = "down_y"
command = /$D,y
time = 1

[Command]
name = "down_z"
command = /$D,z
time = 1

[Command]
name = "fwd_x"
command = /$F,x
time = 1

[Command]
name = "fwd_y"
command = /$F,y
time = 1

[Command]
name = "fwd_z"
command = /$F,z
time = 1

[Command]
name = "up_x"
command = /$U,x
time = 1

[Command]
name = "up_y"
command = /$U,y
time = 1

[Command]
name = "up_z"
command = /$U,z
time = 1

[Command]
name = "back_a"
command = /$B,a
time = 1

[Command]
name = "back_b"
command = /$B,b
time = 1

[Command]
name = "back_c"
command = /$B,c
time = 1

[Command]
name = "down_a"
command = /$D,a
time = 1

[Command]
name = "down_b"
command = /$D,b
time = 1

[Command]
name = "down_c"
command = /$D,c
time = 1

[Command]
name = "fwd_a"
command = /$F,a
time = 1

[Command]
name = "fwd_b"
command = /$F,b
time = 1

[Command]
name = "fwd_c"
command = /$F,c
time = 1

[Command]
name = "up_a"
command = /$U,a
time = 1

[Command]
name = "up_b"
command = /$U,b
time = 1

[Command]
name = "up_c"
command = /$U,c
time = 1

;-| Dir + Button |---------------------------------------------------------
[Command]
name = "back+x"
command = $B,x
time = 5

[Command]
name = "back+y"
command = $B,y
time = 5

[Command]
name = "back+z"
command = $B,z
time = 5

[Command]
name = "down+x"
command = $D,x
time = 5

[Command]
name = "down+y"
command = $D,y
time = 5

[Command]
name = "down+z"
command = $D,z
time = 5

[Command]
name = "fwd+x"
command = F,x
time = 5

[Command]
name = "fwd+y"
command = $F,y
time = 5

[Command]
name = "fwd+z"
command = $F,z
time = 5

[Command]
name = "up+x"
command = $U,x
time = 5

[Command]
name = "up+y"
command = $U,y
time = 5

[Command]
name = "up+z"
command = $U,z
time = 5

[Command]
name = "back+a"
command = $B,a
time = 5

[Command]
name = "back+b"
command = $B,b
time = 5

[Command]
name = "back+c"
command = $B,c
time = 5

[Command]
name = "down+a"
command = $D,a
time = 5

[Command]
name = "down+b"
command = $D,b
time = 5

[Command]
name = "down+c"
command = $D,c
time = 5

[Command]
name = "fwd+a"
command = $F,a
time = 5

[Command]
name = "fwd+b"
command = $F,b
time = 5

[Command]
name = "fwd+c"
command = $F,c
time = 5

[Command]
name = "up+a"
command = $U,a
time = 5

[Command]
name = "up+b"
command = $U,b
time = 5

[Command]
name = "up+c"
command = $U,c
time = 5

;-| Single Button |---------------------------------------------------------
[Command]
name = "a"
command = a
time = 1

[Command]
name = "b"
command = b
time = 1

[Command]
name = "c"
command = c
time = 1

[Command]
name = "x"
command = x
time = 1

[Command]
name = "y"
command = y
time = 1

[Command]
name = "z"
command = z
time = 1

[Command]
name = "s"
command = s
time = 1

;-| Single Dir |------------------------------------------------------------
[Command]
name = "fwd" ;Required (do not remove)
command = $F
time = 1

[Command]
name = "downfwd"
command = $DF
time = 1

[Command]
name = "down" ;Required (do not remove)
command = $D
time = 1

[Command]
name = "downback"
command = $DB
time = 1

[Command]
name = "back" ;Required (do not remove)
command = $B
time = 1

[Command]
name = "upback"
command = $UB
time = 1

[Command]
name = "up" ;Required (do not remove)
command = $U
time = 1

[Command]
name = "upfwd"
command = $UF
time = 1

;-| Hold Button |--------------------------------------------------------------
[Command]
name = "hold_x"
command = /x
time = 1

[Command]
name = "hold_y"
command = /y
time = 1

[Command]
name = "hold_z"
command = /z
time = 1

[Command]
name = "hold_a"
command = /a
time = 1

[Command]
name = "hold_b"
command = /b
time = 1

[Command]
name = "hold_c"
command = /c
time = 1

[Command]
name = "hold_s"
command = /s
time = 1

;-| Hold Dir |--------------------------------------------------------------
[Command]
name = "holdfwd" ;Required (do not remove)
command = /$F
time = 1

[Command]
name = "holddownfwd"
command = /$DF
time = 1

[Command]
name = "holddown" ;Required (do not remove)
command = /$D
time = 1

[Command]
name = "holddownback"
command = /$DB
time = 1

[Command]
name = "holdback" ;Required (do not remove)
command = /$B
time = 1

[Command]
name = "holdupback"
command = /$UB
time = 1

[Command]
name = "holdup" ;Required (do not remove)
command = /$U
time = 1

[Command]
name = "holdupfwd"
command = /$UF
time = 1

;---------------------------------------------------------------------------
; Don't remove the following line. It's required by the CMD standard.
[Statedef -1]

;===== Contact/Hit/Guard =====
;----- MoveContact -----
[State -1, VarSet]
type = VarSet
trigger1 = Time <= 1
trigger2 = StateTime <= 1
ignorehitpause = 1
v = 15
value = 0

[State -1, VarAdd]
type = VarAdd
trigger1 = MoveContact
ignorehitpause = 1
v = 15
value = 1
;--------------------

;----- MoveHit -----
[State -1, VarSet]
type = VarSet
trigger1 = Time <= 1
trigger2 = StateTime <= 1
ignorehitpause = 1
v = 16
value = 0

[State -1, VarAdd]
type = VarAdd
trigger1 = MoveHit
ignorehitpause = 1
v = 16
value = 1
;--------------------

;----- MoveGuarded -----
[State -1, VarSet]
type = VarSet
trigger1 = Time <= 1
trigger2 = StateTime <= 1
ignorehitpause = 1
v = 17
value = 0

[State -1, VarAdd]
type = VarAdd
trigger1 = MoveGuarded
ignorehitpause = 1
v = 17
value = 1
;--------------------
;=========================

;--------------------
; AI is Activated
[State -1, VarSet]
type = VarSet
trigger1 = Var(44) > 0
trigger1 = RoundState = 2
ignorehitpause = 1
var(20) = -1

[State -1, VarRandom]
type = VarRandom
triggerall = Var(20) < 0
trigger1 = RoundState = 2
ignorehitpause = 1
v = 21
range = 0,2100

;----- H. Moves -----
[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 2000
trigger1 = Var(21) < 2100
trigger1 = Ctrl
value = 2000
;--------------------

;----- S. Moves -----
[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 1100
trigger1 = Var(21) < 1200
trigger1 = Ctrl
value = 1100

[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 1000
trigger1 = Var(21) < 1100
trigger1 = Ctrl
value = 1000
;--------------------

;----- N. Moves -----
[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 400
trigger1 = Var(21) < 500
trigger1 = Ctrl
value = 360

[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 300
trigger1 = Var(21) < 400
trigger1 = Ctrl
value = 350

[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 200
trigger1 = Var(21) < 300
trigger1 = Ctrl
value = 200

[State -2, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 10
trigger1 = Var(21) < 100
trigger1 = Ctrl
value = 65

[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = Var(21) >= 0
trigger1 = Var(21) < 10
trigger1 = Ctrl
value = 60

[State -1, State]
type = ChangeState
triggerall = StateNo <= 40
triggerall = StateType != A
triggerall = MoveType = I
triggerall = RoundState = 2
triggerall = Var(20) < 0
trigger1 = P2Dist X >= 250
trigger2 = Var(21) >= 100
trigger2 = Var(21) < 200
trigger2 = Ctrl
value = 100
;--------------------
;--------------------

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

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

;----- AfterImage -----
[State -2, AfterImage]
type = AfterImageTime
trigger1 = Vel X >= const(velocity.runjump.fwd.x)
ignorehitpause = 1
time = 2
;--------------------

;--------------------
; Remove Explods
[State -2, RemoveExplod]
type = RemoveExplod
triggerall = NumExplod(266) > 0
trigger1 = MoveType != A
ignorehitpause = 1
id = 266
;--------------------

;--------------------
; Shadow Omega
[State -2, VarSet]
type = VarSet
triggerall = PalNo > 6
trigger1 = AnimElemNo(0) < Var(10) 
var(10) = AnimElemNo(0) - 1

[State -2, VarAdd]
type = VarAdd
triggerall = PalNo > 6
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
var(10) = 1

[State -2, Speed]
type = ChangeAnim
triggerall = PalNo > 6
trigger1 = AnimElemTime(AnimElemNo(0) + 1) < 0
value = Anim
elem = Var(10)

[State -2, PosAdd]
type = PosAdd
trigger1 = PalNo > 6
trigger1 = StateNo < 2100
x = Vel X
y = Vel Y

[State -2, VelAdd]
type = VelAdd
triggerall = PalNo > 6
triggerall = StateNo < 2100
trigger1 = Vel Y != 0
y = .2

[State -2, AttackMulSet]
type = AttackMulSet
trigger1 = PalNo > 6
ignorehitpause = 1
value = 1.5

[State -2, NotHitBy]
type = NotHitBy
triggerall = PalNo > 6
trigger1 = MoveType = H
ignorehitpause = 1
value = SCA
time = 1
;--------------------

;--------------------
; Armor Code
[State -2, AssertSpecial]
type = AssertSpecial
trigger1 = 1
ignorehitpause = 1
flag = NoStandguard
flag2 = NoCrouchguard
flag3 = NoAirguard

[State -2, Vel X]
type = VarSet
trigger1 = MoveType != H
trigger1 = Time > 0
fv = 30
value = Vel X
ignorehitpause = 1

[State -2, Vel Y]
type = VarSet
trigger1 = MoveType != H

trigger1 = Time > 0
fv = 31
value = Vel Y
ignorehitpause = 1

[State -2, StateNo]
type = VarSet
trigger1 = MoveType != H
trigger1 = Time > 0
v = 40
value = StateNo
ignorehitpause = 1

[State -2, Anim]
type = VarSet
trigger1 = MoveType != H
trigger1 = Time > 0
v = 41
value = Anim
ignorehitpause = 1

[State -2, AnimElemNo]
type = VarSet
trigger1 = MoveType != H
trigger1 = Time > 0
v = 42
value = AnimElemNo(0)
ignorehitpause = 1

[State -2, Ctrl]
type = VarSet
trigger1 = MoveType != H
trigger1 = Time > 0
v = 43
value = Ctrl
ignorehitpause = 1

[State -2, VarSet]
type = VarSet
triggerall = RoundState >= 2
triggerall = PrevStateNo != 5005
triggerall = MoveType != H
trigger1 = StateTime <= 1
ignorehitpause = 1
var(44) = -1

[State -2, VarAdd]
type = VarAdd
trigger1 = RoundState >= 2
trigger1 = MoveType != H
ignorehitpause = 1
var(44) = 1

[State -2, VarSet]
type = VarSet
trigger1 = Var(45) <= 0
trigger2 = Var(45) >= 50
v = 45
value = 0
ignorehitpause = 1

[State -2, VarSet]
type = VarSet
trigger1 = MoveType = H
v = 45
value = 1
ignorehitpause = 1

[State -2, VarAdd]
type = VarAdd
trigger1 = Var(45) > 0
v = 45
value = 1
ignorehitpause = 1

[State -2, NotHitBy]
type = NotHitBy
trigger1 = Var(45) > 0
trigger1 = MoveType != H
ignorehitpause = 1
value = SCA
time = 1

[State -2, HitOverride]
type = HitOverride
trigger1 = Var(20) <= 0
attr = SCA, AA, AT, AP
ignorehitpause = 1
stateno = 5005
time = 1

[State -2, HitOverride]
type = HitOverride
trigger1 = Var(20) > 0
trigger2 = MoveType != A
attr = SCA, AA, AT, AP
ignorehitpause = 1
stateno = 5000
time = 1

[State -2, PalFX]
type = PalFX
triggerall = Var(45) > 0
trigger1 = MoveType != H
trigger1 = TimeMod = 4,0
time = 2
add = 250,250,250
ignorehitpause = 1
;--------------------

;--------------------
; No Power Set
[State -2, PowerSet]
type = PowerSet
trigger1 = 1
ignorhitpause = 1
value = 0
;--------------------

;--------------------
; Attack identifier
[State -2, VarSet]
type = VarSet
trigger1 = MoveType != A
ignorehitpause = 1
var(1) = 0
;--------------------

;--------------------
; Air Jump Variable
[State -2, VarSet]
type = VarSet
trigger1 = Var(5) > 0
trigger1 = StateType != A
ignorehitpause = 1
var(5) = 0

[State -2, VarSet]
type = VarSet
trigger1 = StateNo = 45
ignorehitpause = 1
var(5) = 1
;--------------------

;--------------------
; Can't KO from F1
[State -2, VarSet]
type = VarSet
trigger1 = Life > Var(50)
ignorehitpause = 1
var(50) = Life

[State -2, LifeSet]
type = LifeSet
trigger1 = 1
ignorehitpause = 1
value = Var(50)

[State -2, VarAdd]
type = VarAdd
trigger1 = MoveType = H
ignorehitpause = 1
var(50) = Ceil(-GetHitVar(Damage))
;--------------------

;--------------------
; Aura Shadow
[State -2, Helper]
type = Helper
triggerall = Alive
triggerall = NumHelper(9999) = 0
trigger1 = RoundState > 0
trigger1 = RoundState < 3
trigger1 = StateNo != 180
trigger1 = StateNo != 190
trigger2 = StateNo = 190
trigger2 = Anim = 191
trigger2 = AnimElem = 9
helpertype = normal
name = "Aura Shadow"
pausemovetime = 100000000
supermovetime = 100000000
id = 9999
pos = 0,0
postype = p1
stateno = 9999
keyctrl = 0
ownpal = 1
;--------------------

[State -2, State]
type = SelfState
triggerall = Var(20) >= 0
triggerall = StateNo < 5150 || StateNo >= 5160
trigger1 = !Alive
value = 5151

[State -2, State]
type = SelfState
triggerall = Var(20) < 0
triggerall = StateNo < 5150 || StateNo >= 5160
trigger1 = !Alive
value = 5155

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

;-------------------------
; No Music Until The Match.
;-------------------------
[State -3, AssertSpecial]
type = AssertSpecial
trigger1 = RoundNo <= 1
trigger1 = RoundState < 2
trigger2 = RoundsExisted = 0
trigger2 = TeamMode = Turns
trigger2 = RoundState < 2
trigger3 = MatchOver
trigger4 = Alive = 0
flag = NoMusic
;-------------------------
