;-------------------------------------------------------------
;CNS file for Gohan HD (from SNES,"Dragon Ball Z HD") 
;Made by MugenGuy & Redspider for Mugen 04.14.01
;-------------------------------------------------------------

;Constant file for Gohan HD:
;Contains all the states needed for the character.
;-------------------------------------------------------------

;---------------------------------------------------------------------------
;Flash Battle - Fighting with opponent
[Statedef 8250]
type 			= S
movetype		= A
physics		= N
anim			= IfElse(SelfAnimExist(200),200,(IfElse(SelfAnimExist(201),201,(IfElse(SelfAnimExist(202),202,(IfElse(SelfAnimExist(203),203,(IfElse(SelfAnimExist(204),204,205)))))))))
velset		= 0,0
ctrl			= 0
poweradd		= 0
facep2		= 1
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
sprpriority	= 2

[State 8250: 	ForceFeedBack]
type 			= ForceFeedback
trigger1		= ((GameTime%5) = 0) && (Random <= 499)
waveform 		= Square
time 			= 3

;Weak Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && ((Time = 0) || (AnimTime = 0)) && (Random = [0,100])
trigger1		= (SelfAnimExist(200))
value 		= 200

;Medium Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && ((Time = 0) || (AnimTime = 0)) && (Random = [100,175])
trigger1		= (SelfAnimExist(201))
value 		= 201

;Strong Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && ((Time = 0) || (AnimTime = 0)) && (Random = [176,250])
trigger1		= (SelfAnimExist(202))
value 		= 202

;Weak Kick Anim
[State 8255: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && (Time = 0) && (Random = [251,300])
trigger1		= (SelfAnimExist(210))
value 		= 210

;Medium Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && ((Time = 0) || (AnimTime = 0)) && (Random = [300,479])
trigger1		= (SelfAnimExist(211))
value 		= 211

;Strong Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 0) && ((Time = 0) || (AnimTime = 0)) && (Random = [479,601])
trigger1		= (SelfAnimExist(212))
value 		= 212
;----------------SSj------------------
;SSj Weak Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && ((Time = 0) || (AnimTime = 0)) && (Random = [0,100])
trigger1		= (SelfAnimExist(3200))
value 		= 3200

;SSj Medium Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && ((Time = 0) || (AnimTime = 0)) && (Random = [100,175])
trigger1		= (SelfAnimExist(3201))
value 		= 3201

;SSj Strong Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && ((Time = 0) || (AnimTime = 0)) && (Random = [176,250])
trigger1		= (SelfAnimExist(3202))
value 		= 3202

;SSj Weak Kick Anim
[State 8255: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && (Time = 0) && (Random = [251,300])
trigger1		= (SelfAnimExist(3210))
value 		= 3210

;SSj Medium Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && ((Time = 0) || (AnimTime = 0)) && (Random = [300,479])
trigger1		= (SelfAnimExist(3211))
value 		= 3211

;SSj Strong Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Var(1) = 1 || Var(1) = 2) && ((Time = 0) || (AnimTime = 0)) && (Random = [479,601])
trigger1		= (SelfAnimExist(3212))
value 		= 3212

[State 8250: 	AssertSpecial] 
type 			= AssertSpecial
trigger1 		= (Time < 400) && (Pos Y < 0)
flag 			= NoShadow

[State 8250:	PlayerPush]
type			= PlayerPush
trigger1		= 1
value			= 0

[State 8250:	PosAdd]
type			= PosAdd
trigger1		= (GameTime%5) = 0
x			= IfElse(Random <= 499,-1,1)

[State 8250:	MakeDust]
type			= MakeDust
trigger1		= ((GameTime%10) = 0) && (Random <= 499) && (Pos Y >= 0)
pos 			= -5,0
spacing 		= 4

[State 8250:	VarSet]
type			= VarSet
trigger1		= Time = 0
v			= 11
value			= 0

[State 		8250, Aura Surrounding]
type 		= Explod
trigger1	= (Var(1) = 0) && (Time = 0)
anim 		= 736
ID 		= 745
postype		= p1
pos 		= 0, -20
sprpriority 	= 10
removetime 	= -1
bindtime 	= -1

[State 		8250, Aura Surrounding]
type 		= Explod
trigger1	= (Var(1) = 1 || Var(1) = 2) && (Time = 0)
anim 		= 736
ID 		= 745
postype		= p1
pos 		= 0, -20
sprpriority 	= 10
removetime 	= -1
bindtime 	= -1

[State 		8255, Energy Surrounding]
type 		= Explod
trigger1	= time = 0
anim 		= 736
ID 		= 0085
postype		= p2
pos 		= 0, -20
sprpriority 	= 10
removetime 	= -1
bindtime 	= -1

[State 		8250, Energy Hitting] 
type 		= explod 
trigger1 	= TimeMod = 52,0
anim 		= 746
id 		= 746
sprpriority 	= 12
removetime 	= 45
bindtime 	= 45
pos 		= 20,-45 

[State 8250:	VarAdd]
type			= VarAdd
triggerall		= Time > 0
trigger1		= (Command = "x") || (Command = "y") || (Command = "z") || (Command = "a") || (Command = "b") || (Command = "c")
v			= 11
value			= 1

[State 8250:	VarAdd]
type			= VarAdd
triggerall		= Time > 0
trigger1		= (Target, Command = "x") || (Target, Command = "y") || (Target, Command = "z")
trigger2		= (Target, Command = "a") || (Target, Command = "b") || (Target, Command = "c")
v			= 11
value			= IfElse(P2Name = "Broli Remix ver1.2",-3,-1)

[State 8250:	HitAdd]
type			= HitAdd
triggerall		= Time > 0
trigger1		= (Command = "x") || (Command = "y") || (Command = "z") || (Command = "a") || (Command = "b") || (Command = "c")
value			= 1

;Flash Battle movement
[State 8250:	VelSet]
type			= VelSet
trigger1		= (Anim != [130,160]) && (Pos Y <= 1)
x			= IfElse(((Target, Command = "holdback") || (Command = "holdfwd")),2,(IfElse(((Target, Command = "holdfwd") || (Command = "holdback")),-2,0)))
y			= IfElse(((Target, Command = "holdup") || (Command = "holdup")),-2,(IfElse(((Target, Command = "holddown") || (Command = "holddown")),2,0)))

[State 8250:	TargetLifeAdd]
type			= TargetLifeAdd
triggerall		= Time > 0
trigger1		= (Command = "x") || (Command = "y") || (Command = "z") || (Command = "a") || (Command = "b") || (Command = "c")
value			= IfElse(P2Name = "Broli Remix ver1.2",-1,-2)
kill			= 0

[State 8250:	LifeAdd]
type			= LifeAdd
triggerall		= Time > 0
trigger1		= (Target, Command = "x") || (Target, Command = "y") || (Target, Command = "z")
trigger2		= (Target, Command = "a") || (Target, Command = "b") || (Target, Command = "c")
value			= IfElse(P2Name = "Broli Remix ver1.2",-3,-2)
kill			= 0

[State 8250:	PlaySnd]
type			= PlaySnd
trigger1		= ((Anim = 200) || (Anim = 201)) && (AnimElem = 2)
value			= S15,0

[State 8250:	PlaySnd]
type			= PlaySnd
trigger1		= ((Anim = 202) || (Anim = 210)) && (AnimElem = 2)
value			= S15,1

[State 8250:	PlaySnd]
type			= PlaySnd
trigger1		= ((Anim = 211) || (Anim = 212)) && (AnimElem = 2)
value			= S15,2

[State 8250:	PlaySnd]
type			= PlaySnd
trigger1		= Time = 401
value			= S0,11

[State 8250:	EnvShake]
type			= EnvShake
trigger1		= (GameTime%3) = 0 && Time < 600
time			= 10
freq			= 100
ampl			= -6
phase			= 90

[State 8250:	EvnColor]
type			= EnvColor
trigger1		= (GameTime%15) = 0 && Random <= 499 && Time < 600
value			= 200,255,255
time			= 5
under			= 0

[State 8250:	BGPalFX]
type			= BGPalFX
trigger1		= (GameTime%30) = 0 && (Random <= 499) && (Time < 600)
time			= 15
add			= 100,100,100
mul			= 200,200,200
sinadd		= -100,-100,-100,15
invertall		= 1
color			= 256

[State 8250:	BindToTarget]
type			= BindToTarget
trigger1		= (Target, Anim != 100) || (Target, StateNo != 8200)
time			= 1
pos			= 45,0,Foot

[State 8250:	PosSet]
type			= PosSet
trigger1		= Pos Y > 0
y			= 0

[State 8250:	ChangeAnim]
type			= ChangeAnim
trigger1		= (Time >= 601) && (Var(11) > -10)
value			= 130

[State 8250:	VelSet]
type			= VelSet
trigger1		= Time = 640
x			= 0
y			= 0

[State 8250:	TargetState]
type			= TargetState
trigger1		= (Var(11) = [10,15]) && (Time = 601)
value			= 5300

[State 8250:	ChangeState]
type			= ChangeState
trigger1		= (Var(11) >= 35)
value			= 2400

;[State 8250:	ChangeState]
;type			= ChangeState
;trigger1		= (Var(11) < -35)
;value			= 8251

[State 8250:	ChangeState]
type			= ChangeState
trigger1		= (Var(11) < -35 ) && (Time = 601)
value			= 5300

[State 8250:	ChangeState]
type			= ChangeState
trigger1		= (Anim = 130) && (Pos Y >= 0)
value			= 47
ctrl			= 1

[State 8250:	ChangeState]
type			= ChangeState
trigger1		= (Time = 650)
value			= 0
ctrl			= 1

;---------------------------------------------------------------------------
;Flash Battle - Getting knocked by opponent
[Statedef 8251]
type 			= A
movetype		= H
physics		= N
velset		= 0,0
ctrl			= 0
poweradd		= 0
juggle		= 0
facep2		= 0
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
sprpriority		= -2

[State 730, 1]
type = changeanim
triggerall = Var(1) = 0 || Var(1) = 3
trigger1 = time = 0
value = 130

[State 730, 1]
type = changeanim
triggerall = Var(1) = 1 || Var(1) = 2
trigger1 = time = 0
value = 3130

[State 8251:	MakeDust]
type			= MakeDust
trigger1		= 1
pos			= 10,15
spacing		= 4

[State 8251:	AfterImage]
type 			= AfterImage
trigger1 		= Time = 0
time 			= 15
timegap		= 1
framegap 		= 2
length 		= 10
paladd 		= 0, 0, 0
palmul 		= .50, .50, .50
palcontrast 	= 110,110,110
trans 		= add

[State 8251:	LifeAdd]
type			= LifeAdd
trigger1 		= Time <= 15
value			= -2

;Big Explosion - Opponent hits ground
[State 8251:	Explod]
type			= Explod
trigger1 		= (Vel Y > 0) && (Pos Y >= 0)
anim			= 1005
id			= 851
pos			= 0,0
postype		= p1
facing		= 1
vfacing		= 1
bindtime		= 1
vel			= 0,0
accel			= 0,0
random		= 0,0
removetime		= -2
supermove		= 0
supermovetime	= 0
pausemovetime	= 0
scale			= 1,1
sprpriority		= 0
ontop			= 1
shadow		= -1,100,100
ownpal		= 1
removeongethit	= 0
persistent		= 0

;Big Explosion Sound1 - Fall Ground
[State 8251:	PlaySnd]
type			= PlaySnd
trigger1 		= (Vel Y > 0) && (Pos Y >= 0)
value			= S0,4
persistent		= 0

;Big Explosion Sound2 - Explosion
[State 8251:	PlaySnd]
type			= PlaySnd
trigger1 		= (Vel Y > 0) && (Pos Y >= 0)
value			= S1,0
persistent		= 0

[State 8251:	ChangeState]
type 			= ChangeState
trigger1 		= (BackEdgeBodyDist <= 20) || (FrontEdgeBodyDist <= 20)
value 		= 0

[State 8251: 	ChangeState]
type 			= ChangeState
trigger1 		= Time = 20
value 		= 5300

;---------------------------------------------------------------------------
;Flash Battle - Opponent fighting
[Statedef 8255]
type 			= S
movetype		= H
physics		= N
anim			= 8255
velset		= 0,0
ctrl			= 0
poweradd		= 0
juggle		= 0
facep2		= 1
hitdefpersist	= 0
movehitpersist	= 0
hitcountpersist	= 0
sprpriority		= 2

[State 8255: 	ForceFeedBack]
type 			= ForceFeedback
trigger1		= ((GameTime%5) = 0) && (Random <= 499)
waveform 		= Square
time 			= 3

;Remove guarding anim
[State 8255:	ChangeAnim]
type			= ChangeAnim
trigger1		= Anim = [130,160]
value 		= IfElse(SelfAnimExist(200),200,(IfElse(SelfAnimExist(201),201,(IfElse(SelfAnimExist(202),202,(IfElse(SelfAnimExist(203),203,(IfElse(SelfAnimExist(204),204,205)))))))))

;Weak Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= ((Time = 0) || (AnimTime = 0)) && (Random = [0,100])
trigger1		= (SelfAnimExist(200)) || (SelfAnimExist(201)) || (SelfAnimExist(202)) || (SelfAnimExist(203)) || (SelfAnimExist(204)) || (SelfAnimExist(205))
value 		= IfElse(SelfAnimExist(200),200,(IfElse(SelfAnimExist(201),201,(IfElse(SelfAnimExist(202),202,(IfElse(SelfAnimExist(203),203,(IfElse(SelfAnimExist(204),204,205)))))))))

;Medium Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= ((Time = 0) || (AnimTime = 0)) && (Random = [100,175])
trigger1		= (SelfAnimExist(210)) || (SelfAnimExist(211)) || (SelfAnimExist(212)) || (SelfAnimExist(213)) || (SelfAnimExist(214)) || (SelfAnimExist(215))
value 		= IfElse(SelfAnimExist(210),210,(IfElse(SelfAnimExist(211),211,(IfElse(SelfAnimExist(212),212,(IfElse(SelfAnimExist(213),213,(IfElse(SelfAnimExist(214),214,215)))))))))

;Strong Punch Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= ((Time = 0) || (AnimTime = 0)) && (Random = [176,250])
trigger1		= (SelfAnimExist(220)) || (SelfAnimExist(221)) || (SelfAnimExist(222)) || (SelfAnimExist(223)) || (SelfAnimExist(224)) || (SelfAnimExist(225))
value 		= IfElse(SelfAnimExist(202),202,(IfElse(SelfAnimExist(221),221,(IfElse(SelfAnimExist(222),222,(IfElse(SelfAnimExist(223),223,(IfElse(SelfAnimExist(224),224,225)))))))))

;Weak Kick Anim
[State 8255: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= (Time = 0) && (Random = [251,300])
trigger1		= (SelfAnimExist(230)) || (SelfAnimExist(231)) || (SelfAnimExist(232)) || (SelfAnimExist(233)) || (SelfAnimExist(234)) || (SelfAnimExist(235))
value 		= IfElse(SelfAnimExist(210),210,(IfElse(SelfAnimExist(231),231,(IfElse(SelfAnimExist(232),232,(IfElse(SelfAnimExist(233),233,(IfElse(SelfAnimExist(234),234,235)))))))))

;Medium Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= ((Time = 0) || (AnimTime = 0)) && (Random = [300,479])
trigger1		= (SelfAnimExist(240)) || (SelfAnimExist(241)) || (SelfAnimExist(242)) || (SelfAnimExist(243)) || (SelfAnimExist(244)) || (SelfAnimExist(245))
value 		= IfElse(SelfAnimExist(211),211,(IfElse(SelfAnimExist(241),241,(IfElse(SelfAnimExist(242),242,(IfElse(SelfAnimExist(243),243,(IfElse(SelfAnimExist(244),244,245)))))))))

;Strong Kick Anim
[State 8250: 	ChangeAnim]
type 			= ChangeAnim
triggerall 		= ((Time = 0) || (AnimTime = 0)) && (Random = [479,601])
trigger1		= (SelfAnimExist(250)) || (SelfAnimExist(251)) || (SelfAnimExist(252)) || (SelfAnimExist(253)) || (SelfAnimExist(254)) || (SelfAnimExist(255))
value 		= IfElse(SelfAnimExist(212),212,(IfElse(SelfAnimExist(251),251,(IfElse(SelfAnimExist(252),252,(IfElse(SelfAnimExist(253),253,(IfElse(SelfAnimExist(254),254,255)))))))))

[State 8255:	ChangeAnim]
type			= ChangeAnim
trigger1		= (Time >= 601)
value			= 130

[State 0: ]
type = HitDef
trigger1 = (Time = 601) && (P2Stateno = 5300)
attr = S, HA
hitflag = MAF
guardflag = MA
animtype = hard
air.animtype = Light
fall.animtype = Back
damage = 5,2
sparkno = 2
guard.sparkno = 2
sparkxy = 0,0
hitsound = S15,0
guardsound = S6,0
ground.type = High
air.type = High
ground.velocity = -35,0
air.velocity = -35,0
envshake.time = 15
envshake.freq = 60
envshake.ampl = -4

[State 8255:	ChangeAnim]
type			= SelfState
trigger1		= P2StateNo != 8250
value			= 200
ctrl            = 1 

[State 8255:	DestroySelf]
type			= DestroySelf
trigger1		= IsHelper

[State 8255: 	AssertSpecial] 
type 			= AssertSpecial
trigger1 		= (Time < 600) && (Pos Y < 0)
flag 			= NoShadow

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

[State 8255:	PlayerPush]
type			= PlayerPush
trigger1		= 1
value			= 0

[State 8255:	MakeDust]
type			= MakeDust
trigger1		= ((GameTime%10) = 0) && (Random <= 499) && (Pos Y >= 0)
pos 			= -5,0
spacing 		= 4

[State 8255:	PlaySnd]
type			= PlaySnd
trigger1		= (Random = [0,249]) && (Anim != 130) && ((GameTime%15) = 0)
value			= F5,1

[State 8255:	PlaySnd]
type			= PlaySnd
trigger1		= (Random = [250,499]) && (Anim != 130) && ((GameTime%15) = 0)
value			= F5,2

[State 8255:	PlaySnd]
type			= PlaySnd
trigger1		= (Random = [500,748]) && (Anim != 130) && ((GameTime%15) = 0)
value			= F5,3

[State 8255:	PlaySnd]
type			= PlaySnd
trigger1		= (Random = [749,999]) && (Anim != 130) && ((GameTime%15) = 0)
value			= F5,4

[State 8255:	VelSet]
type			= VelSet
trigger1		= Time = 601
x			= -1

[State 8255:	VelSet]
type			= VelSet
trigger1		= Time = 640
x			= 0
y			= 0

[State 8255, Control]
type = CtrlSet
trigger1 = (Time = 640) || P2Stateno != 8250
value = 1

[State 8255:	SelfState]
type			= SelfState
trigger1		= (Time = 640) || P2Stateno != 8250
value			= 0
ctrl			= 1
;-----------------------------------------------------------------------------------------
